1
0
Bifurcation 0

QH Now queries the WoW client for quests, though it doesn't seem to update correctly when a quest is accepted (and though untested, probably doesn't update locations when the WoW poi changes).

Added LibMapData and began transitioning map data needs to use LibMapData.

Began changing the data collection, yet again. Once this goes beta, the new collection system will be in place... My hope is to allow QH to "learn" as you play, eliminating any need for data compilation, though I will still make attempts to compile said data into a full on db.

Added some code that will eventually be usable to get data from LightHeaded. This is not yet implemented in full, but will be the preferred method of QH doesn't know about a quest. Order of preference will eventually be: 1) Learned data, 2) Internal DB, 3) LightHeaded, 4) WoW client.

NOTE: THIS COMMIT IS ON THE WOW-DB-GET BRANCH. An alpha release will be up on the downloads page by 6:30 US EST on February 29, 2012 (tomorrow).

I THINK I have covered all the changes in this, but I have done so much since my last commit, I cannot be sure.
Cette révision appartient à :
Nathanial.C.Jones 2012-02-29 03:27:41 +00:00
Parent 92ca575dff
révision 87617c4eed
18 fichiers modifiés avec 2255 ajouts et 135 suppressions

Voir le fichier

@ -0,0 +1,3 @@
assert(QuestHelper and type(QuestHelper) == "table", "Ooops, can't load right now.")
QuestHelper.LibMapData = LibStub("LibMapData-1.0")

Voir le fichier

@ -62,6 +62,8 @@ libs\AceConfig-3.0\AceConfig-3.0.xml
bst_astrolabe.lua bst_astrolabe.lua
libs\AstrolabeQH\Load.xml libs\AstrolabeQH\Load.xml
#MapMonitor.lua
#AstroLabeToLibMapDataConversionStub.lua
bst_ctl.lua bst_ctl.lua
libs\ChatThrottleLib\ChatThrottleLib.xml libs\ChatThrottleLib\ChatThrottleLib.xml
@ -70,6 +72,11 @@ bst_range.lua
libs\LibRangeCheck-2.0\CallbackHandler-1.0\CallbackHandler-1.0.xml libs\LibRangeCheck-2.0\CallbackHandler-1.0\CallbackHandler-1.0.xml
libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua libs\LibRangeCheck-2.0\LibRangeCheck-2.0.lua
bst_mapdata.lua
libs\LibMapData-1.0\Libs\CallbackHandler-1.0
libs\LibMapData-1.0\library.lua
LibMapDataInit.lua
changes.lua changes.lua
lang.lua lang.lua

Voir le fichier

@ -198,6 +198,7 @@ OnUpdate = function()
self:Show() self:Show()
local dist, dx, dy = QuestHelper.Astrolabe:ComputeDistance(QuestHelper.collect_rc, QuestHelper.collect_rz, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.c, active_point.z, active_point.x, active_point.y) local dist, dx, dy = QuestHelper.Astrolabe:ComputeDistance(QuestHelper.collect_rc, QuestHelper.collect_rz, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.c, active_point.z, active_point.x, active_point.y)
--print(QuestHelper.collect_rc, QuestHelper.collect_rz, QuestHelper.collect_rx, QuestHelper.collect_ry, active_point.c, active_point.z, active_point.x, active_point.y)
local text = "" local text = ""

Voir le fichier

