Mercurial > wow > kbf
comparison KBF.lua @ 62:31eac67dd283
Add the weapon slot to the weapon enchant tooltip
| author | Chris Mellon <arkanes@gmail.com> |
|---|---|
| date | Mon, 28 Nov 2011 05:59:55 -0600 |
| parents | 46ba8e0a63c7 |
| children | e5c07fdfb70b |
comparison
equal
deleted
inserted
replaced
| 61:46ba8e0a63c7 | 62:31eac67dd283 |
|---|---|
| 155 local thirdWeaponInfo = select(7, GetWeaponEnchantInfo()) | 155 local thirdWeaponInfo = select(7, GetWeaponEnchantInfo()) |
| 156 if thirdWeaponInfo then | 156 if thirdWeaponInfo then |
| 157 if not self.tempEnchant3 then | 157 if not self.tempEnchant3 then |
| 158 -- largely copy/pasted code from SAH to bind to third weapon | 158 -- largely copy/pasted code from SAH to bind to third weapon |
| 159 self.tempEnchant3 = CreateFrame("Button", nil, self.secureHeader); | 159 self.tempEnchant3 = CreateFrame("Button", nil, self.secureHeader); |
| 160 self.tempEnchant3.unit = "player" | |
| 160 self.tempEnchant3:SetWidth(200+16) | 161 self.tempEnchant3:SetWidth(200+16) |
| 161 self.tempEnchant3:SetHeight(16) | 162 self.tempEnchant3:SetHeight(16) |
| 162 self.tempEnchant3:Show() | 163 self.tempEnchant3:Show() |
| 163 self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) | 164 self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) |
| 164 self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) | 165 self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) |
| 288 for tag, info in pairs(knownEnchants) do | 289 for tag, info in pairs(knownEnchants) do |
| 289 if gratt:Find(tag) then | 290 if gratt:Find(tag) then |
| 290 spellId, duration = unpack(info) | 291 spellId, duration = unpack(info) |
| 291 name, _, _ = GetSpellInfo(spellId) | 292 name, _, _ = GetSpellInfo(spellId) |
| 292 local slots = {[16] = "Main Hand", [17] = "Off Hand", [18] = "Thrown"} | 293 local slots = {[16] = "Main Hand", [17] = "Off Hand", [18] = "Thrown"} |
| 293 name = name .. " (" .. slots[slot] .. ")" | 294 name = tag .. " (" .. slots[slot] .. ")" |
| 294 break | 295 break |
| 295 end | 296 end |
| 296 end | 297 end |
| 297 end | 298 end |
| 298 parentFrame.spellId = spellId | 299 parentFrame.spellId = spellId |
| 376 -- Maybe I should just have a single line with the weapon name | 377 -- Maybe I should just have a single line with the weapon name |
| 377 --GameTooltip:SetInventoryItem(unit, slot) | 378 --GameTooltip:SetInventoryItem(unit, slot) |
| 378 local name = GetItemInfo(GetInventoryItemID("player", slot)) | 379 local name = GetItemInfo(GetInventoryItemID("player", slot)) |
| 379 local r, g, b = GetItemQualityColor(GetInventoryItemQuality("player", slot)) | 380 local r, g, b = GetItemQualityColor(GetInventoryItemQuality("player", slot)) |
| 380 GameTooltip:SetText(name, r, g, b) | 381 GameTooltip:SetText(name, r, g, b) |
| 382 local slots = {[16] = "Main Hand", [17] = "Off Hand", [18] = "Thrown"} | |
| 383 GameTooltip:AddLine(slots[slot]) | |
| 381 GameTooltip:AddLine(" ") | 384 GameTooltip:AddLine(" ") |
| 382 GameTooltip:AddSpellByID(button.spellId) | 385 GameTooltip:AddSpellByID(button.spellId) |
| 383 else | 386 else |
| 384 GameTooltip:SetInventoryItem(unit, slot) | 387 GameTooltip:SetInventoryItem(unit, slot) |
| 385 end | 388 end |
