fixed some bugs The Typening caused
This commit is contained in:
19
Scenes/Menus/CharacterSelect/charselect.gd
Normal file
19
Scenes/Menus/CharacterSelect/charselect.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
class_name HeroSelector extends Control
|
||||
|
||||
signal hero_selected(hero_class: int)
|
||||
|
||||
@export var hero_card_scene: PackedScene
|
||||
@export var hbox: HBoxContainer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
for hero: HeroClass in Data.characters:
|
||||
var card: Control = hero_card_scene.instantiate()
|
||||
card.set_hero(hero)
|
||||
card.pressed.connect(func(x: int) -> void: hero_selected.emit(x))
|
||||
card.button_mouse_entered.connect(_on_button_mouse_entered)
|
||||
hbox.add_child(card)
|
||||
|
||||
|
||||
func _on_button_mouse_entered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
Reference in New Issue
Block a user