diff --git a/CodexMapAPI.lua b/CodexMapAPI.lua index ea83044..34be239 100644 --- a/CodexMapAPI.lua +++ b/CodexMapAPI.lua @@ -131,6 +131,37 @@ function API.CurrentMapID(cands) return id end end + -- Zone ohne bekannte Daten (und noch nie betreten): Karten-ID ueber den Zonennamen suchen. + -- Quelle: der Karten-Scan (db.cat.m), sonst alle Nummern 1..8000 durchprobieren. Ergebnis wird gemerkt (auch dauerhaft), + -- ein Fehlschlag fuer 60 Sekunden. + local now = _G.GetTime and _G.GetTime() or 0 + if API.noMatch and API.noMatch[key] and now - API.noMatch[key] < 60 then return nil end + local zname + if _G.GetMapContinents and _G.GetMapZones then + if z == 0 then zname = ({ _G.GetMapContinents() })[c] else zname = ({ _G.GetMapZones(c) })[z] end + end + local target = Norm(zname) + if target then + local ids = {} + local m = Codex.db and Codex.db.cat and Codex.db.cat.m + if type(m) == "table" and next(m) then + for id in pairs(m) do if type(id) == "number" then ids[#ids + 1] = id end end + table.sort(ids) + else + for id = 1, 8000 do ids[#ids + 1] = id end + end + for i = 1, #ids do + local id = ids[i] + if Norm(MapName(id)) == target then + zoneToID[key] = id + resolved[id] = key + Learned()[id] = key + return id + end + end + end + API.noMatch = API.noMatch or {} + API.noMatch[key] = now return nil end diff --git a/CodexPathMap.lua b/CodexPathMap.lua index 8448ef2..e35e18f 100644 --- a/CodexPathMap.lua +++ b/CodexPathMap.lua @@ -473,7 +473,10 @@ function PM.Refresh() layer:Show() local mapID = CurrentMapID() local canvas = Canvas() - if not (mapID and canvas) then return end + if not (mapID and canvas) then + label:SetText(FW.L.CODEX_PATHMAP_NONE) -- nicht die Zeile der vorherigen Karte stehen lassen + return + end local width, height = canvas:GetWidth() or 1, canvas:GetHeight() or 1 if width < 2 or height < 2 then return end local res = PM.Compute(mapID) diff --git a/Freewood-OctoWoW-Codex.toc b/Freewood-OctoWoW-Codex.toc index ec2f259..21d57a5 100644 --- a/Freewood-OctoWoW-Codex.toc +++ b/Freewood-OctoWoW-Codex.toc @@ -3,7 +3,7 @@ ## Notes: Learns quests, creatures and drops while you play: who gives and takes a quest, rewards, objectives, drop chances. ## Notes-deDE: Lernt beim Spielen Quests, Kreaturen und Beute: wer eine Quest vergibt und annimmt, Belohnungen, Ziele, Drop-Chancen. ## Author: Lacustat -## Version: 0.1.143 +## Version: 0.1.144 ## Dependencies: Freewood-OctoWoW-Core ## OptionalDeps: Freewood-OctoWoW-CodexData, Freewood-OctoWoW-ForeverData