godot-wild-jam-66/game/menu/VersionLabel.gd
2024-02-09 01:54:38 +01:00

15 lines
345 B
GDScript

class_name VersionLabel
extends Label
const VERSION_PATH: = "res://version.txt"
func _ready() -> void:
var v = FileAccess.get_file_as_string(VERSION_PATH)
if FileAccess.get_open_error() != OK:
push_error("cannot open version file")
text = ""
else:
text = v.rstrip("\n").rstrip("\r")
if OS.has_feature("debug"):
text += " (DEBUG)"