From 1cccf8967a00f38d81426f8ae561fef0b7af7302 Mon Sep 17 00:00:00 2001 From: Knack117 Date: Sat, 28 Feb 2026 00:12:22 -0500 Subject: [PATCH] v1.0.0.10: Release build - silent refresh fix, Duty List fixes, remove debug logging Made-with: Cursor --- Mappy/Controllers/AddonAreaMapController.cs | 1 - Mappy/Controllers/IntegrationsController.cs | 47 +++++++++++++-------- Mappy/Mappy.csproj | 2 +- Mappy/Windows/MapWindow.cs | 1 - Mappy/pluginmaster.json | 2 +- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Mappy/Controllers/AddonAreaMapController.cs b/Mappy/Controllers/AddonAreaMapController.cs index 3f5d91e..0968a54 100644 --- a/Mappy/Controllers/AddonAreaMapController.cs +++ b/Mappy/Controllers/AddonAreaMapController.cs @@ -102,7 +102,6 @@ public unsafe class AddonAreaMapController : IDisposable return; } - // If the window actually considered closed by the agent. if (AgentMap.Instance()->AddonId is 0) { System.WindowManager.GetWindow()?.Close(); diff --git a/Mappy/Controllers/IntegrationsController.cs b/Mappy/Controllers/IntegrationsController.cs index 42219ce..a1a6b39 100644 --- a/Mappy/Controllers/IntegrationsController.cs +++ b/Mappy/Controllers/IntegrationsController.cs @@ -35,6 +35,8 @@ public unsafe class IntegrationsController : IDisposable private int _silentRefreshHideFramesRemaining; /// Frames to skip quest/temp-marker-triggered silent refresh after user opened map via Duty List (quest/gathering/flag/teleport). private int _suppressSilentRefreshFramesRemaining; + /// Frames after user opened map via Duty List; OnShowHook should not Hide() during this window (ProcessingCommand is cleared when MapWindow opens). + private int _userOpenedMapFramesRemaining; /// True while we're doing a silent refresh; OnAreaMapPreShow should not open the MapWindow. public static bool SilentRefreshInProgress { get; private set; } @@ -142,6 +144,9 @@ public unsafe class IntegrationsController : IDisposable if (_suppressSilentRefreshFramesRemaining > 0) { _suppressSilentRefreshFramesRemaining--; } + if (_userOpenedMapFramesRemaining > 0) { + _userOpenedMapFramesRemaining--; + } var skipQuestTempRefresh = _suppressSilentRefreshFramesRemaining > 0; var questCount = GetActiveQuestCount(); @@ -189,7 +194,7 @@ public unsafe class IntegrationsController : IDisposable } } - /// Call when user opens map via Duty List (quest/gathering/flag/teleport). Suppresses quest/temp-marker-triggered silent refresh for ~1s so we don't close the map. Cancels any in-progress silent refresh so we don't Hide() the map the user just opened. + /// Call when user opens map via Duty List (quest/gathering/flag/teleport). Cancels any in-progress silent refresh so we never Hide() the map. Suppresses new quest/temp-marker-triggered refresh for ~1s. Must be called BEFORE openMapHook.Original so OnFrameworkUpdate cannot call Hide() first. private void SuppressSilentRefreshForUserMapOpen() { _silentRefreshHideFramesRemaining = 0; // Cancel in-progress silent refresh so we never Hide() the map the user just opened @@ -261,33 +266,34 @@ public unsafe class IntegrationsController : IDisposable { Service.Log.Verbose("[OnShow] Beginning Show"); - // If you managed to open the window while the agent says it should be closed - if (System.MapWindow.IsOpen && AgentMap.Instance()->AddonId is 0) + // When user just opened via Duty List / gathering / flag / teleport, pass through immediately. + var userRequestedMap = System.MapWindow.ProcessingCommand || _userOpenedMapFramesRemaining > 0; + if (userRequestedMap) + { + showMapHook!.Original(agent, a1, a2); + return; + } + + var addonId = AgentMap.Instance()->AddonId; + var currentMapId = AgentMap.Instance()->CurrentMapId; + var selectedMapId = AgentMap.Instance()->SelectedMapId; + + if (System.MapWindow.IsOpen && addonId is 0) { Service.Log.Debug("[OnShow] MapWindow can not be open now."); System.MapWindow.Close(); } - // Allow map when user explicitly opened via Duty List / gathering / flag / teleport - if (!ShouldShowMap() && !System.MapWindow.ProcessingCommand) + if (!ShouldShowMap()) { Service.Log.Debug("[OnShow] Condition to open map is rejected, aborting."); return; } - // When user opened via Duty List (quest/gathering/flag/teleport), SelectedMapId != CurrentMapId is expected - // (viewing quest map, not current zone). Don't Hide() - let the map show. - var userRequestedMap = System.MapWindow.ProcessingCommand; - if (!userRequestedMap && - AgentMap.Instance()->AddonId is not 0 && - AgentMap.Instance()->CurrentMapId != AgentMap.Instance()->SelectedMapId) + // CurrentMapId != SelectedMapId = viewing quest map in different zone; pass through, don't Hide() + if (addonId is not 0 && currentMapId != selectedMapId) { - if (!System.SystemConfig.KeepOpen) - { - AgentMap.Instance()->Hide(); - } - - Service.Log.Verbose("[OnShow] Vanilla tried to return to current map, aborted."); + showMapHook!.Original(agent, a1, a2); return; } @@ -307,9 +313,14 @@ public unsafe class IntegrationsController : IDisposable private void OnOpenMapHook(AgentMap* agent, OpenMapInfo* mapInfo) => HookSafety.ExecuteSafe(() => { - // Set before Original so ShowMap (if called synchronously) can bypass ShouldShowMap rejection + // MUST run before Original: cancel any in-progress silent refresh so OnFrameworkUpdate won't call Hide() + // after the game opens the map. Also set flags for OnShowHook pass-through. if (IsUserInitiatedMapOpen(mapInfo->Type)) + { + SuppressSilentRefreshForUserMapOpen(); System.MapWindow.ProcessingCommand = true; + _userOpenedMapFramesRemaining = 30; // Persists after ProcessingCommand cleared by MapWindow.OnOpen + } openMapHook!.Original(agent, mapInfo); diff --git a/Mappy/Mappy.csproj b/Mappy/Mappy.csproj index 674c295..1867788 100644 --- a/Mappy/Mappy.csproj +++ b/Mappy/Mappy.csproj @@ -4,7 +4,7 @@ HSMappy HSMappy Knack117 - 1.0.0.9 + 1.0.0.10 A more versatile in-game map. Replaces the in-game map with an ImGui implementation with several additional features. Fork with minimap improvements, quest radius on minimap, and more. http://brassnet.ddns.net:33983/KnackAtNite/HSMappy diff --git a/Mappy/Windows/MapWindow.cs b/Mappy/Windows/MapWindow.cs index 8054c1e..2309e2b 100644 --- a/Mappy/Windows/MapWindow.cs +++ b/Mappy/Windows/MapWindow.cs @@ -48,7 +48,6 @@ public class MapWindow : Window public override unsafe void PreOpenCheck() { - // If you managed to open the window while the agent says it should be closed if (System.MapWindow.IsOpen && AgentMap.Instance()->AddonId is 0) { Service.Log.Debug("[OnShow] MapWindow can not be open now."); diff --git a/Mappy/pluginmaster.json b/Mappy/pluginmaster.json index 1e04c34..23879cf 100644 --- a/Mappy/pluginmaster.json +++ b/Mappy/pluginmaster.json @@ -1 +1 @@ -[{"Author":"Knack117","Name":"HSMappy","Punchline":"A more versatile in-game map.","Description":"Replaces the in-game map with an ImGui implementation with several additional features. Fork with minimap improvements, quest radius on minimap, white gradient player cone, and more.","Changelog":"1.0.0.9: Duty List quest click: don't Hide() when viewing quest map (SelectedMapId != CurrentMapId). 1.0.0.8: Cancel silent refresh when opening map from Duty List so it doesn't immediately close. 1.0.0.7: Duty List quest click opens Area Map even when Hide With Game GUI would block it. 1.0.0.6: Minimap stays open after client restart (restore on login). 1.0.0.5: Fix crash when map texture path is invalid (ArgumentOutOfRangeException in Lumina GetFileHash). 1.0.0.4: Temp marker circle refreshes when quest objective is progressed. 1.0.0.3: Fix marker cache refresh after quest turn-in; invalidate temp cache so old markers don't persist. 1.0.0.2: Red direction arrow on minimap pointing to player flag. 1.0.0.1: Duty List quest click keeps Area Map open; player flags show on minimap. 1.0.0.0: Initial HSMappy release. Minimap: quest radius circle (orange, transparent), tooltip; cone drawn under markers; white gradient cone; /hsmappy commands.","InternalName":"HSMappy","AssemblyVersion":"1.0.0.9","RepoUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy","ApplicableVersion":"any","Tags":["map","mapping","overlay","utility"],"CategoryTags":["jobs"],"DalamudApiLevel":14,"DownloadLinkInstall":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.9/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.9/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.9/latest.zip","LastUpdate":"1772233604"}] +[{"Author":"Knack117","Name":"HSMappy","Punchline":"A more versatile in-game map.","Description":"Replaces the in-game map with an ImGui implementation with several additional features. Fork with minimap improvements, quest radius on minimap, white gradient player cone, and more.","Changelog":"1.0.0.10: Release build. Suppress silent refresh at start of OnOpenMapHook; remove debug logging. 1.0.0.9: Duty List quest click: don't Hide() when viewing quest map (SelectedMapId != CurrentMapId). 1.0.0.8: Cancel silent refresh when opening map from Duty List so it doesn't immediately close. 1.0.0.7: Duty List quest click opens Area Map even when Hide With Game GUI would block it. 1.0.0.6: Minimap stays open after client restart (restore on login). 1.0.0.5: Fix crash when map texture path is invalid (ArgumentOutOfRangeException in Lumina GetFileHash). 1.0.0.4: Temp marker circle refreshes when quest objective is progressed. 1.0.0.3: Fix marker cache refresh after quest turn-in; invalidate temp cache so old markers don't persist. 1.0.0.2: Red direction arrow on minimap pointing to player flag. 1.0.0.1: Duty List quest click keeps Area Map open; player flags show on minimap. 1.0.0.0: Initial HSMappy release. Minimap: quest radius circle (orange, transparent), tooltip; cone drawn under markers; white gradient cone; /hsmappy commands.","InternalName":"HSMappy","AssemblyVersion":"1.0.0.10","RepoUrl":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy","ApplicableVersion":"any","Tags":["map","mapping","overlay","utility"],"CategoryTags":["jobs"],"DalamudApiLevel":14,"DownloadLinkInstall":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.10/latest.zip","IsHide":false,"IsTestingExclusive":false,"DownloadLinkTesting":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.10/latest.zip","DownloadLinkUpdate":"http://brassnet.ddns.net:33983/KnackAtNite/HSMappy/releases/download/v1.0.0.10/latest.zip","LastUpdate":"1772237531"}]