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.
|
||||
:::
|
||||
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
|
||||
### *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()`).
|
||||
:::
|
||||
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*)
|
||||
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.
|
||||
### *void* <u>reload_configuration</u>(*CoreConfiguration* <u>new_config</u> = *CoreConfiguration.new()*)
|
||||
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>()
|
||||
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. \
|
||||
|
@ -132,11 +91,6 @@ You can use the following placeholders:
|
|||
Returns if custom module support is enabled
|
||||
### *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.
|
||||
### *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*)
|
||||
:::note[Awaiting required]
|
||||
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.
|
||||
|
||||
|
||||
## 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
|
||||
### *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]
|
||||
|
@ -70,11 +51,6 @@ The returned `Dictionary`s have the following structure (example):
|
|||
| ---------------------------------------------------------------------- The HTTP response code
|
||||
------------------------------------------------------------------------------------ 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> = *""*)
|
||||
:::warning
|
||||
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`.
|
||||
|
||||
## 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*
|
||||
Used to determine if running in verbose/command line mode.
|
||||
Makes diagnostic log messages display correctly (workaround for Godot's ANSI true color limitation).
|
||||
|
||||
## 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>)
|
||||
Prints a diagnostic message.
|
||||
### *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" ]*
|
||||
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
|
||||
### *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.
|
||||
|
|
|
@ -13,16 +13,6 @@ Allows you to write configuration files with ease, without any headaches.
|
|||
Do not modify this.
|
||||
:::
|
||||
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
|
||||
### *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]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
var basepath: String
|
||||
## Contains a list of all registered cleanup hooks.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# Contains a list of all registered cleanup hooks.
|
||||
var cleanup_hooks: Dictionary = {}
|
||||
## Contains a list of all loaded custom modules.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# Contains a list of all loaded custom modules.
|
||||
var custom_modules: Dictionary = {}
|
||||
## Contains the node holding all custom modules as children.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# Contains the node holding all custom modules as children.
|
||||
var custom_modules_node: Node
|
||||
## The CORE Object's logger instance.
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# The CORE Object's logger instance.
|
||||
var loggeri: CoreLoggerInstance
|
||||
|
||||
# +++ initialization +++
|
||||
|
@ -89,8 +85,7 @@ func _ready() -> void:
|
|||
add_child(scheduler)
|
||||
get_tree().auto_accept_quit = false
|
||||
|
||||
## Initializes all built-in modules during the preinitialization phase.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Initializes all built-in modules during the preinitialization phase.
|
||||
func initialize_modules() -> void:
|
||||
for module in modules:
|
||||
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)._initialize()
|
||||
|
||||
## Injects CORE's builtin modules into the SceneTree.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Injects CORE's builtin modules into the SceneTree.
|
||||
func inject_modules() -> void: for module in modules: add_child(get(module))
|
||||
|
||||
## Initializes the framework scheduler.
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Initializes the framework scheduler.
|
||||
func initialize_scheduler() -> void:
|
||||
scheduler = Timer.new()
|
||||
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: apply_configuration()
|
||||
|
||||
## Applies the a configuration.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Applies a new configuration.
|
||||
func apply_configuration() -> void:
|
||||
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!")
|
||||
|
@ -356,8 +348,7 @@ func get_version_semantic() -> Array[int]:
|
|||
CoreTypes.VersionType.ALPHA: version_type_int = 0
|
||||
return [version_version, version_type_int, version_typerelease]
|
||||
|
||||
## Determines CORE's installation/base path.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Determines CORE's installation/base path.
|
||||
func determine_basepath() -> bool:
|
||||
if FileAccess.file_exists("res://.corebasepath"):
|
||||
basepath = "res://"
|
||||
|
@ -370,7 +361,6 @@ func determine_basepath() -> bool:
|
|||
return false
|
||||
return true
|
||||
|
||||
# Checks Godot's version
|
||||
## Checks compatibility with the running version.
|
||||
func check_godot_version() -> bool:
|
||||
var version: Dictionary = Engine.get_version_info()
|
||||
|
@ -400,6 +390,7 @@ func quit_safely(exitcode: int = 0) -> void:
|
|||
await cleanup()
|
||||
get_tree().quit(exitcode)
|
||||
|
||||
# Just ignore this.
|
||||
func _notification(what) -> void:
|
||||
match(what):
|
||||
NOTIFICATION_WM_CLOSE_REQUEST:
|
||||
|
|
14
src/erm.gd
14
src/erm.gd
|
@ -18,14 +18,11 @@
|
|||
## Allows for awaited, batched and oneline requests.
|
||||
extends CoreBaseModule
|
||||
|
||||
## Contains a list of all queued downloads.[br]
|
||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
||||
# Contains a list of all queued downloads.
|
||||
var list_queue: Dictionary = {}
|
||||
## Contains a list of all active downloads.[br]
|
||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
||||
# Contains a list of all active downloads.
|
||||
var list_active: Dictionary = {}
|
||||
## Contains a liust of all completed downloads.[br]
|
||||
## [b]Danger: [i]Don't modify this[/i][/b].
|
||||
# Contains a liust of all completed downloads.
|
||||
var list_complete: Dictionary = {}
|
||||
|
||||
## 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)
|
||||
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:
|
||||
var id: int = create_request(url, method, headers, data)
|
||||
start_request(id, parse_utf8)
|
||||
|
@ -116,8 +113,7 @@ func _batch_awaited_request(url: String, parse_utf8: bool, method: HTTPClient.Me
|
|||
return id
|
||||
|
||||
# +++ internal +++
|
||||
## Returns a new download id.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# Returns a new download id.
|
||||
func generate_id() -> int:
|
||||
var id = randi()
|
||||
if list_queue.has(id) or list_active.has(id):
|
||||
|
|
|
@ -23,9 +23,7 @@ extends CoreBaseModule
|
|||
|
||||
signal log_event
|
||||
|
||||
## Keeps track of all logger instances.
|
||||
## Unused instances will be cleaned periodically.
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# Keeps track of all logger instances. Unused instances will be cleaned periodically by CORE's scheduler.
|
||||
var instances: Array[CoreLoggerInstance] = []
|
||||
|
||||
## 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
|
||||
|
||||
# +++ logging +++
|
||||
## The main logging function that does the heavy lifting.[br]
|
||||
## [b]Danger: [i]Don't call this.[/i][/b]
|
||||
# The main logging function that does the heavy lifting.
|
||||
func _log(level: CoreTypes.LoggerLevel, origin: String, message: String) -> void:
|
||||
if !is_level_allowed(level):
|
||||
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.
|
||||
const scene_nodes: Array[String] = [ "debug", "cutscene", "menu", "main", "background" ]
|
||||
## The 'debug' scene collection.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# Scene collections
|
||||
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()
|
||||
## The 'menu' scene collection.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
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()
|
||||
## The 'background' scene collection.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
var scenes_background: Node = Node.new()
|
||||
|
||||
## A list of all loaded scenes[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# A list of all loaded scenes.
|
||||
var scenes: Dictionary = {}
|
||||
|
||||
# +++ module +++
|
||||
|
|
|
@ -23,15 +23,13 @@ extends CoreBaseModule
|
|||
## Indicates if a storage file is currently open.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
var is_open: bool = false
|
||||
## The parsed data inside the storage file.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# The parsed data inside the storage file.
|
||||
var storage: Dictionary = {}
|
||||
## The location of the storage file.[br]
|
||||
## [b]Danger: [i]Don't modify this.[/i][/b]
|
||||
# The location of the storage file.
|
||||
var storage_location: String = ""
|
||||
|
||||
# +++ 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:
|
||||
if is_open:
|
||||
loggeri.error("Failed to open storage: A storage file is already open")
|
||||
|
|
Loading…
Reference in a new issue