1
0
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:
2024-09-24 00:33:41 +08:00
parent daaf7b4901
commit 237830fc91
13 changed files with 149 additions and 73 deletions

View File

@@ -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);