tsm: fix some flickering, don't override game cursor

This commit is contained in:
goat 2024-04-20 17:08:29 +02:00
parent 808f66edc6
commit d4fc0da7f4

View file

@ -142,6 +142,12 @@ internal class TitleScreenMenuWindow : Window, IDisposable
var scale = ImGui.GetIO().FontGlobalScale;
var entries = this.titleScreenMenu.Entries;
var hovered = ImGui.IsWindowHovered(
ImGuiHoveredFlags.RootAndChildWindows |
ImGuiHoveredFlags.AllowWhenBlockedByActiveItem);
Service<InterfaceManager>.Get().OverrideGameCursor = !hovered;
switch (this.state)
{
case State.Show:
@ -187,8 +193,11 @@ internal class TitleScreenMenuWindow : Window, IDisposable
i++;
}
if (!ImGui.IsWindowHovered(ImGuiHoveredFlags.RootAndChildWindows |
ImGuiHoveredFlags.AllowWhenBlockedByActiveItem))
// Don't check for hover if we're in the middle of an animation, as it will cause flickering.
if (this.moveEasings.Any(x => !x.Value.IsDone))
break;
if (!hovered)
{
this.state = State.FadeOut;
}