Quantcast

Add code to allow TomTom specific overrides of HDB data.

Ludovicus [03-18-19 - 22:34]
Add code to allow TomTom specific overrides of HDB data.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index fb8b42a..23fef4a 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -1168,13 +1168,41 @@ SLASH_TOMTOM_WAY3 = "/tomtomway"

 TomTom.NameToMapId = {}
 local NameToMapId = TomTom.NameToMapId
+
+local overrides = {
+    [125] = {mapType = Enum.UIMapType.Zone}, -- Dalaran
+    [126] = {mapType = Enum.UIMapType.Micro},
+    [195] = {suffix = "1"}, -- Kaja'mine
+    [196] = {suffix = "2"}, -- Kaja'mine
+    [197] = {suffix = "3"}, -- Kaja'mine
+    [501] = {mapType = Enum.UIMapType.Zone}, -- Dalaran
+    [502] = {mapType = Enum.UIMapType.Micro},
+    [579] = {suffix = "1"}, -- Lunarfall Excavation
+    [580] = {suffix = "2"}, -- Lunarfall Excavation
+    [581] = {suffix = "3"}, -- Lunarfall Excavation
+    [585] = {suffix = "1"}, -- Frostwall Mine
+    [586] = {suffix = "2"}, -- Frostwall Mine
+    [587] = {suffix = "3"}, -- Frostwall Mine
+    [625] = {mapType = Enum.UIMapType.Orphan}, -- Dalaran
+    [626] = {mapType = Enum.UIMapType.Micro}, -- Dalaran
+    [627] = {mapType = Enum.UIMapType.Zone},
+    [628] = {mapType = Enum.UIMapType.Micro},
+    [629] = {mapType = Enum.UIMapType.Micro},
+    [943] = {suffix = FACTION_HORDE}, -- Arathi Highlands
+    [1044] = {suffix = FACTION_ALLIANCE},
+}
+
 do
     -- Fetch the names of the zones
     for id in pairs(hbd.mapData) do
-        if (hbd.mapData[id].mapType == Enum.UIMapType.Zone) or
-           (hbd.mapData[id].mapType == Enum.UIMapType.Micro) then
+        local mapType = (overrides[id] and overrides[id].mapType) or hbd.mapData[id].mapType
+        if (mapType == Enum.UIMapType.Zone) or
+           (mapType == Enum.UIMapType.Micro) then
             -- Record only Zone or Micro maps
             local name = hbd.mapData[id].name
+            if (overrides[id] and overrides[id].suffix) then
+                name = name .. " " .. overrides[id].suffix
+            end
             if name and NameToMapId[name] then
                 if type(NameToMapId[name]) ~= "table" then
                     -- convert to table