Mercurial > wow > turok
comparison Turok/Modules/Utilities/Toast.lua @ 11:0b1a2f3dbfc4 tip
aura duration override triggering activation twice when aura data still exists briefly after duration end
author | Nenue |
---|---|
date | Mon, 22 Feb 2016 03:11:54 -0500 |
parents | a9b8b0866ece |
children |
comparison
equal
deleted
inserted
replaced
10:e08df0af1849 | 11:0b1a2f3dbfc4 |
---|---|
28 | 28 |
29 T.defaults.toast = { | 29 T.defaults.toast = { |
30 alert_hold = 2, | 30 alert_hold = 2, |
31 alert_fade = 1, | 31 alert_fade = 1, |
32 alert_flash = .6, | 32 alert_flash = .6, |
33 anchor = 'TOP', | 33 anchor = 'TOPLEFT', |
34 parent = 'UIParent', | 34 parent = 'UIParent', |
35 anchorTo = 'TOP', | 35 anchorTo = 'LEFT', |
36 x = 0, y= -56, | 36 x =200, y= 0, |
37 loot = { | 37 loot = { |
38 background_color = {}, | 38 background_color = {}, |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
304 end | 304 end |
305 | 305 |
306 end | 306 end |
307 end | 307 end |
308 | 308 |
309 mod.OnEnable = function() | 309 mod.GetToastsAnchor = function(self) |
310 db = TurokData.toast | |
311 | |
312 --- find the closest frame to the center bottom and anchor to that | |
313 | 310 |
314 local cX, cY = (GetScreenWidth() / 2), (GetScreenHeight() / 2) | 311 local cX, cY = (GetScreenWidth() / 2), (GetScreenHeight() / 2) |
315 local min_skewness = cX | 312 local min_skewness = cX |
316 local max_centrality, center_frame | 313 local max_centrality, center_frame |
317 for n, f in ipairs({UIParent:GetChildren()}) do | 314 for n, f in ipairs({UIParent:GetChildren()}) do |
342 end | 339 end |
343 end | 340 end |
344 end | 341 end |
345 end | 342 end |
346 end | 343 end |
344 return center_frame | |
345 end | |
346 | |
347 mod.OnEnable = function() | |
348 db = TurokData.toast | |
349 | |
350 --- find the closest frame to the center bottom and anchor to that | |
351 | |
347 | 352 |
348 mod.num_events = 0 | 353 mod.num_events = 0 |
349 tkAlerts.alerts = {} | 354 tkAlerts.alerts = {} |
350 for i, event in ipairs(mod.events) do | 355 for i, event in ipairs(mod.events) do |
351 tkAlerts:RegisterEvent(event) | 356 tkAlerts:RegisterEvent(event) |