2023-12-09 01:09:12 +11:00
|
|
|
extends PanelContainer
|
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
signal pressed(hero_class: int)
|
2023-12-17 02:02:16 +11:00
|
|
|
signal button_mouse_entered()
|
2023-12-09 01:09:12 +11:00
|
|
|
|
|
|
|
var hero_class: HeroClass
|
|
|
|
|
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
func set_hero(hero: HeroClass) -> void:
|
2023-12-09 01:09:12 +11:00
|
|
|
hero_class = hero
|
|
|
|
$VBoxContainer/Label.text = hero.hero_name
|
|
|
|
$VBoxContainer/TextureRect.texture = hero.texture
|
|
|
|
|
|
|
|
|
|
|
|
func _on_button_pressed() -> void:
|
2024-03-23 22:36:19 +11:00
|
|
|
pressed.emit(Data.characters.find(hero_class))
|
2023-12-17 02:02:16 +11:00
|
|
|
|
|
|
|
|
|
|
|
func _on_button_mouse_entered() -> void:
|
|
|
|
button_mouse_entered.emit()
|