fix: untyped variables removed, fixed issue with unknown fields

This commit is contained in:
tiger tiger tiger 2025-12-13 13:31:31 +01:00
parent 98c15559b7
commit 8c3b0e03a3
1 changed files with 10 additions and 7 deletions

View File

@ -11,7 +11,7 @@ enum {
DONE DONE
} }
var has_stage = false: var has_stage: bool = false:
set(focus): set(focus):
if not focus == has_stage: if not focus == has_stage:
if focus: if focus:
@ -24,15 +24,15 @@ var has_stage = false:
process_mode = Node.PROCESS_MODE_DISABLED process_mode = Node.PROCESS_MODE_DISABLED
has_stage = focus has_stage = focus
var _input_locked = true var _input_locked: bool = true
var selection_state = INI: var selection_state := INI:
set(state): set(state):
print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state]) print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state])
selection_state = state selection_state = state
_input_locked = !(state == CARDS or state == POSTS) _input_locked = !(state == CARDS or state == POSTS)
if state == CARDS_SELECTED: if state == CARDS_SELECTED:
var tween = get_tree().create_tween() var tween: Tween = get_tree().create_tween()
tween.tween_property($thought_prompt, "modulate", Color(1, 1, 1, 0), 0.5) tween.tween_property($thought_prompt, "modulate", Color(1, 1, 1, 0), 0.5)
elif state == DONE: elif state == DONE:
reset() reset()
@ -57,7 +57,7 @@ var options:Array = []
signal cards_picked(cardnames: Array[String]) signal cards_picked(cardnames: Array[String])
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready() -> void:
reset() reset()
return return
@ -89,7 +89,7 @@ func reset():
output = [] output = []
options = [] options = []
anim_players = [] anim_players = []
var card_controls = $cards.get_children() var card_controls: Array[Node] = $cards.get_children()
for control in card_controls: for control in card_controls:
options.append(control.get_child(1)) options.append(control.get_child(1))
anim_players.append(control.get_child(0)) anim_players.append(control.get_child(0))
@ -97,7 +97,7 @@ func reset():
for player in anim_players: player.play("reveal") for player in anim_players: player.play("reveal")
func fill_card_slots(id: int): func fill_card_slots(id: int):
var new_cards = HardCards.get_cards_by_scene_id(id) var new_cards := HardCards.get_cards_by_scene_id(id)
for i in range(new_cards.size()): for i in range(new_cards.size()):
$cards.get_child(i).remove_child($cards.get_child(i).get_child(1)) $cards.get_child(i).remove_child($cards.get_child(i).get_child(1))
@ -139,6 +139,9 @@ func _input(event):
# fill_card_slots(3) # fill_card_slots(3)
# selection_state = CARDS # selection_state = CARDS
if event is not InputEventAction:
return
if has_stage: if has_stage:
if not _input_locked: if not _input_locked:
if not on_cooldown: if not on_cooldown: