2024-02-22 06:22:22 +11:00
|
|
|
class_name ScoreboardEntry extends HBoxContainer
|
2023-11-08 14:28:55 +11:00
|
|
|
|
|
|
|
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:
|
2023-11-08 14:28:55 +11:00
|
|
|
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:
|
2023-11-08 14:28:55 +11:00
|
|
|
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:
|
2023-11-08 14:28:55 +11:00
|
|
|
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
|