WoWInterface SVN DirtyGear

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 5 to Rev 6
    Reverse comparison

Rev 5 → Rev 6

DirtyGear.lua
1,3 → 1,7
-- DirtyGear
-- Author: Dirtygurl
-- License: GNU GPL v3, 29 June 2007 (see LICENSE.txt)
 
local DirtyGear = {}
DirtyGear.Version = GetAddOnMetadata("DirtyGear", "Version")
 
26,15 → 30,19
INVTYPE_WRIST = false
}
 
DirtyGear.DBIndex = "default"
 
DirtyGear.DB =
{
["default"] = {},
[1] =
["Death Knight-Blood"] =
{
Class = "",
Spec = "",
Class = "Death Knight",
Spec = "Blood",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
64,13 → 72,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Death Knight - Blood (DPS)
[2] =
},
["Death Knight-Frost"] =
{
Class = "",
Spec = "",
Class = "Death Knight",
Spec = "Frost",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
100,13 → 110,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Death Knight - Frost (DPS)
[3] =
},
["Death Knight-Frost-Tank"] =
{
Class = "",
Spec = "",
Class = "Death Knight",
Spec = "Frost",
Type = "Tank",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
136,13 → 148,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Death Knight - Frost (Tanking)
[4] =
},
["Death Knight-Unholy"] =
{
Class = "",
Spec = "",
Class = "Death Knight",
Spec = "Unholy",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
172,13 → 186,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Death Knight - Unholy (DPS)
[5] =
},
["Druid-Balance-Heal"] =
{
Class = "",
Spec = "",
Class = "Druid",
Spec = "Balance",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
208,13 → 224,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Druid - Balance (DPS)
[6] =
},
["Druid-Feral"] =
{
Class = "",
Spec = "",
Class = "Druid",
Spec = "Feral",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
244,13 → 262,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Druid - Feral (DPS)
[7] =
},
["Druid-Feral-Tank"] =
{
Class = "",
Spec = "",
Class = "Druid",
Spec = "Feral",
Type = "Tank",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
280,13 → 300,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Druid - Feral (Tanking)
[8] =
},
["Druid-Restoration-Heal"] =
{
Class = "",
Spec = "",
Class = "Druid",
Spec = "Restoration",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
316,13 → 338,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Druid - Restoration (Healing)
[9] =
},
["Hunter-Beast Mastery"] =
{
Class = "",
Spec = "",
Class = "Hunter",
Spec = "Beast Mastery",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
341,6 → 365,119
},
Gems =
{
Red = { 39999 },
Yellow = { 40014 },
Blue = {},
Orange = { 40053, 40052 },
Purple = { 40030 },
Green = { 40029 },
Prismatic = {},
Meta = { 41398 },
RedYellowBlue = { 42702 },
JewelCraft = { 36766, 42156 }
}
},
["Hunter-Marksmanship"] =
{
Class = "Hunter",
Spec = "Marksmanship",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
INVTYPE_HAND = {},
INVTYPE_HEAD = {},
INVTYPE_LEGS = {},
INVTYPE_WEAPONMAINHAND = {},
INVTYPE_RANGED = {},
INVTYPE_WEAPONOFFHAND = {},
INVTYPE_WEAPON = {},
INVTYPE_SHIELD = {},
INVTYPE_2HWEAPON = {},
INVTYPE_RANGEDRIGHT = {},
INVTYPE_SHOULDER = {},
INVTYPE_WRIST = {}
},
Gems =
{
Red = { 39999, 39997 },
Yellow = { 40014 },
Blue = {},
Orange = { 40053, 40044, 40052, 40043 },
Purple = { 40030, 40029, 40024, 40023 },
Green = { 40100, 40088, 40096, 40086 },
Prismatic = {},
Meta = { 41398 },
RedYellowBlue = { 42702 },
JewelCraft = { 36766, 42156 }
}
},
["Hunter-Survial"] =
{
Class = "Hunter",
Spec = "Survival",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = { 60663 },
INVTYPE_CHEST = { 60692, 44623 },
INVTYPE_FEET = { 60763, 44589, 60623 },
INVTYPE_HAND = { 60668, 44488, 44529 },
INVTYPE_HEAD = { 59954, 35452 },
INVTYPE_LEGS = { 60581, 60582 },
INVTYPE_WEAPONMAINHAND = { 59619, 60707, 44633, 27968 },
INVTYPE_RANGED = { 61468, 55076, 55135 }, -- bows
INVTYPE_WEAPONOFFHAND = { 59619, 60707, 44633, 27968 },
INVTYPE_WEAPON = { 59619, 60707, 44633, 27968 },
INVTYPE_2HWEAPON = { 60691 },
INVTYPE_RANGEDRIGHT = { 61468, 55076, 55135 }, -- wands, guns, crossbows
INVTYPE_SHOULDER = { 59934, 59929 },
INVTYPE_WRIST = { 44575 }
},
Gems =
{
Red = { 39997 },
Yellow = { 40014 },
Blue = {},
Orange = { 40044, 40043 },
Purple = { 40023 },
Green = { 40088, 40086 },
Prismatic = {},
Meta = { 41398 },
RedYellowBlue = { 42702 },
JewelCraft = { 42143, 42156 }
}
},
["Mage-Arcane"] =
{
Class = "Mage",
Spec = "Arcane",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
INVTYPE_HAND = {},
INVTYPE_HEAD = {},
INVTYPE_LEGS = {},
INVTYPE_WEAPONMAINHAND = {},
INVTYPE_RANGED = {},
INVTYPE_WEAPONOFFHAND = {},
INVTYPE_WEAPON = {},
INVTYPE_SHIELD = {},
INVTYPE_2HWEAPON = {},
INVTYPE_RANGEDRIGHT = {},
INVTYPE_SHOULDER = {},
INVTYPE_WRIST = {}
},
Gems =
{
Red = {},
Yellow = {},
Blue = {},
352,13 → 489,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Hunter - Beast Mastery
[10] =
},
["Mage-Fire"] =
{
Class = "",
Spec = "",
Class = "Mage",
Spec = "Fire",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
388,37 → 527,53
RedYellowBlue = {},
JewelCraft = {}
}
}, --Hunter - Marksmanship
[11] =
},
["Mage-Frost"] =
{
Class = "Hunter",
Spec = "Survival",
Class = "Mage",
Spec = "Frost",
Type = "DPS",
Enchants =
{
INVTYPE_HEAD = { 59954, 35452 },
INVTYPE_SHOULDER = { 59934, 59929 },
INVTYPE_CLOAK = { 60663 }
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
INVTYPE_HAND = {},
INVTYPE_HEAD = {},
INVTYPE_LEGS = {},
INVTYPE_WEAPONMAINHAND = {},
INVTYPE_RANGED = {},
INVTYPE_WEAPONOFFHAND = {},
INVTYPE_WEAPON = {},
INVTYPE_SHIELD = {},
INVTYPE_2HWEAPON = {},
INVTYPE_RANGEDRIGHT = {},
INVTYPE_SHOULDER = {},
INVTYPE_WRIST = {}
},
Gems =
{
Red = { 39997 },
Yellow = { 40014 },
Red = { 40111, 39996, 41432 },
Yellow = { 40125, 40014 },
Blue = {},
Orange = { 40044, 40043 },
Purple = { 40023 },
Green = { 40088, 40086 },
Orange = { 40143, 40038 },
Purple = { 40129, 40022 },
Green = {},
Prismatic = {},
Meta = { 41398 },
Meta = { 41398, 41285 },
RedYellowBlue = { 42702 },
JewelCraft = { 42143, 42156 }
JewelCraft = { 42142, 42156 }
}
},
[12] =
["Paladin-Holy"] =
{
Class = "",
Spec = "",
Class = "Paladin",
Spec = "Holy",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
444,17 → 599,19
Purple = {},
Green = {},
Prismatic = {},
Meta = {},
Meta = { 41401, 41376, 41333, 41389 },
RedYellowBlue = {},
JewelCraft = {}
}
}, --Mage - Arcane
[13] =
},
["Paladin-Protection"] =
{
Class = "",
Spec = "",
Class = "Paladin",
Spec = "Protection",
Type = "Tank",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
480,17 → 637,19
Purple = {},
Green = {},
Prismatic = {},
Meta = {},
RedYellowBlue = {},
Meta = { 41380, 41396, 41377 },
RedYellowBlue = { 42702 },
JewelCraft = {}
}
}, --Mage - Fire
[14] =
},
["Paladin-Retribution"] =
{
Class = "",
Spec = "",
Class = "Paladin",
Spec = "Retribution",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
520,13 → 679,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Mage - Frost
[15] =
},
["Priest-Discipline"] =
{
Class = "",
Spec = "",
Class = "Priest",
Spec = "Discipline",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
556,13 → 717,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Paladin - Holy (Healing)
[16] =
},
["Priest-Holy"] =
{
Class = "",
Spec = "",
Class = "Priest",
Spec = "Holy",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
592,13 → 755,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Paladin - Protection (Tanking)
[17] =
},
["Priest-Shadow"] =
{
Class = "",
Spec = "",
Class = "Priest",
Spec = "Shadow",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
628,13 → 793,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Paladin - Retribution (DPS)
[18] =
},
["Rogue-Assassination"] =
{
Class = "",
Spec = "",
Class = "Rogue",
Spec = "Assassination",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
664,13 → 831,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Priest - Discipline (Healing)
[19] =
},
["Rogue-Combat"] =
{
Class = "",
Spec = "",
Class = "Rogue",
Spec = "Combat",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
700,13 → 869,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Priest - Holy (Healing)
[20] =
},
["Rogue-Subtlety"] =
{
Class = "",
Spec = "",
Class = "Rogue",
Spec = "Subtlety",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
736,13 → 907,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Priest - Shadow (DPS)
[21] =
},
["Shaman-Elemental"] =
{
Class = "",
Spec = "",
Class = "Shaman",
Spec = "Elemental",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
772,13 → 945,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Rogue
[22] =
},
["Shaman-Enhancement"] =
{
Class = "",
Spec = "",
Class = "Shaman",
Spec = "Enhancement",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
808,13 → 983,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Shaman - Elemental (DPS)
[23] =
},
["Shaman-Restoration"] =
{
Class = "",
Spec = "",
Class = "Shaman",
Spec = "Restoration",
Type = "Heal",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
844,13 → 1021,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Shaman - Enhancement (DPS)
[24] =
},
["Warlock-Affliction"] =
{
Class = "",
Spec = "",
Class = "Warlock",
Spec = "Affliction",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
880,13 → 1059,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Shaman - Restoration (Healing)
[25] =
},
["Warlock-Demonology"] =
{
Class = "",
Spec = "",
Class = "Warlock",
Spec = "Demonology",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
916,13 → 1097,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Warlock - Affliction
[26] =
},
["Warlock-Destruction"] =
{
Class = "",
Spec = "",
Class = "Warlock",
Spec = "Destruction",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
952,13 → 1135,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Warlock - Demonology
[27] =
},
["Warrior-Arms"] =
{
Class = "",
Spec = "",
Class = "Warrior",
Spec = "Arms",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
988,13 → 1173,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Warlock - Destruction
[28] =
},
["Warrior-Fury"] =
{
Class = "",
Spec = "",
Class = "Warrior",
Spec = "Fury",
Type = "DPS",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
1024,13 → 1211,15
RedYellowBlue = {},
JewelCraft = {}
}
}, --Warrior - Fury (DPS)
[29] =
},
["Warrior-Protection"] =
{
Class = "",
Spec = "",
Class = "Warrior",
Spec = "Protection",
Type = "Tank",
Enchants =
{
INVTYPE_WAIST = { 55655 },
INVTYPE_CLOAK = {},
INVTYPE_CHEST = {},
INVTYPE_FEET = {},
1060,11 → 1249,31
RedYellowBlue = {},
JewelCraft = {}
}
} --Warrior - Protection (Tanking)
}
}
 
