Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Mar 21, 2024
2 parents 60039a1 + acf1787 commit e92f723
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 40 deletions.
25 changes: 19 additions & 6 deletions .currency_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -47,15 +60,15 @@ 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"

$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"
Expand Down
4 changes: 1 addition & 3 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ read_globals = {
"C_AddOns",
"C_CurrencyInfo",
"C_Garrison",
"C_Item",
"C_LegendaryCrafting",
"C_MountJournal",
"C_PerksActivities",
Expand Down Expand Up @@ -94,10 +95,7 @@ read_globals = {
"GetAchievementInfo",
"GetArchaeologyRaceInfoByID",
"GetCVarBool",
"GetDetailedItemLevelInfo",
"GetInstanceInfo",
"GetItemInfo",
"GetItemInfoInstant",
"GetLFGCompletionReward",
"GetLFGCompletionRewardItem",
"GetLFGCompletionRewardItemLink",
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## Version 100206.01

- Added 10.2.6 support.

## Version 100205.03

### Loot (Special)
Expand Down
7 changes: 1 addition & 6 deletions ls_Toasts/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
]]
4 changes: 2 additions & 2 deletions ls_Toasts/core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ls_Toasts/ls_Toasts.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions ls_Toasts/systems/loot_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
24 changes: 20 additions & 4 deletions ls_Toasts/systems/loot_currency.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down
16 changes: 8 additions & 8 deletions ls_Toasts/systems/loot_special.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ls_Toasts/systems/store.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ls_Toasts/systems/world.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e92f723

Please sign in to comment.