Deleted escoria-ui-2verbs. escoria-ui-return-monkey-island is the new UI.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
[gd_resource type="DynamicFont" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/fonts/caslonantique.ttf" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 21
|
||||
font_data = ExtResource( 1 )
|
||||
Binary file not shown.
@@ -1,381 +0,0 @@
|
||||
extends ESCGame
|
||||
|
||||
|
||||
const VERB_USE = "use"
|
||||
|
||||
|
||||
"""
|
||||
Implement methods to react to inputs.
|
||||
|
||||
- left_click_on_bg(position: Vector2)
|
||||
- right_click_on_bg(position: Vector2)
|
||||
- left_double_click_on_bg(position: Vector2)
|
||||
|
||||
- element_focused(element_id: String)
|
||||
- element_unfocused()
|
||||
|
||||
- left_click_on_item(item_global_id: String, event: InputEvent)
|
||||
- right_click_on_item(item_global_id: String, event: InputEvent)
|
||||
- left_double_click_on_item(item_global_id: String, event: InputEvent)
|
||||
|
||||
- left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
|
||||
- right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
|
||||
- left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
|
||||
- inventory_item_focused(inventory_item_global_id: String)
|
||||
- inventory_item_unfocused()
|
||||
- open_inventory()
|
||||
- close_inventory()
|
||||
|
||||
- mousewheel_action(direction: int)
|
||||
|
||||
- hide_ui()
|
||||
- show_ui()
|
||||
|
||||
- pause_game()
|
||||
- unpause_game()
|
||||
- show_main_menu()
|
||||
- hide_main_menu()
|
||||
|
||||
- apply_custom_settings()
|
||||
|
||||
- _on_event_done(event_name: String)
|
||||
"""
|
||||
|
||||
onready var verbs_menu = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
|
||||
/VerbsMargin/verbs_menu
|
||||
onready var tooltip = $ui/Control/panel_down/VBoxContainer/MarginContainer\
|
||||
/tooltip
|
||||
onready var inventory_ui = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
|
||||
/InventoryMargin/inventory_ui
|
||||
var room_select
|
||||
|
||||
func _enter_tree():
|
||||
var room_selector_parent = $ui/Control/panel_down/VBoxContainer\
|
||||
/HBoxContainer/MainMargin/VBoxContainer
|
||||
|
||||
if ProjectSettings.get_setting("escoria/debug/enable_room_selector") and \
|
||||
room_selector_parent.get_node_or_null("room_select") == null:
|
||||
room_select = preload(
|
||||
"res://addons/escoria-core/ui_library/tools/room_select" +\
|
||||
"/room_select.tscn"
|
||||
).instance()
|
||||
room_selector_parent.add_child(room_select)
|
||||
|
||||
|
||||
## BACKGROUND ##
|
||||
|
||||
func left_click_on_bg(position: Vector2) -> void:
|
||||
if escoria.main.current_scene.player:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.BACKGROUND_CLICK,
|
||||
[escoria.main.current_scene.player.global_id, position],
|
||||
true
|
||||
)
|
||||
escoria.action_manager.clear_current_action()
|
||||
escoria.action_manager.clear_current_tool()
|
||||
tooltip.clear()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func right_click_on_bg(position: Vector2) -> void:
|
||||
if escoria.main.current_scene.player:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.BACKGROUND_CLICK,
|
||||
[escoria.main.current_scene.player.global_id, position],
|
||||
true
|
||||
)
|
||||
escoria.action_manager.clear_current_action()
|
||||
escoria.action_manager.clear_current_tool()
|
||||
tooltip.clear()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func left_double_click_on_bg(position: Vector2) -> void:
|
||||
if escoria.main.current_scene.player:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.BACKGROUND_CLICK,
|
||||
[escoria.main.current_scene.player.global_id, position, true],
|
||||
true
|
||||
)
|
||||
escoria.action_manager.clear_current_action()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
## ITEM FOCUS ##
|
||||
|
||||
func element_focused(element_id: String) -> void:
|
||||
var target_obj = escoria.object_manager.get_object(element_id).node
|
||||
|
||||
match escoria.action_manager.action_state:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
# and the tooltip is already set because the item was focused
|
||||
# (see element_focused() and inventory_item_focused())
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
return
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
# Hovering an ESCItem highlights its default action
|
||||
if escoria.action_manager.current_action != VERB_USE \
|
||||
and target_obj is ESCItem:
|
||||
verbs_menu.set_by_name(target_obj.default_action)
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
verbs_menu.set_by_name(escoria.action_manager.current_action)
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target2(target_obj.tooltip_name)
|
||||
|
||||
|
||||
func element_unfocused() -> void:
|
||||
match escoria.action_manager.action_state:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
# and the tooltip is already set because the item was focused
|
||||
# (see element_focused() and inventory_item_focused())
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
return
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
tooltip.set_target("")
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target2("")
|
||||
|
||||
|
||||
|
||||
## ITEMS ##
|
||||
func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
|
||||
[item_global_id, event],
|
||||
true
|
||||
)
|
||||
|
||||
var target_obj = escoria.object_manager.get_object(
|
||||
item_global_id
|
||||
).node
|
||||
|
||||
match escoria.action_manager.action_state:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
# and the tooltip is already set because the item was focused
|
||||
# (see element_focused() and inventory_item_focused())
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
return
|
||||
|
||||
# Just clicked on the item
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
# Clicked on item and now we're awaiting a target item
|
||||
# This means we clicked the tool and we now need a target
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name, true)
|
||||
|
||||
|
||||
|
||||
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
element_focused(item_global_id)
|
||||
var object = escoria.object_manager.get_object(item_global_id)
|
||||
if object != null:
|
||||
verbs_menu.set_by_name(object.node.default_action)
|
||||
|
||||
if verbs_menu.selected_action == null:
|
||||
return
|
||||
|
||||
escoria.action_manager.set_current_action(verbs_menu.selected_action)
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
|
||||
[item_global_id, event],
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
|
||||
[item_global_id, event],
|
||||
true
|
||||
)
|
||||
|
||||
|
||||
## INVENTORY ##
|
||||
func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
|
||||
[inventory_item_global_id, event]
|
||||
)
|
||||
|
||||
var target_obj = escoria.object_manager.get_object(
|
||||
inventory_item_global_id
|
||||
).node
|
||||
|
||||
match escoria.action_manager.action_state:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
# and the tooltip is already set because the item was focused
|
||||
# (see element_focused() and inventory_item_focused())
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
return
|
||||
|
||||
# Just clicked on the inventory item: do nothing special
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
return
|
||||
|
||||
# Clicked on inventory item and now we're awaiting a target item
|
||||
# This means we clicked the tool and we now need a target
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name, true)
|
||||
|
||||
|
||||
func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
||||
escoria.action_manager.set_current_action(verbs_menu.selected_action)
|
||||
escoria.action_manager.do(
|
||||
escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
|
||||
[inventory_item_global_id, event]
|
||||
)
|
||||
|
||||
|
||||
func left_double_click_on_inventory_item(_inventory_item_global_id: String, _event: InputEvent) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func inventory_item_focused(inventory_item_global_id: String) -> void:
|
||||
var target_obj = escoria.object_manager.get_object(
|
||||
inventory_item_global_id
|
||||
).node
|
||||
|
||||
match escoria.action_manager.action_state:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
# and the tooltip is already set because the item was focused
|
||||
# (see element_focused() and inventory_item_focused())
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
return
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
# Hovering an ESCItem highlights its default action
|
||||
if escoria.action_manager.current_action != VERB_USE and target_obj is ESCItem:
|
||||
verbs_menu.set_by_name(target_obj.default_action)
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target2(target_obj.tooltip_name)
|
||||
|
||||
|
||||
func inventory_item_unfocused() -> void:
|
||||
|
||||
match escoria.action_manager.action_state:
|
||||
ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
# Don't change the tooltip if an action input is completed
|
||||
# (ie verb+item(+target)) because the action is now being executed
|
||||
return
|
||||
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
|
||||
tooltip.set_target("")
|
||||
verbs_menu.unselect_actions()
|
||||
ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
|
||||
tooltip.set_target2("")
|
||||
|
||||
|
||||
func open_inventory():
|
||||
pass
|
||||
|
||||
|
||||
func close_inventory():
|
||||
pass
|
||||
|
||||
|
||||
func mousewheel_action(_direction: int):
|
||||
pass
|
||||
|
||||
|
||||
func hide_ui():
|
||||
$ui/Control.hide()
|
||||
verbs_menu.hide()
|
||||
if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR):
|
||||
room_select.hide()
|
||||
inventory_ui.hide()
|
||||
tooltip.hide()
|
||||
|
||||
|
||||
func show_ui():
|
||||
$ui/Control.show()
|
||||
verbs_menu.show()
|
||||
if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR):
|
||||
room_select.show()
|
||||
inventory_ui.show()
|
||||
tooltip.show()
|
||||
|
||||
func hide_main_menu():
|
||||
if get_node(main_menu).visible:
|
||||
get_node(main_menu).hide()
|
||||
show_ui()
|
||||
|
||||
func show_main_menu():
|
||||
if not get_node(main_menu).visible:
|
||||
hide_ui()
|
||||
get_node(main_menu).reset()
|
||||
get_node(main_menu).show()
|
||||
|
||||
func unpause_game():
|
||||
if get_node(pause_menu).visible:
|
||||
get_node(pause_menu).hide()
|
||||
escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = true
|
||||
escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.resume()
|
||||
escoria.main.current_scene.game.show_ui()
|
||||
escoria.main.current_scene.show()
|
||||
escoria.set_game_paused(false)
|
||||
|
||||
func pause_game():
|
||||
if not get_node(pause_menu).visible and not get_node(main_menu).visible:
|
||||
get_node(pause_menu).reset()
|
||||
get_node(pause_menu).set_save_enabled(escoria.save_manager.save_enabled)
|
||||
get_node(pause_menu).show()
|
||||
escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = false
|
||||
escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.pause()
|
||||
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()
|
||||
|
||||
|
||||
func _on_event_done(_return_code: int, _event_name: String):
|
||||
if _return_code == ESCExecution.RC_OK:
|
||||
escoria.action_manager.clear_current_action()
|
||||
verbs_menu.unselect_actions()
|
||||
tooltip.clear()
|
||||
|
||||
|
||||
func apply_custom_settings(custom_settings: Dictionary):
|
||||
if custom_settings.has("a_custom_setting"):
|
||||
escoria.logger.info(
|
||||
self,
|
||||
"custom setting value loaded: %s."
|
||||
% str(custom_settings["a_custom_setting"])
|
||||
)
|
||||
|
||||
|
||||
func get_custom_data() -> Dictionary:
|
||||
return {
|
||||
"ui_type": "9verbs"
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/tooltip/action_target_tooltip.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/inventory/inventory_ui.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/verbs_menu.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" type="Script" id=4]
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/game.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/theme.tres" type="Theme" id=10]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0.6, 0.6, 0.6, 0.5 )
|
||||
|
||||
[node name="game" type="Node2D"]
|
||||
script = ExtResource( 5 )
|
||||
main_menu = NodePath("ui/main_menu")
|
||||
pause_menu = NodePath("ui/pause_menu")
|
||||
ui_parent_control_node = NodePath("ui/Control")
|
||||
|
||||
[node name="dialog_layer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="ESCDialogsPlayer" type="Control" parent="dialog_layer"]
|
||||
theme = ExtResource( 10 )
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ui" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" type="Control" parent="ui"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
theme = ExtResource( 10 )
|
||||
__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="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 270.0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 32.0
|
||||
custom_constants/margin_top = 10
|
||||
|
||||
[node name="tooltip" parent="ui/Control/panel_down/VBoxContainer/MarginContainer" instance=ExtResource( 1 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_top = 10.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 32.0
|
||||
bbcode_text = "[center]Test[/center]"
|
||||
text = "Test"
|
||||
fit_content_height = true
|
||||
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 = 70.0
|
||||
margin_right = 242.0
|
||||
margin_bottom = 110.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="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="main_menu" parent="ui" instance=ExtResource( 7 )]
|
||||
visible = false
|
||||
|
||||
[node name="pause_menu" parent="ui" instance=ExtResource( 9 )]
|
||||
visible = false
|
||||
theme = ExtResource( 10 )
|
||||
|
||||
[connection signal="pressed" from="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
|
||||
@@ -1,31 +0,0 @@
|
||||
[gd_scene load_steps=3 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-core/ui_library/inventory/esc_inventory_container.gd" type="Script" id=3]
|
||||
|
||||
[node name="inventory_ui" type="PanelContainer"]
|
||||
margin_right = 600.0
|
||||
margin_bottom = 175.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
inventory_ui_container = NodePath("ScrollContainer/GridContainer")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 593.0
|
||||
margin_bottom = 168.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="ScrollContainer"]
|
||||
margin_right = 586.0
|
||||
margin_bottom = 161.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
custom_constants/vseparation = 16
|
||||
custom_constants/hseparation = 16
|
||||
columns = 4
|
||||
script = ExtResource( 3 )
|
||||
@@ -1,7 +0,0 @@
|
||||
[plugin]
|
||||
|
||||
name="Escoria 2 Verbs UI"
|
||||
description="Classical LucasArts style 2-verbs UI for the Escoria Framework"
|
||||
author="StraToN"
|
||||
version="1.0.0"
|
||||
script="plugin.gd"
|
||||
@@ -1,24 +0,0 @@
|
||||
# Plugin script to initialize Escoria simple mouse UI
|
||||
tool
|
||||
extends EditorPlugin
|
||||
|
||||
|
||||
# Override function to return the plugin name.
|
||||
func get_plugin_name():
|
||||
return "escoria-ui-2verb"
|
||||
|
||||
|
||||
# Deregister UI
|
||||
func disable_plugin():
|
||||
print("Disabling plugin Escoria UI 9-verbs.")
|
||||
EscoriaPlugin.deregister_ui("res://gymkhana/addons/escoria-ui-2verbs/game.tscn")
|
||||
|
||||
|
||||
# Register UI with Escoria
|
||||
func enable_plugin():
|
||||
print("Enabling plugin Escoria UI 9-verbs.")
|
||||
if not EscoriaPlugin.register_ui(self, "res://gymkhana/addons/escoria-ui-2verbs/game.tscn"):
|
||||
get_editor_interface().set_plugin_enabled(
|
||||
get_plugin_name(),
|
||||
false
|
||||
)
|
||||
@@ -1,6 +0,0 @@
|
||||
[gd_resource type="Theme" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/fonts/caslonantique.tres" type="DynamicFont" id=1]
|
||||
|
||||
[resource]
|
||||
default_font = ExtResource( 1 )
|
||||
@@ -1,14 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/tooltip/tooltip_action_target.gd" type="Script" id=1]
|
||||
|
||||
[node name="tooltip" type="RichTextLabel"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "[center][/center]"
|
||||
scroll_active = false
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
extends ESCTooltip
|
||||
|
||||
export var prepositions = {"use": "with", "give": "to"}
|
||||
|
||||
func update_tooltip_text():
|
||||
bbcode_text = "[center]"
|
||||
bbcode_text += "[color=#" + color.to_html(false) + "]"
|
||||
if !current_action.empty():
|
||||
bbcode_text += current_action + "\t"
|
||||
bbcode_text += current_target
|
||||
|
||||
if waiting_for_target2 and current_target2.empty():
|
||||
current_prep = prepositions.get(current_action, current_prep)
|
||||
bbcode_text += "\t" + current_prep
|
||||
|
||||
if !current_target2.empty():
|
||||
bbcode_text += "\t" + current_prep + "\t" + current_target2
|
||||
|
||||
bbcode_text += "[/color]"
|
||||
bbcode_text += "[/center]"
|
||||
|
||||
# push_align(RichTextLabel.ALIGN_CENTER)
|
||||
# if !current_action.empty():
|
||||
# add_text(current_action + "\t")
|
||||
#
|
||||
# add_text(current_target)
|
||||
#
|
||||
# if waiting_for_target2 and current_target2.empty():
|
||||
# add_text("\t" + current_prep)
|
||||
#
|
||||
# if !current_target2.empty():
|
||||
# add_text("\t" + current_prep + "\t" + current_target2)
|
||||
#
|
||||
# pop()
|
||||
@@ -1,32 +0,0 @@
|
||||
extends Control
|
||||
|
||||
"""
|
||||
This script is out of Escoria's scope. It controls the UI reaction to an
|
||||
UI event (eg right click) to change the cursor accordingly.
|
||||
"""
|
||||
|
||||
var selected_action
|
||||
|
||||
func _ready():
|
||||
for but in get_children():
|
||||
but.connect("pressed", self, "_on_action_selected", [but.name])
|
||||
but.toggle_mode = true
|
||||
|
||||
func _on_action_selected(action: String):
|
||||
if escoria.inputs_manager.input_mode != escoria.inputs_manager.INPUT_ALL:
|
||||
unselect_actions()
|
||||
return
|
||||
|
||||
escoria.action_manager.set_current_action(action)
|
||||
|
||||
for but in get_children():
|
||||
but.set_pressed(but.get_name() == action)
|
||||
|
||||
func unselect_actions():
|
||||
for but in get_children():
|
||||
but.set_pressed(false)
|
||||
|
||||
func set_by_name(action_name: String):
|
||||
selected_action = action_name
|
||||
for but in get_children():
|
||||
but.set_pressed(but.get_name() == action_name)
|
||||
@@ -1,37 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://gymkhana/addons/escoria-ui-2verbs/verbs_menu.gd" type="Script" id=1]
|
||||
|
||||
[node name="actions" type="GridContainer"]
|
||||
margin_right = 493.0
|
||||
margin_bottom = 263.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
columns = 3
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="action1" type="Button" parent="."]
|
||||
margin_right = 161.0
|
||||
margin_bottom = 85.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
text = "Left click"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="action2" type="Button" parent="."]
|
||||
margin_left = 165.0
|
||||
margin_right = 326.0
|
||||
margin_bottom = 85.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
text = "Right click"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
@@ -212,6 +212,11 @@ func left_double_click_on_bg(position: Vector2) -> void:
|
||||
## ITEM/HOTSPOT FOCUS ##
|
||||
|
||||
func element_focused(element_id: String) -> void:
|
||||
escoria.logger.info(
|
||||
self,
|
||||
"monkey"
|
||||
)
|
||||
|
||||
var target_obj = escoria.object_manager.get_object(element_id).node
|
||||
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
|
||||
@@ -854,7 +854,7 @@ search_in_file_extensions=PoolStringArray( "gd", "shader", "esc" )
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://gymkhana/addons/escoria-ui-return-monkey-island/plugin.cfg", "res://gymkhana/addons/escoria-ui-2verbs/plugin.cfg", "res://addons/escoria-wizard/plugin.cfg" )
|
||||
enabled=PoolStringArray( "res://addons/escoria-core/plugin.cfg", "res://addons/escoria-dialog-simple/plugin.cfg", "res://gymkhana/addons/escoria-ui-return-monkey-island/plugin.cfg", "res://addons/escoria-wizard/plugin.cfg" )
|
||||
|
||||
[escoria]
|
||||
|
||||
@@ -877,7 +877,7 @@ debug/crash_message="We're sorry, but the game crashed. Please send us the follo
|
||||
%s"
|
||||
debug/enable_room_selector=true
|
||||
debug/room_selector_room_dir="res://game/rooms"
|
||||
ui/game_scene="res://gymkhana/addons/escoria-ui-2verbs/game.tscn"
|
||||
ui/game_scene="res://gymkhana/addons/escoria-ui-return-monkey-island/game.tscn"
|
||||
ui/inventory_items_path="res://game/items/inventory"
|
||||
ui/default_transition="instant"
|
||||
ui/transition_paths=[ "res://addons/escoria-core/game/scenes/transitions/shaders/" ]
|
||||
|
||||
Reference in New Issue
Block a user