Mercurial > wow > buffalo2
comparison ObjectiveEvents.lua @ 16:880828018bf4
ObjectiveEvents
- trim down the number of events that fire full updates
- begin the general outline for determining which trackers need to refresh
- handlers for accepting and completing auto-popup quests
ObjectiveFrame
- correct variables for money reward calculation
- make sure everythign is scaling to the font strings and that the font strings aren't being pinned by SetSize
ObjectiveInfo
- implementation of autoquest popups
- discern between internal and client bonus objective indexes
- acquire the correct data set from bonus objective query
ObjectiveStyle
- look for a style table under the previously interpreted set before deferring standard options
- horizontal/vertical options in gradient
- remove height-fixing for font strings
author | Nenue |
---|---|
date | Tue, 05 Apr 2016 00:39:12 -0400 |
parents | 7923243ae972 |
children | 605e8f0e46db |
comparison
equal
deleted
inserted
replaced
15:f660f1c1e0aa | 16:880828018bf4 |
---|---|
11 local SmallEvents = { | 11 local SmallEvents = { |
12 QUEST_ACCEPTED = 'OnQuestAccepted', | 12 QUEST_ACCEPTED = 'OnQuestAccepted', |
13 QUEST_REMOVED = 'OnQuestRemoved' | 13 QUEST_REMOVED = 'OnQuestRemoved' |
14 } | 14 } |
15 | 15 |
16 --- Using the same values as Blizzard_ObjectiveTracker for use in securehook | |
17 local OBJECTIVE_TRACKER_UPDATE_QUEST = 0x0001; | |
18 local OBJECTIVE_TRACKER_UPDATE_QUEST_ADDED = 0x0002; | |
19 local OBJECTIVE_TRACKER_UPDATE_TASK_ADDED = 0x0004; | |
20 local OBJECTIVE_TRACKER_UPDATE_SCENARIO = 0x0008; | |
21 local OBJECTIVE_TRACKER_UPDATE_SCENARIO_NEW_STAGE = 0x0010; | |
22 local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT = 0x0020; | |
23 local OBJECTIVE_TRACKER_UPDATE_ACHIEVEMENT_ADDED = 0x0040; | |
24 local OBJECTIVE_TRACKER_UPDATE_SCENARIO_BONUS_DELAYED = 0x0080; | |
25 | |
26 local OBJECTIVE_TRACKER_UPDATE_MODULE_QUEST = 0x0100; | |
27 local OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP = 0x0200; | |
28 local OBJECTIVE_TRACKER_UPDATE_MODULE_BONUS_OBJECTIVE = 0x0400; | |
29 local OBJECTIVE_TRACKER_UPDATE_MODULE_SCENARIO = 0x0800; | |
30 local OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT = 0x1000; | |
31 | |
32 local OBJECTIVE_TRACKER_UPDATE_STATIC = 0x0000; | |
33 local OBJECTIVE_TRACKER_UPDATE_ALL = 0xFFFF; | |
34 | |
35 local OBJECTIVE_TRACKER_UPDATE_REASON = OBJECTIVE_TRACKER_UPDATE_ALL; -- default | |
36 local OBJECTIVE_TRACKER_UPDATE_ID = 0; | |
37 | |
16 local HandlerEvents = { | 38 local HandlerEvents = { |
17 QUEST_ACCEPTED = mod.Quest, | 39 QUEST_ACCEPTED = 0x0003, |
18 QUEST_REMOVED = mod.Quest, | 40 QUEST_WATCH_LIST_CHANGED = 0x0003, |
19 QUEST_WATCH_LIST_CHANGED = mod.Quest, | |
20 SUPER_TRACKED_QUEST_CHANGED = mod.Quest, | 41 SUPER_TRACKED_QUEST_CHANGED = mod.Quest, |
21 QUEST_LOG_UPDATE = mod.Quest, | 42 QUEST_LOG_UPDATE = mod.Quest, |
22 TRACKED_ACHIEVEMENT_LIST_CHANGED = mod.Cheevs, | 43 TRACKED_ACHIEVEMENT_LIST_CHANGED = mod.Cheevs, |
23 TRACKED_ACHIEVEMENT_UPDATE = mod.Cheevs | 44 TRACKED_ACHIEVEMENT_UPDATE = mod.Cheevs |
24 } | 45 } |
27 ['AddQuestWatch'] = 'AddQuestWatch', | 48 ['AddQuestWatch'] = 'AddQuestWatch', |
28 ['RemoveQuestWatch'] = 'RemoveQuestWatch', | 49 ['RemoveQuestWatch'] = 'RemoveQuestWatch', |
29 ['AbandonQuest'] = 'AbandonQuest', | 50 ['AbandonQuest'] = 'AbandonQuest', |
30 ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest', | 51 ['AcknowledgeAutoAcceptQuest'] = 'AcknowledgeAutoAcceptQuest', |
31 ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp', | 52 ['AddAutoQuestPopUp'] = 'AddAutoQuestPopUp', |
53 ['RemoveAutoQuestPopUp'] = 'RemoveAutoQuestPopUp', | |
32 ['RemoveTrackedAchievement'] = 'RemoveTrackedAchievement' | 54 ['RemoveTrackedAchievement'] = 'RemoveTrackedAchievement' |
33 } | 55 } |
34 | 56 |
35 mod.SetEvents = function() | 57 mod.SetEvents = function() |
36 | 58 |
68 mod[SmallEvents[event]](event, ...) | 90 mod[SmallEvents[event]](event, ...) |
69 isHandled = true | 91 isHandled = true |
70 end | 92 end |
71 if HandlerEvents[event] then | 93 if HandlerEvents[event] then |
72 print('|cFF0088FF'..event..'|r wrapper update') | 94 print('|cFF0088FF'..event..'|r wrapper update') |
73 mod.UpdateWrapper() | 95 mod.UpdateWrapper(event) |
74 isHandled = true | 96 isHandled = true |
75 end | 97 end |
76 if not isHandled then | 98 if not isHandled then |
77 print('|cFFFF4400'..event..'|r', ...) | 99 print('|cFFFF4400'..event..'|r', ...) |
78 end | 100 end |
97 end | 119 end |
98 | 120 |
99 | 121 |
100 mod.OnQuestRemoved = function(_, questLogIndex, questID) | 122 mod.OnQuestRemoved = function(_, questLogIndex, questID) |
101 | 123 |
102 mod.UpdateWrapper() | 124 mod.UpdateWrapper(0x00000003) |
103 | 125 |
104 end | 126 end |
105 | 127 |
106 mod.OnQuestFromLocation = function(event) end | 128 mod.OnQuestFromLocation = function(event) end |
107 | 129 |
108 ------------------------------------------------------------------- | 130 ------------------------------------------------------------------- |
109 --- Function hooks for BlizzUI compatibility | 131 --- Function hooks for BlizzUI compatibility |
110 ------------------------------------------------------------------- | 132 ------------------------------------------------------------------- |
111 mod.AddQuestWatch = function(questID) | 133 mod.AddQuestWatch = function(questID) |
112 mod.UpdateWrapper() | 134 mod.UpdateWrapper(0x00000003) |
113 end | 135 end |
114 | 136 |
115 mod.RemoveQuestWatch = function(questIndex, ...) | 137 mod.RemoveQuestWatch = function(questIndex, ...) |
116 print('|cFFFF8800RemoveQuestWatch', questIndex, ...) | 138 print('|cFFFF8800RemoveQuestWatch', questIndex, ...) |
117 local info = mod.Quest.LogInfo[questIndex] | 139 local info = mod.Quest.LogInfo[questIndex] |
124 if mod.Quest.WatchInfo[info.watchIndex] == info then | 146 if mod.Quest.WatchInfo[info.watchIndex] == info then |
125 print('cleaning dead WatchInfo entry') | 147 print('cleaning dead WatchInfo entry') |
126 mod.Quest.WatchInfo[info.watchIndex] = nil | 148 mod.Quest.WatchInfo[info.watchIndex] = nil |
127 end | 149 end |
128 | 150 |
129 mod.UpdateWrapper() | 151 mod.UpdateWrapper('RemovedQuestWatch' .. tostring(questIndex)) |
130 QuestPOIUpdateIcons() | 152 QuestPOIUpdateIcons() |
131 end | 153 end |
132 | 154 |
133 mod.RemoveTrackedAchievement = function(cheevID) | 155 mod.RemoveTrackedAchievement = function(cheevID) |
134 print('|cFFFF8800UntrackAchievement', cheevID) | 156 print('|cFFFF8800UntrackAchievement', cheevID) |
145 | 167 |
146 mod.TurnInQuest = function() | 168 mod.TurnInQuest = function() |
147 | 169 |
148 QuestPOIUpdateIcons() | 170 QuestPOIUpdateIcons() |
149 end | 171 end |
172 | |
173 mod.AddAutoQuestPopUp = function(...) | |
174 print('|cFFFF8800AddAutoQuestPopUp|r', ...) | |
175 mod.UpdateWrapper(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP) | |
176 end | |
177 mod.RemoveAutoQuestPopUp = function(...) | |
178 print('|cFFFF8800RemoveAutoQuestPopUp|r', ...) | |
179 mod.UpdateWrapper(OBJECTIVE_TRACKER_UPDATE_MODULE_AUTO_QUEST_POPUP) | |
180 end |