Issue 320 (#396) - Mobile fixes
Co-authored-by: Dennis Ploeger <develop@dieploegers.de> Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
@@ -59,6 +59,8 @@ func run(command_params: Array) -> int:
|
||||
escoria.main.current_scene.global_id,
|
||||
true
|
||||
)
|
||||
|
||||
escoria.event_manager.interrupt_running_event()
|
||||
|
||||
if !command_params[1]:
|
||||
escoria.main.scene_transition.transition_out()
|
||||
|
||||
@@ -6,6 +6,9 @@ class_name ESCActionManager
|
||||
# The current action was changed
|
||||
signal action_changed
|
||||
|
||||
# Emitted, when an action has been completed
|
||||
signal action_finished
|
||||
|
||||
|
||||
# Current verb used
|
||||
var current_action: String = "" setget set_current_action
|
||||
@@ -109,6 +112,7 @@ func activate(
|
||||
if event_returned[0] == ESCExecution.RC_OK:
|
||||
escoria.action_manager\
|
||||
.clear_current_action()
|
||||
emit_signal("action_finished")
|
||||
return event_returned[0]
|
||||
else:
|
||||
var errors = [
|
||||
@@ -120,14 +124,14 @@ func activate(
|
||||
]
|
||||
if combine_with.node.combine_is_one_way:
|
||||
errors.append(
|
||||
"Reason: %s's item interaction " +\
|
||||
"is one-way." % combine_with.global_id
|
||||
("Reason: %s's item interaction " +\
|
||||
"is one-way.") % combine_with.global_id
|
||||
)
|
||||
escoria.logger.report_warnings(
|
||||
"ESCActionManager.activate: Invalid action",
|
||||
errors
|
||||
)
|
||||
|
||||
emit_signal("action_finished")
|
||||
return ESCExecution.RC_ERROR
|
||||
else:
|
||||
escoria.logger.report_warnings(
|
||||
@@ -140,13 +144,15 @@ func activate(
|
||||
combine_with.global_id
|
||||
]
|
||||
]
|
||||
)
|
||||
)
|
||||
emit_signal("action_finished")
|
||||
return ESCExecution.RC_ERROR
|
||||
else:
|
||||
# We're missing a target here.
|
||||
# Tell the Label to add a conjunction and wait for another
|
||||
# click to add the target to p_param. Until then, return
|
||||
current_tool = target
|
||||
emit_signal("action_finished")
|
||||
return ESCExecution.RC_OK
|
||||
else:
|
||||
escoria.logger.report_warnings(
|
||||
@@ -175,6 +181,7 @@ func activate(
|
||||
)
|
||||
if event_returned[0] == ESCExecution.RC_OK:
|
||||
escoria.action_manager.clear_current_action()
|
||||
emit_signal("action_finished")
|
||||
return event_returned[0]
|
||||
else:
|
||||
escoria.logger.report_warnings(
|
||||
@@ -186,4 +193,5 @@ func activate(
|
||||
]
|
||||
]
|
||||
)
|
||||
emit_signal("action_finished")
|
||||
return ESCExecution.RC_ERROR
|
||||
|
||||
@@ -67,9 +67,6 @@ func _enter_tree():
|
||||
shape.set_extents(size / 2)
|
||||
area.shape_owner_add_shape(sid, shape)
|
||||
|
||||
# Handle inputs to the Area2D ourself
|
||||
area.connect("input_event", self, "manage_input")
|
||||
|
||||
add_child(area)
|
||||
|
||||
# Disable mouse filter events and connect our own events to the ESC input
|
||||
@@ -84,27 +81,30 @@ func _ready():
|
||||
# Manage inputs reaching the Area2D and emit the events to the input manager
|
||||
#
|
||||
# #### Parameters
|
||||
# - _viewport: (not used)
|
||||
# - event: Event received
|
||||
# - _shape_idx: (not used)
|
||||
func manage_input(_viewport, event, _shape_idx) -> void:
|
||||
func _input(event) -> void:
|
||||
if not escoria.current_state == escoria.GAME_STATE.DEFAULT:
|
||||
return
|
||||
if event.is_action_pressed("switch_action_verb"):
|
||||
if event.button_index == BUTTON_WHEEL_UP:
|
||||
emit_signal("mouse_wheel_up")
|
||||
elif event.button_index == BUTTON_WHEEL_DOWN:
|
||||
emit_signal("mouse_wheel_down")
|
||||
if event is InputEventMouseButton:
|
||||
if event is InputEventMouseButton and event.is_pressed():
|
||||
var p = get_global_mouse_position()
|
||||
if event.doubleclick:
|
||||
if event.button_index == BUTTON_LEFT:
|
||||
emit_signal("double_left_click_on_bg", p)
|
||||
var size
|
||||
if get_texture():
|
||||
size = get_texture().get_size()
|
||||
else:
|
||||
if event.is_pressed():
|
||||
if event.button_index == BUTTON_LEFT:
|
||||
emit_signal("left_click_on_bg", p)
|
||||
if event.button_index == BUTTON_RIGHT:
|
||||
emit_signal("right_click_on_bg", p)
|
||||
|
||||
size = rect_size
|
||||
if Rect2(rect_position, size).has_point(p):
|
||||
if event.doubleclick and event.button_index == BUTTON_LEFT:
|
||||
emit_signal("double_left_click_on_bg", p)
|
||||
elif event.button_index == BUTTON_LEFT:
|
||||
emit_signal("left_click_on_bg", p)
|
||||
elif event.button_index == BUTTON_RIGHT:
|
||||
emit_signal("right_click_on_bg", p)
|
||||
|
||||
|
||||
# Calculate the actual area taken by this background depending on its
|
||||
# Texture or set size
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# "click on background" -> player walks to position
|
||||
# "click on item" -> player walks to item then performs the action defined
|
||||
# by current verb
|
||||
|
||||
class_name ESCController
|
||||
|
||||
|
||||
|
||||
@@ -162,8 +162,6 @@ func _ready():
|
||||
connect("mouse_entered", self, "_on_mouse_entered")
|
||||
if not self.is_connected("mouse_exited", self, "_on_mouse_exited"):
|
||||
connect("mouse_exited", self, "_on_mouse_exited")
|
||||
if not self.is_connected("input_event", self, "manage_input"):
|
||||
connect("input_event", self, "manage_input")
|
||||
|
||||
# Register and connect all elements to Escoria backoffice.
|
||||
if not Engine.is_editor_hint():
|
||||
@@ -265,6 +263,39 @@ func _ready():
|
||||
_movable.last_scale = scale
|
||||
_movable.update_terrain()
|
||||
|
||||
# Manage mouse button clicks on this item by sending out signals
|
||||
#
|
||||
# #### Parameters
|
||||
#
|
||||
# - event: Triggered event
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not escoria.current_state == escoria.GAME_STATE.DEFAULT:
|
||||
return
|
||||
if event is InputEventMouseButton and event.is_pressed():
|
||||
var p = get_global_mouse_position()
|
||||
var mouse_in_shape: bool = false
|
||||
var colliders = get_world_2d().direct_space_state.intersect_point(
|
||||
p,
|
||||
32,
|
||||
[],
|
||||
2147483647,
|
||||
true,
|
||||
true
|
||||
)
|
||||
for _owner in get_shape_owners():
|
||||
for _shape_id in range(0, shape_owner_get_shape_count(_owner)):
|
||||
for _collider in colliders:
|
||||
if _collider.collider == self and\
|
||||
_collider.shape == _shape_id:
|
||||
mouse_in_shape = true
|
||||
if mouse_in_shape:
|
||||
if event.doubleclick and event.button_index == BUTTON_LEFT:
|
||||
emit_signal("mouse_double_left_clicked_item", self, event)
|
||||
elif event.button_index == BUTTON_LEFT:
|
||||
emit_signal("mouse_left_clicked_item", self, event)
|
||||
elif event.button_index == BUTTON_RIGHT:
|
||||
emit_signal("mouse_right_clicked_item", self, event)
|
||||
|
||||
|
||||
# Return the animation player node
|
||||
func get_animation_player() -> Node:
|
||||
@@ -291,9 +322,6 @@ func get_interact_position() -> Vector2:
|
||||
var interact_position = null
|
||||
for c in get_children():
|
||||
if c is Position2D:
|
||||
if c.get_owner() == self:
|
||||
interact_position = global_position
|
||||
continue
|
||||
interact_position = c.global_position
|
||||
|
||||
if interact_position == null and collision != null:
|
||||
@@ -302,31 +330,6 @@ func get_interact_position() -> Vector2:
|
||||
return interact_position
|
||||
|
||||
|
||||
# Manage mouse button clicks on this item by sending out signals
|
||||
#
|
||||
# #### Parameters
|
||||
#
|
||||
# - _viewport: not used
|
||||
# - event: Triggered event
|
||||
# - _shape_idx: not used
|
||||
func manage_input(
|
||||
_viewport: Viewport,
|
||||
event: InputEvent,
|
||||
_shape_idx: int
|
||||
) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
|
||||
if event.doubleclick:
|
||||
if event.button_index == BUTTON_LEFT:
|
||||
emit_signal("mouse_double_left_clicked_item", self, event)
|
||||
else:
|
||||
if event.is_pressed():
|
||||
if event.button_index == BUTTON_LEFT:
|
||||
emit_signal("mouse_left_clicked_item", self, event)
|
||||
elif event.button_index == BUTTON_RIGHT:
|
||||
emit_signal("mouse_right_clicked_item", self, event)
|
||||
|
||||
|
||||
# React to the mouse entering the item by emitting the respective signal
|
||||
func _on_mouse_entered():
|
||||
emit_signal("mouse_entered_item", self)
|
||||
|
||||
@@ -21,7 +21,7 @@ var input_mode = INPUT_ALL
|
||||
# A LIFO stack of hovered items
|
||||
var hover_stack: Array = []
|
||||
|
||||
# The global id fo the topmost item from the hover_stack
|
||||
# The global id of the topmost item from the hover_stack
|
||||
var hotspot_focused: String = ""
|
||||
|
||||
|
||||
@@ -261,6 +261,7 @@ func _on_mouse_left_clicked_item(item: ESCItem, event: InputEvent) -> void:
|
||||
if input_mode == INPUT_ALL:
|
||||
if hover_stack.empty() or hover_stack.back() == item:
|
||||
escoria.logger.info("Item left clicked", [item.global_id, event])
|
||||
hotspot_focused = item.global_id
|
||||
escoria.main.current_scene.game.left_click_on_item(
|
||||
item.global_id,
|
||||
event
|
||||
@@ -279,6 +280,7 @@ func _on_mouse_left_double_clicked_item(
|
||||
) -> void:
|
||||
if input_mode == INPUT_ALL:
|
||||
escoria.logger.info("Item left double clicked", [item.global_id, event])
|
||||
hotspot_focused = item.global_id
|
||||
escoria.main.current_scene.game.left_double_click_on_item(
|
||||
item.global_id,
|
||||
event
|
||||
@@ -294,6 +296,7 @@ func _on_mouse_left_double_clicked_item(
|
||||
func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void:
|
||||
if input_mode == INPUT_ALL:
|
||||
escoria.logger.info("Item right clicked", [item.global_id, event])
|
||||
hotspot_focused = item.global_id
|
||||
escoria.main.current_scene.game.right_click_on_item(
|
||||
item.global_id,
|
||||
event
|
||||
|
||||
@@ -68,11 +68,11 @@ func _get_voice_file(key: String, start: String = "") -> String:
|
||||
if _voice_file != "":
|
||||
return _voice_file
|
||||
else:
|
||||
if file_name == "%s.%s" % [
|
||||
if file_name == "%s.%s.import" % [
|
||||
key,
|
||||
ProjectSettings.get("escoria/sound/speech_extension")
|
||||
]:
|
||||
return start.plus_file(file_name)
|
||||
return start.plus_file(file_name.trim_suffix(".import"))
|
||||
file_name = _dir.get_next()
|
||||
return ""
|
||||
|
||||
|
||||
@@ -103,7 +103,6 @@ func _on_dialog_line_typed(object, key):
|
||||
|
||||
# Ending the dialog
|
||||
func _on_dialog_finished():
|
||||
escoria.current_state = escoria.GAME_STATE.DEFAULT
|
||||
emit_signal("dialog_line_finished")
|
||||
queue_free()
|
||||
|
||||
|
||||
@@ -91,5 +91,4 @@ func _on_dialog_finished():
|
||||
current_character.stop_talking()
|
||||
emit_signal("dialog_line_finished")
|
||||
escoria.dialog_player.is_speaking = false
|
||||
escoria.current_state = escoria.GAME_STATE.DEFAULT
|
||||
queue_free()
|
||||
|
||||
@@ -30,18 +30,22 @@ Implement methods to react to inputs.
|
||||
- _on_event_done(event_name: String)
|
||||
"""
|
||||
|
||||
onready var verbs_menu = $ui/panel_down/verbs_layer/verbs_menu
|
||||
onready var tooltip = $ui/panel_down/tooltip_layer/tooltip
|
||||
onready var verbs_menu = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
|
||||
/VerbsMargin/verbs_menu
|
||||
onready var tooltip = $ui/Control/panel_down/VBoxContainer/tooltip
|
||||
onready var room_select = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
|
||||
/MainMargin/VBoxContainer/room_select
|
||||
onready var pause_menu = $ui/pause_menu
|
||||
onready var inventory_ui = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
|
||||
/InventoryMargin/inventory_ui
|
||||
|
||||
func _ready():
|
||||
ProjectSettings.set_setting("escoria/ui/tooltip_follows_mouse", false)
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("switch_action_verb"):
|
||||
if event.button_index == BUTTON_WHEEL_UP:
|
||||
escoria.inputs_manager._on_mousewheel_action(-1)
|
||||
elif event.button_index == BUTTON_WHEEL_DOWN:
|
||||
escoria.inputs_manager._on_mousewheel_action(1)
|
||||
escoria.action_manager.connect(
|
||||
"action_finished",
|
||||
self,
|
||||
"_on_action_finished"
|
||||
)
|
||||
|
||||
|
||||
## BACKGROUND ##
|
||||
@@ -90,7 +94,6 @@ func element_focused(element_id: String) -> void:
|
||||
|
||||
func element_unfocused() -> void:
|
||||
tooltip.clear()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
## ITEMS ##
|
||||
@@ -151,18 +154,18 @@ func mousewheel_action(_direction: int):
|
||||
|
||||
|
||||
func hide_ui():
|
||||
$ui/panel_down.hide()
|
||||
$ui/Control.hide()
|
||||
verbs_menu.hide()
|
||||
$ui/panel_down/verbs_layer/room_select.hide()
|
||||
$ui/panel_down/inventory_layer/inventory_ui.hide()
|
||||
room_select.hide()
|
||||
inventory_ui.hide()
|
||||
tooltip.hide()
|
||||
|
||||
|
||||
func show_ui():
|
||||
$ui/panel_down.show()
|
||||
$ui/Control.show()
|
||||
verbs_menu.show()
|
||||
$ui/panel_down/verbs_layer/room_select.show()
|
||||
$ui/panel_down/inventory_layer/inventory_ui.show()
|
||||
room_select.show()
|
||||
inventory_ui.show()
|
||||
tooltip.show()
|
||||
|
||||
func _on_event_done(_event_name: String):
|
||||
@@ -171,16 +174,24 @@ func _on_event_done(_event_name: String):
|
||||
|
||||
|
||||
func pause_game():
|
||||
if $ui/pause_menu.visible:
|
||||
$ui/pause_menu.hide()
|
||||
if pause_menu.visible:
|
||||
pause_menu.hide()
|
||||
escoria.main.current_scene.game.get_node("camera").current = true
|
||||
escoria.main.current_scene.game.show_ui()
|
||||
escoria.main.current_scene.show()
|
||||
escoria.set_game_paused(false)
|
||||
else:
|
||||
$ui/pause_menu.set_save_enabled(escoria.save_manager.save_enabled)
|
||||
$ui/pause_menu.show()
|
||||
pause_menu.set_save_enabled(escoria.save_manager.save_enabled)
|
||||
pause_menu.show()
|
||||
escoria.main.current_scene.game.get_node("camera").current = false
|
||||
escoria.main.current_scene.game.hide_ui()
|
||||
escoria.main.current_scene.hide()
|
||||
escoria.set_game_paused(true)
|
||||
|
||||
|
||||
func _on_MenuButton_pressed() -> void:
|
||||
pause_game()
|
||||
|
||||
|
||||
func _on_action_finished() -> void:
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
@@ -18,62 +18,120 @@ script = ExtResource( 5 )
|
||||
|
||||
[node name="ui" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="panel_down" type="PanelContainer" parent="ui"]
|
||||
anchor_top = 0.714
|
||||
[node name="Control" type="Control" parent="ui"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = -0.200012
|
||||
mouse_filter = 2
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="panel_down" type="PanelContainer" parent="ui/Control"]
|
||||
anchor_top = 0.7
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_vertical = 3
|
||||
custom_styles/panel = SubResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="verbs_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 270.0
|
||||
|
||||
[node name="verbs_menu" parent="ui/panel_down/verbs_layer" instance=ExtResource( 3 )]
|
||||
anchor_top = 0.715
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 52.0
|
||||
margin_top = 38.5
|
||||
margin_right = -959.0
|
||||
margin_bottom = -63.0
|
||||
|
||||
[node name="room_select" parent="ui/panel_down/verbs_layer" instance=ExtResource( 7 )]
|
||||
margin_left = 503.504
|
||||
margin_top = 820.091
|
||||
margin_right = 686.504
|
||||
margin_bottom = 840.091
|
||||
|
||||
[node name="inventory_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
|
||||
[node name="inventory_ui" parent="ui/panel_down/inventory_layer" instance=ExtResource( 2 )]
|
||||
anchor_top = 0.722
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 752.0
|
||||
margin_top = 31.2
|
||||
margin_right = -63.0
|
||||
margin_bottom = -61.0
|
||||
|
||||
[node name="tooltip_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
|
||||
[node name="tooltip" parent="ui/panel_down/tooltip_layer" instance=ExtResource( 1 )]
|
||||
anchor_left = 0.132
|
||||
anchor_top = 0.719
|
||||
anchor_right = 0.832
|
||||
anchor_bottom = 0.767
|
||||
margin_left = 0.0272522
|
||||
margin_top = 0.320557
|
||||
margin_right = -0.252686
|
||||
margin_bottom = -0.0794678
|
||||
[node name="tooltip" parent="ui/Control/panel_down/VBoxContainer" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 0.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 0, 32 )
|
||||
script = ExtResource( 8 )
|
||||
color = Color( 1, 1, 1, 1 )
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="ui/Control/panel_down/VBoxContainer"]
|
||||
margin_top = 36.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 46.0
|
||||
custom_constants/separation = 10
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ui/Control/panel_down/VBoxContainer"]
|
||||
margin_top = 50.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 270.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VerbsMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 424.0
|
||||
margin_bottom = 220.0
|
||||
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
|
||||
|
||||
[node name="verbs_menu" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/VerbsMargin" instance=ExtResource( 3 )]
|
||||
margin_left = 20.0
|
||||
margin_top = 20.0
|
||||
margin_right = 404.0
|
||||
margin_bottom = 200.0
|
||||
|
||||
[node name="MainMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 428.0
|
||||
margin_right = 852.0
|
||||
margin_bottom = 220.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/margin_right = 20
|
||||
custom_constants/margin_top = 20
|
||||
custom_constants/margin_left = 20
|
||||
custom_constants/margin_bottom = 20
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin"]
|
||||
margin_left = 20.0
|
||||
margin_top = 20.0
|
||||
margin_right = 404.0
|
||||
margin_bottom = 200.0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer"]
|
||||
margin_left = 142.0
|
||||
margin_top = 58.0
|
||||
margin_right = 242.0
|
||||
margin_bottom = 98.0
|
||||
rect_min_size = Vector2( 100, 40 )
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
|
||||
[node name="MenuButton" type="Button" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer"]
|
||||
margin_right = 100.0
|
||||
margin_bottom = 40.0
|
||||
text = "Menu"
|
||||
|
||||
[node name="room_select" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer" instance=ExtResource( 7 )]
|
||||
margin_top = 160.0
|
||||
margin_right = 384.0
|
||||
margin_bottom = 180.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="InventoryMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 856.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 220.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/margin_right = 20
|
||||
custom_constants/margin_top = 20
|
||||
custom_constants/margin_left = 20
|
||||
custom_constants/margin_bottom = 20
|
||||
|
||||
[node name="inventory_ui" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/InventoryMargin" instance=ExtResource( 2 )]
|
||||
margin_left = 20.0
|
||||
margin_top = 20.0
|
||||
margin_right = 404.0
|
||||
margin_bottom = 200.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 3
|
||||
|
||||
@@ -92,3 +150,5 @@ __meta__ = {
|
||||
visible = false
|
||||
|
||||
[node name="camera" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
[connection signal="pressed" from="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
|
||||
|
||||
@@ -32,6 +32,11 @@ Implement methods to react to inputs.
|
||||
|
||||
func _ready():
|
||||
ProjectSettings.set_setting("escoria/ui/tooltip_follows_mouse", true)
|
||||
escoria.action_manager.connect(
|
||||
"action_finished",
|
||||
self,
|
||||
"_on_action_finished"
|
||||
)
|
||||
|
||||
|
||||
## BACKGROUND ##
|
||||
@@ -42,17 +47,11 @@ func left_click_on_bg(position: Vector2) -> void:
|
||||
[escoria.main.current_scene.player.global_id, position],
|
||||
true
|
||||
)
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.set_by_name("walk")
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.clear_tool_texture()
|
||||
|
||||
func right_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do(
|
||||
"walk",
|
||||
[escoria.main.current_scene.player.global_id, position],
|
||||
true
|
||||
)
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
mousewheel_action(1)
|
||||
|
||||
func left_double_click_on_bg(position: Vector2) -> void:
|
||||
escoria.do(
|
||||
@@ -60,22 +59,24 @@ func left_double_click_on_bg(position: Vector2) -> void:
|
||||
[escoria.main.current_scene.player.global_id, position, true],
|
||||
true
|
||||
)
|
||||
$ui/verbs_layer/verbs_menu.set_by_name("walk")
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.set_by_name("walk")
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.clear_tool_texture()
|
||||
|
||||
## ITEM/HOTSPOT FOCUS ##
|
||||
|
||||
func element_focused(element_id: String) -> void:
|
||||
var target_obj = escoria.object_manager.get_object(element_id).node
|
||||
$ui/tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.action_manager.current_action != "use" \
|
||||
and escoria.action_manager.current_tool == null:
|
||||
if target_obj is ESCItem:
|
||||
$ui/verbs_layer/verbs_menu.set_by_name(target_obj.default_action)
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.set_by_name(
|
||||
target_obj.default_action
|
||||
)
|
||||
|
||||
func element_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target("")
|
||||
$tooltip_layer/tooltip.set_target("")
|
||||
|
||||
|
||||
## ITEMS ##
|
||||
@@ -84,7 +85,7 @@ func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.do("item_left_click", [item_global_id, event], true)
|
||||
|
||||
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.do("item_right_click", [item_global_id, event], true)
|
||||
mousewheel_action(1)
|
||||
|
||||
func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.do("item_left_click", [item_global_id, event], true)
|
||||
@@ -98,17 +99,17 @@ func left_click_on_inventory_item(inventory_item_global_id: String, event: Input
|
||||
inventory_item_global_id
|
||||
).node
|
||||
if item.has_method("get_sprite") and item.get_sprite().texture:
|
||||
$ui/verbs_layer/verbs_menu.set_tool_texture(
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.set_tool_texture(
|
||||
item.get_sprite().texture
|
||||
)
|
||||
elif item.inventory_item.texture_normal:
|
||||
$ui/verbs_layer/verbs_menu.set_tool_texture(
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.set_tool_texture(
|
||||
item.inventory_item.texture_normal
|
||||
)
|
||||
|
||||
|
||||
func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.do("item_right_click", [inventory_item_global_id, event], true)
|
||||
mousewheel_action(1)
|
||||
|
||||
|
||||
func left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
||||
@@ -116,7 +117,7 @@ func left_double_click_on_inventory_item(inventory_item_global_id: String, event
|
||||
|
||||
|
||||
func inventory_item_focused(inventory_item_global_id: String) -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target(
|
||||
$tooltip_layer/tooltip.set_target(
|
||||
escoria.object_manager.get_object(
|
||||
inventory_item_global_id
|
||||
).node.tooltip_name
|
||||
@@ -124,43 +125,53 @@ func inventory_item_focused(inventory_item_global_id: String) -> void:
|
||||
|
||||
|
||||
func inventory_item_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target("")
|
||||
$tooltip_layer/tooltip.set_target("")
|
||||
|
||||
|
||||
func open_inventory():
|
||||
$ui/inventory_layer/inventory_ui/inventory_button.show_inventory()
|
||||
$CanvasLayer/ui/HBoxContainer/inventory_ui.show_inventory()
|
||||
|
||||
|
||||
func close_inventory():
|
||||
$ui/inventory_layer/inventory_ui/inventory_button.close_inventory()
|
||||
$CanvasLayer/ui/HBoxContainer/inventory_ui.hide_inventory()
|
||||
|
||||
|
||||
func mousewheel_action(direction: int):
|
||||
$ui/verbs_layer/verbs_menu.iterate_actions_cursor(direction)
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.iterate_actions_cursor(direction)
|
||||
|
||||
|
||||
func hide_ui():
|
||||
$ui/inventory_layer/inventory_ui.hide()
|
||||
$CanvasLayer/ui/HBoxContainer/inventory_ui.hide()
|
||||
|
||||
|
||||
func show_ui():
|
||||
$ui/inventory_layer/inventory_ui.show()
|
||||
$CanvasLayer/ui/HBoxContainer/inventory_ui.show()
|
||||
|
||||
|
||||
func _on_event_done(event_name: String):
|
||||
escoria.action_manager.clear_current_action()
|
||||
$ui/verbs_layer/verbs_menu.clear_tool_texture()
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.clear_tool_texture()
|
||||
|
||||
|
||||
func pause_game():
|
||||
if $ui/pause_menu.visible:
|
||||
$ui/pause_menu.hide()
|
||||
if $CanvasLayer/pause_menu.visible:
|
||||
$CanvasLayer/pause_menu.hide()
|
||||
escoria.main.current_scene.game.get_node("camera").current = true
|
||||
escoria.main.current_scene.game.show_ui()
|
||||
escoria.main.current_scene.show()
|
||||
else:
|
||||
$ui/pause_menu.set_save_enabled(escoria.save_manager.save_enabled)
|
||||
$ui/pause_menu.show()
|
||||
$CanvasLayer/pause_menu.set_save_enabled(
|
||||
escoria.save_manager.save_enabled
|
||||
)
|
||||
$CanvasLayer/pause_menu.show()
|
||||
escoria.main.current_scene.game.get_node("camera").current = false
|
||||
escoria.main.current_scene.game.hide_ui()
|
||||
escoria.main.current_scene.hide()
|
||||
|
||||
|
||||
func _on_action_finished():
|
||||
$CanvasLayer/ui/HBoxContainer/verbs_menu.clear_tool_texture()
|
||||
|
||||
|
||||
func _on_MenuButton_pressed() -> void:
|
||||
pause_game()
|
||||
|
||||
@@ -13,46 +13,80 @@
|
||||
script = ExtResource( 5 )
|
||||
editor_debug_mode = 1
|
||||
|
||||
[node name="ui" type="CanvasLayer" parent="."]
|
||||
[node name="camera" parent="." instance=ExtResource( 3 )]
|
||||
|
||||
[node name="inventory_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 2
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="inventory_ui" parent="ui/inventory_layer" instance=ExtResource( 1 )]
|
||||
margin_left = 1173.73
|
||||
margin_top = 695.268
|
||||
margin_right = 394.205
|
||||
margin_bottom = 587.268
|
||||
[node name="ui" type="Control" parent="CanvasLayer"]
|
||||
anchor_top = 0.9
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="verbs_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 2
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/ui"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="verbs_menu" parent="ui/verbs_layer" instance=ExtResource( 4 )]
|
||||
margin_left = 2234.6
|
||||
margin_top = -583.507
|
||||
margin_right = 2234.6
|
||||
margin_bottom = -583.507
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/ui/HBoxContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 90.0
|
||||
|
||||
[node name="tooltip_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 2
|
||||
[node name="MenuButton" type="Button" parent="CanvasLayer/ui/HBoxContainer/VBoxContainer"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 20.0
|
||||
text = "Menu"
|
||||
|
||||
[node name="tooltip" parent="ui/tooltip_layer" instance=ExtResource( 6 )]
|
||||
mouse_filter = 2
|
||||
bbcode_text = "[center][color=#000000][/color][/center]"
|
||||
offset_from_cursor = Vector2( 75, 10 )
|
||||
[node name="room_select" parent="CanvasLayer/ui/HBoxContainer/VBoxContainer" instance=ExtResource( 7 )]
|
||||
margin_top = 47.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 67.0
|
||||
rect_min_size = Vector2( 200, 0 )
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 6
|
||||
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="ui"]
|
||||
layer = 3
|
||||
[node name="verbs_menu" parent="CanvasLayer/ui/HBoxContainer" instance=ExtResource( 4 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 204.0
|
||||
margin_right = 204.0
|
||||
margin_bottom = 90.0
|
||||
grow_horizontal = 0
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
|
||||
[node name="dialog_player" parent="ui/dialog_layer" instance=ExtResource( 2 )]
|
||||
[node name="inventory_ui" parent="CanvasLayer/ui/HBoxContainer" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 1190.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 90.0
|
||||
rect_scale = Vector2( 1, 1 )
|
||||
|
||||
[node name="room_select" parent="ui" instance=ExtResource( 7 )]
|
||||
margin_left = 75.5099
|
||||
margin_top = 751.323
|
||||
margin_right = 138.51
|
||||
margin_bottom = 791.324
|
||||
|
||||
[node name="pause_menu" parent="ui" instance=ExtResource( 8 )]
|
||||
[node name="pause_menu" parent="CanvasLayer" instance=ExtResource( 8 )]
|
||||
visible = false
|
||||
|
||||
[node name="camera" parent="." instance=ExtResource( 3 )]
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="."]
|
||||
layer = 3
|
||||
|
||||
[node name="dialog_player" parent="dialog_layer" instance=ExtResource( 2 )]
|
||||
|
||||
[node name="tooltip_layer" type="CanvasLayer" parent="."]
|
||||
layer = 2
|
||||
|
||||
[node name="tooltip" parent="tooltip_layer" instance=ExtResource( 6 )]
|
||||
mouse_filter = 2
|
||||
bbcode_text = "[center][color=#000000][/color][/center]"
|
||||
fit_content_height = true
|
||||
offset_from_cursor = Vector2( 75, 10 )
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/ui/HBoxContainer/VBoxContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
extends Control
|
||||
|
||||
var showed: bool = false
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func _on_inventory_button_pressed():
|
||||
if !$AnimationPlayer.is_playing() and !showed:
|
||||
show_inventory()
|
||||
elif !$AnimationPlayer.is_playing() and showed:
|
||||
close_inventory()
|
||||
|
||||
|
||||
func show_inventory():
|
||||
$AnimationPlayer.play("show")
|
||||
yield($AnimationPlayer, "animation_finished")
|
||||
showed = true
|
||||
|
||||
|
||||
func close_inventory():
|
||||
$AnimationPlayer.play("hide")
|
||||
yield($AnimationPlayer, "animation_finished")
|
||||
showed = false
|
||||
55
addons/escoria-ui-simplemouse/inventory/inventory_ui.gd
Normal file
55
addons/escoria-ui-simplemouse/inventory/inventory_ui.gd
Normal file
@@ -0,0 +1,55 @@
|
||||
extends ESCInventory
|
||||
|
||||
|
||||
# Wether the inventory is visible currently
|
||||
var inventory_visible: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Hide inventory by default
|
||||
$FloatingInventory/panel.rect_position.x = \
|
||||
ProjectSettings.get_setting("display/window/size/width")
|
||||
|
||||
func _on_inventory_button_pressed():
|
||||
if $FloatingInventory/InventoryTween.is_active():
|
||||
return
|
||||
if inventory_visible:
|
||||
hide_inventory()
|
||||
else:
|
||||
show_inventory()
|
||||
|
||||
|
||||
func show_inventory():
|
||||
$FloatingInventory/InventoryTween.stop_all()
|
||||
$FloatingInventory/InventoryTween.remove_all()
|
||||
$FloatingInventory/InventoryTween.interpolate_property(
|
||||
$FloatingInventory/panel,
|
||||
"rect_position:x",
|
||||
$FloatingInventory/panel.rect_position.x,
|
||||
$FloatingInventory/panel.rect_position.x - \
|
||||
$FloatingInventory/panel.rect_size.x - \
|
||||
$HBoxContainer/inventory_button.rect_size.x,
|
||||
0.6
|
||||
)
|
||||
$FloatingInventory/InventoryTween.start()
|
||||
yield($FloatingInventory/InventoryTween,"tween_all_completed")
|
||||
$FloatingInventory/InventoryTween.stop_all()
|
||||
inventory_visible = true
|
||||
|
||||
|
||||
func hide_inventory():
|
||||
$FloatingInventory/InventoryTween.stop_all()
|
||||
$FloatingInventory/InventoryTween.remove_all()
|
||||
$FloatingInventory/InventoryTween.interpolate_property(
|
||||
$FloatingInventory/panel,
|
||||
"rect_position:x",
|
||||
$FloatingInventory/panel.rect_position.x,
|
||||
$FloatingInventory/panel.rect_position.x + \
|
||||
$FloatingInventory/panel.rect_size.x + \
|
||||
$HBoxContainer/inventory_button.rect_size.x,
|
||||
0.6
|
||||
)
|
||||
$FloatingInventory/InventoryTween.start()
|
||||
yield($FloatingInventory/InventoryTween,"tween_all_completed")
|
||||
$FloatingInventory/InventoryTween.stop_all()
|
||||
inventory_visible = false
|
||||
@@ -1,143 +1,79 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/scenes/inventory/inventory_ui.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/inventory/inventory_ui.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/images/inventory_bg.png" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/inventory/inventory_ui_container.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/inventory/inventory_showhide.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/images/frame.png" type="Texture" id=5]
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/images/inventory_icon.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "hide"
|
||||
length = 0.3
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:rect_position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("../inventory_button:rect_position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("../inventory_button/panel:rect_position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.3 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( -1682.88, -52 ), Vector2( 268, -52 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "show"
|
||||
length = 0.3
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:rect_position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("../inventory_button:rect_position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 0, 0 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("../inventory_button/panel:rect_position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.3 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 268, -52 ), Vector2( -1682.88, -52 ) ]
|
||||
}
|
||||
|
||||
[node name="inventory_ui" type="Control"]
|
||||
anchor_right = 0.609
|
||||
anchor_bottom = 0.135
|
||||
margin_right = -779.52
|
||||
margin_bottom = -108.0
|
||||
anchor_right = 0.4
|
||||
anchor_bottom = 0.4
|
||||
margin_right = 768.0
|
||||
margin_bottom = 540.0
|
||||
rect_min_size = Vector2( 90, 90 )
|
||||
rect_scale = Vector2( 0.4, 0.4 )
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
"_edit_use_anchors_": true
|
||||
}
|
||||
inventory_ui_container = NodePath("inventory_button/panel/MarginContainer/ScrollContainer/container")
|
||||
inventory_ui_container = NodePath("FloatingInventory/panel/MarginContainer/ScrollContainer/container")
|
||||
|
||||
[node name="inventory_button" type="TextureButton" parent="."]
|
||||
margin_right = 256.0
|
||||
margin_bottom = 322.0
|
||||
texture_normal = ExtResource( 6 )
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="frame" type="TextureRect" parent="inventory_button"]
|
||||
margin_right = 2643.0
|
||||
margin_bottom = 2630.0
|
||||
rect_scale = Vector2( 0.1, 0.1 )
|
||||
texture = ExtResource( 5 )
|
||||
stretch_mode = 1
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="panel" type="TextureRect" parent="inventory_button"]
|
||||
margin_left = 268.0
|
||||
margin_top = -52.0
|
||||
margin_right = 1957.0
|
||||
margin_bottom = 270.0
|
||||
grow_horizontal = 0
|
||||
rect_min_size = Vector2( 1689, 322 )
|
||||
texture = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="inventory_button/panel"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 57.0
|
||||
margin_top = 37.0
|
||||
margin_right = -68.0
|
||||
margin_bottom = -71.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="inventory_button" type="TextureButton" parent="HBoxContainer"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 900.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture_normal = ExtResource( 6 )
|
||||
expand = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="frame" type="TextureRect" parent="HBoxContainer/inventory_button"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource( 5 )
|
||||
expand = true
|
||||
stretch_mode = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FloatingInventory" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="panel" type="TextureRect" parent="FloatingInventory"]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -516.0
|
||||
margin_top = -160.0
|
||||
rect_min_size = Vector2( 0, 160 )
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource( 2 )
|
||||
expand = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="FloatingInventory/panel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/margin_right = 20
|
||||
custom_constants/margin_top = 20
|
||||
custom_constants/margin_left = 20
|
||||
@@ -146,23 +82,22 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="inventory_button/panel/MarginContainer"]
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="FloatingInventory/panel/MarginContainer"]
|
||||
margin_left = 20.0
|
||||
margin_top = 20.0
|
||||
margin_right = 1544.0
|
||||
margin_bottom = 194.0
|
||||
margin_top = 80.0
|
||||
margin_right = 496.0
|
||||
margin_bottom = 80.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 6
|
||||
scroll_vertical_enabled = false
|
||||
|
||||
[node name="container" type="HBoxContainer" parent="inventory_button/panel/MarginContainer/ScrollContainer"]
|
||||
margin_right = 1524.0
|
||||
margin_bottom = 174.0
|
||||
[node name="container" type="HBoxContainer" parent="FloatingInventory/panel/MarginContainer/ScrollContainer"]
|
||||
margin_right = 476.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 20
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="inventory_button"]
|
||||
anims/hide = SubResource( 1 )
|
||||
anims/show = SubResource( 2 )
|
||||
[node name="InventoryTween" type="Tween" parent="FloatingInventory"]
|
||||
|
||||
[connection signal="pressed" from="inventory_button" to="inventory_button" method="_on_inventory_button_pressed"]
|
||||
[connection signal="pressed" from="HBoxContainer/inventory_button" to="." method="_on_inventory_button_pressed"]
|
||||
|
||||
@@ -8,48 +8,66 @@
|
||||
[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_hand.png" type="Texture" id=6]
|
||||
|
||||
[node name="verbs_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="actions" type="GridContainer" parent="."]
|
||||
[node name="actions" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
margin_right = 333.0
|
||||
margin_bottom = 175.0
|
||||
columns = 3
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="walk" type="TextureRect" parent="actions"]
|
||||
margin_right = 64.0
|
||||
margin_bottom = 64.0
|
||||
margin_left = 94.0
|
||||
margin_top = 418.0
|
||||
margin_right = 158.0
|
||||
margin_bottom = 482.0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="look" type="TextureRect" parent="actions"]
|
||||
margin_left = 68.0
|
||||
margin_right = 132.0
|
||||
margin_bottom = 64.0
|
||||
margin_left = 350.0
|
||||
margin_top = 418.0
|
||||
margin_right = 414.0
|
||||
margin_bottom = 482.0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="pickup" type="TextureRect" parent="actions"]
|
||||
margin_left = 136.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 64.0
|
||||
margin_left = 607.0
|
||||
margin_top = 418.0
|
||||
margin_right = 671.0
|
||||
margin_bottom = 482.0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="use" type="TextureRect" parent="actions"]
|
||||
margin_top = 68.0
|
||||
margin_right = 64.0
|
||||
margin_bottom = 132.0
|
||||
margin_left = 864.0
|
||||
margin_top = 418.0
|
||||
margin_right = 928.0
|
||||
margin_bottom = 482.0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="talk" type="TextureRect" parent="actions"]
|
||||
margin_left = 68.0
|
||||
margin_top = 68.0
|
||||
margin_right = 132.0
|
||||
margin_bottom = 132.0
|
||||
margin_left = 1121.0
|
||||
margin_top = 418.0
|
||||
margin_right = 1185.0
|
||||
margin_bottom = 482.0
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
texture = ExtResource( 4 )
|
||||
|
||||
[node name="mouse_position" type="Control" parent="."]
|
||||
|
||||
Reference in New Issue
Block a user