1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-02-05 05:02:20 +08:00

work in progress

This commit is contained in:
2025-04-20 20:36:52 +08:00
parent f32b11f49a
commit 3d54a1a83e
10 changed files with 227 additions and 102 deletions

View File

@@ -245,6 +245,14 @@ public class MyWindow : ManualBehaviour
return comboBox;
}
public MySmallComboBox AddSmallComboBox(float x, float y, RectTransform parent, int fontSize = 15)
{
var comboBox = MySmallComboBox.CreateComboBox(x, y, parent).WithFontSize(fontSize);
_maxX = Math.Max(_maxX, x + comboBox.Width);
MaxY = Math.Max(MaxY, y + comboBox.Height);
return comboBox;
}
#region Slider
public class ValueMapper<T>
{
@@ -315,9 +323,9 @@ public class MyWindow : ManualBehaviour
return slider;
}
public MySlider AddSlider<T>(float x, float y, RectTransform parent, ConfigEntry<T> config, ValueMapper<T> valueMapper, string format = "G", float width = 0f, float textWidth = 0f)
public MySlider AddSlider<T>(float x, float y, RectTransform parent, ConfigEntry<T> config, ValueMapper<T> valueMapper, string format = "G", float width = 0f)
{
var slider = MySlider.CreateSlider(x, y, parent, OnConfigValueChanged(config), valueMapper.Min, valueMapper.Max, format, width, textWidth);
var slider = MySlider.CreateSlider(x, y, parent, OnConfigValueChanged(config), valueMapper.Min, valueMapper.Max, format, width);
slider.SetLabelText(valueMapper.FormatValue(format, config.Value));
config.SettingChanged += SettingsChanged;
OnFree += () => config.SettingChanged -= SettingsChanged;
@@ -558,6 +566,7 @@ public abstract class MyWindowManager
MyWindow.InitBaseObject();
MyCheckBox.InitBaseObject();
MyComboBox.InitBaseObject();
MySmallComboBox.InitBaseObject();
}
public static T CreateWindow<T>(string name, string title = "") where T : MyWindow