Split project

This commit is contained in:
h z
2024-06-29 06:35:23 +08:00
parent b26404abd2
commit 117835b503
45 changed files with 1972 additions and 26 deletions

View File

@@ -0,0 +1,46 @@
using Godot;
using Nocturnis.DataStructures.ConfigurableParameters;
namespace Enigmos.Manual;
public partial class ModuleKeyValueParameterSetter : ModuleParameterSetter
{
public new IKeyParameter UnderlyingParameter
{
get => (base.UnderlyingParameter as IKeyParameter)!;
set => base.UnderlyingParameter = value;
}
private Button Binding { get; set; }
private bool ReadyToBind { get; set; }
public void Init(IKeyParameter parameter)
{
UnderlyingParameter = parameter;
ReadyToBind = false;
}
public override void _Ready()
{
Binding = GetNode<Button>("Binding");
}
private void StartBind()
{
Binding.Text = "Press a Key";
InputMap.ActionEraseEvents(UnderlyingParameter.ParameterValue);
ReadyToBind = true;
}
public override void _Input(InputEvent @event)
{
if (ReadyToBind && @event is InputEventKey keyEvent)
{
InputMap.ActionAddEvent(UnderlyingParameter.ParameterValue, keyEvent);
Binding.Text = keyEvent.AsTextKeyLabel();
ReadyToBind = false;
}
base._Input(@event);
}
}