diff --git a/.currency_build.ps1 b/.currency_build.ps1 index 3042e7e..b6d33c0 100644 --- a/.currency_build.ps1 +++ b/.currency_build.ps1 @@ -23,15 +23,28 @@ $categoriesToBlacklist = @( 252 # Tuskarr - Fishing Nets (Hidden) ) -$blackist = $csv | Where-Object { ($currenciesToBlacklist -contains $_.ID -or $categoriesToBlacklist -contains $_.CategoryID) -and $currenciesToWhitelist -notcontains $_.ID } | Select-Object -Property ID, Name_lang +# convert IDs to int because sorting strings sucks ass +$ID = @{ l = "ID"; e = { $_.ID -as [int] } } + +$blackist = $csv | + Where-Object { + ($currenciesToBlacklist -contains $_.ID -or $categoriesToBlacklist -contains $_.CategoryID) -and $currenciesToWhitelist -notcontains $_.ID + } | + Select-Object $ID, Name_lang | + Sort-Object ID # $blackist | ForEach-Object { -# Write-Host "[$($_.ID.PadLeft(4))] = true, -- $($_.Name_lang)" +# Write-Host "[$($_.ID.ToString().PadLeft(4))] = true, -- $($_.Name_lang)" # } # 0x8 - 1/100 scalar for display -$mult = $csv | Where-Object { $_.Flags_0 -band 8 -and -not (($currenciesToBlacklist -contains $_.ID -or $categoriesToBlacklist -contains $_.CategoryID) -and $currenciesToWhitelist -notcontains $_.ID) } | Select-Object -Property ID, Name_lang +$mult = $csv | + Where-Object { + $_.Flags_0 -band 8 -and -not (($currenciesToBlacklist -contains $_.ID -or $categoriesToBlacklist -contains $_.CategoryID) -and $currenciesToWhitelist -notcontains $_.ID) + } | + Select-Object $ID, Name_lang | + Sort-Object ID # $mult | ForEach-Object { -# Write-Host "[$($_.ID.PadLeft(4))] = 0.01, -- $($_.Name_lang)" +# Write-Host "[$($_.ID.ToString().PadLeft(4))] = 0.01, -- $($_.Name_lang)" # } $lua = ".\ls_Toasts\systems\loot_currency.lua" @@ -47,7 +60,7 @@ foreach ($line in Get-Content $lua) { $out += "local BLACKLIST = {`n" $blackist | ForEach-Object { - $out += "`t[$($_.ID.PadLeft(4))] = true, -- $($_.Name_lang)`n" + $out += "`t[$($_.ID.ToString().PadLeft(4))] = true, -- $($_.Name_lang)`n" } $out += "}`n`n" @@ -55,7 +68,7 @@ $out += "}`n`n" $out += "local MULT = {`n" $mult | ForEach-Object { - $out += "`t[$($_.ID.PadLeft(4))] = 0.01, -- $($_.Name_lang)`n" + $out += "`t[$($_.ID.ToString().PadLeft(4))] = 0.01, -- $($_.Name_lang)`n" } $out += "}`n" diff --git a/.luacheckrc b/.luacheckrc index c1fcdab..e651b66 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -48,6 +48,7 @@ read_globals = { "C_AddOns", "C_CurrencyInfo", "C_Garrison", + "C_Item", "C_LegendaryCrafting", "C_MountJournal", "C_PerksActivities", @@ -94,10 +95,7 @@ read_globals = { "GetAchievementInfo", "GetArchaeologyRaceInfoByID", "GetCVarBool", - "GetDetailedItemLevelInfo", "GetInstanceInfo", - "GetItemInfo", - "GetItemInfoInstant", "GetLFGCompletionReward", "GetLFGCompletionRewardItem", "GetLFGCompletionRewardItemLink", diff --git a/CHANGELOG.md b/CHANGELOG.md index a24a673..cc25dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Version 100206.01 + +- Added 10.2.6 support. + ## Version 100205.03 ### Loot (Special) diff --git a/ls_Toasts/core/changelog.lua b/ls_Toasts/core/changelog.lua index 93933c3..35ccbcc 100644 --- a/ls_Toasts/core/changelog.lua +++ b/ls_Toasts/core/changelog.lua @@ -6,10 +6,5 @@ local _G = getfenv(0) -- Mine E.CHANGELOG = [[ -### Loot (Special) - -- Added loot roll info. It's a returning feature. However, there's a caveat, I don't know if "transmog" rolls are - actually a thing in this particular case because it's basically an undocumented feature. I added it based on my - assumptions, so if it works, good, if it doesn't, oh well. But "need", "greed", and "disenchant" rolls should work as - expected. +- Added 10.2.6 support. ]] diff --git a/ls_Toasts/core/core.lua b/ls_Toasts/core/core.lua index fbbb760..bb4edf0 100644 --- a/ls_Toasts/core/core.lua +++ b/ls_Toasts/core/core.lua @@ -202,11 +202,11 @@ do } function E:GetItemLevel(itemLink) - local _, _, _, _, _, _, _, _, itemEquipLoc, _, _, itemClassID, itemSubClassID = GetItemInfo(itemLink) + local _, _, _, _, _, _, _, _, itemEquipLoc, _, _, itemClassID, itemSubClassID = C_Item.GetItemInfo(itemLink) -- 3:11 is artefact relic if (itemClassID == 3 and itemSubClassID == 11) or slots[itemEquipLoc] then - return GetDetailedItemLevelInfo(itemLink) or 0 + return C_Item.GetDetailedItemLevelInfo(itemLink) or 0 end return 0 diff --git a/ls_Toasts/ls_Toasts.toc b/ls_Toasts/ls_Toasts.toc index 2194fc7..d24c919 100644 --- a/ls_Toasts/ls_Toasts.toc +++ b/ls_Toasts/ls_Toasts.toc @@ -1,6 +1,6 @@ -## Interface: 100205 +## Interface: 100206 ## Author: lightspark -## Version: 100205.03 +## Version: 100206.01 ## Title: LS: |cff00cc99Toasts|r ## Notes: Better toasts, cheers! ## IconTexture: Interface\AddOns\ls_Toasts\assets\logo-64 diff --git a/ls_Toasts/systems/loot_common.lua b/ls_Toasts/systems/loot_common.lua index 1a7e8c5..c2e2e91 100644 --- a/ls_Toasts/systems/loot_common.lua +++ b/ls_Toasts/systems/loot_common.lua @@ -110,7 +110,7 @@ local function Toast_SetUp(event, link, quantity) name, icon = C_PetJournal.GetPetInfoBySpeciesID(speciesID) quality = tonumber(breedQuality) else - name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType = GetItemInfo(originalLink) + name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType = C_Item.GetItemInfo(originalLink) isQuestItem = bindType == 4 or (classID == 12 and subClassID == 0) end @@ -254,13 +254,13 @@ end local function Test() -- item, Chaos Crystal - local _, link = GetItemInfo(124442) + local _, link = C_Item.GetItemInfo(124442) if link then Toast_SetUp("COMMON_LOOT_TEST", link, m_random(9, 99)) end -- item, Hochenblume, Rank 3 - _, link = GetItemInfo(191462) + _, link = C_Item.GetItemInfo(191462) if link then Toast_SetUp("COMMON_LOOT_TEST", link, m_random(9, 99)) end diff --git a/ls_Toasts/systems/loot_currency.lua b/ls_Toasts/systems/loot_currency.lua index 43a0c3f..f04e5d7 100644 --- a/ls_Toasts/systems/loot_currency.lua +++ b/ls_Toasts/systems/loot_currency.lua @@ -50,7 +50,6 @@ local BLACKLIST = { [1347] = true, -- Legionfall Building - Personal Tracker - Mage Tower (Hidden) [1349] = true, -- Legionfall Building - Personal Tracker - Command Tower (Hidden) [1350] = true, -- Legionfall Building - Personal Tracker - Nether Tower (Hidden) - [1705] = true, -- Warfronts - Personal Tracker - Iron in Chest (Hidden) [1501] = true, -- Writhing Essence [1506] = true, -- Argus Waystone [1534] = true, -- Zandalari Archaeology Fragment @@ -69,6 +68,7 @@ local BLACKLIST = { [1599] = true, -- 7th Legion [1600] = true, -- Honorbound [1703] = true, -- PVP Season Rated Participation Currency + [1705] = true, -- Warfronts - Personal Tracker - Iron in Chest (Hidden) [1714] = true, -- Warfronts - Personal Tracker - Wood in Chest (Hidden) [1722] = true, -- Azerite Ore [1723] = true, -- Lumber @@ -191,11 +191,11 @@ local BLACKLIST = { [1980] = true, -- Torghast - Scoreboard - Run Layer [1981] = true, -- Torghast - Scoreboard - Run ID [1982] = true, -- The Enlightened + [1986] = true, -- Players Remaining [1997] = true, -- Archivists' Codex [2000] = true, -- Motes of Fate [2001] = true, -- Paden Test Currency [2002] = true, -- Renown-Maruuk Centaur - [2153] = true, -- Red Whelp (Under Red Wings) [2016] = true, -- Dragon Racing - Scoreboard - Race Complete Time [2017] = true, -- Dragon Racing - Scoreboard - Race Complete Time - Fraction 1 [2018] = true, -- Dragon Racing - Scoreboard - Race Quest ID @@ -314,6 +314,7 @@ local BLACKLIST = { [2150] = true, -- Red Whelp (Curing Whiff) [2151] = true, -- Red Whelp (Mending Breath) [2152] = true, -- Red Whelp (Sleepy Ruby Warmth) + [2153] = true, -- Red Whelp (Under Red Wings) [2154] = true, -- Dragon Racing - Personal Best Record - Waking Shores 01 Reverse [2155] = true, -- Dragon Racing - Best Time Display - Whole [2156] = true, -- Dragon Racing - Best Time Display - Fraction 1 @@ -380,6 +381,8 @@ local BLACKLIST = { [2226] = true, -- Dragon Racing - Best Time Display - Reverse - Fraction 10 [2227] = true, -- Dragon Racing - Best Time Display - Reverse - Fraction 100 [2228] = true, -- Tuskarr - Fishing Net - Location 06 - Net 01 - Loot + [2230] = true, -- Darkmoon Prize Ticket (Void) + [2231] = true, -- Players [2235] = true, -- 10.0 Dragonrider PVP - Whirling Surge Dismounts 10.0.2 [DNT] [2236] = true, -- Dragon Racing - Scoreboard - Race Complete Time MS [2237] = true, -- 10.0 Dragonrider PVP - Whirling Surge Dismounts 10.0.5 [DNT] @@ -784,6 +787,7 @@ local BLACKLIST = { [2703] = true, -- Dragon Racing - Personal Best Record - ED 05 Challenge R [2704] = true, -- Dragon Racing - Personal Best Record - ED 06 Challenge [2705] = true, -- Dragon Racing - Personal Best Record - ED 06 Challenge R + [2710] = true, -- Study of Shadowflame [2715] = true, -- Whelpling's Dreaming Crests [2716] = true, -- Drake's Dreaming Crests [2717] = true, -- Wyrm's Dreaming Crests @@ -844,11 +848,23 @@ local BLACKLIST = { [2773] = true, -- Dragon Racing - Personal Best Record - Northrend 18 Reverse [2774] = true, -- 10.2 Professions - Personal Tracker - S3 Spark Drops (Hidden) [2780] = true, -- Echoed Ephemera Tracker [DNT] + [2784] = true, -- 10.2 Legendary - Progressive Advance - Tracker [2796] = true, -- Renascent Dream + [2800] = true, -- 10.2.6 Professions - Personal Tracker - S4 Spark Drops (Hidden) + [2805] = true, -- Whelpling's Awakened Crest + [2808] = true, -- Drake's Awakened Crest + [2810] = true, -- Wyrm's Awakened Crest + [2811] = true, -- Aspect's Awakened Crest + [2814] = true, -- Renown-Keg Leg's Crew [2819] = true, -- Azerothian Archives + [2822] = true, -- [DNT] Corgi Cache [2878] = true, -- 10.2 Professions - Personal Tracker - Legendary - Restored Leaf - [2710] = true, -- Study of Shadowflame - [2784] = true, -- 10.2 Legendary - Progressive Advance - Tracker + [2906] = true, -- Plunder + [2907] = true, -- Pirate Booty Visual + [2912] = true, -- Renascent Awakening + [2922] = true, -- Plunder + [3010] = true, -- 10.2.6 Rewards - Personal Tracker - S4 Dinar Drops (Hidden) + [3011] = true, -- Plunder } local MULT = { diff --git a/ls_Toasts/systems/loot_special.lua b/ls_Toasts/systems/loot_special.lua index 050c774..79994db 100644 --- a/ls_Toasts/systems/loot_special.lua +++ b/ls_Toasts/systems/loot_special.lua @@ -50,7 +50,7 @@ local function Toast_SetUp(event, link, quantity, factionGroup, lessAwesome, isU local sanitizedLink, originalLink, _, itemID = E:SanitizeLink(link) local toast, isNew, isQueued = E:GetToast(event, "link", sanitizedLink) if isNew then - local name, _, quality, _, _, _, _, _, _, icon = GetItemInfo(originalLink) + local name, _, quality, _, _, _, _, _, _, icon = C_Item.GetItemInfo(originalLink) if name and (quality and quality >= C.db.profile.types.loot_special.threshold and quality <= 5) then local color = ITEM_QUALITY_COLORS[quality] or ITEM_QUALITY_COLORS[1] local title = L["YOU_RECEIVED"] @@ -256,43 +256,43 @@ local function Test() factionGroup = factionGroup ~= "Neutral" and factionGroup or "Horde" -- pvp, Fearless Gladiator's Dreadplate Girdle - local _, link = GetItemInfo(142679) + local _, link = C_Item.GetItemInfo(142679) if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, factionGroup) end -- titanforged, Bonespeaker Bracers - _, link = GetItemInfo("item:134222::::::::110:63::36:4:3432:41:1527:3337:::") + _, link = C_Item.GetItemInfo("item:134222::::::::110:63::36:4:3432:41:1527:3337:::") if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, true) end -- upgraded from uncommon to epic, Nightsfall Brestplate - _, link = GetItemInfo("item:139055::::::::110:70::36:3:3432:1507:3336:::") + _, link = C_Item.GetItemInfo("item:139055::::::::110:70::36:3:3432:1507:3336:::") if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, true, 2) end -- legendary, Aman'Thul's Vision - _, link = GetItemInfo("item:154172::::::::110:64:::1:3571:::") + _, link = C_Item.GetItemInfo("item:154172::::::::110:64:::1:3571:::") if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, nil, true) end -- azerite, Vest of the Champion - _, link = GetItemInfo("item:159906::::::::110:581::11::::") + _, link = C_Item.GetItemInfo("item:159906::::::::110:581::11::::") if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, nil, nil, true) end -- corrupted, Devastation's Hour - _, link = GetItemInfo("item:172187::::::::20:71::3:1:3524:::") + _, link = C_Item.GetItemInfo("item:172187::::::::20:71::3:1:3524:::") if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, nil, nil, nil, true) end -- roll, Rhinestone Sunglasses - _, link = GetItemInfo(52489) + _, link = C_Item.GetItemInfo(52489) if link then Toast_SetUp("SPECIAL_LOOT_TEST", link, 1, nil, nil, nil, nil, nil, nil, nil, m_random(1, 4), m_random(1, 100)) end diff --git a/ls_Toasts/systems/store.lua b/ls_Toasts/systems/store.lua index e03bfc6..1950694 100644 --- a/ls_Toasts/systems/store.lua +++ b/ls_Toasts/systems/store.lua @@ -59,7 +59,7 @@ local function Toast_SetUp(event, entitlementType, textureID, name, payloadID, p toast, isNew = E:GetToast(event, "link", sanitizedLink) if not isNew then return end - _, _, quality = GetItemInfo(originalLink) + _, _, quality = C_Item.GetItemInfo(originalLink) toast._data.link = sanitizedLink toast._data.tooltip_link = originalLink @@ -110,8 +110,8 @@ end local function getItemLink(itemID, textureID) if itemID then - if select(5, GetItemInfoInstant(itemID)) == textureID then - local _, link = GetItemInfo(itemID) + if select(5, C_Item.GetItemInfoInstant(itemID)) == textureID then + local _, link = C_Item.GetItemInfo(itemID) if link then return link, false end @@ -163,7 +163,7 @@ end local function Test() -- WoW Token - local name, link, _, _, _, _, _, _, _, icon = GetItemInfo(122270) + local name, link, _, _, _, _, _, _, _, icon = C_Item.GetItemInfo(122270) if link then Toast_SetUp("ENTITLEMENT_TEST", Enum.WoWEntitlementType.Item, icon, name, 122270, link) end diff --git a/ls_Toasts/systems/world.lua b/ls_Toasts/systems/world.lua index 3101224..10f080f 100644 --- a/ls_Toasts/systems/world.lua +++ b/ls_Toasts/systems/world.lua @@ -135,7 +135,7 @@ local function Toast_SetUp(event, isUpdate, questID, name, moneyReward, xpReward local slot = toast["Slot" .. toast._data.used_slots] if slot then - local _, _, _, _, texture = GetItemInfoInstant(itemReward) + local _, _, _, _, texture = C_Item.GetItemInfoInstant(itemReward) texture = texture or "Interface\\Icons\\INV_Box_02" slot.Icon:SetTexture(texture) @@ -198,7 +198,7 @@ end local function Test() -- reward, Blood of Sargeras - local _, link = GetItemInfo(124124) + local _, link = C_Item.GetItemInfo(124124) if link then -- world quest, may not work local quests = C_TaskQuest.GetQuestsForPlayerByMapID(1014)