Added bg_sound manager and according ESC command.
Started transitions scene.
This commit is contained in:
@@ -3,4 +3,5 @@
|
||||
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi.TTF" type="DynamicFontData" id=1]
|
||||
|
||||
[resource]
|
||||
size = 21
|
||||
font_data = ExtResource( 1 )
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _on_new_game_pressed():
|
||||
escoria.new_game()
|
||||
|
||||
func _on_load_game_pressed():
|
||||
# Show Loading screen
|
||||
pass
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
@@ -1,60 +0,0 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/main_menu.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
|
||||
|
||||
[node name="main_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -92.0
|
||||
margin_top = -73.5
|
||||
margin_right = 92.0
|
||||
margin_bottom = 73.5
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="new_game" type="Button" parent="VBoxContainer"]
|
||||
margin_right = 184.0
|
||||
margin_bottom = 83.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "New game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="load_game" type="Button" parent="VBoxContainer"]
|
||||
margin_top = 93.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 115.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Load game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="quit" type="Button" parent="VBoxContainer"]
|
||||
margin_top = 125.0
|
||||
margin_right = 184.0
|
||||
margin_bottom = 147.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Quit"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/new_game" to="." method="_on_new_game_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/load_game" to="." method="_on_load_game_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/quit" to="." method="_on_quit_pressed"]
|
||||
20
game/ui/commons/main_menu/main_menu.gd
Normal file
20
game/ui/commons/main_menu/main_menu.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _ready():
|
||||
escoria.esc_level_runner.set_sound_state(["bg_music",
|
||||
"res://game/sfx/Game-Menu_Looping.mp3", true])
|
||||
|
||||
func _on_new_game_pressed():
|
||||
escoria.new_game()
|
||||
|
||||
func _on_load_game_pressed():
|
||||
# Show Loading screen
|
||||
pass
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_continue_pressed():
|
||||
pass # Replace with function body.
|
||||
81
game/ui/commons/main_menu/main_menu.tscn
Normal file
81
game/ui/commons/main_menu/main_menu.tscn
Normal file
@@ -0,0 +1,81 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/main_menu/main_menu.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://addons/escoria-core/logo/escoria-logo-small.png" type="Texture" id=3]
|
||||
|
||||
[node name="main_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false,
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -308.0
|
||||
margin_top = 52.0
|
||||
margin_right = 308.0
|
||||
margin_bottom = 288.0
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -179.0
|
||||
margin_top = -35.746
|
||||
margin_right = 179.0
|
||||
margin_bottom = 227.254
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="new_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_right = 358.0
|
||||
margin_bottom = 189.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "New game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="load_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 199.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 226.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Load game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="quit" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 236.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 263.0
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Quit"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/new_game" to="." method="_on_new_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/load_game" to="." method="_on_load_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/quit" to="." method="_on_quit_pressed"]
|
||||
17
game/ui/commons/pause_menu/pause_menu.gd
Normal file
17
game/ui/commons/pause_menu/pause_menu.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Control
|
||||
|
||||
|
||||
func _on_continue_pressed():
|
||||
escoria.main.current_scene.game.pause_game()
|
||||
|
||||
|
||||
func _on_save_game_pressed():
|
||||
pass
|
||||
|
||||
|
||||
func _on_load_game_pressed():
|
||||
pass
|
||||
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
93
game/ui/commons/pause_menu/pause_menu.tscn
Normal file
93
game/ui/commons/pause_menu/pause_menu.tscn
Normal file
@@ -0,0 +1,93 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/commons/pause_menu/pause_menu.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
|
||||
[ext_resource path="res://addons/escoria-core/logo/escoria-logo-small.png" type="Texture" id=3]
|
||||
|
||||
[node name="pause_menu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
margin_left = -308.0
|
||||
margin_right = 308.0
|
||||
margin_bottom = 236.0
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -127.8
|
||||
margin_top = -80.62
|
||||
margin_right = 127.8
|
||||
margin_bottom = 80.62
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="continue" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_right = 255.0
|
||||
margin_bottom = 32.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Continue"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="save_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 42.0
|
||||
margin_right = 255.0
|
||||
margin_bottom = 75.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Save game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="load_game" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 85.0
|
||||
margin_right = 255.0
|
||||
margin_bottom = 118.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Load game"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="quit" type="Button" parent="Panel/VBoxContainer"]
|
||||
margin_top = 128.0
|
||||
margin_right = 255.0
|
||||
margin_bottom = 161.0
|
||||
size_flags_vertical = 3
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "Quit"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/continue" to="." method="_on_continue_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/save_game" to="." method="_on_save_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/load_game" to="." method="_on_load_game_pressed"]
|
||||
[connection signal="pressed" from="Panel/VBoxContainer/quit" to="." method="_on_quit_pressed"]
|
||||
@@ -31,6 +31,9 @@ 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
|
||||
|
||||
func _ready():
|
||||
ProjectSettings.set_setting("escoria/ui/tooltip_follows_mouse", false)
|
||||
|
||||
@@ -47,32 +50,32 @@ func _input(event):
|
||||
func left_click_on_bg(position : Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.esc_runner.clear_current_action()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
func right_click_on_bg(position : Vector2) -> void:
|
||||
escoria.do("walk", ["player", position])
|
||||
escoria.esc_runner.clear_current_action()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
func left_double_click_on_bg(position : Vector2) -> void:
|
||||
escoria.do("walk", ["player", position, true])
|
||||
escoria.esc_runner.clear_current_action()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
## ITEM FOCUS ##
|
||||
|
||||
func element_focused(element_id : String) -> void:
|
||||
var target_obj = escoria.esc_runner.get_object(element_id)
|
||||
$ui/tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.esc_runner.current_action != "use" && escoria.esc_runner.current_tool == null:
|
||||
if target_obj is ESCItem:
|
||||
$ui/verbs_layer/verbs_menu.set_by_name(target_obj.default_action)
|
||||
verbs_menu.set_by_name(target_obj.default_action)
|
||||
|
||||
func element_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.clear()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
tooltip.clear()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
## ITEMS ##
|
||||
|
||||
@@ -80,7 +83,7 @@ func left_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
escoria.do("item_left_click", [item_global_id, event])
|
||||
|
||||
func right_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
escoria.esc_runner.set_current_action($ui/verbs_layer/verbs_menu.selected_action)
|
||||
escoria.esc_runner.set_current_action(verbs_menu.selected_action)
|
||||
escoria.do("item_right_click", [item_global_id, event])
|
||||
|
||||
func left_double_click_on_item(item_global_id : String, event : InputEvent) -> void:
|
||||
@@ -93,54 +96,70 @@ func left_click_on_inventory_item(inventory_item_global_id : String, event : Inp
|
||||
# if escoria.esc_runner.current_action == "use":
|
||||
# var item = escoria.esc_runner.get_object(inventory_item_global_id)
|
||||
# if item.texture:
|
||||
# $ui/verbs_layer/verbs_menu.set_tool_texture(item.texture)
|
||||
# verbs_menu.set_tool_texture(item.texture)
|
||||
# elif item.inventory_item_scene_file.instance().texture_normal:
|
||||
# $ui/verbs_layer/verbs_menu.set_tool_texture(item.inventory_item_scene_file.instance().texture_normal)
|
||||
# verbs_menu.set_tool_texture(item.inventory_item_scene_file.instance().texture_normal)
|
||||
|
||||
|
||||
func right_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
|
||||
escoria.esc_runner.set_current_action($ui/verbs_layer/verbs_menu.selected_action)
|
||||
escoria.esc_runner.set_current_action(verbs_menu.selected_action)
|
||||
escoria.do("item_right_click", [inventory_item_global_id, event])
|
||||
|
||||
func left_double_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
|
||||
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.esc_runner.get_object(inventory_item_global_id)
|
||||
$ui/tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
|
||||
tooltip.set_target(target_obj.tooltip_name)
|
||||
|
||||
if escoria.esc_runner.current_action != "use" && escoria.esc_runner.current_tool == null:
|
||||
if target_obj is ESCItem:
|
||||
$ui/verbs_layer/verbs_menu.set_by_name(target_obj.default_action_inventory)
|
||||
verbs_menu.set_by_name(target_obj.default_action_inventory)
|
||||
|
||||
|
||||
func inventory_item_unfocused() -> void:
|
||||
$ui/tooltip_layer/tooltip.set_target("")
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
tooltip.set_target("")
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func open_inventory():
|
||||
$ui/inventory_layer/inventory_ui/inventory_button.show_inventory()
|
||||
pass
|
||||
|
||||
|
||||
func close_inventory():
|
||||
$ui/inventory_layer/inventory_ui/inventory_button.close_inventory()
|
||||
|
||||
func mousewheel_action(direction : int):
|
||||
pass
|
||||
|
||||
|
||||
func mousewheel_action(_direction : int):
|
||||
pass
|
||||
|
||||
|
||||
func hide_ui():
|
||||
$ui/panel_down.hide()
|
||||
$ui/verbs_layer/verbs_menu.hide()
|
||||
$ui/inventory_layer/inventory_ui.hide()
|
||||
$ui/tooltip_layer/tooltip.hide()
|
||||
verbs_menu.hide()
|
||||
$ui/panel_down/inventory_layer/inventory_ui.hide()
|
||||
tooltip.hide()
|
||||
|
||||
|
||||
func show_ui():
|
||||
$ui/panel_down.show()
|
||||
$ui/verbs_layer/verbs_menu.show()
|
||||
$ui/inventory_layer/inventory_ui.show()
|
||||
$ui/tooltip_layer/tooltip.show()
|
||||
verbs_menu.show()
|
||||
$ui/panel_down/inventory_layer/inventory_ui.show()
|
||||
tooltip.show()
|
||||
|
||||
func _on_event_done(event_name: String):
|
||||
func _on_event_done(_event_name: String):
|
||||
escoria.esc_runner.clear_current_action()
|
||||
$ui/verbs_layer/verbs_menu.unselect_actions()
|
||||
verbs_menu.unselect_actions()
|
||||
|
||||
|
||||
func pause_game():
|
||||
if $ui/pause_menu.visible:
|
||||
$ui/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.show()
|
||||
escoria.main.current_scene.game.get_node("camera").current = false
|
||||
escoria.main.current_scene.game.hide_ui()
|
||||
escoria.main.current_scene.hide()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=10 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://game/ui/ui_9verbs/tooltip/action_target_tooltip.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://game/ui/ui_9verbs/inventory/inventory_ui.tscn" type="PackedScene" id=2]
|
||||
@@ -8,6 +8,7 @@
|
||||
[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/camera.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://game/ui/commons/room_select.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://game/ui/ui_9verbs/tooltip/tooltip_action_target.gd" type="Script" id=8]
|
||||
[ext_resource path="res://game/ui/commons/pause_menu/pause_menu.tscn" type="PackedScene" id=9]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 0.6, 0.6, 0.6, 0.5 )
|
||||
@@ -27,34 +28,40 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="verbs_layer" type="CanvasLayer" parent="ui"]
|
||||
[node name="verbs_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
|
||||
[node name="verbs_menu" parent="ui/verbs_layer" instance=ExtResource( 3 )]
|
||||
margin_left = 21.097
|
||||
margin_top = 615.331
|
||||
margin_right = 21.097
|
||||
margin_bottom = 615.331
|
||||
[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/verbs_layer" instance=ExtResource( 7 )]
|
||||
margin_left = 394.817
|
||||
margin_top = 756.336
|
||||
margin_right = 423.817
|
||||
margin_bottom = 776.336
|
||||
[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"]
|
||||
[node name="inventory_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
|
||||
[node name="inventory_ui" parent="ui/inventory_layer" instance=ExtResource( 2 )]
|
||||
margin_left = 661.041
|
||||
margin_top = 615.331
|
||||
margin_right = 661.041
|
||||
margin_bottom = 615.331
|
||||
[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"]
|
||||
[node name="tooltip_layer" type="CanvasLayer" parent="ui/panel_down"]
|
||||
layer = 2
|
||||
|
||||
[node name="tooltip" parent="ui/tooltip_layer" instance=ExtResource( 1 )]
|
||||
[node name="tooltip" parent="ui/panel_down/tooltip_layer" instance=ExtResource( 1 )]
|
||||
anchor_left = 0.132
|
||||
anchor_top = 0.719
|
||||
anchor_right = 0.832
|
||||
@@ -81,4 +88,7 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="pause_menu" parent="ui" instance=ExtResource( 9 )]
|
||||
visible = false
|
||||
|
||||
[node name="camera" parent="." instance=ExtResource( 6 )]
|
||||
|
||||
@@ -4,27 +4,22 @@
|
||||
[ext_resource path="res://game/items/ESCORIA_ALL_ITEMS.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://game/ui/ui_9verbs/inventory/inventory_ui_container.gd" type="Script" id=3]
|
||||
|
||||
[node name="inventory_ui" type="Control"]
|
||||
[node name="inventory_ui" type="PanelContainer"]
|
||||
margin_right = 600.0
|
||||
margin_bottom = 175.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
items_container = NodePath("PanelContainer/ScrollContainer/GridContainer")
|
||||
inventory_ui_container = NodePath("ScrollContainer/GridContainer")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
margin_right = 600.0
|
||||
margin_bottom = 175.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer"]
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 593.0
|
||||
margin_bottom = 168.0
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="PanelContainer/ScrollContainer"]
|
||||
[node name="GridContainer" type="GridContainer" parent="ScrollContainer"]
|
||||
margin_right = 586.0
|
||||
size_flags_horizontal = 3
|
||||
custom_constants/vseparation = 16
|
||||
|
||||
@@ -9,23 +9,23 @@ UI event (eg right click) to change the cursor accordingly.
|
||||
var selected_action
|
||||
|
||||
func _ready():
|
||||
for but in $actions.get_children():
|
||||
for but in get_children():
|
||||
but.connect("pressed", self, "_on_action_selected", [but.name])
|
||||
but.toggle_mode = true
|
||||
|
||||
func _on_action_selected(action : String):
|
||||
escoria.esc_runner.set_current_action(action)
|
||||
|
||||
for but in $actions.get_children():
|
||||
for but in get_children():
|
||||
but.set_pressed(but.get_name() == action)
|
||||
|
||||
func unselect_actions():
|
||||
for but in $actions.get_children():
|
||||
for but in get_children():
|
||||
but.set_pressed(false)
|
||||
|
||||
func set_by_name(action_name : String):
|
||||
selected_action = action_name
|
||||
for but in $actions.get_children():
|
||||
for but in get_children():
|
||||
but.set_pressed(but.get_name() == action_name)
|
||||
|
||||
|
||||
|
||||
@@ -2,25 +2,20 @@
|
||||
|
||||
[ext_resource path="res://game/ui/ui_9verbs/verbs_menu.gd" type="Script" id=1]
|
||||
|
||||
[node name="verbs_menu" type="Control"]
|
||||
margin_left = 1.0
|
||||
margin_right = 1.0
|
||||
[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="actions" type="GridContainer" parent="."]
|
||||
margin_right = 333.0
|
||||
margin_bottom = 175.0
|
||||
columns = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="open" type="Button" parent="actions"]
|
||||
margin_right = 108.0
|
||||
margin_bottom = 55.0
|
||||
[node name="open" type="Button" parent="."]
|
||||
margin_right = 161.0
|
||||
margin_bottom = 85.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -29,10 +24,10 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="pickup" type="Button" parent="actions"]
|
||||
margin_left = 112.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 55.0
|
||||
[node name="pickup" 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
|
||||
@@ -41,10 +36,10 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="push" type="Button" parent="actions"]
|
||||
margin_left = 224.0
|
||||
margin_right = 332.0
|
||||
margin_bottom = 55.0
|
||||
[node name="push" type="Button" parent="."]
|
||||
margin_left = 330.0
|
||||
margin_right = 491.0
|
||||
margin_bottom = 85.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -53,10 +48,10 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="close" type="Button" parent="actions"]
|
||||
margin_top = 59.0
|
||||
margin_right = 108.0
|
||||
margin_bottom = 114.0
|
||||
[node name="close" type="Button" parent="."]
|
||||
margin_top = 89.0
|
||||
margin_right = 161.0
|
||||
margin_bottom = 174.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -65,11 +60,11 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="look" type="Button" parent="actions"]
|
||||
margin_left = 112.0
|
||||
margin_top = 59.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 114.0
|
||||
[node name="look" type="Button" parent="."]
|
||||
margin_left = 165.0
|
||||
margin_top = 89.0
|
||||
margin_right = 326.0
|
||||
margin_bottom = 174.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -78,11 +73,11 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="pull" type="Button" parent="actions"]
|
||||
margin_left = 224.0
|
||||
margin_top = 59.0
|
||||
margin_right = 332.0
|
||||
margin_bottom = 114.0
|
||||
[node name="pull" type="Button" parent="."]
|
||||
margin_left = 330.0
|
||||
margin_top = 89.0
|
||||
margin_right = 491.0
|
||||
margin_bottom = 174.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -91,10 +86,10 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="give" type="Button" parent="actions"]
|
||||
margin_top = 118.0
|
||||
margin_right = 108.0
|
||||
margin_bottom = 173.0
|
||||
[node name="give" type="Button" parent="."]
|
||||
margin_top = 178.0
|
||||
margin_right = 161.0
|
||||
margin_bottom = 263.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -103,11 +98,11 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="use" type="Button" parent="actions"]
|
||||
margin_left = 112.0
|
||||
margin_top = 118.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 173.0
|
||||
[node name="use" type="Button" parent="."]
|
||||
margin_left = 165.0
|
||||
margin_top = 178.0
|
||||
margin_right = 326.0
|
||||
margin_bottom = 263.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
@@ -116,11 +111,11 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="talk" type="Button" parent="actions"]
|
||||
margin_left = 224.0
|
||||
margin_top = 118.0
|
||||
margin_right = 332.0
|
||||
margin_bottom = 173.0
|
||||
[node name="talk" type="Button" parent="."]
|
||||
margin_left = 330.0
|
||||
margin_top = 178.0
|
||||
margin_right = 491.0
|
||||
margin_bottom = 263.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
toggle_mode = true
|
||||
|
||||
Reference in New Issue
Block a user