Update to 5582fef70a5a8220313cfc414b8cf4ee0f48bc87
This commit is contained in:
parent
59ac90c40b
commit
d743da3b8d
1 changed files with 16 additions and 9 deletions
25
src/core.gd
25
src/core.gd
|
@ -28,7 +28,7 @@ const version_version: int = 2
|
|||
## The version type. See [enum CoreTypes.VersionType] for more information.
|
||||
const version_type: CoreTypes.VersionType = CoreTypes.VersionType.RELEASE
|
||||
## The version type number. Resets on every new version and version type.
|
||||
const version_typerelease: int = 0
|
||||
const version_typerelease: int = 1
|
||||
## The fork indicator. Update this if you intend on soft or hard forking this framework.
|
||||
const version_fork: String = ""
|
||||
|
||||
|
@ -245,19 +245,26 @@ func register_custom_module(module_name: String, module_origin: String, module_c
|
|||
if custom_modules.has(module_name):
|
||||
loggeri.error(stringify_variables("Registering module failed: A custom module with the name %name% already exists.", { "name": module_name }))
|
||||
return false
|
||||
loggeri.diag("Updating variables")
|
||||
|
||||
# Update variables
|
||||
module_class.name = module_name
|
||||
module_class.core = self
|
||||
module_class.logger = logger.get_instance(module_origin, module_class)
|
||||
module_class.logger.framework = true
|
||||
loggeri.diag("Adding module to SceneTree")
|
||||
custom_modules_node.add_child(module_class)
|
||||
loggeri.diag("Merging module with custom_modules")
|
||||
|
||||
# Register module
|
||||
custom_modules.merge({ module_name: module_class })
|
||||
loggeri.diag("Initializing custom module")
|
||||
module_class._initialize()
|
||||
loggeri.diag("Updating custom module configuration")
|
||||
module_class._pull_config()
|
||||
|
||||
# Add to 'custom_modules_node'
|
||||
custom_modules_node.add_child(module_class)
|
||||
|
||||
# Initialize module
|
||||
@warning_ignore("redundant_await")
|
||||
await module_class._initialize()
|
||||
|
||||
# Update module configuration
|
||||
@warning_ignore("redundant_await")
|
||||
await module_class._pull_config()
|
||||
return true
|
||||
|
||||
## Unregisters a custom module, making it no longer available.
|
||||
|
|
Loading…
Reference in a new issue