Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Jan 30, 2023
2 parents 3888cc0 + 8b2d1ae commit c031e45
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 21 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## Version 100005.02

### Loot (Common)

- Reworked the reagent and crafted item quality icon.

![Imgur](https://i.imgur.com/oZomyJR.png)

## Version 100005.01

- Added 10.0.5 support.
Expand Down
8 changes: 1 addition & 7 deletions ls_Toasts/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 10.0.5 support.
### Loot (Common)
- Added support for reagent ranks.
### Loot (Currency)
- Updated the currency blacklist.
- Reworked the reagent and crafted item quality icon.
]]
8 changes: 8 additions & 0 deletions ls_Toasts/core/skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ function P:SetSkin(toast, id)
iconText2:SetJustifyH("RIGHT")
iconText2:SetShadowOffset(skin.icon_text_2.shadow and 1 or 0, skin.icon_text_2.shadow and -1 or 0)

-- .IconText3
local iconText3 = toast.IconText3
iconText3:SetFont(fontPath, fontSize, skin.icon_text_3.flags)
iconText3:SetVertexColor(unpack(skin.icon_text_3.color))
iconText3:SetPoint("TOPLEFT", 0, -1)
iconText3:SetJustifyH("LEFT")
iconText3:SetShadowOffset(skin.icon_text_3.shadow and 1 or 0, skin.icon_text_3.shadow and -1 or 0)

-- .Skull
toast.Skull.isHidden = skin.skull.hidden

Expand Down
19 changes: 18 additions & 1 deletion ls_Toasts/core/toast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ local function toast_Release(self)
self.IconText2:SetText("")
self.IconText2.Blink:Stop()
self.IconText2.PostSetAnimatedValue = nil
self.IconText3:SetText("")
self.IconText3.PostSetAnimatedValue = nil
self.IconText3BG:Hide()
self.Skull:Hide()
self.Text:SetText("")
self.Text.PostSetAnimatedValue = nil
Expand Down Expand Up @@ -540,7 +543,8 @@ local function constructToast()
iconText1BG:SetPoint("LEFT", 0, 0)
iconText1BG:SetPoint("TOP", iconText1, "TOP", 0, 1)
iconText1BG:SetPoint("BOTTOMRIGHT", 0, 0)
iconText1BG:SetColorTexture(0, 0, 0, 0.6)
iconText1BG:SetColorTexture(1, 1, 1, 1)
iconText1BG:SetGradient("VERTICAL", {r = 0, g = 0, b = 0, a = 0.8}, {r = 0, g = 0, b = 0, a = 0})
iconText1BG:Hide()
toast.IconText1BG = iconText1BG

Expand Down Expand Up @@ -577,6 +581,19 @@ local function constructToast()
anim:SetDuration(0.4)
end

local iconText3 = iconParent:CreateFontString(nil, "ARTWORK")
iconText3.SetAnimatedValue = text_SetAnimatedValue
toast.IconText3 = iconText3

local iconText3BG = iconParent:CreateTexture(nil, "BACKGROUND", nil, 4)
iconText3BG:SetPoint("LEFT", 0, 0)
iconText3BG:SetPoint("BOTTOM", iconText3, "BOTTOM", 0, -1)
iconText3BG:SetPoint("TOPRIGHT", 0, 0)
iconText3BG:SetColorTexture(1, 1, 1, 1)
iconText3BG:SetGradient("VERTICAL", {r = 0, g = 0, b = 0, a = 0}, {r = 0, g = 0, b = 0, a = 0.8})
iconText3BG:Hide()
toast.IconText3BG = iconText3BG

