From 3f1f26a791f58fbef901010014f67e6f97752573 Mon Sep 17 00:00:00 2001 From: Miki Urban Date: Mon, 6 Jan 2025 00:12:14 -0800 Subject: [PATCH 01/15] Added The War Within --- Appearances/11.lua | 265 ++++++++++++++++++++++++++++++++++++++++++ Appearances/Base.lua | 4 +- Core.lua | 79 ++++++++----- DB.lua | 16 ++- Localization/enUS.lua | 3 + SetCollector.toc | 1 + 6 files changed, 337 insertions(+), 31 deletions(-) create mode 100644 Appearances/11.lua diff --git a/Appearances/11.lua b/Appearances/11.lua new file mode 100644 index 0000000..91053a7 --- /dev/null +++ b/Appearances/11.lua @@ -0,0 +1,265 @@ +-- Appearances from The War Within (v.11.x) + +-- +-- LOCAL VARIABLES +-- + +local ALL = SetCollector.ALL +local ANY = SetCollector.ANY + +-- Armor Type +local CLOTH = SetCollector.CLOTH +local LEATHER = SetCollector.LEATHER +local MAIL = SetCollector.MAIL +local PLATE = SetCollector.PLATE +local ANY_ARMOR = SetCollector.ANY_ARMOR + +-- Classes +local DEATHKNIGHT = SetCollector.DEATHKNIGHT +local DEMONHUNTER = SetCollector.DEMONHUNTER +local DRUID = SetCollector.DRUID +local EVOKER = SetCollector.EVOKER +local HUNTER = SetCollector.HUNTER +local MAGE = SetCollector.MAGE +local MONK = SetCollector.MONK +local PALADIN = SetCollector.PALADIN +local PRIEST = SetCollector.PRIEST +local ROGUE = SetCollector.ROGUE +local SHAMAN = SetCollector.SHAMAN +local WARLOCK = SetCollector.WARLOCK +local WARRIOR = SetCollector.WARRIOR +local ANY_CLASS = SetCollector.ANY_CLASS + +-- Factions +local ALLIANCE = SetCollector.ALLIANCE +local HORDE = SetCollector.HORDE +local ANY_FACTION = SetCollector.ANY_FACTION + +-- Obtainable +local OBTAIN = SetCollector.OBTAIN +local NO_OBTAIN = SetCollector.NO_OBTAIN + +-- Useable as Transmog +local TRANSMOG = SetCollector.TRANSMOG +local NO_TRANSMOG = SetCollector.NO_TRANSMOG + +-- Locations +local NO_LOCATION = nil + +-- +-- LOCAL FUNCTIONS +-- + +local function A(...) return SetCollector:CreateAppearance(...) end +local function I(...) return SetCollector:CreateAppearanceFromItemID(...) end +local function CreateSet(...) return SetCollector:CreateSet(...) end +local function CreateVariant(...) return SetCollector:CreateVariant(...) end +local function IncludeSet(...) return SetCollector:IncludeSet(...) end +local function AddSetsToDatabase(...) return SetCollector:AddSetsToDatabase(...) end + +local function GetCraftedAppearances() + local COLLECTION, VERSION = SetCollector.CRAFTED, 110000 + local sets = { + + } + -- AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetDungeonAppearances() + local COLLECTION, VERSION = SetCollector.DUNGEON, 110000 + local sets = { + + } + -- AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetExpansionAppearances() + local COLLECTION, VERSION = SetCollector.EXPANSION, 110000 + local sets = { + -- Osidion + -- Cartographer's Orientation + IncludeSet(COLLECTION,110000,3552,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3554,3555,3556,3553), -- Mossy Cartographer's Orientation, Red, Purple, Green, Teal + -- Artisan's Talent + IncludeSet(COLLECTION,110000,3547,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3548,3549,3550,3551), -- Sooty Artisan's Talent, Purple, Green, Blue, Black + -- Quotidian Wear + IncludeSet(COLLECTION,110000,3530,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3527,3528,3529,3531), -- Taupe Quotidian Wear, Yellow, Red, Green, Blue + -- Patron's Elegance + IncludeSet(COLLECTION,110000,3534,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3533,3535,3536,3532), -- Court Patron's Elegance, Purple, Blue, Black, Red + -- Toiler's Uniform + IncludeSet(COLLECTION,110000,3545,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3542,3543,3544,3546), -- Toiler's Navy Uniform, Red, Green, Burgundy, Blue + -- Peddler's Trinkets + IncludeSet(COLLECTION,110000,3537,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3540,3541,3538,3539), -- Occult Peddler's Trinkets, Blue, Black, Purple, Green + -- Educator's Knowledge + IncludeSet(COLLECTION,110000,3525,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3526,3522,3523,3524), -- Midnight Educator's Knowledge, Black, Red, Purple, Green + + + -- Honorary Councilmember's Mandate + IncludeSet(COLLECTION,110000,3519,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3874,4229,3883), -- Awakened Ambassador's Silver Drapery, Unique Creatures, Silver, Awakened + -- Hallowfall Quests + IncludeSet(COLLECTION,110000,3518,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3876), -- Misplaced Arathi Attire, Dark + -- Coreway Regalia + IncludeSet(COLLECTION,110000,3891,LEATHER,ANY_CLASS,ANY_FACTION), -- Coreway Regalia + -- Threads of Awakening + IncludeSet(COLLECTION,110000,3892,CLOTH,ANY_CLASS,ANY_FACTION), -- Threads of Awakening + -- Algari Chainmail + IncludeSet(COLLECTION,110000,3890,MAIL,ANY_CLASS,ANY_FACTION), -- Algari Chainmail + -- Dorn Defender Armaments + IncludeSet(COLLECTION,110000,3889,PLATE,ANY_CLASS,ANY_FACTION), -- Dorn Defender Armaments + -- (blank) + IncludeSet(COLLECTION,110000,3520,ANY_ARMOR,ANY_CLASS,ANY_FACTION), -- Finery of the Assembly + IncludeSet(COLLECTION,110000,3521,ANY_ARMOR,ANY_CLASS,ANY_FACTION), -- Thread-Bearer's Carapace + -- Underground Gear + IncludeSet(COLLECTION,110000,3640,CLOTH,ANY_CLASS,ANY_FACTION), -- Delver's Cloth Armor + IncludeSet(COLLECTION,110000,3642,MAIL,ANY_CLASS,ANY_FACTION), -- Delver's Mail Armor + IncludeSet(COLLECTION,110000,3641,LEATHER,ANY_CLASS,ANY_FACTION), -- Delver's Leather Armor + IncludeSet(COLLECTION,110000,3643,PLATE,ANY_CLASS,ANY_FACTION), -- Delver's Plate Armor + -- Spreading the Light + IncludeSet(COLLECTION,110000,3518,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3877,3876), -- Darkened Arathi Attire, Purple, Dark + -- Hallowfall Gear + IncludeSet(COLLECTION,110000,3655,PLATE,ANY_CLASS,ANY_FACTION,3696,3879), -- Aegis of Hidden Stars, Aspirant, Delves + IncludeSet(COLLECTION,110000,3657,LEATHER,ANY_CLASS,ANY_FACTION,3880,3698), -- Myconic Shell, Delves, Aspirant + IncludeSet(COLLECTION,110000,3656,MAIL,ANY_CLASS,ANY_FACTION,3697,3878), -- Chains of the Stygian Sea, Aspirant, Delves + IncludeSet(COLLECTION,110000,3658,CLOTH,ANY_CLASS,ANY_FACTION,3699,3881), -- Unkindled Waxweave Panoply, Aspirant, Delves + -- Hallowfall Arathi Renown + IncludeSet(COLLECTION,110000,3518,ANY_ARMOR,ANY_CLASS,ANY_FACTION), -- Expeditionary Arathi Attire + } + AddSetsToDatabase(VERSION, COLLECTION, sets) + + COLLECTION, VERSION = SetCollector.EXPANSION, 110005 + sets = { + -- Rare Monster Hunting + IncludeSet(COLLECTION,110005,3643,PLATE,ANY_CLASS,ANY_FACTION,4149), -- Khaz Algar Trophymaster's Plate Armor, Rare Monsters + IncludeSet(COLLECTION,110005,3642,MAIL,ANY_CLASS,ANY_FACTION,4150), -- Khaz Algar Trophymaster's Mail Armor, Rare Monsters + IncludeSet(COLLECTION,110005,3641,LEATHER,ANY_CLASS,ANY_FACTION,4151), -- Khaz Algar Trophymaster's Leather Armor, Rare Monsters + IncludeSet(COLLECTION,110005,3640,ANY_ARMOR,ANY_CLASS,ANY_FACTION,4152), -- Khaz Algar Trophymaster's Cloth Armor, Rare Monsters + } + AddSetsToDatabase(VERSION, COLLECTION, sets) + + COLLECTION, VERSION = SetCollector.EXPANSION, 110007 + sets = { + -- Siren Isle + IncludeSet(COLLECTION,110007,3518,ANY_ARMOR,ANY_CLASS,ANY_FACTION,4228,4227), -- Sacred Wayfarer's Attire, Yellow, Black + -- Plunderlord's Stormridden Finery + IncludeSet(COLLECTION,110007,4175,ANY_ARMOR,ANY_CLASS,ANY_FACTION), -- Plunderlord's Stormridden Finery + -- Clockwork Collection + IncludeSet(COLLECTION,110007,4208,ANY_ARMOR,ANY_CLASS,ANY_FACTION,4210,4209,4211), -- Violet Clockwork Attire, Green, Gold, Purple + } + AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetOtherAppearances() + local COLLECTION, VERSION = SetCollector.EXPANSION, 110000 + local sets = { + -- Heritage Armor + IncludeSet(COLLECTION,110000,3700,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3702,3701), -- Heritage of Khaz Algar, Gundargaz, Freywold + } + AddSetsToDatabase(VERSION, COLLECTION, sets) + + COLLECTION, VERSION = SetCollector.OTHER, 110005 + sets = { + -- WoW's 20th Anniversary + IncludeSet(COLLECTION,110005,3871,PLATE,PALADIN,ANY_FACTION), -- Eternal Judgment Armor + IncludeSet(COLLECTION,110005,3864,PLATE,DEATHKNIGHT,ANY_FACTION), -- Pale Rider's Eternal Armor + IncludeSet(COLLECTION,110005,3872,PLATE,WARRIOR,ANY_FACTION), -- Eternal Battlegear of Wrath + IncludeSet(COLLECTION,110005,3865,CLOTH,PRIEST,ANY_FACTION), -- Eternal Vestments of Transcendence + IncludeSet(COLLECTION,110005,3873,CLOTH,WARLOCK,ANY_FACTION), -- Eternal Nemesis Raiment + IncludeSet(COLLECTION,110005,3866,MAIL,SHAMAN,ANY_FACTION), -- The Eternal Ten Storms Armor + IncludeSet(COLLECTION,110005,3867,LEATHER,ROGUE,ANY_FACTION), -- Eternal Bloodfang Armor + IncludeSet(COLLECTION,110005,3868,CLOTH,MAGE,ANY_FACTION), -- Eternal Netherwind Regalia + IncludeSet(COLLECTION,110005,3861,LEATHER,MONK,ANY_FACTION), -- Eternal Battlegear of the August Acolyte + IncludeSet(COLLECTION,110005,3869,MAIL,HUNTER,ANY_FACTION), -- Dragonstalker's Eternal Armor + IncludeSet(COLLECTION,110005,3862,MAIL,EVOKER,ANY_FACTION), -- Earth-Warder's Eternal Armor + IncludeSet(COLLECTION,110005,3870,LEATHER,DRUID,ANY_FACTION), -- Eternal Stormrage Armor + IncludeSet(COLLECTION,110005,3863,LEATHER,DEMONHUNTER,ANY_FACTION), -- Netherwalker's Eternal Armor + } + AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetPvPAppearances() + local COLLECTION, VERSION = SetCollector.PVP, 110000 + local sets = { + -- The War Within Season 1 + IncludeSet(COLLECTION,110000,3824,LEATHER,DRUID,ANY_FACTION,3837), -- Forged Gladiator's Leather Armor, Elite + IncludeSet(COLLECTION,110000,3826,MAIL,HUNTER,ANY_FACTION,3839), -- Forged Gladiator's Chain Armor, Elite + IncludeSet(COLLECTION,110000,3828,PLATE,PALADIN,ANY_FACTION,3841), -- Forged Gladiator's Plate Armor, Elite + IncludeSet(COLLECTION,110000,3830,LEATHER,ROGUE,ANY_FACTION,3843), -- Forged Gladiator's Leather Armor, Elite + IncludeSet(COLLECTION,110000,3832,PLATE,WARRIOR,ANY_FACTION,3845), -- Forged Gladiator's Plate Armor, Elite + IncludeSet(COLLECTION,110000,3656,MAIL,ANY_CLASS,ANY_FACTION,3697), -- Forged Aspirant's Chain Armor, Aspirant + IncludeSet(COLLECTION,110000,3658,CLOTH,ANY_CLASS,ANY_FACTION,3699), -- Forged Aspirant's Silk Armor, Aspirant + IncludeSet(COLLECTION,110000,3821,CLOTH,MAGE,ANY_FACTION,3834), -- Forged Gladiator's Silk Armor, Elite + IncludeSet(COLLECTION,110000,3823,LEATHER,DEMONHUNTER,ANY_FACTION,3836), -- Forged Gladiator's Leather Armor, Elite + IncludeSet(COLLECTION,110000,3825,MAIL,EVOKER,ANY_FACTION,3838), -- Forged Gladiator's Chain Armor, Elite + IncludeSet(COLLECTION,110000,3827,LEATHER,MONK,ANY_FACTION,3840), -- Forged Gladiator's Leather Armor, Elite + IncludeSet(COLLECTION,110000,3829,CLOTH,PRIEST,ANY_FACTION,3842), -- Forged Gladiator's Silk Armor, Elite + IncludeSet(COLLECTION,110000,3831,MAIL,SHAMAN,ANY_FACTION,3844), -- Forged Gladiator's Chain Armor, Elite + IncludeSet(COLLECTION,110000,3833,CLOTH,WARLOCK,ANY_FACTION,3846), -- Forged Gladiator's Silk Armor, Elite + IncludeSet(COLLECTION,110000,3655,PLATE,ANY_CLASS,ANY_FACTION,3696), -- Forged Aspirant's Plate Armor, Aspirant + IncludeSet(COLLECTION,110000,3657,LEATHER,ANY_CLASS,ANY_FACTION,3698), -- Forged Aspirant's Leather Armor, Aspirant + IncludeSet(COLLECTION,110000,3822,PLATE,DEATHKNIGHT,ANY_FACTION,3835), -- Forged Gladiator's Plate Armor, Elite + } + AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetRaidAppearances() + local COLLECTION, VERSION = SetCollector.RAID, 110000 + local sets = { + -- Nerub-ar Palace + IncludeSet(COLLECTION,110000,3751,CLOTH,PRIEST,ANY_FACTION,3750,3749,3752), -- Shards of Living Luster, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3759,MAIL,SHAMAN,ANY_FACTION,3757,3758,3760), -- Waves of the Forgotten Reservoir, Heroic, Mythic, Raid Finder + IncludeSet(COLLECTION,110000,3767,PLATE,WARRIOR,ANY_FACTION,3766,3765,3768), -- Warsculptor's Masterwork, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3723,LEATHER,DEMONHUNTER,ANY_FACTION,3721,3722,3724), -- Husk of the Hypogeal Nemesis, Heroic, Mythic, Raid Finder + IncludeSet(COLLECTION,110000,3731,MAIL,EVOKER,ANY_FACTION,3730,3729,3732), -- Destroyer's Scarred Wards, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3739,CLOTH,MAGE,ANY_FACTION,3738,3737,3740), -- Sparks of Violet Rebirth, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3747,PLATE,PALADIN,ANY_FACTION,3745,3746,3748), -- Entombed Seraph's Radiance, Heroic, Mythic, Raid Finder + IncludeSet(COLLECTION,110000,3755,LEATHER,ROGUE,ANY_FACTION,3754,3753,3756), -- K'areshi Phantom's Bindings, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3763,CLOTH,WARLOCK,ANY_FACTION,3762,3761,3764), -- Rites of the Hexflame Coven, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3711,PLATE,DEATHKNIGHT,ANY_FACTION,3718,3719,3720), -- Exhumed Centurion's Relics, Heroic, Mythic, Raid Finder + IncludeSet(COLLECTION,110000,3727,LEATHER,DRUID,ANY_FACTION,3726,3725,3728), -- Mane of the Greatlynx, Mythic, Heroic, Raid Finder + IncludeSet(COLLECTION,110000,3735,MAIL,HUNTER,ANY_FACTION,3733,3734,3736), -- Lightless Scavenger's Necessities, Heroic, Mythic, Raid Finder + IncludeSet(COLLECTION,110000,3743,LEATHER,MONK,ANY_FACTION,3742,3741,3744), -- Gatecrasher's Fortitude, Mythic, Heroic, Raid Finder + } + AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +local function GetTradingPostAppearances() + local COLLECTION, VERSION = SetCollector.TRADING, 110000 + local sets = { + -- Plunderlord's Finery + IncludeSet(COLLECTION,110000,3443,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3875), -- Plunderlord's Radiant Finery, Yellow + -- Harvest Golem + IncludeSet(COLLECTION,110000,3885,ANY_ARMOR,ANY_CLASS,ANY_FACTION,3886,3887,3888), -- Battered Harvest Golem, Purple, Green, Blue + } + AddSetsToDatabase(VERSION, COLLECTION, sets) + + COLLECTION, VERSION = SetCollector.TRADING, 110007 + sets = { + -- Ornate Lunar Festival Attire + IncludeSet(COLLECTION,110007,4213,ANY_ARMOR,ANY_CLASS,ANY_FACTION,4214,4215,4216), -- Ornate Teal Lunar Festival Attire, Pink, Purple, Teal + } + AddSetsToDatabase(VERSION, COLLECTION, sets) +end + +-- +-- GLOBAL FUNCTIONS +-- + +function SetCollector:GetVersion11Appearances(expansion) + if expansion.v11 then + GetCraftedAppearances() + GetDungeonAppearances() + GetExpansionAppearances() + GetOtherAppearances() + GetPvPAppearances() + GetRaidAppearances() + GetTradingPostAppearances() + end +end + +function SetCollector:GetVersion11Status() + return SetCollector:GetExpansionStatus("11") +end + +function SetCollector:SetVersion11Status() + SetCollector:SetExpansionStatus("11") +end + diff --git a/Appearances/Base.lua b/Appearances/Base.lua index b30c16f..578f566 100644 --- a/Appearances/Base.lua +++ b/Appearances/Base.lua @@ -102,7 +102,7 @@ function SetCollector:IncludeSet(collection, uid, setID, armorType, class, facti description = description.." ("..setInfo.expansionID..")" end local set = { - ID = collection.Code..string.format("%04d", uid)..setID..armorType.Code..class.Code..faction.Code, + ID = collection.Code..string.format("%06d", uid)..setID..armorType.Code..class.Code..faction.Code, setID = setInfo.setID, Collection = collection.Description, Title = setInfo.name, @@ -167,7 +167,7 @@ end function SetCollector:CreateSet(collection, uid, title, armorType, class, faction, location, ...) local set = { - ID = collection.Code..string.format("%04d", uid)..armorType.Code..class.Code..faction.Code, + ID = collection.Code..string.format("%06d", uid)..armorType.Code..class.Code..faction.Code, Collection = collection.Description, Title = title, TooltipID = SetCollector:CreateTooltipID(collection, uid, title), diff --git a/Core.lua b/Core.lua index 7a01f7e..dfeeb7d 100644 --- a/Core.lua +++ b/Core.lua @@ -189,12 +189,14 @@ function SetCollector:ToggleExpansion(parameters) expansions.v09 = not expansions.v09 elseif parameters == "10" then expansions.v10 = not expansions.v10 + elseif parameters == "11" then + expansions.v11 = not expansions.v11 end SetCollector:Print(L["RELOAD"]) end function SetCollector:PrintItem(itemID) - local sLink = select(2,GetItemInfo(itemID)) + local sLink = select(2,C_Item.GetItemInfo(itemID)) SetCollector:Print(sLink) end @@ -299,9 +301,17 @@ end function ParseClassMask(bits) -- 0 == All classes can wear - if bits == 0 then + if bits == nil or bits == 0 then + return "ANY_CLASS" + end + + local cleanBits = BitAND(bits, math.pow(2, GetNumClasses()) - 1) + + -- 0 == All classes can wear + if cleanBits == 0 then return "ANY_CLASS" end + local map = { WARRIOR = 0x001, PALADIN = 0x002, @@ -317,32 +327,37 @@ function ParseClassMask(bits) DEMONHUNTER = 0x800, DRAKTHYR = 0x1000 } + -- Check for exact match between class for char, mask in pairs(map) do - if bits == mask then + if cleanBits == mask then return char .. "" end end - -- Check for "any" match between class - local any_map = { - ANY_PLATE = 0x001 + 0x002 + 0x020, - ANY_LEATHER = 0x008 + 0x200 + 0x800 + 0x400, - ANY_CLOTH = 0x010 + 0x080 + 0x100, - ANY_MAIL = 0x004 + 0x040 + 0x1000 - } - for char, mask in pairs(any_map) do - if bits == mask then - return "ANY_CLASS" - end - end - -- hmm, weird case, better itemize - local parse = bits .. ": " - for char, mask in pairs(map) do - if (BitAND(bits, mask) == mask) then - parse = parse .. char .. " " - end - end - return parse + + -- Right now, the remaining code is useless. Just pass "Any Class" and depend on cloth\mail\etc to filter. + return "ANY_CLASS" + + -- -- Check for "any" match between class + -- local any_map = { + -- ANY_PLATE = 0x001 + 0x002 + 0x020, + -- ANY_LEATHER = 0x008 + 0x200 + 0x800 + 0x400, + -- ANY_CLOTH = 0x010 + 0x080 + 0x100, + -- ANY_MAIL = 0x004 + 0x040 + 0x1000 + -- } + -- for char, mask in pairs(any_map) do + -- if cleanBits == mask then + -- return char .. "" + -- end + -- end + -- -- hmm, weird case, better itemize + -- local parse = cleanBits .. ": " + -- for char, mask in pairs(map) do + -- if (BitAND(cleanBits, mask) == mask) then + -- parse = parse .. char .. " " + -- end + -- end + -- return parse end function ParseArmorMask(bits) @@ -350,22 +365,30 @@ function ParseArmorMask(bits) if bits == 0 then return "ANY_ARMOR" end + + local cleanBits = BitAND(bits, math.pow(2, GetNumClasses()) - 1) + + -- 0 == All classes can wear + if cleanBits == 0 then + return "ANY_ARMOR" + end + local map = { PLATE = 0x001 + 0x002 + 0x020, - LEATHER = 0x008 + 0x200 + 0x800 + 0x400, + LEATHER = 0x008 + 0x200 + 0x400 + 0x800, CLOTH = 0x010 + 0x080 + 0x100, MAIL = 0x004 + 0x040 + 0x1000 } - local parse = bits .. ": " + for char, mask in pairs(map) do - if (BitAND(bits, mask) > 0) then + if (BitAND(cleanBits, mask) > 0) then return char .. "" end end -- hmm, weird case, better itemize - local parse = bits .. ": " + local parse = cleanBits .. ": " for char, mask in pairs(map) do - if (BitAND(bits, mask) == mask) then + if (BitAND(cleanBits, mask) == mask) then parse = parse .. char .. " " end end diff --git a/DB.lua b/DB.lua index 1812c10..eeca183 100644 --- a/DB.lua +++ b/DB.lua @@ -26,7 +26,8 @@ local defaults = { v07 = true, v08 = true, v09 = true, - v10 = true + v10 = true, + v11 = true }, minimap = { hide = false @@ -480,6 +481,7 @@ function SetCollector:AddAppearances(debug) SetCollector:GetVersion08Appearances(expansions) -- Battle for Azeroth SetCollector:GetVersion09Appearances(expansions) -- Shadowlands SetCollector:GetVersion10Appearances(expansions) -- Dragonflight + SetCollector:GetVersion11Appearances(expansions) -- The War Within --if debug then SetCollector:Print("Finished adding appearances to database.") end end @@ -513,6 +515,7 @@ function SetCollector:GetExpansionStatus(version) elseif version == "8" then return expansions.v08 elseif version == "9" then return expansions.v09 elseif version == "10" then return expansions.v10 + elseif version == "11" then return expansions.v11 end end @@ -529,6 +532,7 @@ function SetCollector:SetExpansionStatus(version) elseif version == "8" then expansions.v08 = not expansions.v08 elseif version == "9" then expansions.v09 = not expansions.v09 elseif version == "10" then expansions.v10 = not expansions.v10 + elseif version == "11" then expansions.v11 = not expansions.v11 end end @@ -781,6 +785,16 @@ function SetCollector:GetOptions() set = "SetVersion10Status", width = "full" }, + v11 = { + type = "toggle", + hidden = HideExpansionToggle("110000"), + order = 21, + name = L["INT_OPT_EXPANSION_11_NAME"], + desc = L["INT_OPT_EXPANSION_11_DESC"], + get = "GetVersion11Status", + set = "SetVersion11Status", + width = "full" + }, }, }, tooltips = { diff --git a/Localization/enUS.lua b/Localization/enUS.lua index 3d47c78..71f4a81 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -106,6 +106,7 @@ L["7"] = "7" L["8"] = "8" L["9"] = "9" L["10"] = "10" +L["11"] = "11" -- From Translators L["ADDON_NAME"] = "Set Collector" @@ -376,6 +377,8 @@ L["INT_OPT_EXPANSION_09_NAME"] = "Shadowlands" L["INT_OPT_EXPANSION_09_DESC"] = "Include sets from Shadowlands." L["INT_OPT_EXPANSION_10_NAME"] = "Dragonflight" L["INT_OPT_EXPANSION_10_DESC"] = "Include sets from Dragonflight." +L["INT_OPT_EXPANSION_11_NAME"] = "The War Within" +L["INT_OPT_EXPANSION_11_DESC"] = "Include sets from The War Within." L["INT_OPT_FAVORITE_NAME"] = "Only show favorite sets" L["INT_OPT_FAVORITE_DESC"] = "Only show sets you have marked as favorite." L["INT_OPT_HIDDEN_NAME"] = "Show sets that you have hidden" diff --git a/SetCollector.toc b/SetCollector.toc index a7130d2..cdf89b4 100644 --- a/SetCollector.toc +++ b/SetCollector.toc @@ -30,6 +30,7 @@ Appearances\07.lua Appearances\08.lua Appearances\09.lua Appearances\10.lua +Appearances\11.lua DB.lua UI.lua Tooltips.lua From 4bb534378578522dbab2229e8d88c93fa7320eac Mon Sep 17 00:00:00 2001 From: Miki Urban Date: Thu, 9 Jan 2025 00:25:35 -0800 Subject: [PATCH 02/15] Typo --- Appearances/00.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Appearances/00.lua b/Appearances/00.lua index 0a1d15b..5e2b1b9 100644 --- a/Appearances/00.lua +++ b/Appearances/00.lua @@ -80,7 +80,8 @@ local function GetHeritageAppearances() IncludeSet(COLLECTION,10099,1981,ANY_ARMOR,ANY_CLASS,ANY_FACTION), } VERSION = 100107 - AddSetsToDatabase(VERSION, COLLECTION, sets)sets = { + AddSetsToDatabase(VERSION, COLLECTION, sets) + sets = { IncludeSet(COLLECTION,11001,3085,ANY_ARMOR,ANY_CLASS,ANY_FACTION), IncludeSet(COLLECTION,11001,3086,ANY_ARMOR,ANY_CLASS,ANY_FACTION), } From cd4b8551aa352ffb307dca0fb421da6f5c1945ab Mon Sep 17 00:00:00 2001 From: Miki Urban Date: Thu, 9 Jan 2025 00:31:51 -0800 Subject: [PATCH 03/15] Improvements in showing the default set item as the item button instead of some random variant of it --- Appearances/Base.lua | 16 +-- UI.lua | 250 ++++++++++++++++++++++--------------------- 2 files changed, 137 insertions(+), 129 deletions(-) diff --git a/Appearances/Base.lua b/Appearances/Base.lua index 578f566..179ce5d 100644 --- a/Appearances/Base.lua +++ b/Appearances/Base.lua @@ -58,29 +58,28 @@ local function is_numeric(x) return false end -function SetCollector:CreateAppearance(ID, sourceID, slotID, ...) +function SetCollector:CreateAppearance(ID, sourceID, slotID, itemID, ...) local t = { ID = ID or 0, sourceID = sourceID or 0, slotID = slotID or 0, - alternateIDs = {} + itemID = itemID } - -- if select('#', ...) > 0 then -- add alternate appearance IDs return t end function SetCollector:CreateAppearanceFromItemID(itemID) - appearanceID, sourceID = C_TransmogCollection.GetItemInfo(itemID) - if (sourceID) then + local slotID = 0 + local appearanceID, sourceID = C_TransmogCollection.GetItemInfo(itemID) + if sourceID then slotID = select(1, C_TransmogCollection.GetSourceInfo(sourceID)) end local t = { ID = appearanceID or 0, sourceID = sourceID or 0, slotID = slotID or 0, - alternateIDs = {} + itemID = itemID } - -- if select('#', ...) > 0 then -- add alternate appearance IDs return t end @@ -151,10 +150,11 @@ function SetCollector:IncludeVariant(setID, setInfo, ...) if appearances then variant.Count = #appearances for pos in pairs(appearances) do + local itemID = C_TransmogCollection.GetSourceItemID(appearances[pos].appearanceID) local sourceInfo = C_TransmogCollection.GetSourceInfo(appearances[pos].appearanceID); if (sourceInfo) then local slotID = C_Transmog.GetSlotForInventoryType(sourceInfo.invType) - table.insert(variant.Appearances, SetCollector:CreateAppearance(sourceInfo.visualID or nil, sourceInfo.sourceID or nil, slotID or nil)) + table.insert(variant.Appearances, SetCollector:CreateAppearance(sourceInfo.visualID or nil, sourceInfo.sourceID or nil, slotID or nil, itemID or nil)) end end local function compare(a, b) diff --git a/UI.lua b/UI.lua index 85b7c71..4348a83 100644 --- a/UI.lua +++ b/UI.lua @@ -369,54 +369,57 @@ local itemButton = CreateFrame("Button","$parentItem"..i,modelFrame,"SetCollecto prevItem = itemButton end -local function SetItemButton(button, appearanceID, sourceID) - if button and appearanceID and appearanceID > 0 then - local src = 0 - local s = 1 - local isCollected = SetCollector:IsAppearanceCollected(appearanceID) - local sources = C_TransmogCollection.GetAllAppearanceSources(appearanceID) - if sources and isCollected then - src = sources[1] - else - src = sourceID +local function SetItemButton(button, appearanceID, sourceID, itemID) + if button then + local id, app, src, isCollected, icon, sLink = itemID, appearanceID, sourceID, false, nil, nil + if id then + app, src = C_TransmogCollection.GetItemInfo(id) end - local sTexture, sLink if src and src > 0 then - _, _, _, sTexture, _, sLink = C_TransmogCollection.GetAppearanceSourceInfo(src) + _, _, _, icon, isCollected, sLink = C_TransmogCollection.GetAppearanceSourceInfo(src) end - if sLink and sTexture then - local itemID = GetItemInfoInstant(sLink); - if itemID and itemID > 0 then - button.link = sLink - button.ItemID = itemID - button.icon:SetTexture(sTexture) - button.icon:SetVertexColor(1, 1, 1, 0.5) - button.icon:SetDesaturated(true) - button.glow:Hide() - - if isCollected then - button.icon:SetVertexColor(1, 1, 1, 1) - button.icon:SetDesaturated(false) - local iRarity = select(3, GetItemInfo(sLink)) - if iRarity then - local r, g, b, _ = GetItemQualityColor(iRarity) - button.glow:SetVertexColor(r, g, b) - end - button.glow:Show() - end - - if not sources or #sources == 0 then - button.icon:SetVertexColor(1, 0.25, 0.25, 0.5) - end - - button:Show() - end + local sources = C_TransmogCollection.GetAllAppearanceSources(app) + if sources and not isCollected then + for _, source in ipairs(sources) do + _, _, _, icon, isCollected, sLink = C_TransmogCollection.GetAppearanceSourceInfo(source) + if isCollected then + break + end + end + end + if sLink and icon then + if not id then + id = C_Item.GetItemInfoInstant(sLink) + end + if id and id > 0 then + button.link = sLink + button.ItemID = id + button.icon:SetTexture(icon) + + if isCollected then + button.icon:SetVertexColor(1, 1, 1, 1) + button.icon:SetDesaturated(false) + local iRarity = select(3, C_Item.GetItemInfo(sLink)) + if iRarity then + local r, g, b, _ = C_Item.GetItemQualityColor(iRarity) + button.glow:SetVertexColor(r, g, b) + end + button.glow:Show() + else + button.icon:SetVertexColor(1, 0.25, 0.25, 0.5) + button.icon:SetDesaturated(true) + button.glow:Hide() end - else - button:Hide() - end + + button:Show() + end + end + else + button:Hide() + end end + local function ClearItemButtons(button) if button then for i=button, #EQUIPMENT do @@ -542,90 +545,95 @@ end function SetCollector:UpdateSelectedVariantTab(self) if frame:IsShown() then - local selected = PanelTemplates_GetSelectedTab(self); - if selected and SetCollector:GetDebug() then SetCollector:Print("Updating Selected Variant Tab: "..selected) end - - local collection = _G["SetCollectorSetDisplayTab"..selected].Collection - local set = _G["SetCollectorSetDisplayTab"..selected].Set - local outfit = _G["SetCollectorSetDisplayTab"..selected].Outfit - - ClearItemButtons(1) - - local inc = 0 - if collection and set then - local items, acq = {}, 0 - modelFrame:Undress() - if outfit and collection == 0 then - local itemTransmogInfoList = C_TransmogCollection.GetOutfitItemTransmogInfoList(outfit) - for i=1, #itemTransmogInfoList do - local sourceID = itemTransmogInfoList[i].appearanceID - if sourceID and sourceID > 0 then - local categoryID, appearanceID, _, _, isCollected = C_TransmogCollection.GetAppearanceSourceInfo(sourceID) - if isCollected then - acq = acq + 1 - end - if categoryID then - inc = inc + 1 - items[inc] = { - categoryID = categoryID, - appearanceID = appearanceID, - sourceID = sourceID - } - end - end - end - - elseif ( collection > 0 ) then - local db = SetCollector.db.global.collections - local num = #db[collection].Sets[set].Variants[selected].Appearances - for i=1, num do - local sourceID = db[collection].Sets[set].Variants[selected].Appearances[i].sourceID - local appearanceID = db[collection].Sets[set].Variants[selected].Appearances[i].ID - if sourceID == 0 then - sourceID = GetSourceID(appearanceID) - end - if sourceID and sourceID > 0 then - local categoryID, appearanceID = C_TransmogCollection.GetAppearanceSourceInfo(sourceID) - local isCollected = SetCollector:IsAppearanceCollected(appearanceID) - if isCollected then - acq = acq + 1 - end - if categoryID then - inc = inc + 1 - items[inc] = { - categoryID = categoryID, - appearanceID = appearanceID, - sourceID = sourceID - } - end - end - end + local selected = PanelTemplates_GetSelectedTab(self) + if selected and SetCollector:GetDebug() then + SetCollector:Print("Updating Selected Variant Tab: " .. selected) end - local function compare(a, b) - return a.categoryID < b.categoryID - end - table.sort(items, compare) - for i=1, #items do - modelFrame:TryOn(items[i].sourceID) - SetItemButton(_G["SetCollectorSetDisplayModelFrameItem"..i], items[i].appearanceID, items[i].sourceID) - end - - SetCollectorSummaryButtonSummary:SetText(string.format(L["ITEMS_COLLECTED"],acq,inc)) - if acq ~= "*" and acq > 0 then - SetCollectorSummaryButton.Texture:SetAtlas("collections-itemborder-collected") - else - SetCollectorSummaryButton.Texture:SetAtlas("collections-itemborder-uncollected") - end - SetCollectorSummaryButton:Show() - else - modelFrame:Dress() - ClearItemButtons(inc + 1) - SetCollectorSummaryButton:Hide() - end + local collection = _G["SetCollectorSetDisplayTab" .. selected].Collection + local set = _G["SetCollectorSetDisplayTab" .. selected].Set + local outfit = _G["SetCollectorSetDisplayTab" .. selected].Outfit + + ClearItemButtons(1) + + local inc = 0 + if collection and set then + local items, acq = {}, 0 + modelFrame:Undress() + if outfit and collection == 0 then + local itemTransmogInfoList = C_TransmogCollection.GetOutfitItemTransmogInfoList(outfit) + for i = 1, #itemTransmogInfoList do + local sourceID = itemTransmogInfoList[i].appearanceID + if sourceID and sourceID > 0 then + local categoryID, appearanceID, _, _, isCollected = + C_TransmogCollection.GetAppearanceSourceInfo(sourceID) + if isCollected then + acq = acq + 1 + end + if categoryID then + inc = inc + 1 + items[inc] = { + categoryID = categoryID, + appearanceID = appearanceID, + sourceID = sourceID + } + end + end + end + elseif (collection > 0) then + local db = SetCollector.db.global.collections + local num = #db[collection].Sets[set].Variants[selected].Appearances + for i = 1, num do + local sourceID = db[collection].Sets[set].Variants[selected].Appearances[i].sourceID + local appearanceID = db[collection].Sets[set].Variants[selected].Appearances[i].ID + local itemID = db[collection].Sets[set].Variants[selected].Appearances[i].itemID + if sourceID == 0 then + sourceID = GetSourceID(appearanceID) + end + if sourceID and sourceID > 0 then + local categoryID, appearanceID = C_TransmogCollection.GetAppearanceSourceInfo(sourceID) + local isCollected = SetCollector:IsAppearanceCollected(appearanceID) + if isCollected then + acq = acq + 1 + end + if categoryID then + inc = inc + 1 + items[inc] = { + categoryID = categoryID, + appearanceID = appearanceID, + sourceID = sourceID, + itemID = itemID + } + end + end + end + end + + local function compare(a, b) + return a.categoryID < b.categoryID + end + table.sort(items, compare) + for i = 1, #items do + modelFrame:TryOn(items[i].sourceID) + SetItemButton(_G["SetCollectorSetDisplayModelFrameItem" .. i], items[i].appearanceID, items[i].sourceID, items[i].itemID) + end + + SetCollectorSummaryButtonSummary:SetText(string.format(L["ITEMS_COLLECTED"], acq, inc)) + if acq ~= "*" and acq > 0 then + SetCollectorSummaryButton.Texture:SetAtlas("collections-itemborder-collected") + else + SetCollectorSummaryButton.Texture:SetAtlas("collections-itemborder-uncollected") + end + SetCollectorSummaryButton:Show() + else + modelFrame:Dress() + ClearItemButtons(inc + 1) + SetCollectorSummaryButton:Hide() + end end end + function SetCollector:SetVariantTab(self, tab) PanelTemplates_SetTab(self, tab); SetCollector:UpdateSelectedVariantTab(self); From a79c9776579848e38ac7afb0777d01f1f1d864a3 Mon Sep 17 00:00:00 2001 From: Miki Urban Date: Sun, 26 Jan 2025 19:36:19 -0800 Subject: [PATCH 04/15] Cleanup --- Core.lua | 10 +++++----- SetCollector.xml | 2 +- Tooltips.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Core.lua b/Core.lua index dfeeb7d..6b1c6a7 100644 --- a/Core.lua +++ b/Core.lua @@ -56,7 +56,7 @@ end function SetCollector:GetAppearanceInfo(itemLink) if itemLink then local appearanceID, sourceID, itemID, setIDs - itemID = GetItemInfoInstant(itemLink) + itemID = C_Item.GetItemInfoInstant(itemLink) appearanceID, sourceID = C_TransmogCollection.GetItemInfo(itemLink) if sourceID then setIDs = C_TransmogSets.GetSetsContainingSourceID(sourceID) @@ -142,10 +142,10 @@ function SetCollector:UpdateCollections() end function SetCollector:PLAYER_LOGIN() - local DEBUG = SetCollector:GetDebug() - if DEBUG then SetCollector:Print("Running PLAYER_LOGIN processes"); end - SetCollector:InitializeFilter(DEBUG) - SetCollector:InitializeModel(DEBUG) + local DEBUG = SetCollector:GetDebug() + if DEBUG then SetCollector:Print("Running PLAYER_LOGIN processes"); end + SetCollector:InitializeFilter(DEBUG) + SetCollector:InitializeModel(DEBUG) end -- diff --git a/SetCollector.xml b/SetCollector.xml index 235b770..a63f81c 100644 --- a/SetCollector.xml +++ b/SetCollector.xml @@ -90,7 +90,7 @@ - - - + @@ -165,8 +164,8 @@ - - + + diff --git a/UI.lua b/UI.lua index c8598fa..ff10d68 100644 --- a/UI.lua +++ b/UI.lua @@ -120,10 +120,6 @@ end tinsert(UISpecialFrames, frame:GetName()) -- Hides frame when Escape is pressed or Game menu selected. - -local helpButton = CreateFrame("Button","$parentTutorialButton",frame,"MainHelpPlateButton") -helpButton:SetPoint("TOPLEFT",frame, 39, 20) - -- -- ScrollFrame -- @@ -201,7 +197,6 @@ function SetCollectorSetButton_OnClick(self, button, ...) SetHighlight(self) else SetCollector:SetVariantTabs() - --ClearItemButtons() UnsetHighlight(self) end elseif ( not IsShiftKeyDown() and button == "RightButton" ) then @@ -406,19 +401,12 @@ end local function ClearItemButtons(button) - if button then - for i=button, #EQUIPMENT do - _G["SetCollectorSetDisplayModelFrameItem"..i]:Hide() - end - else - for i=1, #EQUIPMENT do - _G["SetCollectorSetDisplayModelFrameItem"..i]:Hide() - end + local startPos = button or 1 + for i=startPos, #EQUIPMENT do + _G["SetCollectorSetDisplayModelFrameItem"..i]:Hide() end end - - -- -- Variant Tabs -- @@ -524,7 +512,7 @@ function SetCollector:UpdateSelectedVariantTab(self) local collection = _G["SetCollectorSetDisplayTab" .. selected].Collection local set = _G["SetCollectorSetDisplayTab" .. selected].Set - ClearItemButtons(1) + ClearItemButtons() local slotIndex = 0 if collection and set then @@ -786,43 +774,6 @@ function SetCollector:InitializeFilter(DEBUG) if DEBUG then SetCollector:Print("Filters Initialized") end end - - --- --- Tutorial --- - -local AddTutorial = { - FramePos = { x = 0, y = -30 }, - FrameSize = { width = 638, height = 496 }, - [1] = { ButtonPos = { x = 500, y = 10 }, HighLightBox = { x = 497, y = 2, width = 200, height = 30 }, ToolTipDir = "LEFT", ToolTipText = L["TUTORIAL_1"] }, - [2] = { ButtonPos = { x = 120, y = -405 }, HighLightBox = { x = 8, y = -30, width = 252, height = 518 }, ToolTipDir = "DOWN", ToolTipText = L["TUTORIAL_2"] }, - [3] = { ButtonPos = { x = 310, y = -31 }, HighLightBox = { x = 285, y = -30, width = 412, height = 50 }, ToolTipDir = "LEFT", ToolTipText = L["TUTORIAL_3"] }, - [4] = { ButtonPos = { x = 476, y = -405 }, HighLightBox = { x = 285, y = -83, width = 412, height = 465 }, ToolTipDir = "DOWN", ToolTipText = L["TUTORIAL_4"] }, -} - -local function GetTutorial() - local helpPlate, mainHelpButton - helpPlate = AddTutorial - mainHelpButton = helpButton - return helpPlate, mainHelpButton -end - -function SetCollector:ToggleTutorial() - local helpPlate, mainHelpButton = GetTutorial() - - if ( helpPlate and not HelpPlate_IsShowing(helpPlate) and frame:IsShown()) then - HelpPlate_Show(helpPlate, frame:GetName(), mainHelpButton, HelpPlateSeen) - SetCollector_HELP_VISIBLE = true - HelpPlateSeen = true - else - HelpPlate_Hide(true) -- True indicates to animate the hide. Blank or flase suppresses the animation. - SetCollector_HELP_VISIBLE = false - end -end - - - -- -- Portrait -- @@ -1010,7 +961,6 @@ function SetCollector:OnShow(self) end function SetCollector:OnHide(self) - HelpPlate_Hide() SetCollectorSummaryButton:Hide() SetCollector:SetVariantTabs() ClearItemButtons() @@ -1018,9 +968,7 @@ function SetCollector:OnHide(self) end function SetCollector:SetupUI(DEBUG) - ResetUILocation() - local tutorialScript = function() SetCollector:ToggleTutorial() end - helpButton:SetScript("OnClick", tutorialScript) + ResetUILocation() local onShowScript = function() SetCollector:OnShow() end frame:SetScript("OnShow", onShowScript) From e4345dad84f96e8822cd5f93bd123c66e93807ef Mon Sep 17 00:00:00 2001 From: Miki Urban Date: Tue, 10 Feb 2026 22:47:27 -0800 Subject: [PATCH 15/15] Added set dump to the export --- Appearances/Base.lua | 4 ++++ Core.lua | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Appearances/Base.lua b/Appearances/Base.lua index ee37104..5aaa098 100644 --- a/Appearances/Base.lua +++ b/Appearances/Base.lua @@ -22,6 +22,10 @@ SetCollector.LEATHER = SetCollector.ROGUE + SetCollector.DRUID + SetCollector. SetCollector.MAIL = SetCollector.HUNTER + SetCollector.SHAMAN + SetCollector.EVOKER SetCollector.PLATE = SetCollector.WARRIOR + SetCollector.PALADIN + SetCollector.DEATHKNIGHT +-- Sometimes the mask goes beyond the range of expected values +SetCollector.ALL_CLASSES = 0x1FFF + + -- Some transmog have unusual class restrictions SetCollector.AZZINOTH = SetCollector.WARRIOR + SetCollector.ROGUE + SetCollector.DEATHKNIGHT + SetCollector.MONK + SetCollector.DEMONHUNTER SetCollector.DRAGONWRATH = SetCollector.PRIEST + SetCollector.SHAMAN + SetCollector.MAGE + SetCollector.WARLOCK + SetCollector.DRUID + SetCollector.EVOKER diff --git a/Core.lua b/Core.lua index 0dd006d..7ef2b91 100644 --- a/Core.lua +++ b/Core.lua @@ -96,6 +96,29 @@ end -- Global Functions -- +function SetCollector:ParseClassMask(mask) + local cleanMask = SetCollector:BitAND(mask, SetCollector.ALL_CLASSES) + if (SetCollector:BitAND(cleanMask, SetCollector.ANY_CLASS)) then return "ANY_CLASS" end + if (SetCollector:BitAND(cleanMask, SetCollector.CLOTH)) then return "ANY_CLOTH" end + if (SetCollector:BitAND(cleanMask, SetCollector.LEATHER)) then return "ANY_LEATHER" end + if (SetCollector:BitAND(cleanMask, SetCollector.MAIL)) then return "ANY_MAIL" end + if (SetCollector:BitAND(cleanMask, SetCollector.PLATE)) then return "ANY_PLATE" end + if (SetCollector:BitAND(cleanMask, SetCollector.DEATHKNIGHT)) then return 'DEATHKNIGHT' end + if (SetCollector:BitAND(cleanMask, SetCollector.DEMONHUNTER)) then return 'DEMONHUNTER' end + if (SetCollector:BitAND(cleanMask, SetCollector.DRUID)) then return 'DRUID' end + if (SetCollector:BitAND(cleanMask, SetCollector.EVOKER)) then return 'EVOKER' end + if (SetCollector:BitAND(cleanMask, SetCollector.HUNTER)) then return 'HUNTER' end + if (SetCollector:BitAND(cleanMask, SetCollector.MAGE)) then return 'MAGE' end + if (SetCollector:BitAND(cleanMask, SetCollector.MONK)) then return 'MONK' end + if (SetCollector:BitAND(cleanMask, SetCollector.PALADIN)) then return 'PALADIN' end + if (SetCollector:BitAND(cleanMask, SetCollector.PRIEST)) then return 'PRIEST' end + if (SetCollector:BitAND(cleanMask, SetCollector.ROGUE)) then return 'ROGUE' end + if (SetCollector:BitAND(cleanMask, SetCollector.SHAMAN)) then return 'SHAMAN' end + if (SetCollector:BitAND(cleanMask, SetCollector.WARLOCK)) then return 'WARLOCK' end + if (SetCollector:BitAND(cleanMask, SetCollector.WARRIOR)) then return 'WARRIOR' end + return 'UNKNOWN' +end + function SetCollector:GetDebug() DEBUG = SetCollector.db.global.debug return DEBUG @@ -292,6 +315,9 @@ end function SetCollector:ExportSetData() local tree = {} local exportTree = {} + local dumpList = {} + local dumpColumns = {"setID", "baseSetID", "name", "desc", "label", "patchID", "classMask", "uiOrder", "faction"} + table.insert(dumpList, table.concat(dumpColumns, "|")) local sets = C_TransmogSets.GetAllSets() if (sets) then for i, set in ipairs(sets) do @@ -348,11 +374,16 @@ function SetCollector:ExportSetData() end exportTree[setInfo.patchID][setInfo.patchID][heading][baseSetID] = lua2 + local faction = setInfo.requiredFaction or "" + local mask = SetCollector:ParseClassMask(setInfo.classMask) + dumpColumns = {setID, baseSetID, setInfo.name, strDesc, strLabel, setInfo.patchID, mask, setInfo.uiOrder, faction} + table.insert(dumpList, table.concat(dumpColumns, "|")) end end end SetCollector.db.global.export = exportTree + SetCollector.db.global.dumpList = dumpList SetCollector:Print("Done exporting") end