v1.0.0.10: Release build - silent refresh fix, Duty List fixes, remove debug logging

Made-with: Cursor
This commit is contained in:
2026-02-28 00:12:22 -05:00
parent f1864f4cac
commit 1cccf8967a
5 changed files with 31 additions and 22 deletions
+29 -18
View File
@@ -35,6 +35,8 @@ public unsafe class IntegrationsController : IDisposable
private int _silentRefreshHideFramesRemaining;
/// <summary>Frames to skip quest/temp-marker-triggered silent refresh after user opened map via Duty List (quest/gathering/flag/teleport).</summary>
private int _suppressSilentRefreshFramesRemaining;
/// <summary>Frames after user opened map via Duty List; OnShowHook should not Hide() during this window (ProcessingCommand is cleared when MapWindow opens).</summary>
private int _userOpenedMapFramesRemaining;
/// <summary>True while we're doing a silent refresh; OnAreaMapPreShow should not open the MapWindow.</summary>
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
}
}
/// <summary>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.</summary>
/// <summary>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.</summary>
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);