聊天重做前缓存
This commit is contained in:
@@ -34,6 +34,26 @@ local function GetOverlayDB()
|
||||
return MapOverlayData or LibMapOverlayData or zMapOverlayData or mapOverlayData
|
||||
end
|
||||
|
||||
local function SafeSetMapToCurrentZone()
|
||||
if not SetMapToCurrentZone then
|
||||
return
|
||||
end
|
||||
if SFrames and SFrames.CallWithPreservedBattlefieldMinimap then
|
||||
return SFrames:CallWithPreservedBattlefieldMinimap(SetMapToCurrentZone)
|
||||
end
|
||||
return pcall(SetMapToCurrentZone)
|
||||
end
|
||||
|
||||
local function SafeSetMapZoom(continent, zone)
|
||||
if not SetMapZoom then
|
||||
return
|
||||
end
|
||||
if SFrames and SFrames.CallWithPreservedBattlefieldMinimap then
|
||||
return SFrames:CallWithPreservedBattlefieldMinimap(SetMapZoom, continent, zone)
|
||||
end
|
||||
return pcall(SetMapZoom, continent, zone)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Persistence: save/load discovered overlay data to SFramesDB
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -428,7 +448,7 @@ local function ProcessScanZone()
|
||||
end
|
||||
|
||||
local entry = scanQueue[scanIndex]
|
||||
SetMapZoom(entry.cont, entry.zone)
|
||||
SafeSetMapZoom(entry.cont, entry.zone)
|
||||
|
||||
local mapFile = GetMapInfo and GetMapInfo() or ""
|
||||
if mapFile == "" then
|
||||
@@ -490,11 +510,11 @@ function MapReveal:FinishScan()
|
||||
end
|
||||
|
||||
if savedMapZ > 0 then
|
||||
SetMapZoom(savedMapC, savedMapZ)
|
||||
SafeSetMapZoom(savedMapC, savedMapZ)
|
||||
elseif savedMapC > 0 then
|
||||
SetMapZoom(savedMapC, 0)
|
||||
SafeSetMapZoom(savedMapC, 0)
|
||||
else
|
||||
if SetMapToCurrentZone then SetMapToCurrentZone() end
|
||||
SafeSetMapToCurrentZone()
|
||||
end
|
||||
|
||||
local cf = DEFAULT_CHAT_FRAME
|
||||
|
||||
Reference in New Issue
Block a user