mtd/Scripts/scoreboard_entry.gd

28 lines
729 B
GDScript3
Raw Normal View History

2024-02-22 06:22:22 +11:00
class_name ScoreboardEntry extends HBoxContainer
var display_name: String
var character: int
var ready_state: bool
2024-02-22 06:22:22 +11:00
func set_display_name(_old_name: String, new_name: String) -> void:
display_name = new_name
$DisplayName.text = new_name
func get_display_name() -> String:
return display_name
2024-02-22 06:22:22 +11:00
func set_character(_old_class: int, new_class: int) -> void:
character = new_class
$CharacterName.text = Data.characters[new_class].hero_name
func get_character() -> int:
return character
2024-02-22 06:22:22 +11:00
func set_ready_state(state: bool) -> void:
ready_state = state
if state:
$TextureRect.texture.region = Rect2(32, 0, 32, 32)
else:
$TextureRect.texture.region = Rect2(0, 0, 32, 32)
func get_ready_state() -> bool:
return ready_state