fix(game.gd): if using an item cancel action on click on bg, fixes #116
This commit is contained in:
@@ -270,7 +270,8 @@ func perform_inputevent_on_object(
|
||||
# player walking towards the destination.
|
||||
if current_action and not event_to_queue:
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
# clear_current_action()
|
||||
if action_state != ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
clear_current_action()
|
||||
action_finished.emit()
|
||||
return
|
||||
|
||||
|
||||
@@ -245,6 +245,7 @@ func click_on_bg(position: Vector2) -> void:
|
||||
# If we are using an inventory item reset mouse cursor and cancel action
|
||||
if escoria.action_manager.action_state == ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
gymkhana.cursor_manager.clear_cursor()
|
||||
escoria.action_manager.clear_current_tool()
|
||||
|
||||
|
||||
if escoria.main.current_scene.player:
|
||||
|
||||
@@ -5,4 +5,3 @@ func set_cursor(texture: Texture) -> void:
|
||||
|
||||
func clear_cursor():
|
||||
Input.set_custom_mouse_cursor(null)
|
||||
# escoria.action_manager.clear_current_tool()
|
||||
|
||||
@@ -12,16 +12,15 @@ process_mode = 1
|
||||
script = ExtResource("1")
|
||||
global_id = "turno_cocina_frontal"
|
||||
esc_script = "res://gymkhana/items/inventory/turno_cocina_frontal.esc"
|
||||
combine_when_selected_action_is_in = PackedStringArray("action4")
|
||||
inventory_texture = ExtResource("2")
|
||||
dialog_color = Color(1, 1, 1, 1)
|
||||
inventory_texture_hovered = ExtResource("2")
|
||||
custom_data = {
|
||||
"tooltips": {
|
||||
"action3": "tooltip_frontal_action3",
|
||||
"action4": "tooltip_frontal_action4"
|
||||
}
|
||||
}
|
||||
combine_when_selected_action_is_in = ["action4"]
|
||||
animations = null
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(-2, 0)
|
||||
|
||||
Reference in New Issue
Block a user