Purge online and in-editor documentation for internal methods & vars
This commit is contained in:
parent
341fb1dfb3
commit
97703eac04
10 changed files with 22 additions and 173 deletions
|
@ -36,22 +36,6 @@ Used internally for loading, managing and unloading modules.
|
||||||
Do not modify this.
|
Do not modify this.
|
||||||
:::
|
:::
|
||||||
Stores the path to CORE's installation directory.
|
Stores the path to CORE's installation directory.
|
||||||
### *Dictionary* <u>cleanup_hooks</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains a list of all registered cleanup hooks.
|
|
||||||
### *Dictionary* <u>custom_modules</u> = *{}*
|
|
||||||
### *void* <u>_ready</u>()
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains a list of all loaded custom modules.
|
|
||||||
### *Node* <u>custom_modules_node</u>
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains the node holding all custom modules as children.
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### *void* <u>_init</u>(*CoreConfiguration* <u>new_config</u>)
|
### *void* <u>_init</u>(*CoreConfiguration* <u>new_config</u>)
|
||||||
|
@ -59,26 +43,6 @@ Contains the node holding all custom modules as children.
|
||||||
Do not call this (except you're using `Core.new()`).
|
Do not call this (except you're using `Core.new()`).
|
||||||
:::
|
:::
|
||||||
Handles the preinitialization part. Does stuff like checking the engine version, loading the config and loading all modules into memory.
|
Handles the preinitialization part. Does stuff like checking the engine version, loading the config and loading all modules into memory.
|
||||||
### *void* <u>_ready</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Handles the initialization part. Injects the builtin modules into the SceneTree and makes sure custom modules can be loaded properly. \
|
|
||||||
### *void* <u>initialize_modules</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Initializes all built-in modules during the preinitialization phase.
|
|
||||||
### *void* <u>inject_modules</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Injects CORE's built-in modules into the SceneTree.
|
|
||||||
### *void* <u>initialize_scheduler</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Initializes the framework scheduler.
|
|
||||||
### *void* <u>complete_init</u>(*bool* <u>no_success_message</u> = *false*)
|
### *void* <u>complete_init</u>(*bool* <u>no_success_message</u> = *false*)
|
||||||
Waits for all built-in and custom modules to fully initialize. \
|
Waits for all built-in and custom modules to fully initialize. \
|
||||||
\
|
\
|
||||||
|
@ -93,11 +57,6 @@ Returns a registered custom module. \
|
||||||
Please note that you can't get CORE's built-in modules with this function.
|
Please note that you can't get CORE's built-in modules with this function.
|
||||||
### *void* <u>reload_configuration</u>(*CoreConfiguration* <u>new_config</u> = *CoreConfiguration.new()*)
|
### *void* <u>reload_configuration</u>(*CoreConfiguration* <u>new_config</u> = *CoreConfiguration.new()*)
|
||||||
Loads a (new) configuration object and applies it to all modules.
|
Loads a (new) configuration object and applies it to all modules.
|
||||||
### *void* <u>apply_configuration</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Applies the a configuration.
|
|
||||||
### *void* <u>cleanup</u>()
|
### *void* <u>cleanup</u>()
|
||||||
Makes sure that CORE does not leak memory on shutdown/unload. \
|
Makes sure that CORE does not leak memory on shutdown/unload. \
|
||||||
Unloads all custom modules, built-in modules, frees any of CORE's classes and lastly itself. \
|
Unloads all custom modules, built-in modules, frees any of CORE's classes and lastly itself. \
|
||||||
|
@ -132,11 +91,6 @@ You can use the following placeholders:
|
||||||
Returns if custom module support is enabled
|
Returns if custom module support is enabled
|
||||||
### *Array[int]* <u>get_version_semantic</u>()
|
### *Array[int]* <u>get_version_semantic</u>()
|
||||||
Returns the CORE version in the semantic versioning scheme. The first integer contains the version number, the second integer contains the version type (`0` for alpha, `1` for beta, `2` for rc and `3` for release) and the last integer contains the version type number.
|
Returns the CORE version in the semantic versioning scheme. The first integer contains the version number, the second integer contains the version type (`0` for alpha, `1` for beta, `2` for rc and `3` for release) and the last integer contains the version type number.
|
||||||
### *bool* <u>determine_basepath</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Determines CORE's installation/base path.
|
|
||||||
### *void* <u>quit_safely</u>(*int* <u>exitcode</u> = *0*)
|
### *void* <u>quit_safely</u>(*int* <u>exitcode</u> = *0*)
|
||||||
:::note[Awaiting required]
|
:::note[Awaiting required]
|
||||||
Using the `await` keyword is required for this function.
|
Using the `await` keyword is required for this function.
|
||||||
|
|
|
@ -7,25 +7,6 @@ description: Allows for awaited, batched and oneline requests.
|
||||||
Makes it easy to download files off the internet and communicate with HTTP servers.
|
Makes it easy to download files off the internet and communicate with HTTP servers.
|
||||||
|
|
||||||
|
|
||||||
## Variables
|
|
||||||
### *Dictionary* <u>list_queue</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains a list of all queued downloads.
|
|
||||||
|
|
||||||
### *Dictionary* <u>list_active</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains a list of all active downloads.
|
|
||||||
|
|
||||||
### *Dictionary* <u>list_complete</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
Contains a list of all completed downloads.
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### *Dictionary* <u>awaited_request</u>(*String* <u>url</u>, *bool* <u>parse_utf8</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*)
|
### *Dictionary* <u>awaited_request</u>(*String* <u>url</u>, *bool* <u>parse_utf8</u>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>data</u> = *""*)
|
||||||
:::note[Awaiting required]
|
:::note[Awaiting required]
|
||||||
|
@ -70,11 +51,6 @@ The returned `Dictionary`s have the following structure (example):
|
||||||
| ---------------------------------------------------------------------- The HTTP response code
|
| ---------------------------------------------------------------------- The HTTP response code
|
||||||
------------------------------------------------------------------------------------ Equal to @GlobalScope.Error. If not 0/Error.OK = the request failed
|
------------------------------------------------------------------------------------ Equal to @GlobalScope.Error. If not 0/Error.OK = the request failed
|
||||||
```
|
```
|
||||||
### *int* <u>generate_id</u>()
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Returns a new download id.
|
|
||||||
### *int* <u>create_request</u>(*String* <url>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>body</u> = *""*)
|
### *int* <u>create_request</u>(*String* <url>, *HTTPClient.Method* <u>method</u> = *HTTPClient.Method.METHOD_GET*, *PackedStringArray* <u>headers</u> = *PackedStringArray([])*, *String* <u>body</u> = *""*)
|
||||||
:::warning
|
:::warning
|
||||||
You'll probably not need this. Only use this function when implementing your own downloading method.
|
You'll probably not need this. Only use this function when implementing your own downloading method.
|
||||||
|
|
|
@ -15,22 +15,11 @@ Emitted on any log call, permitted or not. \
|
||||||
**format** is set to `""` when **allowed** is set `false`.
|
**format** is set to `""` when **allowed** is set `false`.
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
### *Array[CoreLoggerInstance]* <u>instances</u> = *[]*
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
Keeps track of all logger instances.
|
|
||||||
Unused instances will be cleaned periodically.
|
|
||||||
### *bool* <u>verbose_mode</u> = *false*
|
### *bool* <u>verbose_mode</u> = *false*
|
||||||
Used to determine if running in verbose/command line mode.
|
Used to determine if running in verbose/command line mode.
|
||||||
Makes diagnostic log messages display correctly (workaround for Godot's ANSI true color limitation).
|
Makes diagnostic log messages display correctly (workaround for Godot's ANSI true color limitation).
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### *void* <u>_log</u>(*CoreTypes.LoggerLevel* <u>level</u>, *String* <u>origin</u>, *String* <u>message</u>)
|
|
||||||
:::danger[Don't call]
|
|
||||||
Do not call this.
|
|
||||||
:::
|
|
||||||
The main logging function that does the heavy lifting.
|
|
||||||
### *void* <u>diag</u>(*String* <u>origin</u>, *String* <u>message</u>)
|
### *void* <u>diag</u>(*String* <u>origin</u>, *String* <u>message</u>)
|
||||||
Prints a diagnostic message.
|
Prints a diagnostic message.
|
||||||
### *void* <u>verb</u>(*String* <u>origin</u>, *String* <u>message</u>)
|
### *void* <u>verb</u>(*String* <u>origin</u>, *String* <u>message</u>)
|
||||||
|
|
|
@ -11,38 +11,6 @@ Allows for organized scene management, making development much faster.
|
||||||
## *Array[String]* <u>scene_nodes</u> = *[ "debug", "cutscene", "menu", "main", "background" ]*
|
## *Array[String]* <u>scene_nodes</u> = *[ "debug", "cutscene", "menu", "main", "background" ]*
|
||||||
Used internally for adding, managing and removing scene collections.
|
Used internally for adding, managing and removing scene collections.
|
||||||
|
|
||||||
## Variables
|
|
||||||
## *Node* <u>scenes_debug</u> = *Node.new()*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The 'debug' scene collection.
|
|
||||||
## *Node* <u>scenes_cutscene</u> = *Node.new()*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The 'cutscene' scene collection.
|
|
||||||
## *Node* <u>scenes_menu</u> = *Node.new()*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The 'menu' scene collection.
|
|
||||||
## *Node* <u>scenes_main</u> = *Node.new()*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The 'main' scene collection.
|
|
||||||
## *Node* <u>scenes_background</u> = *Node.new()*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The 'background' scene collection.
|
|
||||||
## *Dictionary* <u>scenes</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
A list of all loaded scenes
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### *bool* <u>add_scene</u>(*String* <u>scene_name</u>, *Node* <u>scene_class</u>, *CoreTypes.SceneType* <u>scene_type</u>)
|
### *bool* <u>add_scene</u>(*String* <u>scene_name</u>, *Node* <u>scene_class</u>, *CoreTypes.SceneType* <u>scene_type</u>)
|
||||||
Adds a scene to some scene collection.
|
Adds a scene to some scene collection.
|
||||||
|
|
|
@ -13,16 +13,6 @@ Allows you to write configuration files with ease, without any headaches.
|
||||||
Do not modify this.
|
Do not modify this.
|
||||||
:::
|
:::
|
||||||
Indicates if a storage file is currently open.
|
Indicates if a storage file is currently open.
|
||||||
### *Dictionary* <u>storage</u> = *{}*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The parsed data inside the storage file.
|
|
||||||
### *String* <u>storage_location</u> = *""*
|
|
||||||
:::danger[Don't modify]
|
|
||||||
Do not modify this.
|
|
||||||
:::
|
|
||||||
The location of the storage file.
|
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### *bool* <u>open_storage</u>(*String* <u>location</u>, *bool* <u>create_new</u> = *true*, *bool* <u>sanity_check</U> = *true*, *bool* <u>fail_on_sanity_check</u> = *false*)
|
### *bool* <u>open_storage</u>(*String* <u>location</u>, *bool* <u>create_new</u> = *true*, *bool* <u>sanity_check</U> = *true*, *bool* <u>fail_on_sanity_check</u> = *false*)
|
||||||
|
|
29
src/core.gd
29
src/core.gd
|
@ -57,17 +57,13 @@ var storage: CoreBaseModule
|
||||||
## Stores the path to CORE's installation directory.[br]
|
## Stores the path to CORE's installation directory.[br]
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||||
var basepath: String
|
var basepath: String
|
||||||
## Contains a list of all registered cleanup hooks.[br]
|
# Contains a list of all registered cleanup hooks.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var cleanup_hooks: Dictionary = {}
|
var cleanup_hooks: Dictionary = {}
|
||||||
## Contains a list of all loaded custom modules.[br]
|
# Contains a list of all loaded custom modules.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var custom_modules: Dictionary = {}
|
var custom_modules: Dictionary = {}
|
||||||
## Contains the node holding all custom modules as children.[br]
|
# Contains the node holding all custom modules as children.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var custom_modules_node: Node
|
var custom_modules_node: Node
|
||||||
## The CORE Object's logger instance.
|
# The CORE Object's logger instance.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var loggeri: CoreLoggerInstance
|
var loggeri: CoreLoggerInstance
|
||||||
|
|
||||||
# +++ initialization +++
|
# +++ initialization +++
|
||||||
|
@ -89,8 +85,7 @@ func _ready() -> void:
|
||||||
add_child(scheduler)
|
add_child(scheduler)
|
||||||
get_tree().auto_accept_quit = false
|
get_tree().auto_accept_quit = false
|
||||||
|
|
||||||
## Initializes all built-in modules during the preinitialization phase.[br]
|
# Initializes all built-in modules during the preinitialization phase.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func initialize_modules() -> void:
|
func initialize_modules() -> void:
|
||||||
for module in modules:
|
for module in modules:
|
||||||
set(module, CoreBaseModule.new())
|
set(module, CoreBaseModule.new())
|
||||||
|
@ -100,12 +95,10 @@ func initialize_modules() -> void:
|
||||||
get(module).loggeri = logger.get_instance(basepath.replace("res://", "") + "src/" + module + ".gd", get(module))
|
get(module).loggeri = logger.get_instance(basepath.replace("res://", "") + "src/" + module + ".gd", get(module))
|
||||||
get(module)._initialize()
|
get(module)._initialize()
|
||||||
|
|
||||||
## Injects CORE's builtin modules into the SceneTree.[br]
|
# Injects CORE's builtin modules into the SceneTree.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func inject_modules() -> void: for module in modules: add_child(get(module))
|
func inject_modules() -> void: for module in modules: add_child(get(module))
|
||||||
|
|
||||||
## Initializes the framework scheduler.
|
# Initializes the framework scheduler.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func initialize_scheduler() -> void:
|
func initialize_scheduler() -> void:
|
||||||
scheduler = Timer.new()
|
scheduler = Timer.new()
|
||||||
scheduler.name = "Scheduler"
|
scheduler.name = "Scheduler"
|
||||||
|
@ -163,8 +156,7 @@ func reload_configuration(new_config: CoreConfiguration = CoreConfiguration.new(
|
||||||
if initialized: loggeri.verb("Overrode configuration (development mode)")
|
if initialized: loggeri.verb("Overrode configuration (development mode)")
|
||||||
if initialized: apply_configuration()
|
if initialized: apply_configuration()
|
||||||
|
|
||||||
## Applies the a configuration.[br]
|
# Applies a new configuration.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func apply_configuration() -> void:
|
func apply_configuration() -> void:
|
||||||
if loggeri != null: loggeri.verb("Applying configuration")
|
if loggeri != null: loggeri.verb("Applying configuration")
|
||||||
if is_devmode() and loggeri != null: loggeri.warn("The CORE Framework is in development mode. Here be dragons!")
|
if is_devmode() and loggeri != null: loggeri.warn("The CORE Framework is in development mode. Here be dragons!")
|
||||||
|
@ -356,8 +348,7 @@ func get_version_semantic() -> Array[int]:
|
||||||
CoreTypes.VersionType.ALPHA: version_type_int = 0
|
CoreTypes.VersionType.ALPHA: version_type_int = 0
|
||||||
return [version_version, version_type_int, version_typerelease]
|
return [version_version, version_type_int, version_typerelease]
|
||||||
|
|
||||||
## Determines CORE's installation/base path.[br]
|
# Determines CORE's installation/base path.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func determine_basepath() -> bool:
|
func determine_basepath() -> bool:
|
||||||
if FileAccess.file_exists("res://.corebasepath"):
|
if FileAccess.file_exists("res://.corebasepath"):
|
||||||
basepath = "res://"
|
basepath = "res://"
|
||||||
|
@ -370,7 +361,6 @@ func determine_basepath() -> bool:
|
||||||
return false
|
return false
|
||||||
return true
|
return true
|
||||||
|
|
||||||
# Checks Godot's version
|
|
||||||
## Checks compatibility with the running version.
|
## Checks compatibility with the running version.
|
||||||
func check_godot_version() -> bool:
|
func check_godot_version() -> bool:
|
||||||
var version: Dictionary = Engine.get_version_info()
|
var version: Dictionary = Engine.get_version_info()
|
||||||
|
@ -400,6 +390,7 @@ func quit_safely(exitcode: int = 0) -> void:
|
||||||
await cleanup()
|
await cleanup()
|
||||||
get_tree().quit(exitcode)
|
get_tree().quit(exitcode)
|
||||||
|
|
||||||
|
# Just ignore this.
|
||||||
func _notification(what) -> void:
|
func _notification(what) -> void:
|
||||||
match(what):
|
match(what):
|
||||||
NOTIFICATION_WM_CLOSE_REQUEST:
|
NOTIFICATION_WM_CLOSE_REQUEST:
|
||||||
|
|
14
src/erm.gd
14
src/erm.gd
|
@ -18,14 +18,11 @@
|
||||||
## Allows for awaited, batched and oneline requests.
|
## Allows for awaited, batched and oneline requests.
|
||||||
extends CoreBaseModule
|
extends CoreBaseModule
|
||||||
|
|
||||||
## Contains a list of all queued downloads.[br]
|
# Contains a list of all queued downloads.
|
||||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
|
||||||
var list_queue: Dictionary = {}
|
var list_queue: Dictionary = {}
|
||||||
## Contains a list of all active downloads.[br]
|
# Contains a list of all active downloads.
|
||||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
|
||||||
var list_active: Dictionary = {}
|
var list_active: Dictionary = {}
|
||||||
## Contains a liust of all completed downloads.[br]
|
# Contains a liust of all completed downloads.
|
||||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
|
||||||
var list_complete: Dictionary = {}
|
var list_complete: Dictionary = {}
|
||||||
|
|
||||||
## Determines how unsecure requests should be handled.
|
## Determines how unsecure requests should be handled.
|
||||||
|
@ -107,7 +104,7 @@ func batch_awaited_request(urls: PackedStringArray, parse_utf8: bool, method: HT
|
||||||
list_complete.erase(id)
|
list_complete.erase(id)
|
||||||
return dldata
|
return dldata
|
||||||
|
|
||||||
## Internal function, do not call
|
# Does the work, but in a thread.
|
||||||
func _batch_awaited_request(url: String, parse_utf8: bool, method: HTTPClient.Method = HTTPClient.Method.METHOD_GET, headers: PackedStringArray = PackedStringArray([]), data: String = "") -> int:
|
func _batch_awaited_request(url: String, parse_utf8: bool, method: HTTPClient.Method = HTTPClient.Method.METHOD_GET, headers: PackedStringArray = PackedStringArray([]), data: String = "") -> int:
|
||||||
var id: int = create_request(url, method, headers, data)
|
var id: int = create_request(url, method, headers, data)
|
||||||
start_request(id, parse_utf8)
|
start_request(id, parse_utf8)
|
||||||
|
@ -116,8 +113,7 @@ func _batch_awaited_request(url: String, parse_utf8: bool, method: HTTPClient.Me
|
||||||
return id
|
return id
|
||||||
|
|
||||||
# +++ internal +++
|
# +++ internal +++
|
||||||
## Returns a new download id.[br]
|
# Returns a new download id.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func generate_id() -> int:
|
func generate_id() -> int:
|
||||||
var id = randi()
|
var id = randi()
|
||||||
if list_queue.has(id) or list_active.has(id):
|
if list_queue.has(id) or list_active.has(id):
|
||||||
|
|
|
@ -23,9 +23,7 @@ extends CoreBaseModule
|
||||||
|
|
||||||
signal log_event
|
signal log_event
|
||||||
|
|
||||||
## Keeps track of all logger instances.
|
# Keeps track of all logger instances. Unused instances will be cleaned periodically by CORE's scheduler.
|
||||||
## Unused instances will be cleaned periodically.
|
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var instances: Array[CoreLoggerInstance] = []
|
var instances: Array[CoreLoggerInstance] = []
|
||||||
|
|
||||||
## Used to determine if running in verbose/command line mode.[br]
|
## Used to determine if running in verbose/command line mode.[br]
|
||||||
|
@ -70,8 +68,7 @@ func _pull_config() -> void:
|
||||||
config_newlines_sizelimit = core.config.logger_newlines_sizelimit
|
config_newlines_sizelimit = core.config.logger_newlines_sizelimit
|
||||||
|
|
||||||
# +++ logging +++
|
# +++ logging +++
|
||||||
## The main logging function that does the heavy lifting.[br]
|
# The main logging function that does the heavy lifting.
|
||||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
|
||||||
func _log(level: CoreTypes.LoggerLevel, origin: String, message: String) -> void:
|
func _log(level: CoreTypes.LoggerLevel, origin: String, message: String) -> void:
|
||||||
if !is_level_allowed(level):
|
if !is_level_allowed(level):
|
||||||
emit_signal("log_event", false, level, origin, message, "")
|
emit_signal("log_event", false, level, origin, message, "")
|
||||||
|
|
14
src/sms.gd
14
src/sms.gd
|
@ -22,24 +22,14 @@ extends CoreBaseModule
|
||||||
|
|
||||||
## Used internally for adding, managing and removing scene collections.
|
## Used internally for adding, managing and removing scene collections.
|
||||||
const scene_nodes: Array[String] = [ "debug", "cutscene", "menu", "main", "background" ]
|
const scene_nodes: Array[String] = [ "debug", "cutscene", "menu", "main", "background" ]
|
||||||
## The 'debug' scene collection.[br]
|
# Scene collections
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes_debug: Node = Node.new()
|
var scenes_debug: Node = Node.new()
|
||||||
## The 'cutscene' scene collection.[br]
|
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes_cutscene: Node = Node.new()
|
var scenes_cutscene: Node = Node.new()
|
||||||
## The 'menu' scene collection.[br]
|
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes_menu: Node = Node.new()
|
var scenes_menu: Node = Node.new()
|
||||||
## The 'main' scene collection.[br]
|
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes_main: Node = Node.new()
|
var scenes_main: Node = Node.new()
|
||||||
## The 'background' scene collection.[br]
|
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes_background: Node = Node.new()
|
var scenes_background: Node = Node.new()
|
||||||
|
|
||||||
## A list of all loaded scenes[br]
|
# A list of all loaded scenes.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var scenes: Dictionary = {}
|
var scenes: Dictionary = {}
|
||||||
|
|
||||||
# +++ module +++
|
# +++ module +++
|
||||||
|
|
|
@ -23,15 +23,13 @@ extends CoreBaseModule
|
||||||
## Indicates if a storage file is currently open.[br]
|
## Indicates if a storage file is currently open.[br]
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||||
var is_open: bool = false
|
var is_open: bool = false
|
||||||
## The parsed data inside the storage file.[br]
|
# The parsed data inside the storage file.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var storage: Dictionary = {}
|
var storage: Dictionary = {}
|
||||||
## The location of the storage file.[br]
|
# The location of the storage file.
|
||||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
|
||||||
var storage_location: String = ""
|
var storage_location: String = ""
|
||||||
|
|
||||||
# +++ file management +++
|
# +++ file management +++
|
||||||
## Opens a storage file into memory.
|
## Opens a storage file and loads it into memory.
|
||||||
func open_storage(location: String, create_new: bool = true, sanity_check: bool = true, fail_on_sanity_check: bool = false) -> bool:
|
func open_storage(location: String, create_new: bool = true, sanity_check: bool = true, fail_on_sanity_check: bool = false) -> bool:
|
||||||
if is_open:
|
if is_open:
|
||||||
loggeri.error("Failed to open storage: A storage file is already open")
|
loggeri.error("Failed to open storage: A storage file is already open")
|
||||||
|
|
Loading…
Reference in a new issue