Skip to content

Commit

Permalink
More theme fixes. (#893)
Browse files Browse the repository at this point in the history
* Fixed a bug where quest items without masque were not highlighted properly.

* Fixed a bug in color copy over from the skin to the theme system.
  • Loading branch information
Cidan authored Jan 9, 2023
1 parent ceaafe0 commit be39d56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ function addon:OnProfileChanged()
return self:Reconfigure()
end

-- Thanks to Talyrius for this idea
-- TODO(lobato): Remove this update code in a future version
local prevSkinPreset = {
BackpackColor = { 0, 0, 0, 1 },
BankColor = { 0, 0, 0.5, 1 },
ReagentBankColor = { 0, 0.5, 0, 1 },
}

function addon:UpgradeProfile()
-- Copy over skin settings to the new theme format.
local skin = addon.db.profile.skin
Expand All @@ -261,18 +269,18 @@ function addon:UpgradeProfile()

-- Update the color data.
if key == "backpack" and skin.BackpackColor then
for i, v in ipairs(skin.BackpackColor) do
v = v or 1
for i, v in ipairs(prevSkinPreset.BackpackColor) do
v = skin.BackpackColor[i] or v
addon.db.profile.theme[key].color[i] = v
end
elseif key == "bank" and skin.BankColor then
for i, v in ipairs(skin.BankColor) do
v = v or 1
for i, v in ipairs(prevSkinPreset.BankColor) do
v = skin.BankColor[i] or v
addon.db.profile.theme[key].color[i] = v
end
elseif key == "reagentBank" and skin.ReagentBankColor then
for i, v in ipairs(skin.ReagentBankColor) do
v = v or 1
for i, v in ipairs(prevSkinPreset.ReagentBankColor) do
v = skin.ReagentBankColor[i] or v
addon.db.profile.theme[key].color[i] = v
end
end
Expand Down
2 changes: 1 addition & 1 deletion widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ function buttonProto:UpdateBorder(isolatedEvent)
local isQuestItem, questId, isQuestActive
if hasItem(self.hasItem) then
quality = addon:GetContainerItemQuality(self.bag, self.slot)
addon:GetContainerItemQuestInfo(self.bag, self.slot)
isQuestItem, questId, isQuestActive = addon:GetContainerItemQuestInfo(self.bag, self.slot)
texture, r, g, b, a, x1, x2, y1, y2, blendMode = GetBorder(quality, isQuestItem, questId, isQuestActive, settings)
end

Expand Down

0 comments on commit be39d56

Please sign in to comment.