Mercurial > wow > kbf
comparison KBF.lua @ 46:04d0d145a676
fix some drycoded OOC stuff
author | Chris Mellon <arkanes@gmail.com> |
---|---|
date | Wed, 23 Feb 2011 19:03:17 -0600 |
parents | ca720b4b5435 |
children | afd410b949ea |
comparison
equal
deleted
inserted
replaced
45:ca720b4b5435 | 46:04d0d145a676 |
---|---|
68 -- enqueues a callable that will be run once in-combat lockdown is past | 68 -- enqueues a callable that will be run once in-combat lockdown is past |
69 -- all callables will be executed in a single run, in the order they were enqueued | 69 -- all callables will be executed in a single run, in the order they were enqueued |
70 -- if called when OOC, the function will be called immediately, unless the alwaysQueue parameter is true, | 70 -- if called when OOC, the function will be called immediately, unless the alwaysQueue parameter is true, |
71 -- in which case it will be appended normally | 71 -- in which case it will be appended normally |
72 function kbf:QueueForOOC(func, alwaysQueue) | 72 function kbf:QueueForOOC(func, alwaysQueue) |
73 if InCombatLockDown() or alwaysQueue then | 73 if InCombatLockdown() or alwaysQueue then |
74 tinsert(self.oocQueue, func) | 74 tinsert(self.oocQueue, func) |
75 else | 75 else |
76 func() | 76 func() |
77 end | 77 end |
78 end | 78 end |
147 self:UpdateBarExpirationTime(tempEnchant) | 147 self:UpdateBarExpirationTime(tempEnchant) |
148 buffCount = buffCount + 1 | 148 buffCount = buffCount + 1 |
149 -- SAH binds the offhand enchant to the main hand for removal purposes. | 149 -- SAH binds the offhand enchant to the main hand for removal purposes. |
150 -- fix it up if we're out of combat | 150 -- fix it up if we're out of combat |
151 -- TODO: maybe this should only happen if we're dirty | 151 -- TODO: maybe this should only happen if we're dirty |
152 QueueForOOC(function() tempEnchant:SetAttribute('target-slot', 17) end) | 152 self:QueueForOOC(function() tempEnchant:SetAttribute('target-slot', 17) end) |
153 end | 153 end |
154 if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then | 154 if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then |
155 self:OnEnter(tempEnchant) | 155 self:OnEnter(tempEnchant) |
156 end | 156 end |
157 -- make a fake third buff bar. It can't be used to cancel the buff, but | 157 -- make a fake third buff bar. It can't be used to cancel the buff, but |
166 self.tempEnchant3:Show() | 166 self.tempEnchant3:Show() |
167 self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) | 167 self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) |
168 self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) | 168 self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) |
169 self.tempEnchant3:EnableMouse(true) | 169 self.tempEnchant3:EnableMouse(true) |
170 --TODO: queue up for setting when leaving combat | 170 --TODO: queue up for setting when leaving combat |
171 QueueForOOC(function() self.tempEnchant3:SetAttribute('target-slot', 18) end) | 171 self:QueueForOOC(function() self.tempEnchant3:SetAttribute('target-slot', 18) end) |
172 -- set up the tooltip | 172 -- set up the tooltip |
173 end | 173 end |
174 -- TODO: If we're out of combat and theres an OH enchant, | 174 -- TODO: If we're out of combat and theres an OH enchant, |
175 -- create a secure action button & position it relative | 175 -- create a secure action button & position it relative |
176 -- to that. What happens when the OH weapon enchant frame | 176 -- to that. What happens when the OH weapon enchant frame |