diff --git a/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonTooltips.cs b/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonTooltips.cs index fc46550..7f7b8c7 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonTooltips.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Tooltips/ButtonTooltips.cs @@ -45,7 +45,7 @@ private static void RunHoverEnterPostfix(Button __instance, ButtonEventData even var localOffset = canvasBounds.Center.x_ + canvasBounds.Min._y - canvasHitPoint.xy; var offset = tooltipParent.LocalVectorToGlobal(localOffset.xy_) + (0.01f * tooltipParent.Backward); - __instance.World.RunInSeconds(0.5f, () => + __instance.World.RunInSeconds(TooltipConfig.Instance.HoverTime, () => { if (!TooltipManager.HasTooltip(__instance)) { diff --git a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs index fb82963..57f213c 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs @@ -20,6 +20,11 @@ public sealed class TooltipConfig : SingletonConfigSection new ConfigKeyRange(.5f, 4) }; + 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(0, 2) + }; + /// /// Gets the background color for tooltips. /// @@ -51,6 +56,8 @@ public sealed class TooltipConfig : SingletonConfigSection /// public float TextScale => _textScaleKey; + public float HoverTime => _hoverTime; + /// public override Version Version { get; } = new Version(1, 0, 0); }