Remove autoload.gd, add config check, modify msgs

This commit is contained in:
JeremyStar™ 2023-07-07 18:22:15 +02:00
parent 357ea3eba4
commit 8d73c97a3e
2 changed files with 6 additions and 32 deletions

View file

@ -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()

View file

@ -22,7 +22,7 @@ func _ready() -> void:
get_tree().quit(142) get_tree().quit(142)
return return
if engine_version["status"] != "stable": 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 await get_tree().create_timer(0.1).timeout
get_tree().quit(143) get_tree().quit(143)
return return
@ -36,6 +36,11 @@ func _ready() -> void:
await get_tree().create_timer(0.1).timeout await get_tree().create_timer(0.1).timeout
get_tree().quit(145) get_tree().quit(145)
return 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") print("coreinit -> Constructing coreloader")
var coreloader = Control.new() var coreloader = Control.new()
coreloader.name = "coreloader" coreloader.name = "coreloader"