mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 19:42:17 +08:00
UXAssist 1.2.4
This commit is contained in:
@@ -22,6 +22,12 @@ public class MyWindow : ManualBehaviour
|
||||
protected const float TabHeight = 27f;
|
||||
protected const float Margin = 30f;
|
||||
protected const float Spacing = 10f;
|
||||
protected event Action OnFree;
|
||||
|
||||
public override void _OnFree()
|
||||
{
|
||||
OnFree?.Invoke();
|
||||
}
|
||||
|
||||
public virtual void TryClose()
|
||||
{
|
||||
@@ -222,12 +228,14 @@ public class MyWindow : ManualBehaviour
|
||||
{
|
||||
var slider = MySlider.CreateSlider(x, y, parent, OnConfigValueChanged(config), valueMapper.Min, valueMapper.Max, format, width);
|
||||
slider.SetLabelText(valueMapper.FormatValue(format, config.Value));
|
||||
config.SettingChanged += (sender, args) =>
|
||||
EventHandler func = (_, _) =>
|
||||
{
|
||||
var index = OnConfigValueChanged(config);
|
||||
slider.Value = index;
|
||||
slider.SetLabelText(valueMapper.FormatValue(format, config.Value));
|
||||
};
|
||||
config.SettingChanged += func;
|
||||
OnFree += () => config.SettingChanged -= func;
|
||||
slider.OnValueChanged += () =>
|
||||
{
|
||||
var index = Mathf.RoundToInt(slider.Value);
|
||||
|
||||
Reference in New Issue
Block a user