Test version text
This commit is contained in:
23
game/scripts/version_label.gd
Normal file
23
game/scripts/version_label.gd
Normal file
@ -0,0 +1,23 @@
|
||||
extends VersionText
|
||||
|
||||
|
||||
@export var show_label_in_editor: bool = true
|
||||
@export_category("Label Settings")
|
||||
@export var major_version: int = 0
|
||||
@export var minor_version: int = 0
|
||||
@export var patch: int = 0
|
||||
|
||||
@export var show_branch_name: bool = true
|
||||
@export var show_sha: bool = true
|
||||
|
||||
func _ready() -> void:
|
||||
# fill text
|
||||
text = ("%s_%d.%d.%d-%03d" %[project_name, major_version, minor_version, patch, commit_number])
|
||||
|
||||
# extra details
|
||||
if show_branch_name: text += "-%s" %branch_name
|
||||
if show_sha: text += "-%s" %short_sha
|
||||
|
||||
# show text
|
||||
if show_label_in_editor || build_override: show()
|
||||
else: hide()
|
||||
1
game/scripts/version_label.gd.uid
Normal file
1
game/scripts/version_label.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://dlna6j58fshxu
|
||||
8
game/scripts/version_text.gd
Normal file
8
game/scripts/version_text.gd
Normal file
@ -0,0 +1,8 @@
|
||||
class_name VersionText extends Label
|
||||
|
||||
var project_name: String = "X"
|
||||
var commit_number: int = 0
|
||||
var branch_name: String = "X"
|
||||
var short_sha: String = "X"
|
||||
|
||||
var build_override: bool = false
|
||||
1
game/scripts/version_text.gd.uid
Normal file
1
game/scripts/version_text.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b3rhuel4vnoss
|
||||
Reference in New Issue
Block a user