@ -13,11 +13,63 @@ local function signed(c)
--return strchar(c) --return strchar(c)
end end
local dec2hex = {[0] = "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
local hex2dec = {}
for k, v in pairs(dec2hex) do hex2dec[v] = k end
local function tohex(c)
return dec2hex[c]
end
local function lgToDec(c, pos)
if not c or c == "" then return 0 end
local ret = 0
pos = pos or 0
if pos == 0 then c = string.reverse(c) end
ret = todec(string.sub(c,1,1)) * math.pow(16, pos) + lgToDec(string.sub(c, 2), pos + 1)
return ret
end
local function lgToHex(c, pos)
local ret, rem, hex
pos = pos or 0
c = c or 0
local minVal = math.pow(16, pos)
local maxVal = math.pow(16, pos+1) - 1
if c > maxVal then
rem, hex = lgToHex(c, pos + 1)
else
rem, hex = c, ""
end
local mult = 0
while rem >= minVal do
mult = mult + 1
rem = rem - minVal
end
return rem, hex .. tohex(mult)
end
local function todec(c)
return hex2dec[c]
end
local function float(c) local function float(c)
-- if not c then c = -128 end -- if not c then c = -128 end
-- QuestHelper: Assert( c >= -128, string.format("c is too small. It is %s.", tostring(c))) -- QuestHelper: Assert( c >= -128, string.format("c is too small. It is %s.", tostring(c)))
-- QuestHelper: Assert( c < 128, string.format("c is too big. It is %s.", tostring(c))) -- QuestHelper: Assert( c < 128, string.format("c is too big. It is %s.", tostring(c)))
local ret = tostring(c):gsub(",",".") -- eliminate issues with locales that use a comma as the decimal separator. local ret = tohex(math.floor(128 * c))
return ret return ret
end end
@ -26,9 +78,10 @@ local function BolusizeLocation(delayed, c, z, x, y, dl, mid, mf, f)
-- x and y are floating-point values, generally between 0 and 1. We'll dedicate 24 bits to the fractional part, largely because we can. -- x and y are floating-point values, generally between 0 and 1. We'll dedicate 24 bits to the fractional part, largely because we can.
-- Overall we're using a weird 11 bytes on this. Meh. -- Overall we're using a weird 11 bytes on this. Meh.
-- Also, any nil values are being turned into MIN_WHATEVER. -- Also, any nil values are being turned into MIN_WHATEVER.
local float_x = float(x) local float_x = x
local float_y = float(y) local float_y = y
local loc = {} local loc = {}
--local locStr = (delayed and 1 or 0) .. lgToHex(mid) .. tohex(dl) .. float(x) .. float(y)
loc["delayed"] = (delayed and 1 or 0) loc["delayed"] = (delayed and 1 or 0)
loc["c"] = c loc["c"] = c
loc["z"] = z loc["z"] = z

Voir le fichier

@ -143,52 +143,158 @@ function DB_HasItem(group, id)
return false return false
end end
local function GetBlizzardQuestInfoFrameMainLoop(qid)
local function GetZonePOIs(c, z) local POIFrame, questFrame
SetMapZoom(c, z) QuestMapUpdateAllQuests()
local pois = {}
local count = 1
local hasQuests = false
local numEntries = QuestMapUpdateAllQuests()
QuestPOIUpdateIcons() QuestPOIUpdateIcons()
local numCompleteedQuests = 0 WorldMapFrame_UpdateQuests()
local mapID = GetMapInfo()
for i = 1, numEntries do
local questId, questLogIndex = QuestPOIGetQuestIDByVisibleIndex(i)
local _, x, y, objective = QuestPOIGetIconInfo(questId)
if x and y then
local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(questLogIndex)
numObjectives = GetNumQuestLeaderBoards(questLogIndex)
if isComplete and isComplete < 0 then
isComplete = false
elseif numObjectives == 0 then
isComplete = true
end
local poi = {}
if pois[questId] then poi = pois[questId]
else pois[questId] = poi end
if not poi.questLogIndex then for i = 1, MAX_NUM_QUESTS do
poi.questLogIndex = questLogIndex questFrame = _G["WorldMapQuestFrame" .. i]
poi.questId = questId if questFrame then
poi.name = questTitle if questFrame.questId == qid then
poi.criteria = {} POIFrame = questFrame.poiIcon
poi.criteria.loc = {} break
end end
local loc = {}
loc.c = c
loc.x = x
loc.y = y
loc.p = mapID
loc.completed = isComplete
poi.criteria.loc:insert(loc)
count = count+1
hasQuests = true
end end
end end
return pois, hasQuests return questFrame, POIFrame
end
local function GetBlizzardQuestInfoFrame(qid, map)
if map then SetMapByID(map) end
QuestMapUpdateAllQuests()
QuestPOIUpdateIcons()
WorldMapFrame_UpdateQuests()
local POIFrame
local questFrame
local dLvl
if map and GetNumDungeonMapLevels() > 0 then -- Suspicion is that each dungeon level has to be iterated.
for i = 1, GetNumDungeonMapLevels() do
SetDungeonMapLevel(i)
questFrame, POIFrame = GetBlizzardQuestInfoFrameMainLoop(qid)
if POIFrame then
dLvl = i
break
end
end
else -- Only need to call once
questFrame, POIFrame = GetBlizzardQuestInfoFrameMainLoop(qid)
end
return questFrame, POIFrame, dLvl or 0
end
local function GetBlizzardQuestInfo(qid)
local questFrame, POIFrame, qdLvl = GetBlizzardQuestInfoFrame(qid)
local mapId = GetCurrentMapAreaID()
local c, z
local dLvl = false
local qMapId
if GetNumDungeonMapLevels() > 0 then dLvl = GetCurrentMapDungeonLevel() end
if not POIFrame then
-- Iterate over all maps to try and find it (we are of course assuming that the player has the quest, otherwise we will be SOL.
local maps = QuestHelper.LibMapData:GetAllMapIDs()
for _, map in pairs(maps) do
if map >= 0 and not QuestHelper.LibMapData:IsContinentMap(map) then
questFrame, POIFrame, qdLvl = GetBlizzardQuestInfoFrame(qid, map)
if POIFrame then
qMapId = map
break
end
end
end
c, z = GetCurrentMapContinent(), GetCurrentMapZone()
SetMapByID(mapId)
if not POIFrame then return nil end -- At this point we either have the quest or we are SOL.
else
qMapId = mapId
c, z = GetCurrentMapContinent(), GetCurrentMapZone()
end
local _, _, _, x, y = POIFrame:GetPoint()
if not x or not y then return nil end
local frame = WorldMapDetailFrame
local width, height = frame:GetWidth(), frame:GetHeight()
local wm_scale, poi_scale = frame:GetScale(), POIFrame:GetScale()
-- Convert from yards to %
local cx = ((x / (wm_scale / poi_scale)) / width)
local cy = ((-y / (wm_scale / poi_scale)) / height)
if cx < 0 or cx > 1 or cy < 0 or cy > 1 then return nil end
-- Now we want to convert to proper format for QH.
-- Look at WoWPro:findBlizzCoords(qid) for remainder
local _, contX, contY = QuestHelper.Astrolabe:GetAbsoluteContinentPosition(c, z, cx, cy)
--contX, contY = contX / QuestHelper.Astrolabe:GetZoneWidth(c, 0), contY / QuestHelper.Astrolabe:GetZoneHeight(c, 0)
local solid = { ["continent"] = c, contX - 10, contY - 10, contX + 10, contY - 10, contX + 10, contY + 10, contX - 10, contY + 10 }
local ret = {}
ret.solid = solid
ret.criteria = {}
local questIdx = GetQuestLogIndexByID(qid)
local numCrit = GetNumQuestLeaderBoards(questIdx)
local loc = { ["loc"] = { { ["p"] = qMapId, ["x"] = contX, ["y"] = contY} } }
for i = 1, numCrit do
table.insert(ret.criteria, loc)
end
ret.name = GetQuestLogTitle(questIdx)
ret.Blizzard = true
return ret
end
local function GetLightHeadedQuestInfo(qid)
if not LightHeaded or type(LightHeaded) ~= "table" then return nil end -- LH not loaded
local npcid, npcname, stype
local coords = {}
_, _, _, _, _, _, _, stype, npcname, npcid = LightHeaded:GetQuestInfo(qid)
-- Note: If we want the quest giver, we need fields 5, 6 and 7 above, rather than what we have gotten.
--
if stype == "npc" then
local data = LightHeaded:LoadNPCData(tonumber(npcid))
if not data then return end -- LightHeaded has no clue about the given NPC, despite giving us the id.
for zid,x,y in data:gmatch("([^,]+),([^,]+),([^:]+):") do
table.insert(coords, {["p"] = zid, ["x"] = x, ["y"] = y})
end
end
--can't return coordinates until we know more about what we are getting and then convert accordingly.
for k, v in pairs(coords) do for k1, v1 in pairs(v) do print(k, k1, v1) end end
--return coords
return nil
end
local function GetSelfQuestInfo(qid)
return nil
end
-- Returns x and y in yards relative to something... Continent?
local function GetQuestInfo(qid)
assert(type(qid) == "number")
local coords = GetSelfQuestInfo(qid)
--if not coords then coords = GetLightHeadedQuestInfo(qid) end
if not coords then
coords = GetBlizzardQuestInfo(qid)
end
return coords -- Might still be nil, but if we don't have anything from Blizz, prolly nothing can be done.
end end
function DB_GetItem(group, id, silent, register) function DB_GetItem(group, id, silent, register)
@ -204,25 +310,7 @@ function DB_GetItem(group, id, silent, register)
-- Loop over zones AND floors -- Loop over zones AND floors
-- see QuestRouterLite.lua for specific calls. -- see QuestRouterLite.lua for specific calls.
-- In the end, the item returned MUST be "formatted" the same as a true QHDB item. -- In the end, the item returned MUST be "formatted" the same as a true QHDB item.
ite = {} ite = GetQuestInfo(id)
local origC = GetCurrentMapContinent()
local origZ = GetCurrentMapZone()
local myPois = {}
local myCount = 1
for c, cname in ipairs({GetMapContinents()}) do
for z, zname in ipairs({GetMapZones(c)}) do
local pois, zoneHasQuests = GetZonePOIs(c, z)
if zoneHasQuests and pois[id] then
ite:insert(pois[id])
end
end
end
SetMapZoom(origC, origZ)
-- Convert POIs appropriately.
-- Set ite to the correctly formatted POIs.
end end
if not ite then if not ite then
@ -312,7 +400,9 @@ function DB_ReleaseItem(ite)
if frequencies[ite] == 0 then if frequencies[ite] == 0 then
--print("incinerating", freq_group[ite], freq_id[ite]) --print("incinerating", freq_group[ite], freq_id[ite])
cache[freq_group[ite]][freq_id[ite]] = nil if cache[freq_group[ite]] then
cache[freq_group[ite]][freq_id[ite]] = nil
end
freq_group[ite] = nil freq_group[ite] = nil
freq_id[ite] = nil freq_id[ite] = nil

Voir le fichier

@ -134,12 +134,14 @@ local function GetQuestMetaobjective(questid, lbcount, qindex)
-- just doublechecking here -- just doublechecking here
if not QuestCriteriaWarningBroadcast and q and q.criteria then for k, v in pairs(q.criteria) do if not QuestCriteriaWarningBroadcast and q and q.criteria then for k, v in pairs(q.criteria) do
if type(k) == "number" and k > lbcount then if type(k) == "number" and k > lbcount then
--QuestHelper:TextOut(string.format("Too many stored objectives for this quest, please report on the Questhelper homepage (%s %s %s)", questid, lbcount, k)) -- we're just going to hide this for now QuestHelper:TextOut(string.format("Too many stored objectives for this quest, please report on the Questhelper homepage (%s %s %s)", questid, lbcount, k)) -- we're just going to hide this for now
--[==[
if qindex then if qindex then
QuestHelper_ErrorCatcher_ExplicitError(false, string.format("Too many stored objectives (%s %s %s %s)", questid, lbcount, k, select(1, GetQuestLogTitle(qindex)))) QuestHelper_ErrorCatcher_ExplicitError(false, string.format("Too many stored objectives (%s %s %s %s)", questid, lbcount, k, select(1, GetQuestLogTitle(qindex))))
else else
QuestHelper_ErrorCatcher_ExplicitError(false, string.format("Too many stored objectives (%s %s %s %s)", questid, lbcount, k, v)) QuestHelper_ErrorCatcher_ExplicitError(false, string.format("Too many stored objectives (%s %s %s %s)", questid, lbcount, k, v))
end end
--]==]
QuestCriteriaWarningBroadcast = true QuestCriteriaWarningBroadcast = true
end end
end end end end
@ -172,7 +174,7 @@ local function GetQuestMetaobjective(questid, lbcount, qindex)
end end
if #ttx == 0 then if #ttx == 0 then
table.insert(ttx, {loc = {x = 5000, y = 5000, c = 0, p = 2}, icon_id = 7, type_quest_unknown = true, map_desc = {"Unknown"}}) -- this is Ashenvale, for no particularly good reason table.insert(ttx, {loc = {x = 5000, y = 5000, c = 0, p = 43}, icon_id = 7, type_quest_unknown = true, map_desc = {"Unknown"}}) -- this is Ashenvale, for no particularly good reason
ttx.type_quest_unknown = true ttx.type_quest_unknown = true
end end
@ -192,28 +194,29 @@ local function GetQuestMetaobjective(questid, lbcount, qindex)
end end
do do
local ttx = {type_quest_finish = true} if q and q.finish and q.loc then
--QuestHelper:TextOut(string.format("finny %d", q.finish.loc and #q.finish.loc or -1)) local ttx = {type_quest_finish = true}
if q and q.finish and q.finish.loc then --QuestHelper:TextOut(string.format("finny %d", q.finish.loc and #q.finish.loc or -1))
ttx.solid = horribledupe(q.finish.solid) if q and q.finish and q.finish.loc then
for m, v in ipairs(q.finish.loc) do ttx.solid = horribledupe(q.finish.solid)
--print(v.rc, v.rz) for m, v in ipairs(q.finish.loc) do
--print(QuestHelper_IndexLookup[v.rc]) --print(v.rc, v.rz)
--print(QuestHelper_IndexLookup[v.rc][v.rz]) --print(QuestHelper_IndexLookup[v.rc])
table.insert(ttx, {desc = "Turn in quest", why = ite, loc = {x = v.x, y = v.y, c = QuestHelper_ParentLookup[v.p], p = v.p}, tracker_hidden = true, cluster = ttx, icon_id = 7, type_quest = ite.type_quest}) --print(QuestHelper_IndexLookup[v.rc][v.rz])
table.insert(ttx, {desc = "Turn in quest", why = ite, loc = {x = v.x, y = v.y, c = QuestHelper_ParentLookup[v.p], p = v.p}, tracker_hidden = true, cluster = ttx, icon_id = 7, type_quest = ite.type_quest})
end
end end
end
if #ttx == 0 then if #ttx == 0 then
table.insert(ttx, {desc = "Turn in quest", why = ite, loc = {x = 5000, y = 5000, c = 0, p = 2}, tracker_hidden = true, cluster = ttx, icon_id = 7, type_quest = ite.type_quest, type_quest_unknown = true}) -- this is Ashenvale, for no particularly good reason table.insert(ttx, {desc = "Turn in quest", why = ite, loc = {x = 5000, y = 5000, c = 0, p = 43}, tracker_hidden = true, cluster = ttx, icon_id = 7, type_quest = ite.type_quest, type_quest_unknown = true}) -- this is Ashenvale, for no particularly good reason
ttx.type_quest_unknown = true ttx.type_quest_unknown = true
end end
ite.finish = ttx ite.finish = ttx
end
end end
quest_list[questid] = ite quest_list[questid] = ite
if q then DB_ReleaseItem(q) end if q then DB_ReleaseItem(q) end
end end
@ -799,7 +802,9 @@ function QH_UpdateQuests(force)
end end
end end
db.finish.tooltip_defer_questname = title -- we're using this as our fallback right now if db.finish then
db.finish.tooltip_defer_questname = title -- we're using this as our fallback right now
end
next_chunks[id] = chunk next_chunks[id] = chunk

Voir le fichier

@ -427,6 +427,26 @@ local function rightclick_menu(obj)
end end
end end
function QuestHelper:PlaceIconOnWorldMap( worldMapFrame, icon, map, dLvl, xPos, yPos )
assert(type(worldMapFrame) == "table")
assert(worldMapFrame.GetWidth and worldmapFrame.GetHeight)
assert(type(icon) == "table")
assert(icon.SetPoint and icon.ClearAllPoints)
assert(type(map) == "number")
assert(type(dLvl) == "number" or dLvl == nil)
assert(type(xPos) == "number")
assert(type(yPos) == "number")
if dLvl == nil then dLvl = 0 end
if map == -1 then return end -- Can't do anything without continent knowledge
local nMap, nFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel() or 0
local nCont
if nMap == -1 then cont = GetCurrentMapContinent() end
end
function QuestHelper:CreateWorldMapDodad(objective, nxt) function QuestHelper:CreateWorldMapDodad(objective, nxt)
local icon = CreateFrame("Button", nil, QuestHelper.map_overlay) local icon = CreateFrame("Button", nil, QuestHelper.map_overlay)
icon:SetFrameStrata("FULLSCREEN") icon:SetFrameStrata("FULLSCREEN")

Voir le fichier

@ -289,6 +289,8 @@ function Astrolabe:ComputeDistance( c1, z1, x1, y1, c2, z2, x2, y2 )
return dist, xDelta, yDelta; return dist, xDelta, yDelta;
end end
local yards
function Astrolabe:TranslateWorldMapPosition( C, Z, xPos, yPos, nC, nZ ) function Astrolabe:TranslateWorldMapPosition( C, Z, xPos, yPos, nC, nZ )
--[[ --[[
argcheck(C, 2, "number"); argcheck(C, 2, "number");
@ -325,7 +327,7 @@ function Astrolabe:TranslateWorldMapPosition( C, Z, xPos, yPos, nC, nZ )
zoneData = WorldMapSize[C]; zoneData = WorldMapSize[C];
local parentContinent = zoneData.parentContinent; local parentContinent = zoneData.parentContinent;
xPos, yPos = getContPosition(zoneData, Z, xPos, yPos); xPos, yPos = getContPosition(zoneData, Z, xPos, yPos);
if not xPos or not yPos then return end -- there is no such zone. why are you asking me such silly things? you are a terrible person. leave me in my despair. if not xPos or not yPos then return end -- there is no such zone. why are you asking me such silly things? you are a terrible person. leave me in my despair.
if ( C ~= parentContinent ) then if ( C ~= parentContinent ) then
-- translate up to world map if we aren't there already -- translate up to world map if we aren't there already
xPos = xPos + zoneData.xOffset; xPos = xPos + zoneData.xOffset;
@ -379,6 +381,14 @@ function Astrolabe:GetZoneWidth(c, z)
end end
end end
function Astrolabe:GetZoneHeight(c, z)
if z ~= 0 then
return WorldMapSize[c][z].height
else
return WorldMapSize[c].height
end
end
--***************************************************************************** --*****************************************************************************
-- This function will do its utmost to retrieve some sort of valid position -- This function will do its utmost to retrieve some sort of valid position
-- for the specified unit, including changing the current map zoom (if needed). -- for the specified unit, including changing the current map zoom (if needed).
@ -1196,8 +1206,8 @@ WorldMapSize = {
AhnQirajTheFallenKingdom = { AhnQirajTheFallenKingdom = {
height = 2700.0, height = 2700.0,
width = 4049.99983215332, width = 4049.99983215332,
xOffset = 0, xOffset = -3891.6665,
yOffset = 0, yOffset = -8033.333,
mapID = 772 mapID = 772
}, },
Ashenvale = { Ashenvale = {
@ -1222,8 +1232,8 @@ WorldMapSize = {
mapID = 3524, mapID = 3524,
}, },
Barrens = { Barrens = {
height = 6756.202067150937, height = 3831.24987792969,
width = 10133.44343943073, width = 5745.83332824707,
xOffset = 14443.84117394525, xOffset = 14443.84117394525,
yOffset = 11187.32013604393, yOffset = 11187.32013604393,
mapID = 17, mapID = 17,
@ -1287,15 +1297,15 @@ WorldMapSize = {
Hyjal = { Hyjal = {
height = 2831.24975585938, height = 2831.24975585938,
width = 4245.83337402344, width = 4245.83337402344,
xOffset = 0, xOffset = 929.167,
yOffset = 0, yOffset = 6195.833,
mapID = 606 mapID = 606
}, },
Hyjal_terrain1 = { Hyjal_terrain1 = {
height = 2831.24975585938, height = 2831.24975585938,
width = 4245.83337402344, width = 4245.83337402344,
xOffset = 0, xOffset = 929.167,
yOffset = 0, yOffset = 6195.833,
mapID = 683 mapID = 683
}, },
Moonglade = { Moonglade = {
@ -1329,8 +1339,8 @@ WorldMapSize = {
SouthernBarrens = { SouthernBarrens = {
height = 4941.66665649414, height = 4941.66665649414,
width = 7412.5, width = 7412.5,
xOffset = 0, xOffset = -1356.25,
yOffset = 0, yOffset = 204.167,
mapID = 607 mapID = 607
}, },
StonetalonMountains = { StonetalonMountains = {
@ -1378,8 +1388,8 @@ WorldMapSize = {
Uldum = { Uldum = {
height = 4129.16650390625, height = 4129.16650390625,
width = 6193.74975585938, width = 6193.74975585938,
xOffset = 0, xOffset = -2441.667,
yOffset = 0, yOffset = -8029.1665,
mapID = 720 mapID = 720
}, },
UngoroCrater = { UngoroCrater = {
@ -1519,17 +1529,17 @@ WorldMapSize = {
mapID = 44, mapID = 44,
}, },
RuinsofGilneas = { RuinsofGilneas = {
height = 889.583251953125, height = 2097.916668701172,
width = 593.749877929688, width = 3145.83325195312,
xOffset = 0, xOffset = -3439.583,
yOffset = 0, yOffset = -533.333,
mapID = 611 mapID = 611
}, },
RuinsofGilneasCity = { RuinsofGilneasCity = {
height = 889.583251953125, height = 889.583251953125,
width = 593.749877929688, width = 593.749877929688,
xOffset = 0, xOffset = -1933.333,
yOffset = 0, yOffset = -1306.25,
mapID = 685 mapID = 685
}, },
SearingGorge = { SearingGorge = {
@ -1561,8 +1571,8 @@ WorldMapSize = {
mapID = 1519, mapID = 1519,
}, },
StranglethornVale = { -- Split to Vale, Jungle and Cape StranglethornVale = { -- Split to Vale, Jungle and Cape
height = 4254.18312444072, height = 4368.75,
width = 6381.248484543122, width = 6552.0830078125,
xOffset = 15951.13375783437, xOffset = 15951.13375783437,
yOffset = 22345.18258706305, yOffset = 22345.18258706305,
mapID = 33, mapID = 33,
@ -1570,8 +1580,8 @@ WorldMapSize = {
StranglethornJungle = { StranglethornJungle = {
height = 2733.3330078125, height = 2733.3330078125,
width = 4099.99987792969, width = 4099.99987792969,
xOffset = 0, xOffset = -1743.750,
yOffset = 0, yOffset = -11016.666,
mapID = 37 mapID = 37
}, },
Sunwell = { Sunwell = {
@ -1591,8 +1601,8 @@ WorldMapSize = {
TheCapeOfStranglethorn = { TheCapeOfStranglethorn = {
height = 2631.25, height = 2631.25,
width = 3945.83312988281, width = 3945.83312988281,
xOffset = 0, xOffset = -2108.333,
yOffset = 0, yOffset = -12516.666,
mapID = 673 mapID = 673
}, },
Tirisfal = { Tirisfal = {
@ -1605,29 +1615,29 @@ WorldMapSize = {
TolBarad = { TolBarad = {
height = 1343.75, height = 1343.75,
width = 2014.58329248428, width = 2014.58329248428,
xOffset = 0, xOffset = -2010.417,
yOffset = 0, yOffset = -560.417,
mapID = 708 mapID = 708
}, },
TolBaradDailyArea = { TolBaradDailyArea = {
height = 1224.99993896484, height = 1224.99993896484,
width = 1837.5, width = 1837.5,
xOffset = 0, xOffset = -2412.5,
yOffset = 0, yOffset = 377.083,
mapID = 709 mapID = 709
}, },
TwilightHighlands = { TwilightHighlands = {
height = 3514.5830078125, height = 3514.5830078125,
width = 5270.8330078125, width = 5270.8330078125,
xOffset = 0, xOffset = 2437.5,
yOffset = 0, yOffset = -2156.25,
mapID = 700 mapID = 700
}, },
TwilightHighlands_terrain1 = { TwilightHighlands_terrain1 = {
height = 3514.5830078125, height = 3514.5830078125,
width = 5270.8330078125, width = 5270.8330078125,
xOffset = 0, xOffset = 2437.5,
yOffset = 0, yOffset = -2156.25,
mapID = 770 mapID = 770
}, },
Undercity = { Undercity = {
@ -1640,29 +1650,29 @@ WorldMapSize = {
Vashjir = { Vashjir = {
height = 4631.24975585938, height = 4631.24975585938,
width = 6945.83276367188, width = 6945.83276367188,
xOffset = 0, xOffset = -8754.166,
yOffset = 0, yOffset = -3720.833,
mapID = 613 mapID = 613
}, },
VashjirDepths = { VashjirDepths = {
height = 2716.66650390625, height = 2716.66650390625,
width = 4075.0, width = 4075.0,
xOffset = 0, xOffset = -8233.333,
yOffset = 0, yOffset = -4906.25,
mapID = 614 mapID = 614
}, },
VashjirKelpForest = { VashjirKelpForest = {
height = 1868.75024414062, height = 1868.75024414062,
width = 2802.0830078125, width = 2802.0830078125,
xOffset = 0, xOffset = -5070.833,
yOffset = 0, yOffset = -4018.75,
mapID = 610 mapID = 610
}, },
VashjirRuins = { VashjirRuins = {
height = 3233.3330078125, height = 3233.3330078125,
width = 4849.99963378906, width = 4849.99963378906,
xOffset = 0, xOffset = -6681.25,
yOffset = 0, yOffset = -4756.25,
mapID = 615 mapID = 615
}, },
WesternPlaguelands = { WesternPlaguelands = {
@ -1840,10 +1850,10 @@ WorldMapSize = {
mapID = 66, mapID = 66,
}, },
HrothgarsLanding = { HrothgarsLanding = {
height = 2452.7, height = 2452.083984375,
width = 2452.7*1.5, width = 3677.08312988281,
xOffset = 23967.599 - 17549.182, xOffset = 6418.417,
yOffset = 1027.392 - 1215.431, yOffset = -188.039,
} }
}, },
}, },
@ -1855,12 +1865,12 @@ WorldMapSize = {
xOffset = 0.0, xOffset = 0.0,
yOffset = 0.0, yOffset = 0.0,
zoneData = { zoneData = {
Deepholm = { height = 3399.999877929688, width = 5099.9987792969, xOffset = 0, yOffset = 0, mapID = 640 }, Deepholm = { height = 3399.999877929688, width = 5099.9987792969, xOffset = -3052.083, yOffset = 2795.833, mapID = 640 },
Kezan = { height = 900.00048828125, width = 1352.08319091797, xOffset = 0, yOffset = 0, mapID = 605 }, Kezan = { height = 900.00048828125, width = 1352.08319091797, xOffset = -2129.167, yOffset = -7731.25, mapID = 605 },
TheLostIsles = { height = 3010.41665649414, width = 4514.5830078125, xOffset = 0, yOffset = 0, mapID = 544 }, TheLostIsles = { height = 3010.41665649414, width = 4514.5830078125, xOffset = -4383.333, yOffset = 2881.25, mapID = 544 },
TheLostIsles_terrain1 = { height = 3010.41665649414, width = 4514.5830078125, xOffset = 0, yOffset = 0, mapID = 681 }, TheLostIsles_terrain1 = { height = 3010.41665649414, width = 4514.5830078125, xOffset = -4383.333, yOffset = 2881.25, mapID = 681 },
TheLostIsles_terrain2 = { height = 3010.41665649414, width = 4514.5830078125, xOffset = 0, yOffset = 0, mapID = 682 }, TheLostIsles_terrain2 = { height = 3010.41665649414, width = 4514.5830078125, xOffset = -4383.333, yOffset = 2881.25, mapID = 682 },
TheMaelstrom = { height = 1033.33325195312, width = 1550.0, xOffset = 0, yOffset = 0, mapID = 737 } TheMaelstrom = { height = 1033.33325195312, width = 1550.0, xOffset = -1556.25, yOffset = 1370.833, mapID = 737 }
} }
} }
} }

Voir le fichier

@ -0,0 +1,25 @@
------------------------------------------------------------------------
r100 | kagaro | 2011-12-02 00:28:58 +0000 (Fri, 02 Dec 2011) | 1 line
Changed paths:
A /tags/0.21-release (from /trunk:99)
Tagging as 0.21-release
------------------------------------------------------------------------
r99 | kagaro | 2011-12-02 00:27:41 +0000 (Fri, 02 Dec 2011) | 1 line
Changed paths:
M /trunk/library.lua
Updated lib from forum tests that shows game data incorrect
------------------------------------------------------------------------
r97 | kagaro | 2011-11-29 12:06:46 +0000 (Tue, 29 Nov 2011) | 1 line
Changed paths:
M /trunk/LibMapData-1.0.toc
toc bump
------------------------------------------------------------------------
r96 | kagaro | 2011-11-28 13:01:19 +0000 (Mon, 28 Nov 2011) | 1 line
Changed paths:
M /trunk/library.lua
Adding 4.3 zone data
------------------------------------------------------------------------

Voir le fichier

@ -0,0 +1,14 @@
## Interface: 40300
## Title: Lib: MapData-1.0
## Notes: Static library of wow map data
## Version: 1.0.99
## Author: kagaro
## X-Category: Library
## X-Curse-Packaged-Version: 0.21-release
## X-Curse-Project-Name: LibMapData-1.0
## X-Curse-Project-ID: libmapdata-1-0
## X-Curse-Repository-ID: wow/libmapdata-1-0/mainline
library.lua
Libs/LibStub/LibStub.lua
Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml

Voir le fichier

@ -0,0 +1,240 @@
--[[ $Id: CallbackHandler-1.0.lua 14 2010-08-09 00:43:38Z mikk $ ]]
local MAJOR, MINOR = "CallbackHandler-1.0", 6
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
if not CallbackHandler then return end -- No upgrade needed
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
-- Lua APIs
local tconcat = table.concat
local assert, error, loadstring = assert, error, loadstring
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: geterrorhandler
local xpcall = xpcall
local function errorhandler(err)
return geterrorhandler()(err)
end
local function CreateDispatcher(argCount)
local code = [[
local next, xpcall, eh = ...
local method, ARGS
local function call() method(ARGS) end
local function dispatch(handlers, ...)
local index
index, method = next(handlers)
if not method then return end
local OLD_ARGS = ARGS
ARGS = ...
repeat
xpcall(call, eh)
index, method = next(handlers, index)
until not method
ARGS = OLD_ARGS
end
return dispatch
]]
local ARGS, OLD_ARGS = {}, {}
for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end
code = code:gsub("OLD_ARGS", tconcat(OLD_ARGS, ", ")):gsub("ARGS", tconcat(ARGS, ", "))
return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler)
end
local Dispatchers = setmetatable({}, {__index=function(self, argCount)
local dispatcher = CreateDispatcher(argCount)
rawset(self, argCount, dispatcher)
return dispatcher
end})
--------------------------------------------------------------------------
-- CallbackHandler:New
--
-- target - target object to embed public APIs in
-- RegisterName - name of the callback registration API, default "RegisterCallback"
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused)
-- TODO: Remove this after beta has gone out
assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused")
RegisterName = RegisterName or "RegisterCallback"
UnregisterName = UnregisterName or "UnregisterCallback"
if UnregisterAllName==nil then -- false is used to indicate "don't want this method"
UnregisterAllName = "UnregisterAllCallbacks"
end
-- we declare all objects and exported APIs inside this closure to quickly gain access
-- to e.g. function names, the "target" parameter, etc
-- Create the registry object
local events = setmetatable({}, meta)
local registry = { recurse=0, events=events }
-- registry:Fire() - fires the given event/message into the registry
function registry:Fire(eventname, ...)
if not rawget(events, eventname) or not next(events[eventname]) then return end
local oldrecurse = registry.recurse
registry.recurse = oldrecurse + 1
Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...)
registry.recurse = oldrecurse
if registry.insertQueue and oldrecurse==0 then
-- Something in one of our callbacks wanted to register more callbacks; they got queued
for eventname,callbacks in pairs(registry.insertQueue) do
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
for self,func in pairs(callbacks) do
events[eventname][self] = func
-- fire OnUsed callback?
if first and registry.OnUsed then
registry.OnUsed(registry, target, eventname)
first = nil
end
end
end
registry.insertQueue = nil
end
end
-- Registration of a callback, handles:
-- self["method"], leads to self["method"](self, ...)
-- self with function ref, leads to functionref(...)
-- "addonId" (instead of self) with function ref, leads to functionref(...)
-- all with an optional arg, which, if present, gets passed as first argument (after self if present)
target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]])
if type(eventname) ~= "string" then
error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2)
end
method = method or eventname
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
if type(method) ~= "string" and type(method) ~= "function" then
error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2)
end
local regfunc
if type(method) == "string" then
-- self["method"] calling style
if type(self) ~= "table" then
error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2)
elseif self==target then
error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2)
elseif type(self[method]) ~= "function" then
error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2)
end
if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
local arg=select(1,...)
regfunc = function(...) self[method](self,arg,...) end
else
regfunc = function(...) self[method](self,...) end
end
else
-- function ref with self=object or self="addonId" or self=thread
if type(self)~="table" and type(self)~="string" and type(self)~="thread" then
error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2)
end
if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
local arg=select(1,...)
regfunc = function(...) method(arg,...) end
else
regfunc = method
end
end
if events[eventname][self] or registry.recurse<1 then
-- if registry.recurse<1 then
-- we're overwriting an existing entry, or not currently recursing. just set it.
events[eventname][self] = regfunc
-- fire OnUsed callback?
if registry.OnUsed and first then
registry.OnUsed(registry, target, eventname)
end
else
-- we're currently processing a callback in this registry, so delay the registration of this new entry!
-- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency
registry.insertQueue = registry.insertQueue or setmetatable({},meta)
registry.insertQueue[eventname][self] = regfunc
end
end
-- Unregister a callback
target[UnregisterName] = function(self, eventname)
if not self or self==target then
error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2)
end
if type(eventname) ~= "string" then
error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2)
end
if rawget(events, eventname) and events[eventname][self] then
events[eventname][self] = nil
-- Fire OnUnused callback?
if registry.OnUnused and not next(events[eventname]) then
registry.OnUnused(registry, target, eventname)
end
end
if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then
registry.insertQueue[eventname][self] = nil
end
end
-- OPTIONAL: Unregister all callbacks for given selfs/addonIds
if UnregisterAllName then
target[UnregisterAllName] = function(...)
if select("#",...)<1 then
error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2)
end
if select("#",...)==1 and ...==target then
error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2)
end
for i=1,select("#",...) do
local self = select(i,...)
if registry.insertQueue then
for eventname, callbacks in pairs(registry.insertQueue) do
if callbacks[self] then
callbacks[self] = nil
end
end
end
for eventname, callbacks in pairs(events) do
if callbacks[self] then
callbacks[self] = nil
-- Fire OnUnused callback?
if registry.OnUnused and not next(callbacks) then
registry.OnUnused(registry, target, eventname)
end
end
end
end
end
end
return registry
end
-- CallbackHandler purposefully does NOT do explicit embedding. Nor does it
-- try to upgrade old implicit embeds since the system is selfcontained and
-- relies on closures to work.

Voir le fichier

@ -0,0 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="CallbackHandler-1.0.lua"/>
</Ui>

Voir le fichier

@ -0,0 +1,30 @@
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
local LibStub = _G[LIBSTUB_MAJOR]
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
local oldminor = self.minors[major]
if oldminor and oldminor >= minor then return nil end
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
return self.libs[major], oldminor
end
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
end
return self.libs[major], self.minors[major]
end
function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary })
end

Voir le fichier

@ -0,0 +1,13 @@
## Interface: 20400
## Title: Lib: LibStub
## Notes: Universal Library Stub
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
## X-Website: http://jira.wowace.com/browse/LS
## X-Category: Library
## X-License: Public Domain
## X-Curse-Packaged-Version: 1.0
## X-Curse-Project-Name: LibStub
## X-Curse-Project-ID: libstub
## X-Curse-Repository-ID: wow/libstub/mainline
LibStub.lua

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -375,7 +375,7 @@ Route_Core_Init(
rvv = QuestHelper:CreateTable("route controller path shunt returnvalue") rvv = QuestHelper:CreateTable("route controller path shunt returnvalue")
local rv = QH_Graph_Pathmultifind(loc1.loc, lt, reverse, true) local rv = QH_Graph_Pathmultifind(loc1.loc, lt, reverse, true)
QuestHelper: Assert(#lt == #rv, string.format("lt has %d items, rt has %d items. Both should be the same.", #lt, #rv)) --QuestHelper: Assert(#lt == #rv, string.format("lt has %d items, rt has %d items. Both should be the same.", #lt, #rv))
-- We want to store the math.max(sqrt(#rv), 10) shortest paths -- We want to store the math.max(sqrt(#rv), 10) shortest paths
local tostore = complete_pass and math.max(sqrt(#rv), 10) or #rv local tostore = complete_pass and math.max(sqrt(#rv), 10) or #rv

Voir le fichier

@ -36,6 +36,10 @@ local last_stack = nil
local yield_ct = 0 local yield_ct = 0
local GetTime = GetTime local GetTime = GetTime
local unyieldable = 0 local unyieldable = 0
function QH_Timeslice_GetUnyieldable()
return unyieldable
end
function QH_Timeslice_PushUnyieldable() function QH_Timeslice_PushUnyieldable()
unyieldable = unyieldable + 1 unyieldable = unyieldable + 1
--print(unyieldable) --print(unyieldable)
@ -193,7 +197,7 @@ function QH_Timeslice_Work(time_used, time_this_frame, bonus_time, verbose)
coroutine_running = true coroutine_running = true
QuestHelper: Assert(unyieldable == 0) QuestHelper: Assert(unyieldable == 0)
state, err = coroutine.resume(coro.coro) state, err = coroutine.resume(coro.coro)
QuestHelper: Assert(unyieldable == 0) QuestHelper: Assert(unyieldable == 0, "Unyieldable was " .. unyieldable)
coroutine_running = false coroutine_running = false
end end
local stop = GetTime() local stop = GetTime()

Voir le fichier

@ -1,4 +1,5 @@
function QuestHelper_GetTime() function QuestHelper_GetTime()
if inWorld then return theTime end
if IsMacClient() then return debugprofilestop() if IsMacClient() then return debugprofilestop()
else return debugprofilestop() / 1000 else return debugprofilestop() / 1000
end end
@ -9,7 +10,14 @@ local GetTime = QuestHelper_GetTime
QuestHelper_File["utility.lua"] = "4.0.1.$svnversion$" QuestHelper_File["utility.lua"] = "4.0.1.$svnversion$"
QuestHelper_Loadtime["utility.lua"] = GetTime() QuestHelper_Loadtime["utility.lua"] = GetTime()
local theTime = GetTime()
local inWorld = false
QuestHelper = CreateFrame("Frame", "QuestHelper", nil) QuestHelper = CreateFrame("Frame", "QuestHelper", nil)
local TimeUpdater = CreateFrame("Frame", "TimeUpdater", nil)
TimeUpdater:SetScript("OnUpdate", function () theTime = GetTime() end)
TimeUpdater:RegisterEvent("PLAYER_ENTERING_WORLD")
TimeUpdater:SetScript("OnEvent", function () inWorld = true end)
--[[ static ]] ALLIANCE = 1 --[[ static ]] ALLIANCE = 1
--[[ static ]] HORDE = 2 --[[ static ]] HORDE = 2