Mercurial > wow > worldplan
comparison WorldQuests.lua @ 78:fadf00b437fb v1.4.1
- Fixed pins not being removed upon completion
- Fixed animation stuttering
author | Nenue |
---|---|
date | Mon, 10 Apr 2017 13:14:05 -0400 |
parents | 836cd54c84b3 |
children | 5d33e98710a0 |
comparison
equal
deleted
inserted
replaced
77:d55ceee94714 | 78:fadf00b437fb |
---|---|
28 local GetQuestBountyInfoForMapID, GetQuestLogTitle, GetQuestLogIndexByID, IsQuestComplete = GetQuestBountyInfoForMapID, GetQuestLogTitle, GetQuestLogIndexByID, IsQuestComplete | 28 local GetQuestBountyInfoForMapID, GetQuestLogTitle, GetQuestLogIndexByID, IsQuestComplete = GetQuestBountyInfoForMapID, GetQuestLogTitle, GetQuestLogIndexByID, IsQuestComplete |
29 local IsQuestCriteriaForBounty = IsQuestCriteriaForBounty | 29 local IsQuestCriteriaForBounty = IsQuestCriteriaForBounty |
30 | 30 |
31 local ToggleButton = {} | 31 local ToggleButton = {} |
32 local callbacks = {} | 32 local callbacks = {} |
33 local PinBaseIndex = 1200 | |
34 local BROKEN_ISLES_ID, DALARAN_ID, AZSUNA_ID, VALSHARAH_ID, HIGHMOUNTAIN_ID, STORMHEIM_ID, SURAMAR_ID, EOA_ID = 1007, 1014, 1015,1018, 1024, 1017, 1033, 1096 | 33 local BROKEN_ISLES_ID, DALARAN_ID, AZSUNA_ID, VALSHARAH_ID, HIGHMOUNTAIN_ID, STORMHEIM_ID, SURAMAR_ID, EOA_ID = 1007, 1014, 1015,1018, 1024, 1017, 1033, 1096 |
35 local WORLD_QUEST_MAPS = { [DALARAN_ID] = 'Dalaran70', [AZSUNA_ID] = 'Azsuna', [VALSHARAH_ID] = "Val'sharah", | 34 local WORLD_QUEST_MAPS = { [DALARAN_ID] = 'Dalaran70', [AZSUNA_ID] = 'Azsuna', [VALSHARAH_ID] = "Val'sharah", |
36 [HIGHMOUNTAIN_ID] = 'Highmountain', [STORMHEIM_ID] = 'Stormheim', [SURAMAR_ID] = 'Suramar', [EOA_ID] = 'EyeOfAszhara', } | 35 [HIGHMOUNTAIN_ID] = 'Highmountain', [STORMHEIM_ID] = 'Stormheim', [SURAMAR_ID] = 'Suramar', [EOA_ID] = 'EyeOfAszhara', } |
37 | 36 |
38 local REWARD_CASH = WORLD_QUEST_REWARD_TYPE_FLAG_GOLD | 37 local REWARD_CASH = WORLD_QUEST_REWARD_TYPE_FLAG_GOLD |
346 local name = 'WorldPlanQuestMarker' .. numOverlays | 345 local name = 'WorldPlanQuestMarker' .. numOverlays |
347 --print('|cFF00FF00Creating', name) | 346 --print('|cFF00FF00Creating', name) |
348 pin = CreateFrame('Frame', name, WorldMapPOIFrame, 'WorldPlanQuestPin') | 347 pin = CreateFrame('Frame', name, WorldMapPOIFrame, 'WorldPlanQuestPin') |
349 | 348 |
350 pin:SetID(totalPins) | 349 pin:SetID(totalPins) |
351 pin:SetFrameStrata('HIGH') | |
352 numOverlays = numOverlays + 1 | 350 numOverlays = numOverlays + 1 |
353 --pin.iconBorder:SetVertexColor(0,0,0,1) | 351 --pin.iconBorder:SetVertexColor(0,0,0,1) |
354 end | 352 end |
355 pin.questID = questID | 353 pin.questID = questID |
356 pin.worldQuest = true | 354 pin.worldQuest = true |
383 end | 381 end |
384 | 382 |
385 | 383 |
386 if (not pin.dataLoaded) then | 384 if (not pin.dataLoaded) then |
387 local dataLoaded = pin:GetData() | 385 local dataLoaded = pin:GetData() |
388 isDataLoaded = (isDataLoaded and dataLoaded) | 386 if dataLoaded then |
389 WorldPlan.dataFlush = true | 387 WorldPlan.dataFlush = true |
388 else | |
389 isDataLoaded = false | |
390 end | |
390 end | 391 end |
391 | 392 |
392 | 393 |
393 pin.isActive = TQ_IsActive(questID) | 394 pin.isActive = TQ_IsActive(questID) |
394 pin:GetCriteriaState() | 395 pin:GetCriteriaState() |
410 zone[id] = nil | 411 zone[id] = nil |
411 end | 412 end |
412 db.TasksByID[id] = nil | 413 db.TasksByID[id] = nil |
413 end | 414 end |
414 pin.isActive = nil | 415 pin.isActive = nil |
416 pin.used = nil | |
415 pin.dataLoaded = nil | 417 pin.dataLoaded = nil |
416 pin:HideFrames() | 418 pin:SetShown(false) |
417 tinsert(db.FreePins, pin) | 419 tinsert(db.FreePins, pin) |
418 | 420 |
419 WorldPlan.dataFlush = true | 421 WorldPlan.dataFlush = true |
420 --print('|cFF00FF00-'.. (pin.mapID and GetMapNameByID(pin.mapID) or '???') ..'|r', id, pin.title) | 422 --print('|cFF00FF00-'.. (pin.mapID and GetMapNameByID(pin.mapID) or '???') ..'|r', id, pin.title) |
421 end | 423 end |
583 if pin then | 585 if pin then |
584 print(pin.title, pin.isStale) | 586 print(pin.title, pin.isStale) |
585 if pin:IsShown() and (layoutDirty or pin.isStale) then | 587 if pin:IsShown() and (layoutDirty or pin.isStale) then |
586 local scaleFactor = SCALE_FACTORS[(pin.dataLoaded and not pin.filtered) and scaleConstant or 1] | 588 local scaleFactor = SCALE_FACTORS[(pin.dataLoaded and not pin.filtered) and scaleConstant or 1] |
587 pin.owningFrame = WorldMapFrame | 589 pin.owningFrame = WorldMapFrame |
588 pin:SetFrameLevel(PinBaseIndex+pin:GetID()) | |
589 pin.Overlay:SetFrameLevel(overlayBaseIndex+pin:GetID()) | |
590 pin:SetAnchor(WorldMapPOIFrame, x, y, self.hostWidth, self.hostHeight, scaleFactor) | 590 pin:SetAnchor(WorldMapPOIFrame, x, y, self.hostWidth, self.hostHeight, scaleFactor) |
591 if pin.isStale then | 591 if pin.isStale then |
592 pin:Refresh('WORLDMAP_REFRESH ' .. GetTime()) | 592 pin:Refresh('WORLDMAP_REFRESH ' .. GetTime()) |
593 end | 593 end |
594 if mapID then | 594 if mapID then |