Mercurial > wow > buffalo2
diff ObjectiveTracker/ObjectiveTracker.lua @ 30:7583684becf4
- implement procedural block contents generation
- redo anchor calculations to allow for transitional animation
- attempt to sort out event handling quirks related to autopopup quest completion and turn-in
- revise the data structures created by the different GetInfo's
- start on trimming out redundant variables
author | Nenue |
---|---|
date | Thu, 14 Apr 2016 17:11:13 -0400 |
parents | adcd7c328d07 |
children | a3afe6c3771e |
line wrap: on
line diff
--- a/ObjectiveTracker/ObjectiveTracker.lua Wed Apr 13 21:53:24 2016 -0400 +++ b/ObjectiveTracker/ObjectiveTracker.lua Thu Apr 14 17:11:13 2016 -0400 @@ -7,7 +7,6 @@ local pairs, setmetatable, type, tostring, band, format = _G.pairs, _G.setmetatable, _G.type, _G.tostring, bit.band, string.format local ipairs, tinsert, hooksecurefunc = _G.ipairs, _G.tinsert, _G.hooksecurefunc local PlaySoundFile, IsQuestTask, SortQuestWatches, GetCurrentMapAreaID, GetZoneText, GetMinimapZoneText = PlaySoundFile, IsQuestTask, SortQuestWatches, GetCurrentMapAreaID, GetZoneText, GetMinimapZoneText -local AddQuestWatch, SetSuperTrackedQuestID, GetNumQuestWatches, AUTO_QUEST_WATCH, MAX_WATCHABLE_QUESTS = AddQuestWatch, SetSuperTrackedQuestID, GetNumQuestWatches, AUTO_QUEST_WATCH, MAX_WATCHABLE_QUESTS local QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone = QuestPOIUpdateIcons, GetCVar, IsPlayerInMicroDungeon, WorldMapFrame, GetCVarBool, SetMapToCurrentZone local AddAutoQuestPopUp = AddAutoQuestPopUp local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame') @@ -247,6 +246,7 @@ local frame = CreateFrame('Frame', trackerName, _G.VeneerObjectiveScroll, 'VeneerTrackerTemplate') frame.title:SetText(handler.displayName) frame:SetWidth(c.Width) + frame.previousOffset = 0 handler.frame = frame handler.numBlocks = 0 @@ -266,18 +266,23 @@ Event.QUEST_LOG_UPDATE = function() return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST + OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE end -Event.QUEST_ACCEPTED = function(questLogIndex, questID) +local GetNumQuestWatches, AddQuestWatch, SetSuperTrackedQuestID = GetNumQuestWatches, AddQuestWatch, SetSuperTrackedQuestID +Event.QUEST_ACCEPTED = function(questLogIndex, questID, added) if ( IsQuestTask(questID) ) then return OBJECTIVE_TRACKER_UPDATE_TASK_ADDED, questID else - if ( AUTO_QUEST_WATCH == "1" and GetNumQuestWatches() < MAX_WATCHABLE_QUESTS ) then + if ( _G.AUTO_QUEST_WATCH == "1" ) then AddQuestWatch(questLogIndex); SetSuperTrackedQuestID(questID); end - return OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST + return OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED, questID, added end end +Event.QUEST_REMOVED = function(questLogIndex, questID) + return OBJECTIVE_TRACKER_UPDATE_QUEST, questID, false +end + Event.QUEST_WATCH_LIST_CHANGED = function(questID, added) if ( added ) then if ( not IsQuestTask(questID) ) then @@ -428,13 +433,15 @@ end end else - Play([[Interface\Addons\SharedMedia_MyMedia\sound\Heart.ogg]]) + --Play([[Interface\Addons\SharedMedia_MyMedia\sound\Heart.ogg]]) reason = Event[event] end else - Play([[Interface\Addons\SharedMedia_MyMedia\sound\Quack.ogg]]) + print('no event handler set for', event) + Play([[Interface\Addons\SharedMedia_MyMedia\sound\IM.ogg]]) end if reason then + print('update reason:', reason, 'args:', arg1, arg2, arg3) T:Update(reason, arg1, arg2, arg3) else print('no reason value returned') @@ -491,7 +498,7 @@ end local c = T.Conf.Wrapper - + Wrapper.previousHeight = 0 Scroller:SetScrollChild(Scroll) Scroller:SetWidth(c.Width) Scroll:SetWidth(c.Width) @@ -504,7 +511,6 @@ local from, target, to, x, y = Wrapper:GetPoint(1) print(from, target:GetName(), to, x,y) - T:Update() -- run once to prime the data structure T.UpdateActionButtons()