Compare commits
No commits in common. "c20ce4054a0e57a4f1dd28a0326ab01c1ac7e480" and "8c1e6a1ffc25f2c788d364e9ebc8f059b42a766d" have entirely different histories.
c20ce4054a
...
8c1e6a1ffc
|
|
@ -144,50 +144,16 @@ func _on_board_focused() -> void:
|
||||||
give_lore_feedback()
|
give_lore_feedback()
|
||||||
|
|
||||||
|
|
||||||
## Finalizes board state before closing (ends drags, cleans up transitions)
|
|
||||||
func _finalize_board_state() -> void:
|
|
||||||
print_debug("CardBoard: Finalizing board state before closing (context: %d)" % current_context)
|
|
||||||
|
|
||||||
# End any active drag operations
|
|
||||||
if current_context == DRAG and is_instance_valid(currently_active_node):
|
|
||||||
if currently_active_node.is_dragged:
|
|
||||||
print_debug(" Ending active drag for: %s" % currently_active_node.name)
|
|
||||||
_end_drag(currently_active_node)
|
|
||||||
|
|
||||||
# Stop dragging for all items (safety net in case _end_drag didn't catch everything)
|
|
||||||
for child in dropzone.get_children():
|
|
||||||
if (child is Card or child is StickyNote) and child.is_dragged:
|
|
||||||
print_debug(" Force-stopping drag for: %s" % child.name)
|
|
||||||
child.is_dragged = false
|
|
||||||
|
|
||||||
# Also check cards for attached stickies that might be dragged
|
|
||||||
for child in dropzone.get_children():
|
|
||||||
if child is Card:
|
|
||||||
var attached_sticky = child.get_attached_sticky_note()
|
|
||||||
if attached_sticky and attached_sticky.is_dragged:
|
|
||||||
print_debug(" Force-stopping drag for attached sticky: %s" % attached_sticky.name)
|
|
||||||
attached_sticky.is_dragged = false
|
|
||||||
|
|
||||||
# Return stickies to panels if in ASSIGN mode
|
|
||||||
if current_context == ASSIGN:
|
|
||||||
print_debug(" Returning stickies to panels (was in ASSIGN mode)")
|
|
||||||
_return_sticky_notes_to_panels()
|
|
||||||
|
|
||||||
# Reset context to NAVIGATE
|
|
||||||
current_context = NAVIGATE
|
|
||||||
|
|
||||||
print_debug("CardBoard: Board state finalized")
|
|
||||||
|
|
||||||
|
|
||||||
## Called when board loses focus
|
## Called when board loses focus
|
||||||
func _on_board_unfocused() -> void:
|
func _on_board_unfocused() -> void:
|
||||||
visible = false
|
visible = false
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||||
if is_node_ready():
|
if is_node_ready():
|
||||||
# Finalize any drag operations before closing
|
|
||||||
_finalize_board_state()
|
|
||||||
|
|
||||||
process_mode = Node.PROCESS_MODE_DISABLED
|
process_mode = Node.PROCESS_MODE_DISABLED
|
||||||
|
# Stop any active dragging
|
||||||
|
for sticky in dropzone.get_children():
|
||||||
|
if sticky is StickyNote:
|
||||||
|
sticky.is_dragged = false
|
||||||
|
|
||||||
|
|
||||||
func reclaim_lost_focus(_thief):
|
func reclaim_lost_focus(_thief):
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ func play_story() -> void:
|
||||||
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
|
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
|
||||||
|
|
||||||
Scenes.player_enable.emit(true)
|
Scenes.player_enable.emit(true)
|
||||||
|
active = true
|
||||||
expand()
|
expand()
|
||||||
|
|
||||||
func play_board() -> void:
|
func play_board() -> void:
|
||||||
|
|
@ -137,7 +138,7 @@ func play_board() -> void:
|
||||||
# Hide the CanvasLayer when done
|
# Hide the CanvasLayer when done
|
||||||
canvas_layer.hide()
|
canvas_layer.hide()
|
||||||
|
|
||||||
Scenes.player_enable.emit(true)
|
active = true
|
||||||
expand()
|
expand()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue