From 8d73c97a3ee53155d3bebe1824e987fe812184b1 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 7 Jul 2023 18:22:15 +0200 Subject: [PATCH] Remove autoload.gd, add config check, modify msgs --- autoload.gd | 31 ------------------------------- coreinit.gd | 7 ++++++- 2 files changed, 6 insertions(+), 32 deletions(-) delete mode 100644 autoload.gd diff --git a/autoload.gd b/autoload.gd deleted file mode 100644 index 992efb1..0000000 --- a/autoload.gd +++ /dev/null @@ -1,31 +0,0 @@ -# autoload.gd -# CORE Autoloader -# -# This file is part of StarOpenSource CORE (SOSCORE) -# Made by the StarOpenSource Project and Contributers -# Licensed under GNU GPLv3 -extends Node - -@onready -var core = get_node(NodePath("/root/core")) - -func singleton(singleton_name:String,singleton_path:String) -> void: - var node = Control.new() - node.name = singleton_name - node.set_script(ResourceLoader.load(singleton_path)) - get_tree().root.add_child(node) - -func preset(plugin_id:String) -> bool: - var node = Control.new() - match(plugin_id): - "dialogmgr": - node.name = "DialogueManager" - node.set_script(ResourceLoader.load("res://addons/dialogue_manager/dialogue_manager.gd")) - _: - Logger.error("autoload","Failed adding preset \"" + plugin_id + "\": Invalid preset.") - return false - get_tree().root.add_child(node) - return true - -func _ready() -> void: - core.setready() diff --git a/coreinit.gd b/coreinit.gd index b33c46b..f896556 100644 --- a/coreinit.gd +++ b/coreinit.gd @@ -22,7 +22,7 @@ func _ready() -> void: get_tree().quit(142) return if engine_version["status"] != "stable": - print("coreinit -> CORE only supports stable Godot 4 releases. Please upgrade/downgrade your Godot Project to Godot 4.0.stable.") + print("coreinit -> CORE only supports stable Godot 4 releases. Please upgrade/downgrade your Godot Project to a stable version.") await get_tree().create_timer(0.1).timeout get_tree().quit(143) return @@ -36,6 +36,11 @@ func _ready() -> void: await get_tree().create_timer(0.1).timeout get_tree().quit(145) return + if !FileAccess.file_exists("res://CORE/config.gd"): + print("coreinit -> The CORE configuration file (config.gd) is missing! Please copy the config.gd.example file and rename it to config.gd!") + await get_tree().create_timer(0.1).timeout + get_tree().quit(146) + return print("coreinit -> Constructing coreloader") var coreloader = Control.new() coreloader.name = "coreloader"