feat: In Game Controls Menu
This commit is contained in:
parent
3d8da994b6
commit
733491908d
@ -37,10 +37,12 @@ func set_wallet(value) -> void:
|
|||||||
SaveManager.save_default()
|
SaveManager.save_default()
|
||||||
|
|
||||||
func reinstate() -> void:
|
func reinstate() -> void:
|
||||||
if gsr.input_map.size() < 1:
|
if gsr.input_map.size() <= 1:
|
||||||
InputMap.load_from_globals()
|
InputMap.load_from_globals()
|
||||||
return
|
return
|
||||||
for action in gsr.input_map:
|
for action in gsr.input_map:
|
||||||
InputMap.action_erase_events(action)
|
InputMap.action_erase_events(action)
|
||||||
|
# if(gsr.input_map[action].size() > 0 && gsr.input_map[action].size() < 2):
|
||||||
|
# InputMap.load_from_globals()
|
||||||
for input_event in gsr.input_map[action]:
|
for input_event in gsr.input_map[action]:
|
||||||
InputMap.action_add_event(action, input_event)
|
InputMap.action_add_event(action, input_event)
|
||||||
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/Utilities/GlobalState.gd" type="Script" id=1]
|
[ext_resource path="res://src/Autoload/GlobalState.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://src/Utilities/GlobalStateResource.gd" type="Script" id=2]
|
[ext_resource path="res://src/Utilities/GlobalStateResource.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="Resource" id=1]
|
[sub_resource type="Resource" id=1]
|
||||||
@ -13,5 +13,6 @@ input_map = {
|
|||||||
show_tutorial = false
|
show_tutorial = false
|
||||||
|
|
||||||
[node name="GlobalState" type="Node"]
|
[node name="GlobalState" type="Node"]
|
||||||
|
pause_mode = 2
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
gsr = SubResource( 1 )
|
gsr = SubResource( 1 )
|
||||||
|
|||||||
@ -3,4 +3,6 @@
|
|||||||
[ext_resource path="res://src/Autoload/SaveManager.gd" type="Script" id=1]
|
[ext_resource path="res://src/Autoload/SaveManager.gd" type="Script" id=1]
|
||||||
|
|
||||||
[node name="SaveManager" type="Node"]
|
[node name="SaveManager" type="Node"]
|
||||||
|
pause_mode = 2
|
||||||
|
physics_interpolation_mode = 1
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|||||||
@ -17,6 +17,7 @@ func level_completion() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func teleport() -> void:
|
func teleport() -> void:
|
||||||
|
get_tree().paused = true
|
||||||
anim_player.play("fade_in")
|
anim_player.play("fade_in")
|
||||||
# TODO This doesn't pause the game but should
|
# TODO This doesn't pause the game but should
|
||||||
yield(anim_player, "animation_finished")
|
yield(anim_player, "animation_finished")
|
||||||
|
|||||||
@ -63,6 +63,7 @@ tracks/1/keys = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[node name="Portal" type="Area2D"]
|
[node name="Portal" type="Area2D"]
|
||||||
|
pause_mode = 2
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
monitorable = false
|
monitorable = false
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|||||||
@ -106,8 +106,8 @@ drag_margin_bottom = 0.3
|
|||||||
[node name="Emitter3" parent="BlobbyCam/ParallaxBackground/ParallaxLayer4" index="1"]
|
[node name="Emitter3" parent="BlobbyCam/ParallaxBackground/ParallaxLayer4" index="1"]
|
||||||
visible = true
|
visible = true
|
||||||
|
|
||||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||||
frame = 7
|
frame = 12
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@ -6,4 +6,5 @@ onready var levelState := $"%LevelState"
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
signalManager.emit_signal("level_loaded")
|
signalManager.emit_signal("level_loaded")
|
||||||
|
get_tree().paused = false
|
||||||
|
|
||||||
|
|||||||
@ -34,10 +34,10 @@ unique_name_in_owner = true
|
|||||||
drag_margin_bottom = 0.3
|
drag_margin_bottom = 0.3
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||||
frame = 3
|
frame = 2
|
||||||
|
|
||||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||||
frame = 2
|
frame = 1
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
49
src/UserInterface/Screens/InGameMenu/ControlsMenuIngame.gd
Normal file
49
src/UserInterface/Screens/InGameMenu/ControlsMenuIngame.gd
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
onready var _action_list = $"%ActionKeyList"
|
||||||
|
onready var changes_made := false
|
||||||
|
onready var changes_saved := false
|
||||||
|
|
||||||
|
func on_start():
|
||||||
|
$InputMapper.connect('profile_changed', self, 'rebuild')
|
||||||
|
$InputMapper.initialize_profiles()
|
||||||
|
$ProfilesMenu.initialize($InputMapper)
|
||||||
|
$ProfilesMenu.grab_focus()
|
||||||
|
$InputMapper.change_profile($ProfilesMenu.selected)
|
||||||
|
|
||||||
|
func rebuild(input_profile):
|
||||||
|
_action_list.clear()
|
||||||
|
var first = true
|
||||||
|
for input_action in input_profile.keys():
|
||||||
|
if(input_action.ends_with("_old") || input_action.begins_with(("ui_"))):
|
||||||
|
continue
|
||||||
|
var line = _action_list.add_input_line(input_action, input_profile[input_action])
|
||||||
|
if first:
|
||||||
|
$ProfilesMenu.focus_neighbour_bottom = line.get_child(2).get_path()
|
||||||
|
$Back.focus_neighbour_top = line.get_child(2).get_path()
|
||||||
|
$Save.focus_neighbour_top = line.get_child(2).get_path()
|
||||||
|
$Reset.focus_neighbour_top = line.get_child(2).get_path()
|
||||||
|
first = false
|
||||||
|
line.get_child(2).focus_neighbour_left = $Back.get_path()
|
||||||
|
line.get_child(2).focus_neighbour_right = $Save.get_path()
|
||||||
|
line.connect('change_button_pressed', self, '_on_InputLine_change_button_pressed', [input_action, line])
|
||||||
|
|
||||||
|
func close():
|
||||||
|
self.visible = false
|
||||||
|
$"%PauseOverlay".visible = true
|
||||||
|
$"%PauseOverlay/VBoxContainer/Continue".grab_focus()
|
||||||
|
|
||||||
|
func _on_InputLine_change_button_pressed(action_name, line):
|
||||||
|
var old_event = $InputMapper.get_selected_profile()[action_name]
|
||||||
|
$"%KeySelectMenu".open()
|
||||||
|
var event = yield($"%KeySelectMenu", "key_selected")
|
||||||
|
if event == null:
|
||||||
|
return
|
||||||
|
if($InputMapper.change_action_key(action_name, event, old_event)):
|
||||||
|
changes_made = true
|
||||||
|
changes_saved = false
|
||||||
|
line.update_key(event)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Back_button_up() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
@ -9,6 +9,7 @@ var paused := false setget set_paused
|
|||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
#signalManager.connect("player_died", self, "_on_GlobalState_player_died")
|
#signalManager.connect("player_died", self, "_on_GlobalState_player_died")
|
||||||
|
$ControlsMenu.visible = false
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -31,3 +32,9 @@ func set_paused(value: bool) -> void:
|
|||||||
pause_overlay.visible = value
|
pause_overlay.visible = value
|
||||||
if value == true:
|
if value == true:
|
||||||
$PauseOverlay/VBoxContainer/Continue.grab_focus()
|
$PauseOverlay/VBoxContainer/Continue.grab_focus()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Controls_button_up() -> void:
|
||||||
|
$ControlsMenu.on_start()
|
||||||
|
$ControlsMenu.visible = true
|
||||||
|
$PauseOverlay.visible = false
|
||||||
|
|||||||
@ -1,11 +1,51 @@
|
|||||||
[gd_scene load_steps=7 format=2]
|
[gd_scene load_steps=29 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=1]
|
[ext_resource path="res://assets/meta/ui_theme.tres" type="Theme" id=1]
|
||||||
[ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=2]
|
|
||||||
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://src/UserInterface/Buttons/ChangeSceneButton.tscn" type="PackedScene" id=3]
|
||||||
[ext_resource path="res://src/UserInterface/Buttons/RetryButton.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://src/UserInterface/Buttons/RetryButton.tscn" type="PackedScene" id=4]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/PauseScreen.gd" type="Script" id=5]
|
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/PauseScreen.gd" type="Script" id=5]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/Continue.gd" type="Script" id=6]
|
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/Continue.gd" type="Script" id=6]
|
||||||
|
[ext_resource path="res://src/transparency.gdshader" type="Shader" id=7]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/ReallyQuitMenu.gd" type="Script" id=8]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/ActionKeyList.gd" type="Script" id=9]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/ControlsMenuIngame.gd" type="Script" id=10]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/SaveAndQuitIngameButton.gd" type="Script" id=11]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/KeySelectMenu.gd" type="Script" id=12]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/InputMapper.gd" type="Script" id=13]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/InGameMenu/SavedCheckBackIngameButton.gd" type="Script" id=14]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/Reset.gd" type="Script" id=15]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/SaveButton.gd" type="Script" id=16]
|
||||||
|
[ext_resource path="res://src/UserInterface/Screens/MainMenu/ControlsMenu/ProfilesMenu.gd" type="Script" id=17]
|
||||||
|
[ext_resource path="res://assets/environment/background/Spaceship-Wall.png" type="Texture" id=18]
|
||||||
|
[ext_resource path="res://assets/environment/background/starry-space.png" type="Texture" id=19]
|
||||||
|
[ext_resource path="res://assets/sounds/EpsonStart.ogg" type="AudioStream" id=20]
|
||||||
|
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=21]
|
||||||
|
[ext_resource path="res://assets/meta/montserrat_extrabold.otf" type="DynamicFontData" id=22]
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=1]
|
||||||
|
size = 42
|
||||||
|
font_data = ExtResource( 22 )
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id=6]
|
||||||
|
shader = ExtResource( 7 )
|
||||||
|
shader_param/transparency = 0.1
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=2]
|
||||||
|
font_data = ExtResource( 22 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=3]
|
||||||
|
font_data = ExtResource( 22 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=4]
|
||||||
|
font_data = ExtResource( 22 )
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id=8]
|
||||||
|
shader = ExtResource( 7 )
|
||||||
|
shader_param/transparency = 0.778
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=7]
|
||||||
|
size = 20
|
||||||
|
font_data = ExtResource( 22 )
|
||||||
|
|
||||||
[node name="PauseScreen" type="Control"]
|
[node name="PauseScreen" type="Control"]
|
||||||
pause_mode = 2
|
pause_mode = 2
|
||||||
@ -15,16 +55,367 @@ mouse_filter = 2
|
|||||||
theme = ExtResource( 1 )
|
theme = ExtResource( 1 )
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
[node name="SignalManager" parent="." instance=ExtResource( 2 )]
|
[node name="ControlsMenu" type="Control" parent="."]
|
||||||
|
pause_mode = 2
|
||||||
|
physics_interpolation_mode = 1
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
theme = ExtResource( 1 )
|
||||||
|
script = ExtResource( 10 )
|
||||||
|
|
||||||
|
[node name="InputMapper" type="Node" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
script = ExtResource( 13 )
|
||||||
|
|
||||||
|
[node name="background" type="TextureRect" parent="ControlsMenu"]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_top = 46.0
|
||||||
|
margin_bottom = 46.0
|
||||||
|
texture = ExtResource( 19 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 1
|
||||||
|
|
||||||
|
[node name="background2" type="TextureRect" parent="ControlsMenu"]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
texture = ExtResource( 18 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 1
|
||||||
|
|
||||||
|
[node name="ProfilesMenu" type="OptionButton" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.165
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.165
|
||||||
|
margin_left = -14.5
|
||||||
|
margin_right = 14.5
|
||||||
|
margin_bottom = 19.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
focus_neighbour_top = NodePath("../Back")
|
||||||
|
focus_neighbour_bottom = NodePath("../KeymapViewer/ScrollContainer")
|
||||||
|
script = ExtResource( 17 )
|
||||||
|
|
||||||
|
[node name="Titel" type="Label" parent="ControlsMenu"]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
margin_left = -170.0
|
||||||
|
margin_right = 170.0
|
||||||
|
margin_bottom = 52.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 1 )
|
||||||
|
text = "Controlls Menu"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="ControlsMenu/Titel"]
|
||||||
|
material = SubResource( 6 )
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
margin_left = -39.0
|
||||||
|
margin_top = -3.0
|
||||||
|
margin_right = 251.0
|
||||||
|
margin_bottom = 265.0
|
||||||
|
rect_scale = Vector2( 0.0627026, 0.0522158 )
|
||||||
|
texture = ExtResource( 21 )
|
||||||
|
|
||||||
|
[node name="KeymapViewer" type="VBoxContainer" parent="ControlsMenu"]
|
||||||
|
anchor_left = 0.1
|
||||||
|
anchor_top = 0.3
|
||||||
|
anchor_right = 0.9
|
||||||
|
anchor_bottom = 0.75
|
||||||
|
margin_left = -20.0
|
||||||
|
margin_top = -20.0
|
||||||
|
margin_right = 20.0
|
||||||
|
margin_bottom = 20.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="Headers" type="HBoxContainer" parent="ControlsMenu/KeymapViewer"]
|
||||||
|
margin_right = 552.0
|
||||||
|
margin_bottom = 21.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Action" type="Label" parent="ControlsMenu/KeymapViewer/Headers"]
|
||||||
|
margin_right = 242.0
|
||||||
|
margin_bottom = 21.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 2 )
|
||||||
|
text = "Action"
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="Control" type="Label" parent="ControlsMenu/KeymapViewer/Headers"]
|
||||||
|
margin_left = 246.0
|
||||||
|
margin_right = 305.0
|
||||||
|
margin_bottom = 21.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 3 )
|
||||||
|
text = "Button"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="Change" type="Label" parent="ControlsMenu/KeymapViewer/Headers"]
|
||||||
|
margin_left = 309.0
|
||||||
|
margin_right = 552.0
|
||||||
|
margin_bottom = 21.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 4 )
|
||||||
|
text = "Edit"
|
||||||
|
align = 2
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="ControlsMenu/KeymapViewer"]
|
||||||
|
margin_top = 25.0
|
||||||
|
margin_right = 552.0
|
||||||
|
margin_bottom = 202.0
|
||||||
|
focus_neighbour_top = NodePath("../../ProfilesMenu")
|
||||||
|
focus_neighbour_bottom = NodePath("../../Save")
|
||||||
|
focus_previous = NodePath("../../Back")
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
follow_focus = true
|
||||||
|
|
||||||
|
[node name="ActionKeyList" type="VBoxContainer" parent="ControlsMenu/KeymapViewer/ScrollContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
margin_right = 552.0
|
||||||
|
margin_bottom = 177.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
script = ExtResource( 9 )
|
||||||
|
|
||||||
|
[node name="Back" type="Button" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_left = 0.05
|
||||||
|
anchor_top = 0.95
|
||||||
|
anchor_right = 0.05
|
||||||
|
anchor_bottom = 0.95
|
||||||
|
margin_top = -25.0
|
||||||
|
margin_right = 75.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
rect_min_size = Vector2( 40, 20 )
|
||||||
|
focus_neighbour_left = NodePath("../Save")
|
||||||
|
focus_neighbour_top = NodePath("../KeymapViewer/ScrollContainer")
|
||||||
|
focus_neighbour_right = NodePath("../Reset")
|
||||||
|
focus_neighbour_bottom = NodePath("../ProfilesMenu")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
text = "Back"
|
||||||
|
script = ExtResource( 14 )
|
||||||
|
|
||||||
|
[node name="Reset" type="Button" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.95
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.95
|
||||||
|
margin_left = -37.5
|
||||||
|
margin_top = -25.0
|
||||||
|
margin_right = 37.5
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
rect_min_size = Vector2( 40, 20 )
|
||||||
|
focus_neighbour_left = NodePath("../Back")
|
||||||
|
focus_neighbour_top = NodePath("../KeymapViewer/ScrollContainer")
|
||||||
|
focus_neighbour_right = NodePath("../Save")
|
||||||
|
focus_neighbour_bottom = NodePath("../ProfilesMenu")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
text = "Reset"
|
||||||
|
script = ExtResource( 15 )
|
||||||
|
|
||||||
|
[node name="Save" type="Button" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
anchor_left = 0.95
|
||||||
|
anchor_top = 0.95
|
||||||
|
anchor_right = 0.95
|
||||||
|
anchor_bottom = 0.95
|
||||||
|
margin_left = -75.0
|
||||||
|
margin_top = -25.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
rect_min_size = Vector2( 40, 20 )
|
||||||
|
focus_neighbour_left = NodePath("../Reset")
|
||||||
|
focus_neighbour_top = NodePath("../KeymapViewer/ScrollContainer")
|
||||||
|
focus_neighbour_right = NodePath("../Back")
|
||||||
|
focus_neighbour_bottom = NodePath("../ProfilesMenu")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
text = "Save"
|
||||||
|
script = ExtResource( 16 )
|
||||||
|
|
||||||
|
[node name="KeySelectMenu" type="Panel" parent="ControlsMenu"]
|
||||||
|
pause_mode = 2
|
||||||
|
unique_name_in_owner = true
|
||||||
|
process_priority = 1
|
||||||
|
visible = false
|
||||||
|
material = SubResource( 8 )
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
focus_mode = 2
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
script = ExtResource( 12 )
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="ControlsMenu/KeySelectMenu"]
|
||||||
|
pause_mode = 2
|
||||||
|
wait_time = 5.0
|
||||||
|
|
||||||
|
[node name="Prompt" type="Label" parent="ControlsMenu/KeySelectMenu"]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
margin_left = -170.0
|
||||||
|
margin_top = -26.0
|
||||||
|
margin_right = 170.0
|
||||||
|
margin_bottom = 26.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 7 )
|
||||||
|
text = "Press a key"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="Prompt2" type="Label" parent="ControlsMenu/KeySelectMenu"]
|
||||||
|
anchor_left = 0.663
|
||||||
|
anchor_top = 0.584
|
||||||
|
anchor_right = 0.663
|
||||||
|
anchor_bottom = 0.606
|
||||||
|
margin_left = -202.5
|
||||||
|
margin_top = -13.0
|
||||||
|
margin_right = 202.5
|
||||||
|
margin_bottom = 13.0
|
||||||
|
rect_scale = Vector2( 0.5, 0.5 )
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 7 )
|
||||||
|
text = "(ESC to cancel or wait for timeout in: )"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="ReallyQuitMenu" type="Panel" parent="ControlsMenu"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
material = SubResource( 8 )
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
focus_mode = 2
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
script = ExtResource( 8 )
|
||||||
|
|
||||||
|
[node name="Prompt" type="Label" parent="ControlsMenu/ReallyQuitMenu"]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
margin_left = -334.0
|
||||||
|
margin_top = -26.0
|
||||||
|
margin_right = 335.0
|
||||||
|
margin_bottom = 26.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
mouse_filter = 0
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
custom_fonts/font = SubResource( 7 )
|
||||||
|
text = "Unsaved changes were made.
|
||||||
|
Go back anyway?"
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="ControlsMenu/ReallyQuitMenu"]
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.85
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.85
|
||||||
|
margin_left = -50.5
|
||||||
|
margin_top = -67.0
|
||||||
|
margin_right = 50.5
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 0
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="SaveNQuit" type="Button" parent="ControlsMenu/ReallyQuitMenu/VBoxContainer"]
|
||||||
|
margin_right = 101.0
|
||||||
|
margin_bottom = 20.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
rect_min_size = Vector2( 40, 20 )
|
||||||
|
focus_neighbour_top = NodePath("../QuitDontSave")
|
||||||
|
focus_neighbour_bottom = NodePath("../ContinueEdit")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 7
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Save And Quit"
|
||||||
|
icon_align = 1
|
||||||
|
script = ExtResource( 11 )
|
||||||
|
|
||||||
|
[node name="ContinueEdit" type="Button" parent="ControlsMenu/ReallyQuitMenu/VBoxContainer"]
|
||||||
|
margin_top = 24.0
|
||||||
|
margin_right = 101.0
|
||||||
|
margin_bottom = 43.0
|
||||||
|
focus_neighbour_left = NodePath(".")
|
||||||
|
focus_neighbour_top = NodePath("../SaveNQuit")
|
||||||
|
focus_neighbour_right = NodePath(".")
|
||||||
|
focus_neighbour_bottom = NodePath("../QuitDontSave")
|
||||||
|
focus_next = NodePath(".")
|
||||||
|
focus_previous = NodePath(".")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 7
|
||||||
|
size_flags_vertical = 7
|
||||||
|
text = "Continue Editing"
|
||||||
|
|
||||||
|
[node name="QuitDontSave" type="Button" parent="ControlsMenu/ReallyQuitMenu/VBoxContainer"]
|
||||||
|
margin_top = 47.0
|
||||||
|
margin_right = 101.0
|
||||||
|
margin_bottom = 67.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
rect_min_size = Vector2( 40, 20 )
|
||||||
|
focus_neighbour_top = NodePath("../ContinueEdit")
|
||||||
|
focus_neighbour_bottom = NodePath("../SaveNQuit")
|
||||||
|
input_pass_on_modal_close_click = false
|
||||||
|
size_flags_horizontal = 7
|
||||||
|
size_flags_vertical = 4
|
||||||
|
text = "Quit Don't Save"
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="ControlsMenu"]
|
||||||
|
stream = ExtResource( 20 )
|
||||||
|
volume_db = -10.065
|
||||||
|
autoplay = true
|
||||||
|
bus = "Music"
|
||||||
|
|
||||||
[node name="PauseOverlay" type="ColorRect" parent="."]
|
[node name="PauseOverlay" type="ColorRect" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
color = Color( 0, 0, 0, 0.235294 )
|
color = Color( 0, 0, 0, 0.235294 )
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="PauseOverlay"]
|
[node name="Title" type="Label" parent="PauseOverlay"]
|
||||||
margin_right = 170.0
|
margin_right = 170.0
|
||||||
@ -41,29 +432,36 @@ margin_top = -125.0
|
|||||||
margin_right = 111.0
|
margin_right = 111.0
|
||||||
margin_bottom = 125.0
|
margin_bottom = 125.0
|
||||||
focus_mode = 2
|
focus_mode = 2
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Continue" type="Button" parent="PauseOverlay/VBoxContainer"]
|
[node name="Continue" type="Button" parent="PauseOverlay/VBoxContainer"]
|
||||||
margin_right = 222.0
|
margin_right = 222.0
|
||||||
margin_bottom = 80.0
|
margin_bottom = 59.0
|
||||||
focus_neighbour_top = NodePath("../MainMenuButton")
|
focus_neighbour_top = NodePath("../MainMenuButton")
|
||||||
focus_neighbour_bottom = NodePath("../RetryButton")
|
focus_neighbour_bottom = NodePath("../Controls")
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
text = "Continue"
|
text = "Continue"
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
|
|
||||||
[node name="RetryButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 4 )]
|
[node name="Controls" type="Button" parent="PauseOverlay/VBoxContainer"]
|
||||||
|
margin_top = 63.0
|
||||||
margin_right = 222.0
|
margin_right = 222.0
|
||||||
margin_bottom = 80.0
|
margin_bottom = 123.0
|
||||||
|
focus_neighbour_top = NodePath("../Continue")
|
||||||
|
focus_neighbour_bottom = NodePath("../RetryButton")
|
||||||
|
size_flags_vertical = 3
|
||||||
|
text = "Controls"
|
||||||
|
|
||||||
|
[node name="RetryButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 4 )]
|
||||||
|
margin_top = 127.0
|
||||||
|
margin_right = 222.0
|
||||||
|
margin_bottom = 186.0
|
||||||
focus_neighbour_top = NodePath("../Continue")
|
focus_neighbour_top = NodePath("../Continue")
|
||||||
focus_neighbour_bottom = NodePath("../MainMenuButton")
|
focus_neighbour_bottom = NodePath("../MainMenuButton")
|
||||||
|
|
||||||
[node name="MainMenuButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 3 )]
|
[node name="MainMenuButton" parent="PauseOverlay/VBoxContainer" instance=ExtResource( 3 )]
|
||||||
margin_top = 84.0
|
margin_top = 190.0
|
||||||
margin_right = 222.0
|
margin_right = 222.0
|
||||||
margin_bottom = 165.0
|
margin_bottom = 250.0
|
||||||
focus_neighbour_top = NodePath("../RetryButton")
|
focus_neighbour_top = NodePath("../RetryButton")
|
||||||
focus_neighbour_bottom = NodePath("../Continue")
|
focus_neighbour_bottom = NodePath("../Continue")
|
||||||
text = "Main Menu"
|
text = "Main Menu"
|
||||||
@ -79,4 +477,13 @@ size_flags_horizontal = 0
|
|||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
text = "Pause"
|
text = "Pause"
|
||||||
|
|
||||||
|
[connection signal="focus_entered" from="ControlsMenu/KeymapViewer/ScrollContainer" to="ControlsMenu/KeymapViewer/ScrollContainer" method="_on_focus_entered"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/Back" to="ControlsMenu/Back" method="_on_button_up"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/Reset" to="ControlsMenu/Reset" method="_on_button_up"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/Save" to="ControlsMenu/Save" method="_on_button_up"]
|
||||||
|
[connection signal="timeout" from="ControlsMenu/KeySelectMenu/Timer" to="ControlsMenu/KeySelectMenu" method="close_on_timeout"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/ReallyQuitMenu/VBoxContainer/SaveNQuit" to="ControlsMenu/ReallyQuitMenu/VBoxContainer/SaveNQuit" method="_on_button_up"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/ReallyQuitMenu/VBoxContainer/ContinueEdit" to="ControlsMenu/ReallyQuitMenu" method="close"]
|
||||||
|
[connection signal="button_up" from="ControlsMenu/ReallyQuitMenu/VBoxContainer/QuitDontSave" to="ControlsMenu" method="close"]
|
||||||
[connection signal="button_up" from="PauseOverlay/VBoxContainer/Continue" to="PauseOverlay/VBoxContainer/Continue" method="_on_button_up"]
|
[connection signal="button_up" from="PauseOverlay/VBoxContainer/Continue" to="PauseOverlay/VBoxContainer/Continue" method="_on_button_up"]
|
||||||
|
[connection signal="button_up" from="PauseOverlay/VBoxContainer/Controls" to="." method="_on_Controls_button_up"]
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
extends Button
|
||||||
|
|
||||||
|
onready var selected_screen_base_path: String = "res://src/UserInterface/Screens"
|
||||||
|
onready var signalManager := get_tree().root.get_child(3).get_node("%SignalManager")
|
||||||
|
onready var mapper := $"%InputMapper"
|
||||||
|
export(String, FILE) var next_screen_path: = ""
|
||||||
|
|
||||||
|
func _on_button_up() -> void:
|
||||||
|
signalManager.connect("savemanager_saved",self,"was_saved_now_quit")
|
||||||
|
mapper.commit_to_changes()
|
||||||
|
SaveManager.save_default()
|
||||||
|
|
||||||
|
func was_saved_now_quit() -> void:
|
||||||
|
$"%ReallyQuitMenu".close()
|
||||||
|
$"%ControlsMenu".close()
|
||||||
|
|
||||||
|
func _get_configuration_warning() -> String:
|
||||||
|
return "next_scene_path must be set for the button to work" if next_screen_path == "" else ""
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
extends Button
|
||||||
|
|
||||||
|
func _on_button_up() -> void:
|
||||||
|
if(!get_parent().changes_made || get_parent().changes_saved):
|
||||||
|
$"%ControlsMenu".close()
|
||||||
|
else:
|
||||||
|
set_process_input(false)
|
||||||
|
$"%ReallyQuitMenu".open()
|
||||||
@ -46,6 +46,7 @@ size = 20
|
|||||||
font_data = ExtResource( 18 )
|
font_data = ExtResource( 18 )
|
||||||
|
|
||||||
[node name="ControlsMenu" type="Control"]
|
[node name="ControlsMenu" type="Control"]
|
||||||
|
pause_mode = 1
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
@ -254,7 +255,7 @@ text = "Save"
|
|||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="KeySelectMenu" type="Panel" parent="."]
|
[node name="KeySelectMenu" type="Panel" parent="."]
|
||||||
pause_mode = 1
|
pause_mode = 2
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
process_priority = 1
|
process_priority = 1
|
||||||
visible = false
|
visible = false
|
||||||
|
|||||||
@ -42,6 +42,8 @@ func change_action_key(action_name, event, old_event = null) -> bool:
|
|||||||
func erase_old_action_event(action_name):
|
func erase_old_action_event(action_name):
|
||||||
if(get_selected_profile().has(action_name+"_old")):
|
if(get_selected_profile().has(action_name+"_old")):
|
||||||
var old_event = get_selected_profile()[action_name+"_old"]
|
var old_event = get_selected_profile()[action_name+"_old"]
|
||||||
|
var event = get_selected_profile()[action_name]
|
||||||
|
if(old_event != event):
|
||||||
InputMap.action_erase_event(action_name, old_event)
|
InputMap.action_erase_event(action_name, old_event)
|
||||||
|
|
||||||
func initialize_profiles() -> void:
|
func initialize_profiles() -> void:
|
||||||
|
|||||||
@ -3,10 +3,9 @@ extends Panel
|
|||||||
signal key_selected(scancode)
|
signal key_selected(scancode)
|
||||||
var prev_focus
|
var prev_focus
|
||||||
|
|
||||||
func _ready():
|
func _ready() -> void:
|
||||||
set_process_input(false)
|
set_process_input(false)
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
$Prompt2.text = ("(ESC to cancel or wait: %s" % round($Timer.time_left)) + " sec)"
|
$Prompt2.text = ("(ESC to cancel or wait: %s" % round($Timer.time_left)) + " sec)"
|
||||||
|
|
||||||
@ -28,6 +27,7 @@ func open():
|
|||||||
|
|
||||||
func close():
|
func close():
|
||||||
hide()
|
hide()
|
||||||
|
$Timer.stop()
|
||||||
self.release_focus()
|
self.release_focus()
|
||||||
prev_focus.grab_focus()
|
prev_focus.grab_focus()
|
||||||
set_process_input(false)
|
set_process_input(false)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user