@@ -57,6 +57,8 @@ func initiate_selection(
5757 _selection_count := 0 ,
5858 _selection_type := 'min' ,
5959 _selection_optional := false ) -> void :
60+ if OS .has_feature ("debug" ) and not get_tree ().get_root ().has_node ('Gut' ):
61+ print ("DEBUG INFO:SelectionWindow: Initiated Selection" )
6062 # We don't allow the player to close the popup with the close button
6163 # as that will not send the mandatory signal to unpause the game
6264 get_close_button ().visible = false
@@ -85,7 +87,11 @@ func initiate_selection(
8587 selected_cards = card_array
8688 emit_signal ("confirmed" )
8789 return
88- # We change the window title to be descriptive
90+ # When we have 0 cards to select from, we consider the selection cancelled
91+ elif card_array .size () == 0 :
92+ is_cancelled = true
93+ emit_signal ("confirmed" )
94+ return
8995 match selection_type :
9096 "min" :
9197 window_title = "Select at least " + str (selection_count ) + " cards."
@@ -113,7 +119,6 @@ func initiate_selection(
113119 dupe_selection .remove_from_group ("cards" )
114120 dupe_selection .canonical_name = card .canonical_name
115121 dupe_selection .properties = card .properties .duplicate ()
116- dupe_selection .is_faceup = true
117122 card_sample = dupe_selection
118123 var card_grid_obj = grid_card_object_scene .instance ()
119124 _card_grid .add_child (card_grid_obj )
@@ -123,6 +128,10 @@ func initiate_selection(
123128 card_grid_obj .setup (dupe_selection )
124129 _extra_dupe_ready (dupe_selection , card )
125130 _card_dupe_map [card ] = dupe_selection
131+ # yield(dupe_selection, "ready")
132+ # yield(get_tree().create_timer(0.3), "timeout")
133+ dupe_selection .set_is_faceup (card .is_faceup ,true )
134+ dupe_selection .set_is_faceup (true ,true )
126135 # We connect each card grid's gui input into a call which will handle
127136 # The selections
128137 card_grid_obj .connect ("gui_input" , self , "on_selection_gui_input" , [dupe_selection , card ])
@@ -148,6 +157,8 @@ func initiate_selection(
148157 0 , 1 , 0.5 ,
149158 Tween .TRANS_SINE , Tween .EASE_IN )
150159 _tween .start ()
160+ if OS .has_feature ("debug" ) and not get_tree ().get_root ().has_node ('Gut' ):
161+ print ("DEBUG INFO:SelectionWindow: Started Card Display with a %s card selection" % [_card_grid .get_child_count ()])
151162
152163
153164# Overridable function for games to extend processing of dupe card
0 commit comments