Button remapping work
This commit is contained in:
19
Zennysoft.Game.Ma/src/options/InputMapButton.cs
Normal file
19
Zennysoft.Game.Ma/src/options/InputMapButton.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public abstract partial class InputMapButton : Button
|
||||
{
|
||||
[Signal] public delegate void RemapEventHandler(InputMapButton buttonBeingRemapped);
|
||||
|
||||
public string Action { get; set; }
|
||||
|
||||
public InputEvent InputEvent { get; set; }
|
||||
|
||||
public InputMapButton()
|
||||
{
|
||||
Pressed += RemapButton_Pressed;
|
||||
}
|
||||
|
||||
private void RemapButton_Pressed() => EmitSignal(SignalName.Remap, this);
|
||||
}
|
||||
1
Zennysoft.Game.Ma/src/options/InputMapButton.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/InputMapButton.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bhfrdlnv7xyf6
|
||||
191
Zennysoft.Game.Ma/src/options/InputMapper.cs
Normal file
191
Zennysoft.Game.Ma/src/options/InputMapper.cs
Normal file
@@ -0,0 +1,191 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using NathanHoad;
|
||||
using SimpleInjector.Lifestyles;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
using Zennysoft.Game.Implementation;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class InputMapper : PanelContainer
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node] public VBoxContainer ActionList { get; set; }
|
||||
|
||||
[Node] public KeyboardRemapButton MoveForwardKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton MoveForwardController { get; set; }
|
||||
[Node] public KeyboardRemapButton MoveLeftKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton MoveLeftController { get; set; }
|
||||
[Node] public KeyboardRemapButton MoveRightKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton MoveRightController { get; set; }
|
||||
[Node] public KeyboardRemapButton MoveBackwardKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton MoveBackwardController { get; set; }
|
||||
[Node] public KeyboardRemapButton StrafeLeftKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton StrafeLeftController { get; set; }
|
||||
[Node] public KeyboardRemapButton StrafeRightKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton StrafeRightController { get; set; }
|
||||
[Node] public KeyboardRemapButton AttackKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton AttackController { get; set; }
|
||||
[Node] public KeyboardRemapButton InteractKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton InteractController { get; set; }
|
||||
[Node] public KeyboardRemapButton InventoryKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton InventoryController { get; set; }
|
||||
[Node] public KeyboardRemapButton SortKeyboard { get; set; }
|
||||
[Node] public JoypadRemapButton SortController { get; set; }
|
||||
|
||||
private Button _remappingButton = null;
|
||||
private InputEvent _remappingAction = null;
|
||||
|
||||
private List<JoypadRemapButton> _actionJoyMap = [];
|
||||
private List<KeyboardRemapButton> _actionKeyMap = [];
|
||||
|
||||
private SimpleInjector.Container _container;
|
||||
private ISaveFileManager _saveFileManager;
|
||||
|
||||
[Signal] public delegate void SaveControllerInputEventHandler();
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
_container = new SimpleInjector.Container();
|
||||
_container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
|
||||
_container.RegisterSingleton<IFileSystem, FileSystem>();
|
||||
_container.RegisterSingleton<ISaveFileManager, SaveFileManager>();
|
||||
_saveFileManager = _container.GetInstance<ISaveFileManager>();
|
||||
|
||||
MoveForwardController.Action = GameInputs.MoveUp;
|
||||
MoveForwardKeyboard.Action = GameInputs.MoveUp;
|
||||
MoveLeftController.Action = GameInputs.MoveLeft;
|
||||
MoveLeftKeyboard.Action = GameInputs.MoveLeft;
|
||||
MoveRightController.Action = GameInputs.MoveRight;
|
||||
MoveRightKeyboard.Action = GameInputs.MoveRight;
|
||||
MoveBackwardController.Action = GameInputs.MoveDown;
|
||||
MoveBackwardKeyboard.Action = GameInputs.MoveDown;
|
||||
StrafeLeftController.Action = GameInputs.StrafeLeft;
|
||||
StrafeLeftKeyboard.Action = GameInputs.StrafeLeft;
|
||||
StrafeRightController.Action = GameInputs.StrafeRight;
|
||||
StrafeRightKeyboard.Action = GameInputs.StrafeRight;
|
||||
AttackController.Action = GameInputs.Attack;
|
||||
AttackKeyboard.Action = GameInputs.Attack;
|
||||
InteractController.Action = GameInputs.Interact;
|
||||
InteractKeyboard.Action = GameInputs.Interact;
|
||||
InventoryController.Action = GameInputs.Inventory;
|
||||
InventoryKeyboard.Action = GameInputs.Inventory;
|
||||
SortController.Action = GameInputs.InventorySort;
|
||||
SortKeyboard.Action = GameInputs.InventorySort;
|
||||
|
||||
_actionJoyMap.Add(MoveForwardController);
|
||||
_actionJoyMap.Add(MoveLeftController);
|
||||
_actionJoyMap.Add(MoveRightController);
|
||||
_actionJoyMap.Add(MoveBackwardController);
|
||||
_actionJoyMap.Add(StrafeLeftController);
|
||||
_actionJoyMap.Add(StrafeRightController);
|
||||
_actionJoyMap.Add(AttackController);
|
||||
_actionJoyMap.Add(InteractController);
|
||||
_actionJoyMap.Add(InventoryController);
|
||||
_actionJoyMap.Add(SortController);
|
||||
|
||||
_actionKeyMap.Add(MoveForwardKeyboard);
|
||||
_actionKeyMap.Add(MoveLeftKeyboard);
|
||||
_actionKeyMap.Add(MoveRightKeyboard);
|
||||
_actionKeyMap.Add(MoveBackwardKeyboard);
|
||||
_actionKeyMap.Add(StrafeLeftKeyboard);
|
||||
_actionKeyMap.Add(StrafeRightKeyboard);
|
||||
_actionKeyMap.Add(AttackKeyboard);
|
||||
_actionKeyMap.Add(InteractKeyboard);
|
||||
_actionKeyMap.Add(InventoryKeyboard);
|
||||
_actionKeyMap.Add(SortKeyboard);
|
||||
|
||||
MoveForwardKeyboard.Remap += OnRemap;
|
||||
MoveForwardController.Remap += OnRemap;
|
||||
MoveLeftKeyboard.Remap += OnRemap;
|
||||
MoveLeftController.Remap += OnRemap;
|
||||
MoveRightKeyboard.Remap += OnRemap;
|
||||
MoveRightController.Remap += OnRemap;
|
||||
MoveBackwardKeyboard.Remap += OnRemap;
|
||||
MoveBackwardController.Remap += OnRemap;
|
||||
StrafeLeftKeyboard.Remap += OnRemap;
|
||||
StrafeLeftController.Remap += OnRemap;
|
||||
StrafeRightKeyboard.Remap += OnRemap;
|
||||
StrafeRightController.Remap += OnRemap;
|
||||
AttackKeyboard.Remap += OnRemap;
|
||||
AttackController.Remap += OnRemap;
|
||||
InteractKeyboard.Remap += OnRemap;
|
||||
InteractController.Remap += OnRemap;
|
||||
InventoryKeyboard.Remap += OnRemap;
|
||||
InventoryController.Remap += OnRemap;
|
||||
SortKeyboard.Remap += OnRemap;
|
||||
SortController.Remap += OnRemap;
|
||||
|
||||
InputHelper.JoypadInputChanged += (string action, InputEvent input) =>
|
||||
{
|
||||
var buttonChanged = _actionJoyMap.SingleOrDefault(x => x.Action == action);
|
||||
if (buttonChanged != null)
|
||||
{
|
||||
buttonChanged.SetProcessInput(false);
|
||||
buttonChanged.Text = InputHelper.GetLabelForInput(input);
|
||||
}
|
||||
var allButtons = _actionKeyMap.Concat<InputMapButton>(_actionJoyMap);
|
||||
foreach (var button in allButtons)
|
||||
button.Disabled = false;
|
||||
};
|
||||
|
||||
InputHelper.KeyboardInputChanged += (string action, InputEvent input) =>
|
||||
{
|
||||
var buttonChanged = _actionKeyMap.SingleOrDefault(x => x.Action == action);
|
||||
if (buttonChanged != null)
|
||||
{
|
||||
buttonChanged.SetProcessInput(false);
|
||||
buttonChanged.Text = InputHelper.GetLabelForInput(input);
|
||||
}
|
||||
var allButtons = _actionKeyMap.Concat<InputMapButton>(_actionJoyMap);
|
||||
foreach (var button in allButtons)
|
||||
button.Disabled = false;
|
||||
};
|
||||
}
|
||||
|
||||
public void LoadControllerInput(string jsonData)
|
||||
{
|
||||
InputHelper.DeserializeInputsForActions(jsonData);
|
||||
InitializeButtonText();
|
||||
}
|
||||
|
||||
public void InitializeButtonText()
|
||||
{
|
||||
MoveForwardKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.MoveUp));
|
||||
MoveForwardController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.MoveUp));
|
||||
MoveLeftKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.MoveLeft));
|
||||
MoveLeftController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.MoveLeft));
|
||||
MoveRightKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.MoveRight));
|
||||
MoveRightController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.MoveRight));
|
||||
MoveBackwardKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.MoveDown));
|
||||
MoveBackwardController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.MoveDown));
|
||||
StrafeLeftKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.StrafeLeft));
|
||||
StrafeLeftController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.StrafeLeft));
|
||||
StrafeRightKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.StrafeRight));
|
||||
StrafeRightController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.StrafeRight));
|
||||
AttackKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.Attack));
|
||||
AttackController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.Attack));
|
||||
InteractKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.Interact));
|
||||
InteractController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.Interact));
|
||||
InventoryKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.Inventory));
|
||||
InventoryController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.Inventory));
|
||||
SortKeyboard.Text = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.InventorySort));
|
||||
SortController.Text = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.InventorySort));
|
||||
}
|
||||
|
||||
private void OnRemap(InputMapButton inputButton)
|
||||
{
|
||||
inputButton.Text = "...";
|
||||
inputButton.SetProcessInput(true);
|
||||
var allButtons = _actionKeyMap.Concat<InputMapButton>(_actionJoyMap);
|
||||
foreach (var button in allButtons)
|
||||
button.Disabled = true;
|
||||
ReleaseFocus();
|
||||
}
|
||||
}
|
||||
1
Zennysoft.Game.Ma/src/options/InputMapper.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/InputMapper.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c6lw5yp8p0wb5
|
||||
361
Zennysoft.Game.Ma/src/options/InputMapper.tscn
Normal file
361
Zennysoft.Game.Ma/src/options/InputMapper.tscn
Normal file
@@ -0,0 +1,361 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dk5esf6mm6kte"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6lw5yp8p0wb5" path="res://src/options/InputMapper.cs" id="1_rwvs3"]
|
||||
[ext_resource type="Script" uid="uid://b70br20xue678" path="res://src/options/KeyboardRemapButton.cs" id="2_fmxfy"]
|
||||
[ext_resource type="Script" uid="uid://bo7vk56h1lr07" path="res://src/options/JoypadRemapButton.cs" id="3_yis0i"]
|
||||
|
||||
[node name="InputMapper" type="PanelContainer"]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -451.0
|
||||
offset_top = -451.0
|
||||
offset_right = 449.0
|
||||
offset_bottom = 449.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_rwvs3")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 2
|
||||
mouse_filter = 0
|
||||
theme_override_constants/margin_left = 25
|
||||
theme_override_constants/margin_top = 25
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 25
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 3
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ActionList" type="VBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="Header" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Header"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Actions"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Header"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Header"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Keyboard"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Header"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label3" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Header"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Controller"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Move Forward" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Forward"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Move Forward"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Forward"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveForwardKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Forward"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Forward"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveForwardController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Forward"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Move Left" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Left"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Move Left"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Left"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveLeftKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Left"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Left"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveLeftController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Left"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Move Right" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Right"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Move Right"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Right"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveRightKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Right"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Right"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveRightController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Right"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Move Backward" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Backward"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Move Backward"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Backward"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveBackwardKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Backward"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Backward"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="MoveBackwardController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Move Backward"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Strafe Left" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Left"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Strafe Left"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Left"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="StrafeLeftKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Left"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Left"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="StrafeLeftController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Left"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Strafe Right" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Right"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Strafe Right"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Right"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="StrafeRightKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Right"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Right"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="StrafeRightController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Strafe Right"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Attack" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Attack"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Attack"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Attack"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="AttackKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Attack"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Attack"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="AttackController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Attack"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Interact" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Interact"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Interact"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Interact"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="InteractKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Interact"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Interact"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="InteractController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Interact"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Open Inventory" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Open Inventory"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Open Inventory"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Open Inventory"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="InventoryKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Open Inventory"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Open Inventory"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="InventoryController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Open Inventory"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
|
||||
[node name="Sort Inventory" type="HBoxContainer" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Sort Inventory"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Sort Inventory"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Sort Inventory"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SortKeyboard" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Sort Inventory"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 35)
|
||||
layout_mode = 2
|
||||
script = ExtResource("2_fmxfy")
|
||||
|
||||
[node name="Control2" type="Control" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Sort Inventory"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SortController" type="Button" parent="MarginContainer/VBoxContainer/ScrollContainer/ActionList/Sort Inventory"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
script = ExtResource("3_yis0i")
|
||||
1
Zennysoft.Game.Ma/src/options/InputToString.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/InputToString.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bwd066xv65pbi
|
||||
41
Zennysoft.Game.Ma/src/options/JoypadRemapButton.cs
Normal file
41
Zennysoft.Game.Ma/src/options/JoypadRemapButton.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Godot;
|
||||
using NathanHoad;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public partial class JoypadRemapButton : InputMapButton
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
SetProcessInput(false);
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionType() && InputHelper.GetDeviceFromEvent(@event) != "keyboard")
|
||||
{
|
||||
if (InputHelper.GetJoypadInputForAction(GameInputs.Pause).IsMatch(@event))
|
||||
{
|
||||
InputHelper.SetJoypadInputForAction(Action, InputEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
InputHelper.ReplaceJoypadInputForAction(Action, InputEvent, @event, true);
|
||||
if (Action == GameInputs.MoveUp)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiUp, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveLeft)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiLeft, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveRight)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiRight, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveDown)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiDown, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.Attack)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiAccept, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.Interact)
|
||||
InputHelper.ReplaceJoypadInputForAction(GameInputs.UiCancel, InputEvent, @event, true);
|
||||
InputEvent = @event;
|
||||
}
|
||||
}
|
||||
AcceptEvent();
|
||||
}
|
||||
}
|
||||
1
Zennysoft.Game.Ma/src/options/JoypadRemapButton.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/JoypadRemapButton.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bo7vk56h1lr07
|
||||
42
Zennysoft.Game.Ma/src/options/KeyboardRemapButton.cs
Normal file
42
Zennysoft.Game.Ma/src/options/KeyboardRemapButton.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Godot;
|
||||
using NathanHoad;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public partial class KeyboardRemapButton : InputMapButton
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
SetProcessInput(false);
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
AcceptEvent();
|
||||
if (@event.IsActionType() && InputHelper.GetDeviceFromEvent(@event) == "keyboard")
|
||||
{
|
||||
if (InputHelper.GetKeyboardInputForAction(GameInputs.Pause).IsMatch(@event))
|
||||
{
|
||||
InputHelper.SetKeyboardInputForAction(Action, InputEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
InputHelper.ReplaceKeyboardInputForAction(Action, InputEvent, @event, true);
|
||||
if (Action == GameInputs.MoveUp)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiUp, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveLeft)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiLeft, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveRight)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiRight, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.MoveDown)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiDown, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.Attack)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiAccept, InputEvent, @event, true);
|
||||
else if (Action == GameInputs.Interact)
|
||||
InputHelper.ReplaceKeyboardInputForAction(GameInputs.UiCancel, InputEvent, @event, true);
|
||||
InputEvent = @event;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
Zennysoft.Game.Ma/src/options/KeyboardRemapButton.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/KeyboardRemapButton.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b70br20xue678
|
||||
21
Zennysoft.Game.Ma/src/options/OptionsData.cs
Normal file
21
Zennysoft.Game.Ma/src/options/OptionsData.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta, Id("options_data")]
|
||||
public partial class OptionsData : Node
|
||||
{
|
||||
[Save("MasterVolume")]
|
||||
public required double MasterVolumeLevel { get; set; }
|
||||
|
||||
[Save("MusicVolume")]
|
||||
public required double MusicVolumeLevel { get; set; }
|
||||
|
||||
[Save("SFXVolume")]
|
||||
public required double SFXVolumeLevel { get; set; }
|
||||
|
||||
[Save("ScreenResolution")]
|
||||
public required int ScreenResolution { get; set; }
|
||||
}
|
||||
1
Zennysoft.Game.Ma/src/options/OptionsData.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/options/OptionsData.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://jrl2hyudv6jn
|
||||
@@ -1,7 +1,8 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using NathanHoad;
|
||||
using System.Linq;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -15,7 +16,12 @@ public partial class OptionsMenu : Control
|
||||
[Node] public HSlider MasterVolumeSlider { get; set; }
|
||||
[Node] public HSlider MusicVolumeSlider { get; set; }
|
||||
[Node] public HSlider SFXVolumeSlider { get; set; }
|
||||
[Node] public Button SaveAndExitButton { get; set; }
|
||||
|
||||
[Node] public InputMapper Controller { get; set; }
|
||||
[Node] public TabContainer TabContainer { get; set; }
|
||||
[Node] public Label PressToGoBackLabel { get; set; }
|
||||
|
||||
[Node] public CanvasLayer CanvasLayer { get; set; }
|
||||
|
||||
public OptionsData OptionsData;
|
||||
|
||||
@@ -48,11 +54,65 @@ public partial class OptionsMenu : Control
|
||||
|
||||
ResolutionOptions.ItemSelected += ResolutionOptions_ItemSelected;
|
||||
|
||||
SaveAndExitButton.ButtonUp += SaveAndExitButton_ButtonUp;
|
||||
TabContainer.TabChanged += TabContainer_TabChanged;
|
||||
|
||||
_masterBusIndex = AudioServer.GetBusIndex("Master");
|
||||
_musicBusIndex = AudioServer.GetBusIndex("MUSIC");
|
||||
_sfxBusIndex = AudioServer.GetBusIndex("SFX");
|
||||
|
||||
VisibilityChanged += OptionsMenu_VisibilityChanged;
|
||||
|
||||
InputHelper.JoypadInputChanged += (string action, InputEvent input) =>
|
||||
{
|
||||
if (GameInputs.Interact == action)
|
||||
{
|
||||
var interactInputs = InputHelper.GetLabelForInput(InputHelper.GetJoypadInputForAction(GameInputs.Interact));
|
||||
PressToGoBackLabel.Text = $"Press {interactInputs} to save and exit.";
|
||||
}
|
||||
};
|
||||
|
||||
InputHelper.KeyboardInputChanged += (string action, InputEvent input) =>
|
||||
{
|
||||
if (GameInputs.Interact == action)
|
||||
{
|
||||
var interactInputs = InputHelper.GetLabelForInput(InputHelper.GetKeyboardInputForAction(GameInputs.Interact));
|
||||
PressToGoBackLabel.Text = $"Press {interactInputs} to save and exit.";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void TabContainer_TabChanged(long tab)
|
||||
{
|
||||
if (tab == 0)
|
||||
MasterVolumeSlider.GrabFocus();
|
||||
if (tab == 1)
|
||||
Controller.MoveForwardKeyboard.GrabFocus();
|
||||
}
|
||||
|
||||
private void OptionsMenu_VisibilityChanged() => CanvasLayer.Visible = !CanvasLayer.Visible;
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
var interactInputs = InputHelper.GetKeyboardOrJoypadInputsForAction(GameInputs.Interact);
|
||||
if (interactInputs.Any(x => x.IsMatch(@event)))
|
||||
{
|
||||
AcceptEvent();
|
||||
SaveAndExitMenu();
|
||||
}
|
||||
|
||||
var leftTab = InputHelper.GetKeyboardOrJoypadInputsForAction(GameInputs.StrafeLeft);
|
||||
if (leftTab.Any(x => x.IsMatch(@event)))
|
||||
{
|
||||
AcceptEvent();
|
||||
TabContainer.CurrentTab = Mathf.Max(0, TabContainer.CurrentTab - 1);
|
||||
}
|
||||
|
||||
var rightTab = InputHelper.GetKeyboardOrJoypadInputsForAction(GameInputs.StrafeRight);
|
||||
if (rightTab.Any(x => x.IsMatch(@event)))
|
||||
{
|
||||
AcceptEvent();
|
||||
TabContainer.CurrentTab = Mathf.Min(TabContainer.GetTabCount() - 1, TabContainer.CurrentTab + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void ResolutionOptions_ItemSelected(long index)
|
||||
@@ -71,7 +131,7 @@ public partial class OptionsMenu : Control
|
||||
DisplayServer.WindowSetMode(_windowModes[optionsData.ScreenResolution]);
|
||||
}
|
||||
|
||||
private void SaveAndExitButton_ButtonUp() => EmitSignal(SignalName.OptionsMenuExited);
|
||||
private void SaveAndExitMenu() => EmitSignal(SignalName.OptionsMenuExited);
|
||||
|
||||
private void MasterVolumeSlider_Changed(double valueChanged)
|
||||
{
|
||||
@@ -90,20 +150,4 @@ public partial class OptionsMenu : Control
|
||||
OptionsData.SFXVolumeLevel = valueChanged;
|
||||
AudioServer.SetBusVolumeDb(_sfxBusIndex, Mathf.LinearToDb((float)valueChanged));
|
||||
}
|
||||
}
|
||||
|
||||
[Meta, Id("options_data")]
|
||||
public partial class OptionsData : Node
|
||||
{
|
||||
[Save("MasterVolume")]
|
||||
public required double MasterVolumeLevel { get; set; }
|
||||
|
||||
[Save("MusicVolume")]
|
||||
public required double MusicVolumeLevel { get; set; }
|
||||
|
||||
[Save("SFXVolume")]
|
||||
public required double SFXVolumeLevel { get; set; }
|
||||
|
||||
[Save("ScreenResolution")]
|
||||
public required int ScreenResolution { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://drkl3btdy6uxj"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://drkl3btdy6uxj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cjxmdvhixcj6e" path="res://src/options/OptionsMenu.cs" id="1_jli36"]
|
||||
[ext_resource type="Shortcut" uid="uid://dumkrjur22k2a" path="res://src/ui/ButtonShortcut.tres" id="2_1egkf"]
|
||||
[ext_resource type="PackedScene" uid="uid://dk5esf6mm6kte" path="res://src/options/InputMapper.tscn" id="2_utd4g"]
|
||||
|
||||
[sub_resource type="StyleBoxLine" id="StyleBoxLine_jli36"]
|
||||
|
||||
@@ -18,43 +20,50 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_jli36")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.137255, 0.121569, 0.12549, 1)
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
[node name="CenterContainer" type="AspectRatioContainer" parent="CanvasLayer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/CenterContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="CanvasLayer/CenterContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(1280, 960)
|
||||
layout_mode = 2
|
||||
current_tab = 0
|
||||
|
||||
[node name="Audio" type="MarginContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 100
|
||||
theme_override_constants/margin_top = 100
|
||||
theme_override_constants/margin_right = 100
|
||||
theme_override_constants/margin_bottom = 100
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
mouse_filter = 0
|
||||
|
||||
[node name="MasterVolume" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="MasterVolume" type="HBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VolumeLabel" type="Label" parent="MarginContainer/VBoxContainer/MasterVolume"]
|
||||
[node name="VolumeLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/MasterVolume"]
|
||||
custom_minimum_size = Vector2(125, 0)
|
||||
layout_mode = 2
|
||||
text = "Master Volume"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="MasterVolumeSlider" type="HSlider" parent="MarginContainer/VBoxContainer/MasterVolume"]
|
||||
[node name="MasterVolumeSlider" type="HSlider" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/MasterVolume"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
@@ -66,16 +75,16 @@ max_value = 1.0
|
||||
step = 0.001
|
||||
value = 1.0
|
||||
|
||||
[node name="MusicVolume" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="MusicVolume" type="HBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VolumeLabel" type="Label" parent="MarginContainer/VBoxContainer/MusicVolume"]
|
||||
[node name="VolumeLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/MusicVolume"]
|
||||
custom_minimum_size = Vector2(125, 0)
|
||||
layout_mode = 2
|
||||
text = "Music Volume"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="MusicVolumeSlider" type="HSlider" parent="MarginContainer/VBoxContainer/MusicVolume"]
|
||||
[node name="MusicVolumeSlider" type="HSlider" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/MusicVolume"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
@@ -87,16 +96,16 @@ max_value = 1.0
|
||||
step = 0.001
|
||||
value = 1.0
|
||||
|
||||
[node name="SFXVolume" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="SFXVolume" type="HBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VolumeLabel" type="Label" parent="MarginContainer/VBoxContainer/SFXVolume"]
|
||||
[node name="VolumeLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/SFXVolume"]
|
||||
custom_minimum_size = Vector2(125, 0)
|
||||
layout_mode = 2
|
||||
text = "SFX Volume"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="SFXVolumeSlider" type="HSlider" parent="MarginContainer/VBoxContainer/SFXVolume"]
|
||||
[node name="SFXVolumeSlider" type="HSlider" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/SFXVolume"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
@@ -108,27 +117,33 @@ max_value = 1.0
|
||||
step = 0.001
|
||||
value = 1.0
|
||||
|
||||
[node name="Resolution" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="Resolution" type="HBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ResolutionLabel" type="Label" parent="MarginContainer/VBoxContainer/Resolution"]
|
||||
[node name="ResolutionLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/Resolution"]
|
||||
custom_minimum_size = Vector2(125, 0)
|
||||
layout_mode = 2
|
||||
text = "Resolution: "
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="ResolutionOptions" type="OptionButton" parent="MarginContainer/VBoxContainer/Resolution"]
|
||||
[node name="ResolutionOptions" type="OptionButton" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer/Resolution"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
shortcut = ExtResource("2_1egkf")
|
||||
flat = true
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer/Audio/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="SaveAndExitButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
[node name="Controller" parent="CanvasLayer/CenterContainer/VBoxContainer/TabContainer" instance=ExtResource("2_utd4g")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(150, 75)
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Save and Exit"
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="PressToGoBackLabel" type="Label" parent="CanvasLayer/CenterContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Press "
|
||||
|
||||
Reference in New Issue
Block a user