Mercurial > wow > kbf
comparison KBF.lua @ 44:81cade22f2f9
add instant/wound/deadly poison support
| author | Chris Mellon <arkanes@gmail.com> |
|---|---|
| date | Sun, 13 Feb 2011 08:55:58 -0600 |
| parents | d792f986400f |
| children | ca720b4b5435 |
comparison
equal
deleted
inserted
replaced
| 43:a5d47fbede83 | 44:81cade22f2f9 |
|---|---|
| 134 if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then | 134 if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then |
| 135 self:OnEnter(tempEnchant) | 135 self:OnEnter(tempEnchant) |
| 136 end | 136 end |
| 137 -- make a fake third buff bar. It can't be used to cancel the buff, but | 137 -- make a fake third buff bar. It can't be used to cancel the buff, but |
| 138 -- at least you can see it. | 138 -- at least you can see it. |
| 139 | |
| 140 local thirdWeaponInfo = select(7, GetWeaponEnchantInfo()) | 139 local thirdWeaponInfo = select(7, GetWeaponEnchantInfo()) |
| 141 if thirdWeaponInfo then | 140 if thirdWeaponInfo then |
| 142 if not self.tempEnchant3 then | 141 if not self.tempEnchant3 then |
| 143 -- largely copy/pasted code from SAH to bind to third weapon | 142 -- largely copy/pasted code from SAH to bind to third weapon |
| 144 self.tempEnchant3 = CreateFrame("Button", nil, self.secureHeader); | 143 self.tempEnchant3 = CreateFrame("Button", nil, self.secureHeader); |
| 145 self.tempEnchant3:SetWidth(200+16) | 144 self.tempEnchant3:SetWidth(200+16) |
| 146 self.tempEnchant3:SetHeight(16) | 145 self.tempEnchant3:SetHeight(16) |
| 147 self.tempEnchant3:Show() | 146 self.tempEnchant3:Show() |
| 147 self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) | |
| 148 self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) | |
| 149 self.tempEnchant3:EnableMouse(true) | |
| 150 --TODO: queue up for setting when leaving combat | |
| 151 self.tempEnchant3:SetAttribute('target-slot', 18) | |
| 152 -- set up the tooltip | |
| 148 end | 153 end |
| 154 -- TODO: If we're out of combat and theres an OH enchant, | |
| 155 -- create a secure action button & position it relative | |
| 156 -- to that. What happens when the OH weapon enchant frame | |
| 157 -- is hidden by SAH? | |
| 158 -- most likely: it stays visible but stops moving. | |
| 159 -- in this case, maybe parent it to the OH enchant also | |
| 160 -- so it vanishes and gets out of the way. | |
| 161 | |
| 149 self.tempEnchant3:Show() | 162 self.tempEnchant3:Show() |
| 150 end | 163 end |
| 151 if self.tempEnchant3 and not thirdWeaponInfo then | 164 if self.tempEnchant3 and not thirdWeaponInfo then |
| 152 self.tempEnchant3:Hide() | 165 self.tempEnchant3:Hide() |
| 153 end | 166 end |
| 248 -- try to figure out what the weapon enchant is | 261 -- try to figure out what the weapon enchant is |
| 249 -- tooltip string -> {spellid, duration} | 262 -- tooltip string -> {spellid, duration} |
| 250 local knownEnchants = { | 263 local knownEnchants = { |
| 251 ["Flametongue"] = {8024, 30*60}, | 264 ["Flametongue"] = {8024, 30*60}, |
| 252 ["Frostbrand"] = {8033, 30*60}, | 265 ["Frostbrand"] = {8033, 30*60}, |
| 266 ["Instant Poison"] = {8680, 60*60}, | |
| 267 ["Wound Poison"] = {13218, 60*60}, | |
| 268 ["Deadly Poison"] = {2823, 60*60}, | |
| 253 | 269 |
| 254 } | 270 } |
| 255 local spellId = nil | 271 local spellId = nil |
| 256 if gratt then | 272 if gratt then |
| 257 gratt:SetInventoryItem("player", slot) | 273 gratt:SetInventoryItem("player", slot) |
