Merge branch 'dev-reset-rebind'

Conflicts:
	Assets/UI/Theme.tres
This commit is contained in:
Snoweuph 2023-04-12 21:26:40 +02:00
commit 2fc9af744d
7 changed files with 97 additions and 240 deletions

View file

@ -1,207 +0,0 @@
[gd_resource type="Theme" load_steps=47 format=3 uid="uid://babphdknr2kkd"]
[ext_resource type="StyleBox" uid="uid://bmeh7kt6t886w" path="res://Assets/UI/Button/disabled.tres" id="1_n3up8"]
[ext_resource type="StyleBox" uid="uid://gxy851bdkmb0" path="res://Assets/UI/Button/focus.tres" id="2_ukct7"]
[ext_resource type="StyleBox" uid="uid://cjyijxvb4qfwy" path="res://Assets/UI/Button/hover.tres" id="3_ukadi"]
[ext_resource type="StyleBox" uid="uid://bb7opkg3aneg4" path="res://Assets/UI/Button/normal.tres" id="4_b2mp2"]
[ext_resource type="StyleBox" uid="uid://cu2rciarim0cc" path="res://Assets/UI/Button/pressed.tres" id="5_6rmq1"]
[ext_resource type="Texture2D" uid="uid://c18dqb1wy3its" path="res://Assets/UI/Check Box/checked.png" id="6_re2fr"]
[ext_resource type="Texture2D" uid="uid://jta11o1n4c3d" path="res://Assets/UI/Check Box/unchecked.png" id="7_as124"]
[ext_resource type="Texture2D" uid="uid://je3kjtfx1kr3" path="res://Assets/UI/Button/checked.png" id="8_g1dhe"]
[ext_resource type="Texture2D" uid="uid://dklqdwoqhjm5i" path="res://Assets/UI/Button/unchecked.png" id="9_trcl3"]
[ext_resource type="StyleBox" uid="uid://cgdxtbanwi5gp" path="res://Assets/UI/Scrollbar/h/grabber.tres" id="10_cb1fp"]
[ext_resource type="StyleBox" uid="uid://b5e35dfka2svr" path="res://Assets/UI/Scrollbar/h/grabber_highlight.tres" id="11_s21yb"]
[ext_resource type="StyleBox" uid="uid://b6gse1t3c8ibf" path="res://Assets/UI/Scrollbar/h/grabber_pressed.tres" id="12_fd8p2"]
[ext_resource type="StyleBox" uid="uid://04efvhwskbr6" path="res://Assets/UI/Scrollbar/h/background.tres" id="13_s3ehx"]
[ext_resource type="StyleBox" uid="uid://b1huhquesnexy" path="res://Assets/UI/Scrollbar/h/background_focus.tres" id="14_fwmx8"]
[ext_resource type="Texture2D" uid="uid://cl8b7x3q77gm0" path="res://Assets/UI/Slider/handle.png" id="15_ocljk"]
[ext_resource type="Texture2D" uid="uid://b388qxyyqx8q2" path="res://Assets/UI/Slider/handle_disabled.png" id="16_rbxnn"]
[ext_resource type="Texture2D" uid="uid://o3ufhj36lo0r" path="res://Assets/UI/Slider/handle_highlight.png" id="17_8a3cc"]
[ext_resource type="StyleBox" uid="uid://bwlxiw44285g1" path="res://Assets/UI/Slider/h/fill.tres" id="18_fueyy"]
[ext_resource type="StyleBox" uid="uid://b8mdovvxl7lfl" path="res://Assets/UI/Slider/h/background.tres" id="19_ccnyp"]
[ext_resource type="StyleBox" uid="uid://cx486vo60qcpp" path="res://Assets/UI/Edit/normal.tres" id="20_1xrl8"]
[ext_resource type="StyleBox" uid="uid://dvj15u41tqtnm" path="res://Assets/UI/Edit/readonly.tres" id="21_1jd57"]
[ext_resource type="Texture2D" uid="uid://bj8jxblqmsubn" path="res://Assets/UI/Button/arrow_down.png" id="22_qar1e"]
[ext_resource type="StyleBox" uid="uid://dhna0fajb2uei" path="res://Assets/UI/Progress/background.tres" id="23_r3p5f"]
[ext_resource type="StyleBox" uid="uid://b3i7tjv3ok85r" path="res://Assets/UI/Progress/fill.tres" id="24_twflh"]
[ext_resource type="Texture2D" uid="uid://de5dv104noe06" path="res://Assets/UI/Tab/left.png" id="25_tp1la"]
[ext_resource type="Texture2D" uid="uid://ce87u4fp6tnik" path="res://Assets/UI/Tab/left_highlight.png" id="26_b6do7"]
[ext_resource type="Texture2D" uid="uid://bqpbxb5whco41" path="res://Assets/UI/Tab/right.png" id="27_apyeg"]
[ext_resource type="Texture2D" uid="uid://ds6cfed3dmyr3" path="res://Assets/UI/Tab/right_highligh.png" id="28_h4oun"]
[ext_resource type="StyleBox" uid="uid://dnwseiejbfrqq" path="res://Assets/UI/Tab/panel.tres" id="29_uo2g8"]
[ext_resource type="StyleBox" uid="uid://bgecjuqm2jv0w" path="res://Assets/UI/Tab/tab_disabled.tres" id="30_e041s"]
[ext_resource type="StyleBox" uid="uid://byrx7smwgsuf0" path="res://Assets/UI/Tab/tap_selected.tres" id="31_0n7gu"]
[ext_resource type="StyleBox" uid="uid://ddfin4k7slkmn" path="res://Assets/UI/Tab/tap_unselected.tres" id="32_a2a8b"]
[ext_resource type="StyleBox" uid="uid://cm4uy16ypsdyi" path="res://Assets/UI/Scrollbar/v/grabber.tres" id="33_wjjme"]
[ext_resource type="StyleBox" uid="uid://cmiivkeqn03sa" path="res://Assets/UI/Scrollbar/v/grabber_highlight.tres" id="34_y2stj"]
[ext_resource type="StyleBox" uid="uid://j31rmst7m2q7" path="res://Assets/UI/Scrollbar/v/grabber_pressed.tres" id="35_q0217"]
[ext_resource type="StyleBox" uid="uid://de0w7yppc7e0l" path="res://Assets/UI/Scrollbar/v/background.tres" id="36_bu6rt"]
[ext_resource type="StyleBox" uid="uid://15jbtuchd7r6" path="res://Assets/UI/Scrollbar/v/background_focus.tres" id="37_yr206"]
[ext_resource type="StyleBox" uid="uid://bumc1mixgglv8" path="res://Assets/UI/Slider/v/fill.tres" id="38_wuc1e"]
[ext_resource type="StyleBox" uid="uid://0jfr1uwuog0s" path="res://Assets/UI/Slider/v/background.tres" id="39_dl1e4"]
[ext_resource type="FontFile" uid="uid://dqdeftjkwxe64" path="res://Assets/Fonts/Dogica/dogicapixel.ttf" id="40_bmcvq"]
[sub_resource type="Image" id="Image_iaqit"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 4
}
[sub_resource type="ImageTexture" id="ImageTexture_g5bup"]
image = SubResource("Image_iaqit")
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sj7h5"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jl30t"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v2px0"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.741176, 0.67451, 0.54902, 1)
corner_detail = 1
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rhkly"]
[resource]
default_font = ExtResource("40_bmcvq")
Button/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/font_disabled_color = Color(0.227451, 0.172549, 0.290196, 1)
Button/colors/font_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/font_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/font_hover_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/font_outline_color = Color(0.745098, 0.760784, 0.721569, 1)
Button/colors/font_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/icon_disabled_color = Color(1, 1, 1, 0.4)
Button/colors/icon_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/icon_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/icon_hover_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/icon_normal_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/colors/icon_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
Button/constants/h_separation = 8
Button/constants/outline_size = 0
Button/font_sizes/font_size = 32
Button/styles/disabled = ExtResource("1_n3up8")
Button/styles/focus = ExtResource("2_ukct7")
Button/styles/hover = ExtResource("3_ukadi")
Button/styles/normal = ExtResource("4_b2mp2")
Button/styles/pressed = ExtResource("5_6rmq1")
CheckBox/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/colors/font_disabled_color = Color(0.875, 0.875, 0.875, 0.5)
CheckBox/colors/font_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/colors/font_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/colors/font_hover_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/colors/font_outline_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/colors/font_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckBox/constants/check_v_offset = 0
CheckBox/constants/h_separation = 4
CheckBox/constants/outline_size = 0
CheckBox/icons/checked = ExtResource("6_re2fr")
CheckBox/icons/unchecked = ExtResource("7_as124")
CheckBox/styles/disabled = ExtResource("1_n3up8")
CheckBox/styles/focus = ExtResource("2_ukct7")
CheckBox/styles/hover = ExtResource("3_ukadi")
CheckBox/styles/hover_pressed = ExtResource("5_6rmq1")
CheckBox/styles/normal = ExtResource("4_b2mp2")
CheckBox/styles/pressed = ExtResource("5_6rmq1")
CheckButton/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/colors/font_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/colors/font_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/colors/font_hover_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/colors/font_outline_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/colors/font_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
CheckButton/icons/checked = ExtResource("8_g1dhe")
CheckButton/icons/unchecked = ExtResource("9_trcl3")
CheckButton/styles/disabled = ExtResource("1_n3up8")
CheckButton/styles/focus = ExtResource("2_ukct7")
CheckButton/styles/hover = ExtResource("3_ukadi")
CheckButton/styles/hover_pressed = ExtResource("5_6rmq1")
CheckButton/styles/normal = ExtResource("4_b2mp2")
CheckButton/styles/pressed = ExtResource("5_6rmq1")
HScrollBar/styles/grabber = ExtResource("10_cb1fp")
HScrollBar/styles/grabber_highlight = ExtResource("11_s21yb")
HScrollBar/styles/grabber_pressed = ExtResource("12_fd8p2")
HScrollBar/styles/scroll = ExtResource("13_s3ehx")
HScrollBar/styles/scroll_focus = ExtResource("14_fwmx8")
HSlider/icons/grabber = ExtResource("15_ocljk")
HSlider/icons/grabber_disabled = ExtResource("16_rbxnn")
HSlider/icons/grabber_highlight = ExtResource("17_8a3cc")
HSlider/icons/tick = SubResource("ImageTexture_g5bup")
HSlider/styles/grabber_area = ExtResource("18_fueyy")
HSlider/styles/grabber_area_highlight = ExtResource("18_fueyy")
HSlider/styles/slider = ExtResource("19_ccnyp")
Label/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
Label/colors/font_outline_color = Color(0.745098, 0.760784, 0.721569, 1)
Label/colors/font_shadow_color = Color(0.745098, 0.760784, 0.721569, 1)
Label/constants/line_spacing = 8
Label/constants/outline_size = 0
Label/constants/shadow_offset_x = 0
Label/constants/shadow_offset_y = 4
Label/constants/shadow_outline_size = 1
Label/font_sizes/font_size = 32
Label/styles/normal = SubResource("StyleBoxEmpty_sj7h5")
LineEdit/colors/caret_color = Color(0.168627, 0.662745, 0.705882, 1)
LineEdit/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
LineEdit/colors/font_selected_color = Color(0.168627, 0.662745, 0.705882, 1)
LineEdit/colors/font_uneditable_color = Color(0.745098, 0.760784, 0.721569, 1)
LineEdit/colors/selection_color = Color(0.745098, 0.760784, 0.721569, 1)
LineEdit/font_sizes/font_size = 24
LineEdit/styles/focus = SubResource("StyleBoxEmpty_jl30t")
LineEdit/styles/normal = ExtResource("20_1xrl8")
LineEdit/styles/read_only = ExtResource("21_1jd57")
MenuButton/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
MenuButton/colors/font_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
MenuButton/colors/font_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
MenuButton/colors/font_outline_color = Color(0.941176, 0.964706, 0.909804, 1)
MenuButton/colors/font_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
MenuButton/styles/disabled = ExtResource("1_n3up8")
MenuButton/styles/focus = ExtResource("2_ukct7")
MenuButton/styles/hover = ExtResource("3_ukadi")
MenuButton/styles/normal = ExtResource("4_b2mp2")
MenuButton/styles/pressed = ExtResource("5_6rmq1")
OptionButton/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/colors/font_focus_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/colors/font_hover_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/colors/font_hover_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/colors/font_outline_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/colors/font_pressed_color = Color(0.941176, 0.964706, 0.909804, 1)
OptionButton/icons/arrow = ExtResource("22_qar1e")
Panel/styles/panel = SubResource("StyleBoxFlat_v2px0")
ProgressBar/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
ProgressBar/font_sizes/font_size = 16
ProgressBar/styles/background = ExtResource("23_r3p5f")
ProgressBar/styles/fill = ExtResource("24_twflh")
TabContainer/colors/font_selected_color = Color(0.941176, 0.964706, 0.909804, 1)
TabContainer/colors/font_unselected_color = Color(0.941176, 0.964706, 0.909804, 1)
TabContainer/font_sizes/font_size = 48
TabContainer/icons/decrement = ExtResource("25_tp1la")
TabContainer/icons/decrement_highlight = ExtResource("26_b6do7")
TabContainer/icons/increment = ExtResource("27_apyeg")
TabContainer/icons/increment_highlight = ExtResource("28_h4oun")
TabContainer/styles/panel = ExtResource("29_uo2g8")
TabContainer/styles/tab_disabled = ExtResource("30_e041s")
TabContainer/styles/tab_selected = ExtResource("31_0n7gu")
TabContainer/styles/tab_unselected = ExtResource("32_a2a8b")
TextEdit/colors/caret_color = Color(0.168627, 0.662745, 0.705882, 1)
TextEdit/colors/font_color = Color(0.941176, 0.964706, 0.909804, 1)
TextEdit/colors/font_selected_color = Color(0.168627, 0.662745, 0.705882, 1)
TextEdit/colors/selection_color = Color(0.745098, 0.760784, 0.721569, 1)
TextEdit/font_sizes/font_size = 24
TextEdit/styles/focus = SubResource("StyleBoxEmpty_rhkly")
TextEdit/styles/normal = ExtResource("20_1xrl8")
TextEdit/styles/read_only = ExtResource("21_1jd57")
VScrollBar/styles/grabber = ExtResource("33_wjjme")
VScrollBar/styles/grabber_highlight = ExtResource("34_y2stj")
VScrollBar/styles/grabber_pressed = ExtResource("35_q0217")
VScrollBar/styles/scroll = ExtResource("36_bu6rt")
VScrollBar/styles/scroll_focus = ExtResource("37_yr206")
VSlider/icons/grabber = ExtResource("15_ocljk")
VSlider/icons/grabber_disabled = ExtResource("16_rbxnn")
VSlider/icons/grabber_highlight = ExtResource("17_8a3cc")
VSlider/styles/grabber_area = ExtResource("38_wuc1e")
VSlider/styles/grabber_area_highlight = ExtResource("38_wuc1e")
VSlider/styles/slider = ExtResource("39_dl1e4")

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=5 format=3 uid="uid://cbfcolm6mjolp"]
[gd_scene load_steps=6 format=3 uid="uid://cbfcolm6mjolp"]
[ext_resource type="Script" path="res://Scripts/UI/SettingsMenu.gd" id="1_2rgd2"]
[ext_resource type="Script" path="res://Scripts/UI/Remaping/RemapController.gd" id="2_2f8ap"]
[ext_resource type="Script" path="res://Scripts/UI/Remaping/RemapButton.gd" id="2_4asaa"]
[ext_resource type="Theme" uid="uid://babphdknr2kkd" path="res://Assets/UI/Theme.tres" id="3_ajuuh"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_02uod"]
bg_color = Color(0.439216, 0.631373, 0.537255, 1)
@ -22,7 +23,7 @@ master_volume_slider = NodePath("Panel/MarginContainer/VBoxContainer/SettingsTab
music_volume_slider = NodePath("Panel/MarginContainer/VBoxContainer/SettingsTabs/Audio/ScrollView/MarginContainer/HBoxContainer/Item/MusicVolSlider")
sfx_volume_slider = NodePath("Panel/MarginContainer/VBoxContainer/SettingsTabs/Audio/ScrollView/MarginContainer/HBoxContainer/Item/SFXVolSlider")
[node name="Remap Controller" type="Control" parent="."]
[node name="Remap Controller" type="Control" parent="." node_paths=PackedStringArray("remap_buttons_holder")]
visible = false
layout_mode = 3
anchors_preset = 0
@ -31,6 +32,7 @@ offset_top = 12.0
offset_right = 12.0
offset_bottom = 12.0
script = ExtResource("2_2f8ap")
remap_buttons_holder = NodePath("../Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item")
[node name="Panel" type="Panel" parent="."]
anchors_preset = 15
@ -38,6 +40,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("3_ajuuh")
theme_override_styles/panel = SubResource("StyleBoxFlat_02uod")
[node name="MarginContainer" type="MarginContainer" parent="Panel"]
@ -341,6 +344,16 @@ layout_mode = 2
text = "Attack Controller
"
[node name="Spacer2" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Label"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
size_flags_horizontal = 3
[node name="ResetLabel" type="Label" parent="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Label"]
custom_minimum_size = Vector2(0, 48)
layout_mode = 2
text = "Reset to Defaults"
[node name="Spacer" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
@ -469,6 +482,16 @@ script = ExtResource("2_4asaa")
input_action_name = "attack_controller"
remap_controller = NodePath("../../../../../../../../../../Remap Controller")
[node name="Spacers2" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item"]
custom_minimum_size = Vector2(0, 32)
layout_mode = 2
size_flags_horizontal = 3
[node name="ResetButton" type="Button" parent="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item"]
custom_minimum_size = Vector2(400, 40)
layout_mode = 2
text = "Reset"
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 32
@ -501,4 +524,5 @@ text = "Back"
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AimLeftControllerRemapButton" to="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AimLeftControllerRemapButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AimRightControllerRemapButton" to="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AimRightControllerRemapButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AttackControllerRemapButton" to="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/AttackControllerRemapButton" method="_on_pressed"]
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/SettingsTabs/Controls/ScrollView/MarginContainer/HBoxContainer/Item/ResetButton" to="Remap Controller" method="_on_reset_button_pressed"]
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/MarginContainer/Back Button" to="." method="_on_back_pressed"]

View file

@ -2,6 +2,30 @@ extends Node
const SAVE_FILE : String = "user://SAVEFILE.save"
var game_data = {}
var default_game_data = {
"display_mode": 0,
"vsync_on": false,
"current_resolution_index": 0,
"master_volume": 0,
"music_volume": 0,
"sfx_volume": 0,
"controls": {
"move_up": KEY_W,
"move_left": KEY_A,
"move_down": KEY_S,
"move_right": KEY_D,
"attack": "m" + str(MOUSE_BUTTON_LEFT),
"move_up_controller": "j" + str(JOY_AXIS_LEFT_Y) + "/-1.00",
"move_left_controller": "j" + str(JOY_AXIS_LEFT_X) + "/-1.00",
"move_down_controller": "j" + str(JOY_AXIS_LEFT_Y) + "/1.00",
"move_right_controller": "j" + str(JOY_AXIS_LEFT_X) + "/1.00",
"attack_controller": "b" + str(JOY_BUTTON_A),
"aim_up_controller": "j" + str(JOY_AXIS_RIGHT_Y) + "/-1.00",
"aim_left_controller": "j" + str(JOY_AXIS_RIGHT_X) + "/-1.00",
"aim_down_controller": "j" + str(JOY_AXIS_RIGHT_Y) + "/1.00",
"aim_right_controller": "j" + str(JOY_AXIS_RIGHT_X) + "/1.00",
}
}
func _ready():
load_data()
@ -9,28 +33,7 @@ func _ready():
func load_data():
var file = FileAccess.open(SAVE_FILE, FileAccess.READ)
if file == null:
game_data = {
"display_mode": 0,
"vsync_on": false,
"current_resolution_index": 0,
"master_volume": 0,
"music_volume": 0,
"sfx_volume": 0,
"move_up": KEY_W,
"move_left": KEY_A,
"move_down": KEY_S,
"move_right": KEY_D,
"attack": "m" + str(MOUSE_BUTTON_LEFT),
"move_up_controller": "j" + str(JOY_AXIS_LEFT_Y) + "/-1.00",
"move_left_controller": "j" + str(JOY_AXIS_LEFT_X) + "/-1.00",
"move_down_controller": "j" + str(JOY_AXIS_LEFT_Y) + "/1.00",
"move_right_controller": "j" + str(JOY_AXIS_LEFT_X) + "/1.00",
"attack_controller": "b" + str(JOY_BUTTON_A),
"aim_up_controller": "j" + str(JOY_AXIS_RIGHT_Y) + "/-1.00",
"aim_left_controller": "j" + str(JOY_AXIS_RIGHT_X) + "/-1.00",
"aim_down_controller": "j" + str(JOY_AXIS_RIGHT_Y) + "/1.00",
"aim_right_controller": "j" + str(JOY_AXIS_RIGHT_X) + "/1.00",
}
game_data = default_game_data
save_data()
else:
game_data = file.get_var()

View file

@ -81,10 +81,38 @@ func update_sfx_volume(vol : int) -> void:
# Controls
func set_controls_from_save_file() -> void:
for remappable_input_action in remappable_input_actions:
var action = Save.game_data.keys().find(remappable_input_action)
var action = Save.game_data.controls.keys().find(remappable_input_action)
for key in InputMap.action_get_events(remappable_input_action):
InputMap.action_erase_event(remappable_input_action, key)
var binding = Save.game_data.values()[action]
var binding = Save.game_data.controls.values()[action]
var control_event
match str(binding)[0]:
"m":
binding = int(binding.right(binding.length()-1))
control_event = InputEventMouseButton.new()
control_event.button_index = binding
"b":
binding = int(binding.right(binding.length()-1))
control_event = InputEventJoypadButton.new()
control_event.button_index = binding
"j":
binding = binding.right(binding.length()-1)
binding = binding.split("/")
control_event = InputEventJoypadMotion.new()
control_event.axis = int(binding[0])
control_event.axis_value = float(binding[1])
_:
control_event = InputEventKey.new()
control_event.set_keycode(binding)
InputMap.action_add_event(remappable_input_action, control_event)
pass
func reset_controls_to_save_file() -> void:
for remappable_input_action in remappable_input_actions:
var action = Save.default_game_data.controls.keys().find(remappable_input_action)
for key in InputMap.action_get_events(remappable_input_action):
InputMap.action_erase_event(remappable_input_action, key)
var binding = Save.default_game_data.controls.values()[action]
var control_event
match str(binding)[0]:
"m":

View file

@ -4,7 +4,8 @@ extends Button
@export var remap_controller : Node
func _ready():
display_key()
self.add_to_group("RemappableButton")
self.display_key()
func display_key ():
self.text = "%s" % InputMap.action_get_events(input_action_name)[0].as_text()

View file

@ -2,6 +2,7 @@ extends Control
class_name RemapController
@export var min_time_between_remaps := 0.4
@export var remap_buttons_holder : VBoxContainer
var remap_button : Button
var remap_action : String
@ -52,14 +53,14 @@ func start_remap(button : Button, action : String):
func remap_key(event):
match str(event.get_class()):
"InputEventJoypadButton":
Save.game_data["%s" % [remap_action]] = "b" + str(event.button_index)
Save.game_data.controls["%s" % [remap_action]] = "b" + str(event.button_index)
"InputEventJoypadMotion":
if abs(event.axis_value) < 0.5: return
Save.game_data["%s" % [remap_action]] = "j" + str(event.axis) + str("/1.00" if event.axis_value > 0 else "/-1.00")
Save.game_data.controls["%s" % [remap_action]] = "j" + str(event.axis) + str("/1.00" if event.axis_value > 0 else "/-1.00")
"InputEventMouseButton":
Save.game_data["%s" % [remap_action]] = "m" + str(event.button_index)
Save.game_data.controls["%s" % [remap_action]] = "m" + str(event.button_index)
"InputEventKey":
Save.game_data["%s" % [remap_action]] = event.keycode
Save.game_data.controls["%s" % [remap_action]] = event.keycode
set_process_unhandled_key_input(false)
for key in InputMap.action_get_events(remap_action):
InputMap.action_erase_event(remap_action, key)
@ -70,3 +71,10 @@ func remap_key(event):
time_since_remap = 0
remap_button = null
pass
func _on_reset_button_pressed():
GlobalSettings.reset_controls_to_save_file()
for child in remap_buttons_holder.get_children():
if child is Button and child.is_in_group("RemappableButton"):
child.display_key()
pass

View file

@ -26,8 +26,8 @@ Save="*res://Scripts/SaveSystem/GameDataSaver.gd"
[display]
window/size/viewport_width=640
window/size/viewport_height=1000
window/size/viewport_width=1280
window/size/viewport_height=800
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"