local skull = iconParent:CreateTexture(nil, "ARTWORK", nil, 2)
skull:SetSize(16, 20)
skull:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-HEROIC")
Expand Down
3 changes: 3 additions & 0 deletions ls_Toasts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ local BLACKLISTED_EVENTS = {
["NEW_RECIPE_LEARNED"] = true,
["NEW_RUNEFORGE_POWER_ADDED"] = true,
["NEW_TOY_ADDED"] = true,
["PERKS_ACTIVITY_COMPLETED"] = true,
["PERKS_PROGRAM_CURRENCY_AWARDED"] = true,
["QUEST_LOOT_RECEIVED"] = true,
["QUEST_TURNED_IN"] = true,
["RAF_ENTITLEMENT_DELIVERED"] = true,
Expand All @@ -56,6 +58,7 @@ local BLACKLISTED_EVENTS = {
["SHOW_LOOT_TOAST_UPGRADE"] = true,
["SHOW_PVP_FACTION_LOOT_TOAST"] = true,
["SHOW_RATED_PVP_REWARD_TOAST"] = true,
["TRANSMOG_COLLECTION_SOURCE_ADDED"] = true,
["TRANSMOG_COSMETIC_COLLECTION_SOURCE_ADDED"] = true,
}

Expand Down
2 changes: 1 addition & 1 deletion ls_Toasts/ls_Toasts.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100005
## Author: lightspark
## Version: 100005.01
## Version: 100005.02
## Title: LS: |cff1a9fc0Toasts|r
## Notes: Better toasts, cheers!
## SavedVariables: LS_TOASTS_GLOBAL_CONFIG
Expand Down
5 changes: 5 additions & 0 deletions ls_Toasts/skins/default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ E:RegisterSkin("default", {
flags = "THINOUTLINE",
shadow = false,
},
icon_text_3 = {
color = {1, 1, 1},
flags = "THINOUTLINE",
shadow = false,
},
skull = {
hidden = false,
},
Expand Down
30 changes: 18 additions & 12 deletions ls_Toasts/systems/loot_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ local function Toast_SetUp(event, link, quantity)
end

if isNew then
local name, quality, icon, _, classID, subClassID, bindType, isQuestItem, isCraftingReagent
local name, quality, icon, _, classID, subClassID, bindType, isQuestItem

if linkType == "battlepet" then
local _, speciesID, _, breedQuality, _ = s_split(":", originalLink)
name, icon = C_PetJournal.GetPetInfoBySpeciesID(speciesID)
quality = tonumber(breedQuality)
else
name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType, _, _, isCraftingReagent = GetItemInfo(originalLink)
name, _, quality, _, _, _, _, _, _, icon, _, classID, subClassID, bindType = GetItemInfo(originalLink)
isQuestItem = bindType == 4 or (classID == 12 and subClassID == 0)
end

Expand Down Expand Up @@ -155,20 +155,23 @@ local function Toast_SetUp(event, link, quantity)
end
end

if isCraftingReagent then
local reagentQuality = C_TradeSkillUI.GetItemReagentQualityByItemInfo(itemID)
if reagentQuality then
reagentQuality = C_Texture.GetCraftingReagentQualityChatIcon(reagentQuality)
if reagentQuality then
name = name .. " " .. reagentQuality
end
end
end

if not toast.IconHL.isHidden then
toast.IconHL:SetShown(isQuestItem)
end

local reagentQuality = C_TradeSkillUI.GetItemReagentQualityByItemInfo(originalLink)
if not reagentQuality then
reagentQuality = C_TradeSkillUI.GetItemCraftedQualityByItemInfo(originalLink)
end

if reagentQuality then
reagentQuality = C_Texture.GetCraftingReagentQualityChatIcon(reagentQuality)
if reagentQuality then
toast.IconText3:SetText(reagentQuality)
toast.IconText3BG:Show()
end
end

toast.Title:SetText(title)
toast.Text:SetText(name)
toast.Icon:SetTexture(icon)
Expand Down Expand Up @@ -262,6 +265,9 @@ local function Test()
Toast_SetUp("COMMON_LOOT_TEST", link, m_random(9, 99))
end

-- Obsidian Seared Facesmasher, Rank 5
Toast_SetUp("COMMON_LOOT_TEST", "item:190513:6643:::::::70:263::13:6:8836:8840:8902:8802:8846:8793:7:28:2164:29:40:30:36:38:8:40:185:45:198046:46:194566:::::", 1)

-- battlepet, Anubisath Idol
Toast_SetUp("COMMON_LOOT_TEST", "battlepet:1155:25:3:1725:276:244:0000000000000000", 1)
end
Expand Down

0 comments on commit c031e45

Please sign in to comment.