diff --git a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs index 57f213c..c4a82fd 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs @@ -1,6 +1,8 @@ using Elements.Core; +using Elements.Quantity; using FrooxEngine; using MonkeyLoader.Configuration; +using MonkeyLoader.Resonite.Configuration; using System; namespace MonkeyLoader.Resonite.UI.Tooltips @@ -13,16 +15,17 @@ public sealed class TooltipConfig : SingletonConfigSection private static readonly DefiningConfigKey _backgroundColorKey = new("BackgroundColor", "Sets the background color of a tooltip.", () => RadiantUI_Constants.BG_COLOR); private static readonly DefiningConfigKey _enableDebugButtonData = new("EnableDebugButtonData", "Controls whether debug data for missing button tooltips is logged. Useful when wanting to add new labels.", () => false); private static readonly DefiningConfigKey _enableNonLocalTooltips = new("EnableNonLocalTooltips", "When enabled, tooltips are created as regular slots instead of local ones. Can be used to show them to others. Experimental.", () => false); - private static readonly DefiningConfigKey _textColorKey = new("TextColor", "Sets the text color of a tooltip.", () => RadiantUI_Constants.TEXT_COLOR); - private static readonly DefiningConfigKey _textScaleKey = new("TextSize", "Sets the size of the text on a tooltip.", () => 1f) + private static readonly DefiningConfigKey _hoverTime = new("Hover Time", "The amount of time required to hover on the button before the tooltip opens.", () => 0.5f) { - new ConfigKeyRange(.5f, 4) + new ConfigKeyQuantity(new UnitConfiguration("s", "0", " ", ["s", "ms"]), null, 0, 2) }; - private static readonly DefiningConfigKey _hoverTime = new("Hover Time", "The amount of time required to hover on the button before the tooltip opens.", () => 0.5f) + private static readonly DefiningConfigKey _textColorKey = new("TextColor", "Sets the text color of a tooltip.", () => RadiantUI_Constants.TEXT_COLOR); + + private static readonly DefiningConfigKey _textScaleKey = new("TextSize", "Sets the size of the text on a tooltip.", () => 1f) { - new ConfigKeyRange(0, 2) + new ConfigKeyRange(.5f, 4) }; /// @@ -43,6 +46,8 @@ public sealed class TooltipConfig : SingletonConfigSection /// public bool EnableNonLocalTooltips => _enableNonLocalTooltips; + public float HoverTime => _hoverTime; + /// public override string Id => "Tooltips"; @@ -56,8 +61,6 @@ public sealed class TooltipConfig : SingletonConfigSection /// public float TextScale => _textScaleKey; - public float HoverTime => _hoverTime; - /// public override Version Version { get; } = new Version(1, 0, 0); }