Compare commits

..

No commits in common. "e7d0a9d9a68bc29cab9f512ec064b5ca31e1d9ce" and "b00916229abe2fe1b751729f7cc3471096cb7816" have entirely different histories.

6 changed files with 9 additions and 30 deletions

View file

@ -43,7 +43,7 @@ Stores the path to CORE's installation directory.
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>complete_init</u>()
### *void* <u>complete_init</u>(*bool* <u>no_success_message</u> = *false*)
Waits for all built-in and custom modules to fully initialize. \
\
This ensures that all modules are fully initialized and ready for usage. \

View file

@ -20,8 +20,8 @@ boot_splash/show_image=false
[display]
window/size/viewport_width=1440
window/size/viewport_height=810
window/size/viewport_width=960
window/size/viewport_height=540
[editor_plugins]

View file

@ -24,7 +24,7 @@ class_name CoreTypes
## Available version types, following the StarOpenSource Versioning Specification (SOSVS) version 1.
enum VersionType { RELEASE, RELEASECANDIDATE, BETA, ALPHA }
## Available log levels, followingthe StarOpenSource Logging Specification (SOSLS) version 1.
enum LoggerLevel { NONE, SPECIAL, ERROR, WARN, INFO, VERB, DIAG }
enum LoggerLevel { NONE, ERROR, WARN, INFO, VERB, DIAG }
## Available scene types.
enum SceneType { NONE, DEBUG, CUTSCENE, MENU, MAIN, BACKGROUND }
## To what degree [i]something[/i] should be blocked.

View file

@ -71,9 +71,6 @@ var loggeri: CoreLoggerInstance
## Internal, don't modify.
# Makes CORE inaccessible if true.
var disabled: bool = false
## Internal, don't modify.
# Displays the ✨ special ✨ welcome message if true
var welcomed: bool = false
# +++ initialization +++
func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
@ -129,7 +126,7 @@ func initialize_scheduler() -> void:
## [br]
## This ensures that all modules are fully initialized and ready for usage.[br]
## [i][b]Not calling this function during startup may lead to runtime issues.[/b][/i]
func complete_init() -> void:
func complete_init(no_success_message: bool = false) -> void:
var modsinit_builtin: Array[String] = ["workaround"]
var modsinit_custom: Array[String] = ["workaround"]
@ -154,20 +151,7 @@ func complete_init() -> void:
# Initialization complete
await get_tree().process_frame
if !welcomed:
welcomed = true
logger._log(CoreTypes.LoggerLevel.SPECIAL, basepath.replace("res://", "") + "src/core.gd", """_________________________________ __________ ______
__ ____/_ __ \\__ __ \\__ ____/ ___ ____/____________ _______ ___________ _________________ /__
_ / _ / / /_ /_/ /_ __/ __ /_ __ ___/ __ `/_ __ `__ \\ _ \\_ | /| / / __ \\_ ___/_ //_/
/ /___ / /_/ /_ _, _/_ /___ _ __/ _ / / /_/ /_ / / / / / __/_ |/ |/ // /_/ / / _ ,<
\\____/ \\____/ /_/ |_| /_____/ /_/ /_/ \\__,_/ /_/ /_/ /_/\\___/____/|__/ \\____//_/ /_/|_|
Copyright (c) 2023-2024 The StarOpenSource Project & Contributors.
Licensed under the GNU Affero General Public License v3 WITHOUT ANY WARRANTY.
You should have recieved a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Consider contributing to the CORE Framework to make it even better... and remember: #TransRightsAreHumanRights
Thank you for using the CORE Framework to develop your application or game!""")
if !no_success_message: loggeri.info("Initialized CORE successfully")
# +++ configuration +++
## Loads a (new) configuration object and applies it to all modules.
@ -384,7 +368,7 @@ func determine_basepath() -> bool:
elif FileAccess.file_exists("res://addons/CORE/.corebasepath"):
basepath = "res://addons/CORE/"
else:
printerr("CORE is not located at 'res://CORE/' or 'res://addons/CORE', aborting initialization.")
assert(false, "CORE is not located at 'res://CORE/', aborting initialization")
return false
return true
@ -394,7 +378,7 @@ func check_godot_version() -> bool:
match(version["major"]):
4: pass
_:
printerr("The CORE Framework does not support Godot versions older or newer than 4.x.x.")
printerr("The CORE Framework does not support Godot versions older or newer than 4.x.x")
return false
match(version["minor"]):
0: printerr("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.")
@ -404,7 +388,7 @@ func check_godot_version() -> bool:
printerr("The CORE Framework does not support Godot versions newer than 4.2.x. Please downgrade to Godot 4.2.x.")
return false
if version["status"] != "stable":
printerr("The CORE Framework does not support unstable Godot versions. Please switch to Godot 4.2.x.stable to ensure full compatibility.")
printerr("The CORE Framework does not support unstable Godot versions. Please switch to Godot stable 4.2.x.")
return false
return true

View file

@ -101,10 +101,6 @@ func _log(level: CoreTypes.LoggerLevel, origin: String, message: String) -> void
format = format.replace("%level%", "ERR!")
format_newline = format_newline.replace("%level%", "ERR!")
format = format.replace("%color%", "[color=red]")
CoreTypes.LoggerLevel.SPECIAL:
format = format.replace("%level%", "UWU!")
format_newline = format_newline.replace("%level%", "HI:3")
format = format.replace("%color%", "[color=purple]")
CoreTypes.LoggerLevel.NONE:
format = format.replace("%level%", "CRSH")
format_newline = format_newline.replace("%level%", "CRSH")

View file

@ -34,7 +34,6 @@ func load_framework(config: CoreConfiguration = CoreConfiguration.new()) -> void
config.logger_level = CoreTypes.LoggerLevel.DIAG
core = Core.new(config)
get_tree().root.add_child(core)
core.welcomed = true # Hides the welcome message shown by CORE so it doesn't bloat the log
await get_tree().process_frame
await core.complete_init()