fix: better ui navigation and controls menu
This commit is contained in:
parent
f9b60dfbc7
commit
adc8e17009
@ -119,12 +119,12 @@ func handle_wallslide_input(delta, direction) -> Vector2:
|
|||||||
|
|
||||||
|
|
||||||
func get_horizontal_direction() -> Vector2:
|
func get_horizontal_direction() -> Vector2:
|
||||||
#TODO Check if this is fixed yet
|
#TODO Check if this is fixed yet -> Seems like it, idk what i meant by that lul xd roflcopter lmao wtfbbq1!!!11!
|
||||||
if Input.get_connected_joypads().size() > 0:
|
# if Input.get_connected_joypads().size() > 0:
|
||||||
if Input.is_joy_button_pressed(Input.get_connected_joypads()[0], 14):
|
# if Input.is_action_pressed("move_right"):
|
||||||
return Vector2(-1, 0)
|
# return Vector2(-1, 0)
|
||||||
if Input.is_joy_button_pressed(Input.get_connected_joypads()[0], 15):
|
# if Input.is_action_pressed("move_left"):
|
||||||
return Vector2(1, 0)
|
# return Vector2(1, 0)
|
||||||
return Vector2(
|
return Vector2(
|
||||||
(
|
(
|
||||||
Input.get_action_strength("move_right")
|
Input.get_action_strength("move_right")
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
export var save_location: String = "res://savefile.tres"
|
export var save_location: String = "res://savefile.tres"
|
||||||
onready var signalManager := get_tree().root.get_child(3).get_node("%SignalManager")
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
load_initial_save()
|
load_initial_save()
|
||||||
@ -14,6 +13,7 @@ func load_initial_save() -> void:
|
|||||||
GlobalState.reinstate()
|
GlobalState.reinstate()
|
||||||
|
|
||||||
func save_default() -> void:
|
func save_default() -> void:
|
||||||
|
var signalManager = get_tree().root.get_child(3).get_node("%SignalManager")
|
||||||
for action in InputMap.get_actions():
|
for action in InputMap.get_actions():
|
||||||
GlobalState.gsr.input_map[action] = InputMap.get_action_list(action)
|
GlobalState.gsr.input_map[action] = InputMap.get_action_list(action)
|
||||||
ResourceSaver.save(save_location, GlobalState.gsr)
|
ResourceSaver.save(save_location, GlobalState.gsr)
|
||||||
|
|||||||
@ -106,11 +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="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
|
||||||
frame = 13
|
|
||||||
|
|
||||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||||
frame = 6
|
frame = 7
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
[node name="Blobby" parent="." instance=ExtResource( 9 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@ -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 = 2
|
frame = 3
|
||||||
|
|
||||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||||
frame = 1
|
frame = 2
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@ -29,14 +29,12 @@ func rebuild(input_profile):
|
|||||||
line.connect('change_button_pressed', self, '_on_InputLine_change_button_pressed', [input_action, line])
|
line.connect('change_button_pressed', self, '_on_InputLine_change_button_pressed', [input_action, line])
|
||||||
|
|
||||||
func _on_InputLine_change_button_pressed(action_name, line):
|
func _on_InputLine_change_button_pressed(action_name, line):
|
||||||
set_process_input(false)
|
|
||||||
var old_event = $InputMapper.get_selected_profile()[action_name]
|
var old_event = $InputMapper.get_selected_profile()[action_name]
|
||||||
$KeySelectMenu.open()
|
$"%KeySelectMenu".open()
|
||||||
var event = yield($KeySelectMenu, "key_selected")
|
var event = yield($"%KeySelectMenu", "key_selected")
|
||||||
if event == null:
|
if event == null:
|
||||||
return
|
return
|
||||||
changes_made = true
|
if($InputMapper.change_action_key(action_name, event, old_event)):
|
||||||
changes_saved = false
|
changes_made = true
|
||||||
$InputMapper.change_action_key(action_name, old_event, event)
|
changes_saved = false
|
||||||
line.update_key(event)
|
line.update_key(event)
|
||||||
set_process_input(true)
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=26 format=2]
|
[gd_scene load_steps=27 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=1]
|
[ext_resource path="res://assets/ui/Screenshot 2023-05-23 160521.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd" type="Script" id=2]
|
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ProfilesMenu.gd" type="Script" id=2]
|
||||||
@ -18,6 +18,7 @@
|
|||||||
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SaveAndQuitButton.gd" type="Script" id=16]
|
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SaveAndQuitButton.gd" type="Script" id=16]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SavedCheckBackButton.gd" type="Script" id=17]
|
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/SavedCheckBackButton.gd" type="Script" id=17]
|
||||||
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ReallyQuitMenu.gd" type="Script" id=18]
|
[ext_resource path="res://src/UserInterface/Screens/ControlsMenu/ReallyQuitMenu.gd" type="Script" id=18]
|
||||||
|
[ext_resource path="res://src/Utilities/SignalManager.tscn" type="PackedScene" id=19]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=1]
|
||||||
size = 42
|
size = 42
|
||||||
@ -47,13 +48,14 @@ font_data = ExtResource( 6 )
|
|||||||
[node name="ControlsMenu" type="Control"]
|
[node name="ControlsMenu" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
mouse_filter = 2
|
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
theme = ExtResource( 5 )
|
theme = ExtResource( 5 )
|
||||||
script = ExtResource( 12 )
|
script = ExtResource( 12 )
|
||||||
|
|
||||||
|
[node name="SignalManager" parent="." instance=ExtResource( 19 )]
|
||||||
|
|
||||||
[node name="InputMapper" type="Node" parent="."]
|
[node name="InputMapper" type="Node" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
@ -187,6 +189,7 @@ size_flags_vertical = 3
|
|||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="Back" type="Button" parent="."]
|
[node name="Back" type="Button" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
anchor_left = 0.05
|
anchor_left = 0.05
|
||||||
anchor_top = 0.95
|
anchor_top = 0.95
|
||||||
anchor_right = 0.05
|
anchor_right = 0.05
|
||||||
@ -205,8 +208,10 @@ size_flags_horizontal = 0
|
|||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
text = "Back"
|
text = "Back"
|
||||||
script = ExtResource( 17 )
|
script = ExtResource( 17 )
|
||||||
|
next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn"
|
||||||
|
|
||||||
[node name="Reset" type="Button" parent="."]
|
[node name="Reset" type="Button" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_top = 0.95
|
anchor_top = 0.95
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
@ -228,6 +233,7 @@ text = "Reset"
|
|||||||
script = ExtResource( 15 )
|
script = ExtResource( 15 )
|
||||||
|
|
||||||
[node name="Save" type="Button" parent="."]
|
[node name="Save" type="Button" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
anchor_left = 0.95
|
anchor_left = 0.95
|
||||||
anchor_top = 0.95
|
anchor_top = 0.95
|
||||||
anchor_right = 0.95
|
anchor_right = 0.95
|
||||||
@ -247,14 +253,9 @@ size_flags_vertical = 0
|
|||||||
text = "Save"
|
text = "Save"
|
||||||
script = ExtResource( 14 )
|
script = ExtResource( 14 )
|
||||||
|
|
||||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
|
||||||
stream = ExtResource( 10 )
|
|
||||||
volume_db = -10.065
|
|
||||||
autoplay = true
|
|
||||||
bus = "Music"
|
|
||||||
|
|
||||||
[node name="KeySelectMenu" type="Panel" parent="."]
|
[node name="KeySelectMenu" type="Panel" parent="."]
|
||||||
pause_mode = 1
|
pause_mode = 1
|
||||||
|
unique_name_in_owner = true
|
||||||
process_priority = 1
|
process_priority = 1
|
||||||
visible = false
|
visible = false
|
||||||
material = SubResource( 8 )
|
material = SubResource( 8 )
|
||||||
@ -303,11 +304,11 @@ valign = 1
|
|||||||
|
|
||||||
[node name="ReallyQuitMenu" type="Panel" parent="."]
|
[node name="ReallyQuitMenu" type="Panel" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
process_priority = 1
|
|
||||||
visible = false
|
visible = false
|
||||||
material = SubResource( 8 )
|
material = SubResource( 8 )
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
focus_mode = 2
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
script = ExtResource( 18 )
|
script = ExtResource( 18 )
|
||||||
|
|
||||||
@ -321,6 +322,7 @@ margin_top = -26.0
|
|||||||
margin_right = 335.0
|
margin_right = 335.0
|
||||||
margin_bottom = 26.0
|
margin_bottom = 26.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
|
mouse_filter = 0
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
custom_fonts/font = SubResource( 7 )
|
custom_fonts/font = SubResource( 7 )
|
||||||
@ -329,73 +331,80 @@ text = "Unsaved changes were made.
|
|||||||
align = 1
|
align = 1
|
||||||
valign = 1
|
valign = 1
|
||||||
|
|
||||||
[node name="SaveNQuit" type="Button" parent="ReallyQuitMenu"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="ReallyQuitMenu"]
|
||||||
anchor_left = 0.5
|
|
||||||
anchor_top = 0.65
|
|
||||||
anchor_right = 0.5
|
|
||||||
anchor_bottom = 0.65
|
|
||||||
margin_left = -45.0
|
|
||||||
margin_top = -12.5
|
|
||||||
margin_right = 45.0
|
|
||||||
margin_bottom = 12.5
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
rect_min_size = Vector2( 40, 20 )
|
|
||||||
focus_neighbour_left = NodePath(".")
|
|
||||||
focus_neighbour_top = NodePath("../QuitDontSave")
|
|
||||||
focus_neighbour_right = NodePath(".")
|
|
||||||
focus_neighbour_bottom = NodePath("../ContinueEdit")
|
|
||||||
input_pass_on_modal_close_click = false
|
|
||||||
size_flags_horizontal = 0
|
|
||||||
size_flags_vertical = 0
|
|
||||||
text = "Save & Quit"
|
|
||||||
script = ExtResource( 16 )
|
|
||||||
next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn"
|
|
||||||
|
|
||||||
[node name="ContinueEdit" type="Button" parent="ReallyQuitMenu"]
|
|
||||||
anchor_left = 0.5
|
|
||||||
anchor_top = 0.75
|
|
||||||
anchor_right = 0.5
|
|
||||||
anchor_bottom = 0.75
|
|
||||||
margin_left = -50.5
|
|
||||||
margin_top = -12.5
|
|
||||||
margin_right = 50.5
|
|
||||||
margin_bottom = 12.5
|
|
||||||
focus_neighbour_left = NodePath(".")
|
|
||||||
focus_neighbour_top = NodePath("../SaveNQuit")
|
|
||||||
focus_neighbour_right = NodePath(".")
|
|
||||||
focus_neighbour_bottom = NodePath("../QuitDontSave")
|
|
||||||
input_pass_on_modal_close_click = false
|
|
||||||
text = "Continue Editing"
|
|
||||||
|
|
||||||
[node name="QuitDontSave" type="Button" parent="ReallyQuitMenu"]
|
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_top = 0.85
|
anchor_top = 0.85
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
anchor_bottom = 0.85
|
anchor_bottom = 0.85
|
||||||
margin_left = -45.0
|
margin_left = -50.5
|
||||||
margin_top = -12.5
|
margin_top = -67.0
|
||||||
margin_right = 45.0
|
margin_right = 50.5
|
||||||
margin_bottom = 12.5
|
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
rect_min_size = Vector2( 40, 20 )
|
mouse_filter = 0
|
||||||
focus_neighbour_left = NodePath(".")
|
|
||||||
focus_neighbour_top = NodePath("../ContinueEdit")
|
|
||||||
focus_neighbour_right = NodePath(".")
|
|
||||||
focus_neighbour_bottom = NodePath("../SaveNQuit")
|
|
||||||
input_pass_on_modal_close_click = false
|
input_pass_on_modal_close_click = false
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
text = "Quit Dont Save"
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="SaveNQuit" type="Button" parent="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( 16 )
|
||||||
|
next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn"
|
||||||
|
|
||||||
|
[node name="ContinueEdit" type="Button" parent="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="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"
|
||||||
script = ExtResource( 11 )
|
script = ExtResource( 11 )
|
||||||
next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn"
|
next_screen_path = "res://src/UserInterface/Screens/MainScreen.tscn"
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource( 10 )
|
||||||
|
volume_db = -10.065
|
||||||
|
autoplay = true
|
||||||
|
bus = "Music"
|
||||||
|
|
||||||
[connection signal="focus_entered" from="KeymapViewer/ScrollContainer" to="KeymapViewer/ScrollContainer" method="_on_focus_entered"]
|
[connection signal="focus_entered" from="KeymapViewer/ScrollContainer" to="KeymapViewer/ScrollContainer" method="_on_focus_entered"]
|
||||||
[connection signal="button_up" from="Back" to="Back" method="_on_button_up"]
|
[connection signal="button_up" from="Back" to="Back" method="_on_button_up"]
|
||||||
[connection signal="button_up" from="Reset" to="Reset" method="_on_button_up"]
|
[connection signal="button_up" from="Reset" to="Reset" method="_on_button_up"]
|
||||||
[connection signal="button_up" from="Save" to="Save" method="_on_button_up"]
|
[connection signal="button_up" from="Save" to="Save" method="_on_button_up"]
|
||||||
[connection signal="timeout" from="KeySelectMenu/Timer" to="KeySelectMenu" method="close_on_timeout"]
|
[connection signal="timeout" from="KeySelectMenu/Timer" to="KeySelectMenu" method="close_on_timeout"]
|
||||||
[connection signal="button_up" from="ReallyQuitMenu/SaveNQuit" to="ReallyQuitMenu/SaveNQuit" method="_on_button_up"]
|
[connection signal="button_up" from="ReallyQuitMenu/VBoxContainer/SaveNQuit" to="ReallyQuitMenu/VBoxContainer/SaveNQuit" method="_on_button_up"]
|
||||||
[connection signal="button_up" from="ReallyQuitMenu/ContinueEdit" to="ReallyQuitMenu" method="close"]
|
[connection signal="button_up" from="ReallyQuitMenu/VBoxContainer/ContinueEdit" to="ReallyQuitMenu" method="close"]
|
||||||
[connection signal="button_up" from="ReallyQuitMenu/QuitDontSave" to="ReallyQuitMenu/QuitDontSave" method="_on_button_up"]
|
[connection signal="button_up" from="ReallyQuitMenu/VBoxContainer/QuitDontSave" to="ReallyQuitMenu/VBoxContainer/QuitDontSave" method="_on_button_up"]
|
||||||
|
|||||||
@ -25,6 +25,5 @@ func create_controller_button(event) -> ControllerButton:
|
|||||||
controller_button.expand_icon = true
|
controller_button.expand_icon = true
|
||||||
return controller_button
|
return controller_button
|
||||||
|
|
||||||
|
|
||||||
func _on_ChangeButton_pressed():
|
func _on_ChangeButton_pressed():
|
||||||
emit_signal('change_button_pressed')
|
emit_signal('change_button_pressed')
|
||||||
|
|||||||
@ -17,7 +17,7 @@ func change_profile(id):
|
|||||||
var profile = get(profiles[id])
|
var profile = get(profiles[id])
|
||||||
|
|
||||||
for action_name in profile.keys():
|
for action_name in profile.keys():
|
||||||
change_action_key(action_name, profile[action_name], profile[action_name])
|
change_action_key(action_name, profile[action_name])
|
||||||
emit_signal('profile_changed', profile)
|
emit_signal('profile_changed', profile)
|
||||||
return profile
|
return profile
|
||||||
|
|
||||||
@ -25,19 +25,24 @@ func commit_to_changes():
|
|||||||
for profile_name in profiles.values():
|
for profile_name in profiles.values():
|
||||||
var profile = get(profile_name)
|
var profile = get(profile_name)
|
||||||
for action_name in profile.keys():
|
for action_name in profile.keys():
|
||||||
erase_action_events(action_name, profile[action_name])
|
if(action_name.ends_with("_old")):
|
||||||
|
continue
|
||||||
|
erase_old_action_event(action_name)
|
||||||
|
profile[action_name + "_old"] = profile[action_name]
|
||||||
InputMap.action_add_event(action_name, profile[action_name])
|
InputMap.action_add_event(action_name, profile[action_name])
|
||||||
|
|
||||||
func change_action_key(action_name, old_event, event):
|
func change_action_key(action_name, event, old_event = null) -> bool:
|
||||||
#erase_action_events(action_name, old_event)
|
if(old_event != null):
|
||||||
|
if(event.as_text().match("*Joy*") != old_event.as_text().match("*Joy*")):
|
||||||
|
return false
|
||||||
|
get_selected_profile()[action_name+"_old"] = old_event
|
||||||
get_selected_profile()[action_name] = event
|
get_selected_profile()[action_name] = event
|
||||||
get_selected_profile()[action_name+"_old"] = old_event
|
return true
|
||||||
|
|
||||||
func erase_action_events(action_name, event):
|
func erase_old_action_event(action_name):
|
||||||
var input_events = InputMap.get_action_list(action_name)
|
if(get_selected_profile().has(action_name+"_old")):
|
||||||
for e in input_events:
|
var old_event = get_selected_profile()[action_name+"_old"]
|
||||||
if(e == event):
|
InputMap.action_erase_event(action_name, old_event)
|
||||||
InputMap.action_erase_event(action_name, event)
|
|
||||||
|
|
||||||
func initialize_profiles() -> void:
|
func initialize_profiles() -> void:
|
||||||
var actions: Array = InputMap.get_actions()
|
var actions: Array = InputMap.get_actions()
|
||||||
|
|||||||
@ -16,6 +16,7 @@ func _input(event):
|
|||||||
if "scancode" in event && event.scancode == 16777217:
|
if "scancode" in event && event.scancode == 16777217:
|
||||||
event = null
|
event = null
|
||||||
emit_signal("key_selected", event)
|
emit_signal("key_selected", event)
|
||||||
|
get_tree().set_input_as_handled()
|
||||||
close()
|
close()
|
||||||
|
|
||||||
func open():
|
func open():
|
||||||
|
|||||||
@ -2,17 +2,23 @@ extends Panel
|
|||||||
|
|
||||||
var prev_focus
|
var prev_focus
|
||||||
|
|
||||||
func _ready():
|
|
||||||
set_process_input(false)
|
|
||||||
|
|
||||||
func open():
|
func open():
|
||||||
show()
|
show()
|
||||||
prev_focus = get_focus_owner()
|
prev_focus = get_focus_owner()
|
||||||
$SaveNQuit.grab_focus()
|
mitigate_ui_navigation_spill_over(true)
|
||||||
set_process_input(true)
|
$"VBoxContainer/SaveNQuit".grab_focus()
|
||||||
|
|
||||||
|
func mitigate_ui_navigation_spill_over(var value: bool):
|
||||||
|
var mode = Control.FOCUS_NONE if value else Control.FOCUS_ALL
|
||||||
|
$"%ProfilesMenu".focus_mode = mode
|
||||||
|
$"%Back".focus_mode = mode
|
||||||
|
$"%Reset".focus_mode = mode
|
||||||
|
$"%Save".focus_mode = mode
|
||||||
|
for line in $"../KeymapViewer/ScrollContainer/ActionKeyList".get_children():
|
||||||
|
line.get_node("ChangeButton").focus_mode = mode
|
||||||
|
|
||||||
func close():
|
func close():
|
||||||
hide()
|
hide()
|
||||||
|
mitigate_ui_navigation_spill_over(false)
|
||||||
self.release_focus()
|
self.release_focus()
|
||||||
prev_focus.grab_focus()
|
prev_focus.grab_focus()
|
||||||
set_process_input(false)
|
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
extends Button
|
extends Button
|
||||||
|
|
||||||
onready var selected_screen_base_path: String = "res://src/UserInterface/Screens"
|
onready var selected_screen_base_path: String = "res://src/UserInterface/Screens"
|
||||||
|
onready var signalManager := $"%SignalManager"
|
||||||
onready var mapper := $"%InputMapper"
|
onready var mapper := $"%InputMapper"
|
||||||
export(String, FILE) var next_screen_path: = ""
|
export(String, FILE) var next_screen_path: = ""
|
||||||
|
|
||||||
func _on_button_up() -> void:
|
func _on_button_up() -> void:
|
||||||
|
signalManager.connect("savemanager_saved",self,"was_saved_now_quit")
|
||||||
mapper.commit_to_changes()
|
mapper.commit_to_changes()
|
||||||
SaveManager.save_default()
|
SaveManager.save_default()
|
||||||
yield(SignalManager, "savemanager_saved")
|
|
||||||
|
func was_saved_now_quit() -> void:
|
||||||
get_tree().change_scene(next_screen_path)
|
get_tree().change_scene(next_screen_path)
|
||||||
get_tree().get_current_scene().queue_free()
|
get_tree().get_current_scene().queue_free()
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
|
|||||||
@ -9,6 +9,7 @@ func _on_button_up() -> void:
|
|||||||
get_tree().get_current_scene().queue_free()
|
get_tree().get_current_scene().queue_free()
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
else:
|
else:
|
||||||
|
set_process_input(false)
|
||||||
$"%ReallyQuitMenu".open()
|
$"%ReallyQuitMenu".open()
|
||||||
|
|
||||||
func _get_configuration_warning() -> String:
|
func _get_configuration_warning() -> String:
|
||||||
|
|||||||
@ -4,8 +4,6 @@ extends Control
|
|||||||
onready var current_scene := get_tree().get_current_scene()
|
onready var current_scene := get_tree().get_current_scene()
|
||||||
onready var pause_overlay: ColorRect = get_node("PauseOverlay")
|
onready var pause_overlay: ColorRect = get_node("PauseOverlay")
|
||||||
onready var pause_title: Label = get_node("PauseOverlay/Title")
|
onready var pause_title: Label = get_node("PauseOverlay/Title")
|
||||||
onready var levelState := $"../%LevelState"
|
|
||||||
onready var signalManager := $"../%SignalManager"
|
|
||||||
|
|
||||||
var paused := false setget set_paused
|
var paused := false setget set_paused
|
||||||
|
|
||||||
|
|||||||
@ -37,9 +37,9 @@ 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
|
||||||
for action in gsr.input_map:
|
for action in gsr.input_map:
|
||||||
InputMap.action_erase_events(action)
|
InputMap.action_erase_events(action)
|
||||||
for input_event in gsr.input_map[action]:
|
for input_event in gsr.input_map[action]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user