local LibQTip = LibStub("LibQTip-1.0")
 
function DirtyGear.GetDBIndex()
local spent, points = 0, {}
for i = 1, 3 do
points[i] = select(3, GetTalentTabInfo(i))
if i == 1 or points[i] > points[spent] then
spent = i
end
end
if points[spent] == 0 then
return "default"
end
local class, spec = UnitClass("player"), select(1, GetTalentTabInfo(spent))
if class == "Druid" and GetSpellInfo(GetSpellInfo(16931)) then
return class.."-"..spec.."-Tank"
elseif class == "Death Knight" and GetSpellInfo(GetSpellInfo(55129)) then
return class.."-"..spec.."-Tank"
end
return class.."-"..spec
end
 
function DirtyGear.Print(msg)
if DEFAULT_CHAT_FRAME and msg then
DEFAULT_CHAT_FRAME:AddMessage("|cFF00FF00[DirtyGear]|r "..msg, 1, 1, 1)
1093,7 → 1302,6
JewelCraft = false
}
if not DirtyGear.Tip then
--DirtyGear.Tip = LibQTip:Acquire("DirtyGearTip")
DirtyGear.Tip = CreateFrame("GameTooltip", "DirtyGearTip"..id, nil, "GameTooltipTemplate")
DirtyGear.Tip:SetOwner(UIParent, "ANCHOR_NONE")
DirtyGear.Tip:SetHyperlink(link)
1136,7 → 1344,6
total = total + 1
end
end
--LibQTip:Release(DirtyGear.Tip)
DirtyGear.Tip:ClearLines()
DirtyGear.Tip:Hide()
DirtyGear.Tip = nil
1153,11 → 1360,11
-- Enchants
--]]
DirtyGear.Enchantable.INVTYPE_FINGER = GetSpellInfo(GetSpellInfo(28029))
DirtyGear.Enchantable.INVTYPE_THROWN = iType ~= "Wands" and iType ~= "Thrown"
DirtyGear.Enchantable.INVTYPE_RANGEDRIGHT = iType ~= "Wands" and iType ~= "Thrown"
if DirtyGear.Enchantable[iEquipLoc] and iLink:match("item:%d+:0") then
DirtyGear.EquipmentTip:AddHeader("Missing Enchant")
end
local DirtyGearDB = DirtyGear.DB[11]
local DirtyGearDB = DirtyGear.DB[DirtyGear.DBIndex]
if DirtyGear.Enchantable[iEquipLoc] and DirtyGearDB.Enchants and DirtyGearDB.Enchants[iEquipLoc] then
DirtyGear.EquipmentTip:AddHeader("Available Enchants")
for i, value in pairs(DirtyGearDB.Enchants[iEquipLoc]) do
1223,8 → 1430,10
end
 
function DirtyGear.GameTooltip_OnTooltipCleared(self, ...)
LibQTip:Release(DirtyGear.EquipmentTip)
DirtyGear.EquipmentTip = nil
if DirtyGear.EquipmentTip then
LibQTip:Release(DirtyGear.EquipmentTip)
DirtyGear.EquipmentTip = nil
end
GameTooltip:Hide()
if DirtyGear.GameTooltip_OnTooltipCleared_Orig then
return DirtyGear.GameTooltip_OnTooltipCleared_Orig(self, ...)
1244,6 → 1453,10
 
function DirtyGear.OnVariablesLoaded()
DirtyGear.Print("OnEvent:VARIABLES_LOADED")
DirtyGear.DBIndex = DirtyGear.GetDBIndex()
if not DirtyGear.DB[DirtyGear.DBIndex] then
DirtyGear.DBIndex = "default"
end
DirtyGear.Hookers()
end