diff --git a/docs/docs/reference/core.md b/docs/docs/reference/core.md index 9751d60..c056abe 100644 --- a/docs/docs/reference/core.md +++ b/docs/docs/reference/core.md @@ -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* complete_init(*bool* no_success_message = *false*) +### *void* complete_init() Waits for all built-in and custom modules to fully initialize. \ \ This ensures that all modules are fully initialized and ready for usage. \ diff --git a/project.godot b/project.godot index f7bf514..9d9a8a9 100644 --- a/project.godot +++ b/project.godot @@ -20,8 +20,8 @@ boot_splash/show_image=false [display] -window/size/viewport_width=960 -window/size/viewport_height=540 +window/size/viewport_width=1440 +window/size/viewport_height=810 [editor_plugins] diff --git a/src/classes/types.gd b/src/classes/types.gd index 4d083da..d6fa67c 100644 --- a/src/classes/types.gd +++ b/src/classes/types.gd @@ -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, ERROR, WARN, INFO, VERB, DIAG } +enum LoggerLevel { NONE, SPECIAL, 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. diff --git a/src/core.gd b/src/core.gd index 72a458d..c25a1eb 100644 --- a/src/core.gd +++ b/src/core.gd @@ -71,6 +71,9 @@ 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: @@ -126,7 +129,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(no_success_message: bool = false) -> void: +func complete_init() -> void: var modsinit_builtin: Array[String] = ["workaround"] var modsinit_custom: Array[String] = ["workaround"] @@ -151,7 +154,20 @@ func complete_init(no_success_message: bool = false) -> void: # Initialization complete await get_tree().process_frame - if !no_success_message: loggeri.info("Initialized CORE successfully") + 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 . + +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!""") # +++ configuration +++ ## Loads a (new) configuration object and applies it to all modules. diff --git a/src/logger.gd b/src/logger.gd index 5631d13..37e1062 100644 --- a/src/logger.gd +++ b/src/logger.gd @@ -101,6 +101,10 @@ 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") diff --git a/tests/unitbase.gd b/tests/unitbase.gd index 4319271..1a2a91c 100644 --- a/tests/unitbase.gd +++ b/tests/unitbase.gd @@ -34,6 +34,7 @@ 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()