abandon not possible everywhere + drag fixes + text fixes

This commit is contained in:
Altaezio
2026-07-30 11:57:03 +02:00
parent 04ff9de78a
commit 0409a8bc8b
10 changed files with 35 additions and 12 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ func set_pause(p):
Input.mouse_mode = mouse_mode_before_pause
if p:
%GiveUp.visible = GameInfo.game_data and GameInfo.game_data.current_region_data and SceneManager.actual_scene and SceneManager.actual_scene.get_scene_id() != "TITLE"
%GiveUp.visible = (GameInfo.game_data and GameInfo.game_data.current_region_data and
SceneManager.actual_scene and SceneManager.actual_scene.can_abandon())
%TitleScreen.visible = not (SceneManager.actual_scene and SceneManager.actual_scene.get_scene_id() == "TITLE")
+10 -3
View File
@@ -11,6 +11,7 @@ const CARD_VISUALISATION_TIME = 0.3
const CARD_UP_PADDING = 50
const PRESS_TIME_DRAG := 0.15
const MAX_DIST_INSPECT := ItemObject.ITEM_AREA_WIDTH
@export var default_cursor: Texture2D
@export var action_cursor: Texture2D
@@ -29,6 +30,7 @@ var can_use_item: bool = false
var press_time := 0.
var press_action_done := false
var dragging_inspected := false
var no_inspect_previously_dragged := false
var action_disabled := false
@@ -277,8 +279,10 @@ func update_cursor():
Input.set_custom_mouse_cursor(cursor, Input.CURSOR_ARROW, hotspot)
func stop_inspect(node: Node):
if not dragging_inspected:
if not dragging_inspected or node != inspected:
all_inspected.erase(node)
else:
no_inspect_previously_dragged = true
if node is InventoryGuiItemMouseDetector:
inspected_inventory_slot = null
@@ -305,6 +309,7 @@ func start_dragging():
all_inspected.clear()
all_inspected.append(inspected)
can_interact = false
no_inspect_previously_dragged = false
func stop_dragging():
if dragging_inspected:
@@ -348,6 +353,8 @@ func stop_dragging():
inspect(inspected_inventory_slot)
AudioManager.play_sfx("PickUp")
else: # over the ground -> just leave the dragged item where it is
all_inspected.clear()
inspect(inspected)
if no_inspect_previously_dragged and not started_dragging_from_slot:
all_inspected.clear()
pass
started_dragging_from_slot = null
no_inspect_previously_dragged = false