Personajes seleccionables
This commit is contained in:
1 parent
66f4d8b33b
commit
97335c9d21
42 files changed
+5282
-3106
No files matched your search
@@ -0,0 +1,27 @@
|
||||
extends VBoxContainer
|
||||
|
||||
## Cuadricula fija de cuatro integrantes. No carga niveles ni conserva progreso.
|
||||
signal character_chosen(character: CharacterData)
|
||||
signal back_requested
|
||||
|
||||
@onready var grid: GridContainer = $Scroll/Grid
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$Back.pressed.connect(func() -> void: back_requested.emit())
|
||||
for child: Node in grid.get_children():
|
||||
var card: CharacterCard = child as CharacterCard
|
||||
if card != null:
|
||||
card.character_chosen.connect(_on_character_chosen)
|
||||
|
||||
|
||||
func show_roster(level_name: String) -> void:
|
||||
$LevelName.text = level_name
|
||||
show()
|
||||
$Scroll.scroll_vertical = 0
|
||||
if grid.get_child_count() > 0:
|
||||
(grid.get_child(0) as Control).grab_focus()
|
||||
|
||||
|
||||
func _on_character_chosen(character: CharacterData) -> void:
|
||||
character_chosen.emit(character)
|
||||
Reference in new issue
Block a user