Split project
This commit is contained in:
38
Manual/ModuleBoolValueParameterSetter.cs
Normal file
38
Manual/ModuleBoolValueParameterSetter.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Godot;
|
||||
using Nocturnis.DataStructures.ConfigurableParameters;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
public partial class ModuleBoolValueParameterSetter : ModuleParameterSetter
|
||||
{
|
||||
private CheckButton ToggleSetter { get; set; }
|
||||
private Label TrueLabel { get; set; }
|
||||
private Label FalseLabel { get; set; }
|
||||
|
||||
public void Init(IBoolParameter parameter)
|
||||
{
|
||||
UnderlyingParameter = parameter;
|
||||
InitFlag = true;
|
||||
}
|
||||
|
||||
public new IBoolParameter UnderlyingParameter
|
||||
{
|
||||
get => (base.UnderlyingParameter as IBoolParameter)!;
|
||||
set => base.UnderlyingParameter = value;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (!InitFlag)
|
||||
throw new Exception("TODO - INIT NEED");
|
||||
ToggleSetter = GetNode<CheckButton>("ToggleSetter");
|
||||
TrueLabel = GetNode<Label>("TrueLabel");
|
||||
FalseLabel = GetNode<Label>("FalseLabel");
|
||||
ToggleSetter.ButtonPressed = UnderlyingParameter.ParameterValue;
|
||||
TrueLabel.Text = UnderlyingParameter.TrueDescription;
|
||||
FalseLabel.Text = UnderlyingParameter.FalseDescription;
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
private void ToggleHandler(bool val) => UnderlyingParameter.ParameterValue = val;
|
||||
}
|
||||
Reference in New Issue
Block a user