enabled enforced static typing
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
extends Control
|
||||
class_name HeroSelector
|
||||
class_name HeroSelector extends Control
|
||||
|
||||
signal hero_selected(hero_class)
|
||||
signal hero_selected(hero_class: int)
|
||||
|
||||
@export var hero_card_scene: PackedScene
|
||||
@export var hbox: HBoxContainer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
for hero in Data.characters:
|
||||
var card = hero_card_scene.instantiate()
|
||||
for hero: HeroClass in Data.characters:
|
||||
var card: Control = hero_card_scene.instantiate()
|
||||
card.set_hero(hero)
|
||||
card.pressed.connect(func(x): hero_selected.emit(Data.characters.find(x)))
|
||||
card.pressed.connect(func(x: int) -> void: hero_selected.emit(Data.characters.find(x)))
|
||||
card.button_mouse_entered.connect(_on_button_mouse_entered)
|
||||
hbox.add_child(card)
|
||||
|
||||
|
||||
func _on_button_mouse_entered():
|
||||
func _on_button_mouse_entered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
|
||||
Reference in New Issue
Block a user