Added exit button
Added DunFlow panel Some UI improvements
This commit is contained in:
parent
1407e39703
commit
e9c8da9c51
18 changed files with 427 additions and 130 deletions
|
@ -0,0 +1,45 @@
|
|||
using DunGen;
|
||||
using DunGenPlus.DevTools.UIElements.Collections;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
|
||||
namespace DunGenPlus.DevTools.UIElements
|
||||
{
|
||||
internal class FloatRangeInputField : BaseInputField<FloatRange> {
|
||||
|
||||
public TMP_InputField minInputField;
|
||||
public TMP_InputField maxInputField;
|
||||
private FloatRange _value;
|
||||
|
||||
public void SetupInputField(TitleParameter titleParameter, FloatRange baseValue, Action<FloatRange> setAction) {
|
||||
SetupBase(titleParameter);
|
||||
|
||||
minInputField.onValueChanged.AddListener((t) => SetMinValue(setAction, t));
|
||||
maxInputField.onValueChanged.AddListener((t) => SetMaxValue(setAction, t));
|
||||
|
||||
Set(baseValue);
|
||||
}
|
||||
|
||||
private void SetMinValue(Action<FloatRange> setAction, string text){
|
||||
Plugin.logger.LogInfo($"Setting {title}.min to {text}");
|
||||
_value.Min = ParseTextFloat(text);
|
||||
setAction.Invoke(_value);
|
||||
}
|
||||
|
||||
private void SetMaxValue(Action<FloatRange> setAction, string text){
|
||||
Plugin.logger.LogInfo($"Setting {title}.max to {text}");
|
||||
_value.Max = ParseTextFloat(text);
|
||||
setAction.Invoke(_value);
|
||||
}
|
||||
|
||||
public override void Set(FloatRange value){
|
||||
_value = value;
|
||||
minInputField.text = value.Min.ToString();
|
||||
maxInputField.text = value.Max.ToString();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue