Optimize/change version checking
This commit is contained in:
parent
b739c8ad53
commit
3db90ed612
1 changed files with 11 additions and 7 deletions
18
src/core.gd
18
src/core.gd
|
@ -57,7 +57,7 @@ var custom_modules_node: Node
|
||||||
# Preinitialization
|
# Preinitialization
|
||||||
func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
|
func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
|
||||||
name = "CORE"
|
name = "CORE"
|
||||||
if !check_godot_version(): queue_free()
|
if !check_godot_version(): return
|
||||||
if !determine_basepath(): queue_free()
|
if !determine_basepath(): queue_free()
|
||||||
custom_modules_node = Node.new()
|
custom_modules_node = Node.new()
|
||||||
reload_configuration(new_config)
|
reload_configuration(new_config)
|
||||||
|
@ -270,12 +270,16 @@ func check_godot_version() -> bool:
|
||||||
match(version["major"]):
|
match(version["major"]):
|
||||||
4: pass
|
4: pass
|
||||||
_:
|
_:
|
||||||
assert(true, "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 true
|
return false
|
||||||
match(version["minor"]):
|
match(version["minor"]):
|
||||||
0: print("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.")
|
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.")
|
||||||
1: print("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.")
|
1: 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.")
|
||||||
2: pass
|
2: pass
|
||||||
_: print("The CORE Framework does not support Godot versions newer than 4.2.x. Please downgrade to Godot 4.2.x to ensure full compatibility.")
|
_:
|
||||||
if version["status"] != "stable": print("The CORE Framework does not support unstable Godot versions. Please switch to Godot stable 4.2.1 to ensure full compatibility.")
|
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 stable 4.2.x.")
|
||||||
|
return false
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue