Skip to content

Commit

Permalink
fix: Issue 336 - unclickable area with simplemouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Balloonpopper authored and StraToN committed Feb 13, 2023
1 parent 39165e4 commit cbb7984
Show file tree
Hide file tree
Showing 26 changed files with 72 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ func _on_inventory_item_gui_input(event: InputEvent):
global_id,
event
)
# Make sure fast right clicks in the inventory aren't ignored
elif event.button_index == BUTTON_RIGHT:
emit_signal(
"mouse_right_inventory_item",
global_id,
event
)
else:
if event.is_pressed():
if event.button_index == BUTTON_LEFT:
Expand Down
7 changes: 4 additions & 3 deletions addons/escoria-ui-simplemouse/game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ __meta__ = {
anchor_top = 0.9
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 9 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/ui"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
Expand All @@ -54,6 +53,7 @@ __meta__ = {
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/ui/HBoxContainer"]
margin_right = 58.0
margin_bottom = 90.0
mouse_filter = 2

[node name="MenuButton" type="Button" parent="CanvasLayer/ui/HBoxContainer/VBoxContainer"]
margin_right = 58.0
Expand All @@ -64,6 +64,7 @@ text = "Menu"
margin_left = 62.0
margin_right = 1186.0
margin_bottom = 90.0
mouse_filter = 2
size_flags_horizontal = 3

[node name="inventory_ui" parent="CanvasLayer/ui/HBoxContainer" instance=ExtResource( 1 )]
Expand Down
7 changes: 4 additions & 3 deletions addons/escoria-ui-simplemouse/inventory/inventory_ui.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ anchor_bottom = 1.0
margin_left = -516.0
margin_top = -160.0
rect_min_size = Vector2( 0, 160 )
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 2 )
Expand All @@ -72,27 +73,27 @@ __meta__ = {
[node name="MarginContainer" type="MarginContainer" parent="FloatingInventory/panel"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
__meta__ = {
"_edit_use_anchors_": false
}

[node name="ScrollContainer" type="ScrollContainer" parent="FloatingInventory/panel/MarginContainer"]
margin_left = 20.0
margin_top = 80.0
margin_right = 496.0
margin_bottom = 80.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 6
scroll_vertical_enabled = false

[node name="container" type="HBoxContainer" parent="FloatingInventory/panel/MarginContainer/ScrollContainer"]
margin_right = 476.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 20
Expand Down
Binary file modified game/rooms/room01/room1background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room02/room2background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room03/room3background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room04/assets/forrest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room05/room5background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions game/rooms/room06/esc/worker.esc
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,26 @@ set_active worker false
set_gui_visible true
accept_input ALL

# use has to be supported as simplemouse has no "give" icon
:use r5_filled_sheet
set_gui_visible false
accept_input SKIP

inventory_remove r5_filled_sheet
say worker "I've unlocked the door, in you go!"
walk worker r6_r_exit

# Open the door
set_global r6_r_exit_locked false
# Hide the closed door graphic
set_state r6_r_exit open_door
# Make the open exit visible
set_active r6_r_exit true

# Disappear!
say worker "I will see you again... MUAHAHAHAHA!"
wait 1
set_active worker false

set_gui_visible true
accept_input ALL
Binary file modified game/rooms/room06/room6background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room08/room8background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room09/room9background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified game/rooms/room10/room10background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions game/rooms/room11/room11.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]

[node name="background" parent="." instance=ExtResource( 2 )]
margin_right = 1280.0
margin_bottom = 900.0

[node name="room_label" type="Label" parent="background"]
margin_right = 92.0
Expand Down Expand Up @@ -58,6 +60,7 @@ esc_script = "res://game/rooms/room11/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand All @@ -71,6 +74,7 @@ script = ExtResource( 5 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
global_id = "r11_r_exit"
esc_script = "res://game/rooms/room11/esc/right_exit.esc"
combine_when_selected_action_is_in = [ ]

[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1236.02, 366.281 )
Expand All @@ -84,6 +88,7 @@ global_id = "r11_circle_tk"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_tk.esc"
tooltip_name = "Mysterious circle"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -117,6 +122,7 @@ global_id = "r11_circle_nott"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nott.esc"
tooltip_name = "Mysterious circle"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -150,6 +156,7 @@ global_id = "r11_circle_nohud"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nohud.esc"
tooltip_name = "Mysterious circle"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -183,6 +190,7 @@ global_id = "r11_circle_nosave"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nosave.esc"
tooltip_name = "Mysterious circle"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -216,6 +224,7 @@ global_id = "r11_circle_fadein"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_fadein.esc"
tooltip_name = "Mysterious circle"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down
7 changes: 7 additions & 0 deletions game/rooms/room12/room12.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ esc_script = "res://game/rooms/room12/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -81,6 +82,7 @@ global_id = "r12_transition_default"
esc_script = "res://game/rooms/room12/esc/transition_default.esc"
tooltip_name = "transition_default"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -108,6 +110,7 @@ global_id = "r12_transition_black"
esc_script = "res://game/rooms/room12/esc/transition_black.esc"
tooltip_name = "transition_black"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -135,6 +138,7 @@ global_id = "r12_transition_white"
esc_script = "res://game/rooms/room12/esc/transition_white.esc"
tooltip_name = "transition_white"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -162,6 +166,7 @@ global_id = "r12_transition_shards"
esc_script = "res://game/rooms/room12/esc/transition_shards.esc"
tooltip_name = "transition_shards"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -189,6 +194,7 @@ global_id = "r12_transition_centre"
esc_script = "res://game/rooms/room12/esc/transition_centre.esc"
tooltip_name = "transition_centre"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -216,6 +222,7 @@ global_id = "r12_transition_blackout"
esc_script = "res://game/rooms/room12/esc/transition_blackout.esc"
tooltip_name = "transition_blackout"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down
Binary file modified game/rooms/room12/room12background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions game/rooms/room13/background.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]

[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
Expand Down
4 changes: 2 additions & 2 deletions game/rooms/room14/background.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]

[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
Expand Down
Binary file modified game/rooms/room15/room15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions game/rooms/room15/room15.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ esc_script = "res://game/rooms/room15/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand All @@ -143,6 +144,7 @@ esc_script = "res://game/rooms/room15/esc/right_exit.esc"
is_exit = true
tooltip_name = "Right exit"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down Expand Up @@ -171,6 +173,7 @@ global_id = "say_long_left"
esc_script = "res://game/rooms/room15/esc/say_long.esc"
tooltip_name = "Say long test left"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand All @@ -188,6 +191,7 @@ global_id = "say_long_right"
esc_script = "res://game/rooms/room15/esc/say_long.esc"
tooltip_name = "Say long test right"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand All @@ -205,6 +209,7 @@ global_id = "switch_animation"
esc_script = "res://game/rooms/room15/esc/switch_animation.esc"
tooltip_name = "Switch animation"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand Down
4 changes: 2 additions & 2 deletions game/rooms/room16/background.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]

[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
Expand Down
2 changes: 0 additions & 2 deletions game/rooms/room16/room16.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ align = 1
position = Vector2( 789, 362 )
global_id = "worker1"
esc_script = "res://game/rooms/room16/esc/worker_script.esc"
combine_when_selected_action_is_in = [ ]

[node name="worker2" parent="." instance=ExtResource( 10 )]
position = Vector2( 988, 364 )
global_id = "worker2"
esc_script = ""
combine_when_selected_action_is_in = [ ]

[node name="ESCLocation" type="Position2D" parent="."]
position = Vector2( 45, 513 )
Expand Down
7 changes: 2 additions & 5 deletions game/rooms/room17/background.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]

[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="l_platform" type="Line2D" parent="."]
position = Vector2( 2, -266 )
Expand Down
2 changes: 2 additions & 0 deletions game/rooms/room17/room17.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ esc_script = "res://game/rooms/room17/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

Expand All @@ -68,6 +69,7 @@ global_id = "r12_l_exit"
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
global_id = ""
esc_script = ""
combine_when_selected_action_is_in = [ ]

[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1231.78, 360.624 )
Expand Down
2 changes: 2 additions & 0 deletions game/rooms/room18/room18.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ script = ExtResource( 1 )
global_id = "room18"

[node name="ESCBackground" type="TextureRect" parent="."]
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 2 )

Expand Down
2 changes: 2 additions & 0 deletions game/rooms/room19/room19.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ script = ExtResource( 1 )
global_id = "room19"

[node name="ESCBackground" type="TextureRect" parent="."]
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
script = ExtResource( 2 )

Expand Down

0 comments on commit cbb7984

Please sign in to comment.