Split project
This commit is contained in:
42
Manual/ModuleCharValueParameterSetter.cs
Normal file
42
Manual/ModuleCharValueParameterSetter.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Godot;
|
||||
using Nocturnis.DataStructures.ConfigurableParameters;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
public partial class ModuleCharValueParameterSetter : ModuleParameterSetter
|
||||
{
|
||||
private LineEdit CharInput { get; set; }
|
||||
private Button Apply { get; set; }
|
||||
private Label ExtraInformation { get; set; }
|
||||
|
||||
public void Init(ICharParameter parameter)
|
||||
{
|
||||
UnderlyingParameter = parameter;
|
||||
InitFlag = true;
|
||||
}
|
||||
|
||||
public new ICharParameter UnderlyingParameter
|
||||
{
|
||||
get => (base.UnderlyingParameter as ICharParameter)!;
|
||||
set => base.UnderlyingParameter = value;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (!InitFlag)
|
||||
throw new Exception("TODO - INIT NEED");
|
||||
Description = GetNode<Label>("Description");
|
||||
Apply = GetNode<Button>("Apply");
|
||||
CharInput = GetNode<LineEdit>("CharInput");
|
||||
ExtraInformation = GetNode<Label>("ExtraInformation");
|
||||
Description.Text = UnderlyingParameter.ParameterName;
|
||||
CharInput.Text = UnderlyingParameter.ParameterValue.ToString();
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
private void ApplyChange()
|
||||
{
|
||||
UnderlyingParameter.ParameterValue = CharInput.Text[0];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user