Compare with Previous | Blame | View Log
# Add to mapcz all maps that are NOT part of the continent/zone pairs. diff -rwc Orig/TomTom/TomTom.lua Mine/TomTom/TomTom.lua *** Orig/TomTom/TomTom.lua Sun Dec 12 18:04:46 2010 --- Mine/TomTom/TomTom.lua Sun Jan 9 21:37:49 2011 *************** *** 45,51 **** mapcz[mapid] = {cid, zid} end end ! SetMapByID(orig) -- Speed up minimap updates --- 45,57 ---- mapcz[mapid] = {cid, zid} end end ! for id=1,10000 do ! if not ( mapcz[id] ) then ! if ( SetMapByID(id) ) then ! mapcz[id] = {-1, id} ! end ! end ! end SetMapByID(orig) -- Speed up minimap updates *************** *** 55,60 **** --- 61,67 ---- -- and converts it to a c,z,x,y tuple function compat:GetCurrentPlayerPosition() local map, floor, x, y = Astrolabe:GetCurrentPlayerPosition() + print("compat:GetCurrentPlayerPosition()=>",map, floor, x, y) local cz = mapcz[map] if cz then local c, z = unpack(cz) *************** *** 84,97 **** end function compat:PlaceIconOnMinimap(icon, c, z, x, y) ! local mapId = Astrolabe:GetMapID(c, z) local floors = Astrolabe:GetNumFloors(mapId) local floor = floors == 0 and 0 or 1 return Astrolabe:PlaceIconOnMinimap(icon, mapId, floor, x, y) end function compat:PlaceIconOnWorldMap(frame, icon, c, z, x, y) ! local mapId = Astrolabe:GetMapID(c, z) local floors = Astrolabe:GetNumFloors(mapId) local floor = floors == 0 and 0 or 1 --- 91,124 ---- end function compat:PlaceIconOnMinimap(icon, c, z, x, y) ! local mapId ! if c == -1 then ! mapId = z ! z = 0 ! else ! mapId = Astrolabe:GetMapID(c, z) ! end ! if mapId == nil then ! error("compat:PlaceIconOnMinimap() call to Astrolabe:GetMapID("..c..","..z..") failed") ! end local floors = Astrolabe:GetNumFloors(mapId) local floor = floors == 0 and 0 or 1 return Astrolabe:PlaceIconOnMinimap(icon, mapId, floor, x, y) end function compat:PlaceIconOnWorldMap(frame, icon, c, z, x, y) ! local mapId ! if c == -1 then ! mapId = z ! z = 0 ! else ! mapId = Astrolabe:GetMapID(c, z) ! end ! if mapId == nil then ! error("compat:PlaceIconOnWorldMap() call to Astrolabe:GetMapID("..c..","..z..") failed") ! ! end ! mapId = 680 local floors = Astrolabe:GetNumFloors(mapId) local floor = floors == 0 and 0 or 1 *************** *** 279,285 **** end function TomTom:ReloadWaypoints() ! local pc, pz = GetCurrentMapContinent(), GetCurrentMapZone() for uid,value in pairs(waypoints) do self:ClearWaypoint(uid) --- 306,312 ---- end function TomTom:ReloadWaypoints() ! local pc, pz = TomTom:WhereAmI() for uid,value in pairs(waypoints) do self:ClearWaypoint(uid) *************** *** 436,442 **** end -- Actually try to add a note ! local c,z = GetCurrentMapContinent(), GetCurrentMapZone() local x,y = GetCurrentCursorPosition() if z == 0 then --- 463,469 ---- end -- Actually try to add a note ! local c,z = TomTom:WhereAmI() local x,y = GetCurrentCursorPosition() if z == 0 then *************** *** 804,822 **** end end ! -- TODO: Make this not suck ! function TomTom:AddWaypoint(x, y, desc, persistent, minimap, world, silent) local c,z = GetCurrentMapContinent(), GetCurrentMapZone() ! if not c or not z or c < 1 then ! --self:Print("Cannot find a valid zone to place the coordinates") ! return end return self:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, silent) end function TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, custom_callbacks, silent, crazy) local callbacks if custom_callbacks then callbacks = custom_callbacks --- 831,862 ---- end end ! function TomTom:WhereAmI() local c,z = GetCurrentMapContinent(), GetCurrentMapZone() ! if c < 0 then ! z = GetCurrentMapAreaID() ! end ! if not c or not z then ! self:Print("Cannot find a valid zone to place the coordinates") ! end ! return c,z end + -- TODO: Make this not suck + function TomTom:AddWaypoint(x, y, desc, persistent, minimap, world, silent) + local c,z = TomTom:WhereAmI() return self:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, silent) end function TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world, custom_callbacks, silent, crazy) + if type(c) ~= "number" then error("TomTom:AddZWaypoint() c was not a number, it was " .. type(c)) end + if type(z) ~= "number" then error("TomTom:AddZWaypoint() z was not a number, it was " .. type(z)) end + if type(x) ~= "number" then error("TomTom:AddZWaypoint() x was not a number, it was " .. type(x)) end + if type(y) ~= "number" then error("TomTom:AddZWaypoint() y was not a number, it was " .. type(y)) end + + print("TomTom:AddZWaypoint("..c..","..z..","..x..","..y..","..tostring(desc)..",...)") + local callbacks if custom_callbacks then callbacks = custom_callbacks *************** *** 865,870 **** --- 905,911 ---- local zone = self:GetMapFile(c, z) if not zone then + error("TomTom:AddZWaypoint() failed self:GetMapFile("..c..","..z..")") return end *************** *** 972,977 **** --- 1013,1029 ---- end end + for id=1,10000 do + if ( SetMapByID(id) ) then + local mapFile = GetMapInfo() + reverseMapFileC[mapFile] = reverseMapFileC[mapFile] or -1 + reverseMapFileZ[mapFile] = reverseMapFileZ[mapFile] or id + mapCZtoFile[-1] = mapCZtoFile[-1] or {} + mapCZtoFile[-1][id] = mapCZtoFile[-1][id] or {} + mapCZtoFile[-1][id] = mapFile + end + end + for cid, mapFile in pairs(continentMapFile) do reverseMapFileC[mapFile] = cid reverseMapFileZ[mapFile] = 0 *************** *** 1142,1147 **** --- 1194,1209 ---- tokens[1] = tokens[1]:lower() end + if tokens[1] == "lfo" then + for x = 62,68,2 do + for y = 10,20,5 do + TomTom:AddWaypoint(x, y, string.format("LFO@(%d,%d)",x,y)) + end + end + ChatFrame1:AddMessage("OK Boss, added them!") + return + end + if tokens[1] == "reset" then if tokens[2] == "all" then if TomTom.db.profile.general.confirmremoveall then *************** *** 1178,1183 **** --- 1240,1248 ---- ChatFrame1:AddMessage(string.format(L["Found multiple matches for zone '%s'. Did you mean: %s"], tokens[2], table.concat(poss, ", "))) return + elseif #matches == 0 then + ChatFrame1:AddMessage(string.format(L["Found no matches for zone '%s'."], tokens[2])) + return end local c,z,name = unpack(matches[1]) diff -rwc Orig/TomTom/TomTom.toc Mine/TomTom/TomTom.toc *** Orig/TomTom/TomTom.toc Sun Dec 12 18:04:46 2010 --- Mine/TomTom/TomTom.toc Mon Jan 10 04:45:03 2011 *************** *** 31,36 **** --- 31,37 ---- Localization.ruRU.lua Localization.zhTW.lua Localization.koKR.lua + Localization.esES.lua TomTom.lua TomTom_Waypoints.lua diff -rwc Orig/TomTom/TomTom_Corpse.lua Mine/TomTom/TomTom_Corpse.lua *** Orig/TomTom/TomTom_Corpse.lua Sun Dec 12 18:04:46 2010 --- Mine/TomTom/TomTom_Corpse.lua Sun Jan 9 20:33:36 2011 *************** *** 19,25 **** return c, z, x, y end ! local oc,oz = GetCurrentMapContinent(), GetCurrentMapZone() for i=1,select("#", GetMapContinents()) do SetMapZoom(i) --- 19,25 ---- return c, z, x, y end ! local oc,oz = TomTom:WhereAmI() for i=1,select("#", GetMapContinents()) do SetMapZoom(i) diff -rwc Orig/TomTom/TomTom_POIIntegration.lua Mine/TomTom/TomTom_POIIntegration.lua *** Orig/TomTom/TomTom_POIIntegration.lua Sun Dec 12 18:04:46 2010 --- Mine/TomTom/TomTom_POIIntegration.lua Sun Jan 9 20:30:43 2011 *************** *** 37,43 **** end local function setQuestWaypoint(self) ! local c, z = GetCurrentMapContinent(), GetCurrentMapZone(); local x, y = POIAnchorToCoord(self) local qid = self.questId --- 37,43 ---- end local function setQuestWaypoint(self) ! local c, z = TomTom:WhereAmI() local x, y = POIAnchorToCoord(self) local qid = self.questId diff -rwc Orig/TomTom/TomTom_Waypoints.lua Mine/TomTom/TomTom_Waypoints.lua *** Orig/TomTom/TomTom_Waypoints.lua Sun Dec 12 18:04:46 2010 --- Mine/TomTom/TomTom_Waypoints.lua Sun Jan 9 15:51:34 2011 *************** *** 100,105 **** --- 100,110 ---- function TomTom:SetWaypoint(c, z, x, y, callbacks, show_minimap, show_world) + if type(c) ~= "number" then error("TomTom:SetWaypoint() c was not a number, it was " .. type(c)) end + if type(z) ~= "number" then error("TomTom:SetWaypoint() z was not a number, it was " .. type(z)) end + if type(x) ~= "number" then error("TomTom:SetWaypoint() x was not a number, it was " .. type(x)) end + if type(y) ~= "number" then error("TomTom:SetWaypoint() y was not a number, it was " .. type(y)) end + print("TomTom:SetWaypoint("..c..","..z..","..x..","..y..",...)") -- Try to acquire a waypoint from the frame pool local point = table.remove(pool) *************** *** 185,190 **** --- 190,196 ---- point.uid = getuid(point) -- Place the waypoint + compat:PlaceIconOnMinimap(point.minimap, c, z, x, y) if show_world then Only in Mine/TomTom/libs: .DS_Store diff -rwc Orig/TomTom/libs/Astrolabe/Astrolabe.lua Mine/TomTom/libs/Astrolabe/Astrolabe.lua *** Orig/TomTom/libs/Astrolabe/Astrolabe.lua Sun Dec 12 18:04:46 2010 --- Mine/TomTom/libs/Astrolabe/Astrolabe.lua Sun Jan 9 20:01:30 2011 *************** *** 51,56 **** --- 51,57 ---- -- define local variables for Data Tables (defined at the end of this file) local WorldMapSize, MinimapSize, ValidMinimapShapes, zeroData; + ASTROLABE_VERBOSE=1 function Astrolabe:GetVersion() return LIBRARY_VERSION_MAJOR, LIBRARY_VERSION_MINOR; *************** *** 351,362 **** --- 352,370 ---- function Astrolabe:GetMapID(continent, zone) zone = zone or 0; local ret = self.ContinentList[continent]; + if ret == nil then + error("Astrolabe:GetMapID() Bad Continent "..tostring(continent)) + end if ( ret ) then + if ret[zone] == nil then + error("Astrolabe:GetMapID() Bad zone "..tostring(zone)) + end return ret[zone]; end if ( continent == 0 and zone == 0 ) then return 0; end + error("Astrolabe:GetMapID(",continent, zone,") fell through!") end function Astrolabe:GetNumFloors( mapID ) *************** *** 483,488 **** --- 491,497 ---- end function Astrolabe:PlaceIconOnMinimap( icon, mapID, mapFloor, xPos, yPos ) + print("Astrolabe:PlaceIconOnMinimap(",icon, mapID, mapFloor, xPos, yPos,")") -- check argument types argcheck(icon, 2, "table"); assert(3, icon.SetPoint and icon.ClearAllPoints, "Usage Message"); *************** *** 512,517 **** --- 521,527 ---- local dist, xDist, yDist = self:ComputeDistance(lM, lF, lx, ly, mapID, mapFloor, xPos, yPos); if not ( dist ) then --icon's position has no meaningful position relative to the player's current location + print("Astrolabe:PlaceIconOnMinimap: ComputeDistance(",lM, lF, lx, ly, mapID, mapFloor, xPos, yPos,") No meaningful Pos") return -1; end *************** *** 1430,1435 **** --- 1440,1451 ---- xOffset = 0, yOffset = 0, }, + [680] = { + height = 3010.41666, + width = 4514.58301, + xOffset = 0, + yOffset = 0, + }, [681] = { height = 3010.41666, width = 4514.58301,