Launcher/Versions.gd

34 lines
634 B
GDScript3
Raw Normal View History

2022-10-10 20:59:43 -05:00
extends Node
var os_name = ""
var suffix = ""
2022-10-10 20:59:43 -05:00
func get_version():
var version
2022-10-10 20:59:43 -05:00
var store = Store.get_store()
2022-10-10 20:59:43 -05:00
if store.has("current_version"):
version = store["current_version"]
else:
version = null
2022-10-10 20:59:43 -05:00
return version
2022-10-10 20:59:43 -05:00
func _ready():
# Make sure {config}/UltraFlare/current exists
var current_dir = Directory.new()
if not current_dir.dir_exists(OS.get_config_dir()+"/UltraFlare/current"):
current_dir.make_dir_recursive(OS.get_config_dir()+"/UltraFlare/current")
if OS.get_name() == "X11":
os_name = "linux"
elif OS.get_name() == "Windows":
os_name = "windows"
if os_name == "windows":
suffix = ".exe"
2022-10-10 20:59:43 -05:00