comparison Modules/GuildInfo.lua @ 133:86621c60512b v7.3.2-20171222

- Fixed AP calc tooltip appearing while hidden - Fixed PaperDoll relic tooltips missing nether crucible info
author Nenue
date Fri, 22 Dec 2017 20:36:40 -0500
parents 15a7f27b11e6
children
comparison
equal deleted inserted replaced
132:4cb1d2a0c110 133:86621c60512b
16 function module:OnLoad() 16 function module:OnLoad()
17 Veneer:AddHandler(self, self.anchorPoint) 17 Veneer:AddHandler(self, self.anchorPoint)
18 --self:RegisterEvent('GUILD_ROSTER_UPDATE') 18 --self:RegisterEvent('GUILD_ROSTER_UPDATE')
19 --self:RegisterEvent('GUILD_TRADESKILL_UPDATE') 19 --self:RegisterEvent('GUILD_TRADESKILL_UPDATE')
20 20
21 self:RegisterEvent('LFG_LIST_SEARCH_RESULT_UPDATED') 21 --self:RegisterEvent('LFG_LIST_SEARCH_RESULT_UPDATED')
22 --self:RegisterEvent('LFG_LIST_SEARCH_RESULTS_RECEIVED') 22 --self:RegisterEvent('LFG_LIST_SEARCH_RESULTS_RECEIVED')
23 --self:RegisterEvent('LFG_LIST_AVAILABILITY_UPDATE') 23 --self:RegisterEvent('LFG_LIST_AVAILABILITY_UPDATE')
24 --self:RegisterEvent('LFG_LIST_LOCK_INFO_RECEIVED') 24 --self:RegisterEvent('LFG_LIST_LOCK_INFO_RECEIVED')
25 self:RegisterEvent('ADDON_LOADED') 25 self:RegisterEvent('ADDON_LOADED')
26 26
72 end 72 end
73 73
74 -- cheevos to link 74 -- cheevos to link
75 local overlaps = { 75 local overlaps = {
76 [11781] = 11875, 76 [11781] = 11875,
77 77 [12002] = 12111,
78
79 } 78 }
80 local cheevos = { 79 local cheevos = {
81 -- Mythic Prog: Tomb 80 -- Mythic Prog
82 { 81 {
82 -- Antorus
83 12002, -- argus
84 12001, -- aggramar
85 12000, -- coven
86 11999, -- barry
87 11998, -- kin'garoth
88 11997, -- imonar
89 11996, -- eonar
90 11995, -- portal keeper
91 11994, -- high command
92 11993, -- doggos
93 11992, -- worldbreaker
94
95 -- Tomb of Sargeras
83 11781, -- kj 96 11781, -- kj
84 11780, -- avatar 97 11780, -- avatar
85 11779, -- maiden 98 11779, -- maiden
86 11776, -- mistress 99 11776, -- mistress
87 11778, -- host, 100 11778, -- host,
88 11777, -- sisters 101 11777, -- sisters
89 11775, -- harjatan, 102 11775, -- harjatan,
90 11774, -- di, 103 11774, -- di,
91 11773, -- goroth 104 11773, -- goroth
92 }, 105 },
93 -- Completion: Tomb 106 -- Completion
94 { 107 {
108 12111, -- CE Argus,
109 12110, -- AotC Argus,
95 11875, -- CE KJ 110 11875, -- CE KJ
96 11874, -- AotC KJ 111 11874, -- AotC KJ
97 11790 -- Deceiver's Fall, 112 11790 -- Deceiver's Fall,
98 113
99 114
103 11162, -- master 118 11162, -- master
104 11185, -- conqueror 119 11185, -- conqueror
105 } 120 }
106 } 121 }
107 122
123 local invasion = {}
108 local cheev = {} 124 local cheev = {}
109 125
110 function cheev:OnClick() 126 function cheev:OnClick()
111 local resultID = LFGListFrame.SearchPanel.selectedResult or self:GetParent().selectedID 127 local resultID = LFGListFrame.SearchPanel.selectedResult or self:GetParent().selectedID
112 print('current selection = ', resultID) 128 print('current selection = ', resultID)
117 --print(name, comment, leaderName) 133 --print(name, comment, leaderName)
118 ChatFrame_OpenChat("/w "..leaderName.." "..self.link, DEFAULT_CHAT_FRAME) 134 ChatFrame_OpenChat("/w "..leaderName.." "..self.link, DEFAULT_CHAT_FRAME)
119 end 135 end
120 end 136 end
121 137
138 function invasion:OnClick()
139
140 end
141
142 function module:UpdateInvasionButtons()
143
144 end
145
146 local listed = {}
122 147
123 function module:UpdateAchievementLinks() 148 function module:UpdateAchievementLinks()
124 print('UpdateAchievementLinks()') 149 print('UpdateAchievementLinks()')
125 150
126 local resultID = LFGListFrame.SearchPanel.selectedResult or self.selectedID 151 local resultID = LFGListFrame.SearchPanel.selectedResult or self.selectedID
132 local contentsHeight = 0 157 local contentsHeight = 0
133 for _, group in ipairs(cheevos) do 158 for _, group in ipairs(cheevos) do
134 for _, id in ipairs(group) do 159 for _, id in ipairs(group) do
135 local _, name, points, completed, month, day, year, description, flags, icon = GetAchievementInfo(id) 160 local _, name, points, completed, month, day, year, description, flags, icon = GetAchievementInfo(id)
136 if completed then 161 if completed then
162
163 -- if the highest mythic kill
164 if listed[overlaps[id]] then
165 break
166 end
167
168
137 index = index + 1 169 index = index + 1
138 --print(index) 170 --print(index)
139 local block =self.blocks[index] 171 local block =self.blocks[index]
140 if not block then 172 if not block then
141 block = CreateFrame('Button', 'VeneerRosterKunBlock'..index, self, 'VeneerRosterKunBlock') 173 block = CreateFrame('Button', 'VeneerRosterKunBlock'..index, self, 'VeneerRosterKunBlock')
158 190
159 contentsHeight = contentsHeight + block:GetHeight() 191 contentsHeight = contentsHeight + block:GetHeight()
160 192
161 --print(index, name, icon) 193 --print(index, name, icon)
162 lastBlock = block 194 lastBlock = block
195 listed[id] = true
163 break; 196 break;
164 end 197 end
165 end 198 end
166 end 199 end
200
201 --[[
202 local areaPOIs = C_WorldMap.GetAreaPOIForMap(GetCurrentMapAreaID(), 1);
203 if areaPOIs then
204
205
206 for i, areaPoiID in ipairs(areaPOIs) do
207 local poiInfo = C_WorldMap.GetAreaPOIInfo(GetCurrentMapAreaID(), areaPoiID, 1);
208
209 index = index + 1
210 --print(index)
211 local block =self.blocks[index]
212 if not block then
213 block = CreateFrame('Button', 'VeneerRosterKunBlock'..index, self, 'VeneerRosterKunBlock')
214 block:SetScript('OnClick', invasion.OnClick)
215 block:SetID(index)
216 self.blocks[index] = block
217 end
218
219
220
221 end
222 end
223 --]]
167 224
168 --print(index, #self.blocks) 225 --print(index, #self.blocks)
169 if index < #self.blocks then 226 if index < #self.blocks then
170 for i = index+1, #self.blocks do 227 for i = index+1, #self.blocks do
171 --print('hiding', i) 228 --print('hiding', i)
185 self:UpdateGuildInfo() 242 self:UpdateGuildInfo()
186 end 243 end
187 if self.AchievementsDirty or forced then 244 if self.AchievementsDirty or forced then
188 self:UpdateAchievementLinks() 245 self:UpdateAchievementLinks()
189 end 246 end
247
190 248
191 end 249 end
192 function module:SetupGuildUI() 250 function module:SetupGuildUI()
193 self:UnregisterEvent('ADDON_LOADED') 251 self:UnregisterEvent('ADDON_LOADED')
194 end 252 end
201 end 259 end
202 elseif event == 'LFG_LIST_SEARCH_RESULTS_RECEIVED' then 260 elseif event == 'LFG_LIST_SEARCH_RESULTS_RECEIVED' then
203 elseif event == 'LFG_LIST_SEARCH_RESULT_UPDATED' then 261 elseif event == 'LFG_LIST_SEARCH_RESULT_UPDATED' then
204 end 262 end
205 end 263 end
264
265
266 VeneerPetBattleActionMixin = {}
267 VeneerPetBattleInfoMixin = {}
268 local pb = VeneerPetBattleInfoMixin
269 local action = VeneerPetBattleActionMixin
270
271
272 function pb:OnShow()
273 self:ClearAllPoints()
274 self:SetPoint('TOPLEFT', PetBattleFrame.EnemyBuffFrame, 'BOTTOMLEFT', 0, -12)
275 self:RegisterEvent('PET_BATTLE_PET_ROUND_PLAYBACK_COMPLETE')
276 self:RegisterEvent('PET_BATTLE_ACTION_SELECTED')
277 self:RegisterEvent('PET_BATTLE_TURN_STARTED')
278 print('pet on show')
279 self:Refresh()
280 end
281
282 function pb:OnHide()
283 print('pet on hide')
284 self:UnregisterAllEvents()
285 end
286
287 function pb:OnEvent(event)
288 print('pb event|cFFFF8800', event)
289 self:Refresh()
290 end
291
292 function pb:Refresh()
293 local myPetSlot = C_PetBattles.GetActivePet(1)
294 local myPetType = C_PetBattles.GetPetType(1, myPetSlot)
295
296 local index = 0
297 local nonActiveIndex = 0
298 local lastFrame, lastNonActive
299 for petSlot = 1, C_PetBattles.GetNumPets(2) do
300
301 for abilitySlot = 1,3 do
302 local _, name, texture, cooldown, tooltip,_, abilityType, noStrongWeakHints = C_PetBattles.GetAbilityInfo(2, petSlot, abilitySlot)
303 local petHealth = C_PetBattles.GetHealth(2, petSlot)
304
305 if petHealth >= 1 then
306 local isUsable, currentCooldown, currentLockdown = C_PetBattles.GetAbilityState(2, petSlot, abilitySlot);
307 --print(index, petSlot, abilitySlot, name, currentCooldown, currentLockdown, cooldown, petHealth)
308
309 index = index + 1
310 local frame = self.Abilities[index]
311
312 frame.ownerID = 2
313 frame.petIndex = petSlot
314 frame.abIndex = abilitySlot
315 frame.tooltip = tooltip
316 frame.Name:SetText(name)
317 frame.Icon:SetTexture(texture)
318 frame.TypeIcon:SetTexture("Interface\\PetBattles\\PetIcon-"..PET_TYPE_SUFFIX[abilityType])
319
320
321 for i = 1,C_PetBattles.GetNumPets(1) do
322 local myPetType = C_PetBattles.GetPetType(1, i)
323 if not (myPetType or abilityType) then
324 frame.BetterIcon[i]:Hide();
325 else
326 local modifier = C_PetBattles.GetAttackModifier(abilityType, myPetType)
327 if ( noStrongWeakHints or modifier == 1 ) then
328 frame.BetterIcon[i]:Hide();
329 elseif (modifier > 1) then
330 frame.BetterIcon[i]:SetTexture("Interface\\PetBattles\\BattleBar-AbilityBadge-Strong");
331 frame.BetterIcon[i]:Show();
332 elseif (modifier < 1) then
333 frame.BetterIcon[i]:SetTexture("Interface\\PetBattles\\BattleBar-AbilityBadge-Weak");
334 frame.BetterIcon[i]:Show();
335 end
336
337 end
338 end
339
340
341 if cooldown >= 1 then
342 frame.Border2:Show()
343 else
344
345 frame.Border2:Hide()
346 end
347
348
349 currentCooldown = (currentCooldown >= 1) and currentCooldown or 0
350 if petHealth == 0 then
351 frame.Cooldown:SetText(nil)
352 frame.Cooldown:SetTextColor(1,0,0)
353 else
354 if currentLockdown >= 1 and currentLockdown > currentCooldown then
355 frame.Cooldown:SetTextColor(1,0,0)
356 else
357 frame.Cooldown:SetTextColor(1,1,1)
358 end
359 frame.Cooldown:SetText((currentCooldown >= 1) and currentCooldown or nil)
360 end
361
362 frame:ClearAllPoints()
363 if petSlot == C_PetBattles.GetActivePet(2) then
364 frame:SetSize(48,48)
365 frame.Border2:SetSize(72,72)
366 frame.Icon:SetDesaturated(false)
367 frame.Name:SetTextColor(1,1,0)
368 if lastFrame then
369 frame:SetPoint('TOPLEFT', lastFrame, 'BOTTOMLEFT', 0, -4)
370 else
371 frame:SetPoint('TOPLEFT', self, 'TOPLEFT')
372 end
373 lastFrame = frame
374 else
375 frame:SetSize(24,24)
376 frame.Border2:SetSize(36,36)
377 frame.Name:SetTextColor(0.5,0.5,0.5)
378 frame.Icon:SetDesaturated(true)
379 if lastNonActive then
380 frame:SetPoint('TOPLEFT', lastNonActive, 'BOTTOMLEFT', 0, -2)
381 else
382 frame:SetPoint('TOPLEFT', self, 'TOPLEFT', 128, 0)
383 end
384 lastNonActive = frame
385 end
386 frame:Show()
387 end
388 end
389 end
390
391 for i = index + 1, #self.Abilities do
392 self.Abilities[i]:Hide()
393 end
394 end
395
396 function action:OnEnter()
397 PetBattleAbilityTooltip_SetAbility(self.ownerID, self.petIndex, self.abIndex);
398 PetBattleAbilityTooltip_Show("TOPRIGHT", self:GetParent(), "TOPLEFT", -5, 0, self.additionalText);
399 end
400
401 function action:OnLeave()
402 PetBattlePrimaryAbilityTooltip:Hide();
403 end