v1.0.0.6: Minimap stays open after client restart (restore on login)
Made-with: Cursor
This commit is contained in:
@@ -11,6 +11,8 @@ namespace Mappy.Windows;
|
||||
|
||||
public class MinimapWindow : Window
|
||||
{
|
||||
private bool _wasLoggedIn;
|
||||
|
||||
public MinimapWindow() : base("HSMappy Minimap###HSMappyMinimap", new Vector2(200.0f, 200.0f))
|
||||
{
|
||||
DisableWindowSounds = true;
|
||||
@@ -22,8 +24,18 @@ public class MinimapWindow : Window
|
||||
|
||||
public override void PreOpenCheck()
|
||||
{
|
||||
if (Service.ClientState is { IsLoggedIn: false } or { IsPvP: true })
|
||||
var isLoggedIn = Service.ClientState is { IsLoggedIn: true, IsPvP: false };
|
||||
if (!isLoggedIn)
|
||||
{
|
||||
IsOpen = false;
|
||||
_wasLoggedIn = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Restore minimap when transitioning from login screen to in-game (ShowMinimap persists in config)
|
||||
if (!_wasLoggedIn && System.SystemConfig.ShowMinimap)
|
||||
UnCollapseOrShow();
|
||||
_wasLoggedIn = true;
|
||||
}
|
||||
|
||||
protected override unsafe void DrawContents()
|
||||
|
||||
Reference in New Issue
Block a user