From 95aef2ea4823bc90aa26ff9757ce20f341d594c5 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 26 Apr 2024 19:55:16 +0200 Subject: [PATCH] Update welcome message and add version indicator --- src/core.gd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/core.gd b/src/core.gd index b642365..7c16b77 100644 --- a/src/core.gd +++ b/src/core.gd @@ -172,13 +172,16 @@ func complete_init() -> void: if modsinit_custom.size() != 0: print(" Custom: " + str(modsinit_custom)) await get_tree().create_timer(1).timeout - initduration_complete_initialization = Time.get_ticks_msec() - inittime - # Initialization complete await get_tree().process_frame if !welcomed: welcomed = true - logger._log(CoreTypes.LoggerLevel.SPECIAL, basepath.replace("res://", "") + "src/core.gd", """_________________________________ __________ ______ + var version_welcome: String = await get_formatted_string("v%version%-%version_type_technical%%version_typerelease%%version_fork%") + if version_welcome.length() > 15: + await logger.crash("Invalid version size of 15") + elif version_welcome.length() < 15: + version_welcome = " ".repeat(15-version_welcome.length()) + version_welcome + logger._log(CoreTypes.LoggerLevel.SPECIAL, basepath.replace("res://", "") + "src/core.gd", """_________________________________ __________ %version% ______ __ ____/_ __ \\__ __ \\__ ____/ ___ ____/____________ _______ ___________ _________________ /__ _ / _ / / /_ /_/ /_ __/ __ /_ __ ___/ __ `/_ __ `__ \\ _ \\_ | /| / / __ \\_ ___/_ //_/ / /___ / /_/ /_ _, _/_ /___ _ __/ _ / / /_/ /_ / / / / / __/_ |/ |/ // /_/ / / _ ,< @@ -189,10 +192,12 @@ 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!""") - loggeri.info("Framework initialization took " + str(initduration_preinitialization + initduration_initialization + initduration_complete_initialization) + "ms (pre " + str(initduration_preinitialization) + "ms, init " + str(initduration_initialization) + "ms, complete " + str(initduration_complete_initialization) + "ms)") +Thank you for using the CORE Framework to develop your application or game!""".replace("%version%", version_welcome)) if is_devmode(): loggeri.warn("The CORE Framework is running in development mode.\nThis may cause bugs and issues inside the framework. Here be dragons!") if logger.verbose_mode: loggeri.warn("Godot is running in verbose stdout mode.\nDue to a bug in the engine that prevents displaying truecolor ANSI escape\nsequences CORE changed the color of all diagnostic log messages.\nTo prevent this, set 'logger_detect_verbose_mode' in the configuration to 'false'.") + + initduration_complete_initialization = Time.get_ticks_msec() - inittime + loggeri.info("Framework initialization took " + str(initduration_preinitialization + initduration_initialization + initduration_complete_initialization) + "ms (pre " + str(initduration_preinitialization) + "ms, init " + str(initduration_initialization) + "ms, complete " + str(initduration_complete_initialization) + "ms)") # +++ configuration +++ ## Loads a (new) configuration object and applies it to all modules. @@ -469,4 +474,5 @@ func _notification(what) -> void: match(what): NOTIFICATION_WM_CLOSE_REQUEST: if config.automatic_shutdown: + loggeri.diag("Got close request, shutting down") await quit_safely(0)