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