Update development mode
This commit is contained in:
parent
10c5cfd134
commit
bf7eacdb39
5 changed files with 11 additions and 14 deletions
2
Test.gd
2
Test.gd
|
@ -29,7 +29,7 @@ var config: CoreConfiguration = CoreConfiguration.new()
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
# Update config keys
|
# Update config keys
|
||||||
config.headless = false
|
config.headless = false
|
||||||
config.debugging = true
|
config.development = true
|
||||||
config.logger_level = CoreTypes.LoggerLevel.DIAG
|
config.logger_level = CoreTypes.LoggerLevel.DIAG
|
||||||
# Initialize CORE with custom config
|
# Initialize CORE with custom config
|
||||||
core = Core.new(config)
|
core = Core.new(config)
|
||||||
|
|
|
@ -88,7 +88,7 @@ Applies the a configuration.
|
||||||
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.
|
||||||
### *bool* <u>is_devmode</u>()
|
### *bool* <u>is_devmode</u>()
|
||||||
Returns if the CORE Framework is in development mode.
|
Returns if the framework is in development mode.
|
||||||
### *String* <u>get_format_string</u>(*String* <u>string</u>)
|
### *String* <u>get_format_string</u>(*String* <u>string</u>)
|
||||||
Replaces placeholders with human-friendly strings. \
|
Replaces placeholders with human-friendly strings. \
|
||||||
You can use the following placeholders:
|
You can use the following placeholders:
|
||||||
|
|
|
@ -12,11 +12,9 @@ All settings are variables.
|
||||||
## Global
|
## Global
|
||||||
### *bool* <u>headless</u> = *false*
|
### *bool* <u>headless</u> = *false*
|
||||||
Controls CORE's functionality. Renders GUI-related modules useless when set to `false`, which is the recommended behaviour on servers. For CORE's full functionality, set this to `true`.
|
Controls CORE's functionality. Renders GUI-related modules useless when set to `false`, which is the recommended behaviour on servers. For CORE's full functionality, set this to `true`.
|
||||||
### *bool* <u>debugging</u> = *false*
|
### *bool* <u>development</u> = *false*
|
||||||
:::note
|
Puts the framework into development mode. \
|
||||||
This will not enable the development mode automatically, only if you're developing on CORE itself.
|
Unlocks experimental features.
|
||||||
:::
|
|
||||||
Allows debugging functionality if set to `true`, or not if set to `false`.
|
|
||||||
### *bool* <u>custom_modules</u> = *false*
|
### *bool* <u>custom_modules</u> = *false*
|
||||||
Allows or disallows custom modules.
|
Allows or disallows custom modules.
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,9 @@ class_name CoreConfiguration
|
||||||
## Controls CORE's functionality.[br]
|
## Controls CORE's functionality.[br]
|
||||||
## Renders GUI-related modules useless when set to [code]false[/code], which is the recommended behaviour on servers. For CORE's full functionality, set this to [code]true[/code].
|
## Renders GUI-related modules useless when set to [code]false[/code], which is the recommended behaviour on servers. For CORE's full functionality, set this to [code]true[/code].
|
||||||
@export var headless: bool
|
@export var headless: bool
|
||||||
## Allows debugging functionality if set to [code]true[/code], or not if set to [code]false[/code].[br]
|
## Puts the framework into development mode.[br]
|
||||||
## [br]
|
## Unlocks experimental features.
|
||||||
## [b]Note: [i]This will not enable the development mode automatically, only if you're developing on CORE itself.[/i][/b]
|
@export var development: bool
|
||||||
@export var debugging: bool
|
|
||||||
## Allows or disallows custom modules.
|
## Allows or disallows custom modules.
|
||||||
@export var custom_modules: bool
|
@export var custom_modules: bool
|
||||||
@export_category("Logger")
|
@export_category("Logger")
|
||||||
|
@ -45,7 +44,7 @@ class_name CoreConfiguration
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
# Global
|
# Global
|
||||||
headless = false
|
headless = false
|
||||||
debugging = false
|
development = false
|
||||||
custom_modules = false
|
custom_modules = false
|
||||||
|
|
||||||
# Logger
|
# Logger
|
||||||
|
|
|
@ -219,9 +219,9 @@ func cleanup() -> void:
|
||||||
custom_modules_node.queue_free()
|
custom_modules_node.queue_free()
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
## Returns if the CORE Framework is in development mode.
|
## Returns if the framework is in development mode.
|
||||||
func is_devmode() -> bool:
|
func is_devmode() -> bool:
|
||||||
return config.debugging and basepath == "res://" and OS.is_debug_build()
|
return config.development
|
||||||
|
|
||||||
## Replaces placeholders with human-friendly strings.[br]
|
## Replaces placeholders with human-friendly strings.[br]
|
||||||
## You can use the following placeholders:[br]
|
## You can use the following placeholders:[br]
|
||||||
|
|
Loading…
Reference in a new issue