Skip to content

Commit

Permalink
Merge branch 'wotlk/dev' into wotlk/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Nov 3, 2022
2 parents b7f352e + 6af01d8 commit 620476f
Show file tree
Hide file tree
Showing 42 changed files with 694 additions and 227 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# CHANGELOG

## Version 30400.02

- Added an option to show poor quality quality items via common loot toasts. Thanks to Faqar@GitHub.
- Added leaf ornaments to achievement toasts. I can't re-enable Blizz achievement toasts, so as a
compromise I chose to make achievement toasts more unique. If you want them to stand out even more
create a separate anchor to display them.
- Added new "Info" panel to the config. It has links to various resourced including my Discord
server dedicated to LS: * addons.
- Fixed corrupt beautycase border texture. It worked, but baked-in shadows were messed up.
- Updated Traditional Chinese translation. Translated by BNS333@Curse.

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

## Version 30400.01

- Added 3.4.0 support;
Expand Down
Binary file modified assets/toast-border-beautycase.TGA
Binary file not shown.
Binary file modified assets/toast-border.TGA
Binary file not shown.
Binary file added assets/toast-overlay-leaves.TGA
Binary file not shown.
4 changes: 3 additions & 1 deletion core/_core.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="defaults.lua"/>
<Script file="core.lua"/>
<Script file="defaults.lua"/>
<!-- can sort -->
<Script file="anchor.lua"/>
<Script file="changelog.lua"/>
<Script file="queue.lua"/>
<Script file="skin.lua"/>
<Script file="system.lua"/>
Expand Down
17 changes: 17 additions & 0 deletions core/changelog.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
local _, addonTable = ...
local E = addonTable.E

-- Lua
local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added an option to show poor quality quality items via common loot toasts. Thanks to Faqar@GitHub.
- Added leaf ornaments to achievement toasts. I can't re-enable Blizz achievement toasts, so as a
compromise I chose to make achievement toasts more unique. If you want them to stand out even more
create a separate anchor to display them.
- Added new "Info" panel to the config. It has links to various resourced including my Discord
server dedicated to LS: * addons.
- Fixed corrupt beautycase border texture. It worked, but baked-in shadows were messed up.
- Updated Traditional Chinese translation. Translated by BNS333@Curse.
]]
15 changes: 15 additions & 0 deletions core/skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ function P:SetSkin(toast, id)
-- .Bonus
toast.Bonus.isHidden = skin.bonus.hidden

-- .Leaves
toast:SetLeavesVertexColor(unpack(skin.leaves.color))

local leavesPoints = skin.leaves.points
for i = 1, #toast.Leaves do
toast.Leaves[i]:ClearAllPoints()
toast.Leaves[i]:SetPoint(leavesPoints[i].p, toast, leavesPoints[i].rP, leavesPoints[i].x, leavesPoints[i].y)
end

toast.Leaves.isHidden = skin.leaves.hidden

-- .Dragon
toast.Dragon.isHidden = skin.dragon.hidden

Expand Down Expand Up @@ -197,9 +208,13 @@ function P:ResetSkin(toast)

-- .Title
toast.Title:SetVertexColor(unpack(skin.title.color))

-- .Text
toast.Text:SetVertexColor(unpack(skin.text.color))

-- .Leaves
toast:SetLeavesVertexColor(unpack(skin.leaves.color))

-- .Icon
toast.Icon:SetTexCoord(unpack(skin.icon.tex_coords))

Expand Down
55 changes: 55 additions & 0 deletions core/toast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ local function toast_Release(self)
self.AnimIn:Stop()
self.AnimOut:Stop()
self.Bonus:Hide()
self:HideLeaves()
self.Dragon:Hide()
self.Icon:ClearAllPoints()
self.Icon:SetPoint("TOPLEFT", 0, 0)
Expand Down Expand Up @@ -450,6 +451,60 @@ local function constructToast()
bonus:Hide()
toast.Bonus = bonus

-- .Leaves
do
local leaves = {}
toast.Leaves = leaves

local leafTL = toast:CreateTexture(nil, "BACKGROUND", nil, 2)
leafTL:SetTexture("Interface\\AddOns\\ls_Toasts\\assets\\toast-overlay-leaves")
leafTL:SetTexCoord(1 / 512, 213 / 512, 1 / 128, 81 / 128)
leafTL:SetSize(212 / 2, 80 / 2)
leafTL:Hide()
t_insert(leaves, leafTL)

local leafTR = toast:CreateTexture(nil, "BACKGROUND", nil, 2)
leafTR:SetTexture("Interface\\AddOns\\ls_Toasts\\assets\\toast-overlay-leaves")
leafTR:SetTexCoord(213 / 512, 301 / 512, 1 / 128, 61 / 128)
leafTR:SetSize(88 / 2, 60 / 2)
leafTR:Hide()
t_insert(leaves, leafTR)

local leafBR = toast:CreateTexture(nil, "BACKGROUND", nil, 2)
leafBR:SetTexture("Interface\\AddOns\\ls_Toasts\\assets\\toast-overlay-leaves")
leafBR:SetTexCoord(301 / 512, 365 / 512, 1 / 128, 37 / 128)
leafBR:SetSize(64 / 2, 36 / 2)
leafBR:Hide()
t_insert(leaves, leafBR)

-- TODO: Rewrite toasts with mixin and object pools
function toast:ShowLeaves()
for i = 1, #self.Leaves do
self.Leaves[i]:Show()
end
end

function toast:HideLeaves()
for i = 1, #self.Leaves do
self.Leaves[i]:Hide()
end
end

function toast:AreLeavesShown()
return self.Leaves[1]:IsShown()
end

function toast:SetLeavesVertexColor(...)
for i = 1, #self.Leaves do
self.Leaves[i]:SetVertexColor(...)
end
end

function toast:ShouldHideLeaves()
return self.Leaves.isHidden
end
end

local iconParent = CreateFrame("Frame", nil, toast)
iconParent:SetFlattensRenderLayers(true)
iconParent:SetFrameLevel(toast:GetFrameLevel() + 1)
Expand Down
2 changes: 1 addition & 1 deletion embeds/AceConfig-3.0/AceConfig-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- as well as associate it with a slash command.
-- @class file
-- @name AceConfig-3.0
-- @release $Id: AceConfig-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id$

--[[
AceConfig-3.0
Expand Down
35 changes: 14 additions & 21 deletions embeds/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames.
-- @class file
-- @name AceConfigCmd-3.0
-- @release $Id: AceConfigCmd-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-- @release $Id$

--[[
AceConfigCmd-3.0
Expand Down Expand Up @@ -37,17 +37,10 @@ local error, assert = error, assert
-- WoW APIs
local _G = _G

-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- GLOBALS: LibStub, SELECTED_CHAT_FRAME, DEFAULT_CHAT_FRAME


local L = setmetatable({}, { -- TODO: replace with proper locale
__index = function(self,k) return k end
})



local function print(msg)
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
end
Expand Down Expand Up @@ -401,7 +394,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
return
end

local str = strsub(info.input,inputpos);
local strInput = strsub(info.input,inputpos);

if tab.type=="execute" then
------------ execute --------------------------------------------
Expand All @@ -414,21 +407,21 @@ local function handle(info, inputpos, tab, depth, retfalse)

local res = true
if tab.pattern then
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(str, tab.pattern) then
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end
if not strmatch(strInput, tab.pattern) then
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"])
return
end
end

do_final(info, inputpos, tab, "set", str)
do_final(info, inputpos, tab, "set", strInput)



elseif tab.type=="toggle" then
------------ toggle --------------------------------------------
local b
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str=="" then
b = callmethod(info, inputpos, tab, "get")

Expand Down Expand Up @@ -465,9 +458,9 @@ local function handle(info, inputpos, tab, depth, retfalse)

elseif tab.type=="range" then
------------ range --------------------------------------------
local val = tonumber(str)
local val = tonumber(strInput)
if not val then
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"])
return
end
if type(info.step)=="number" then
Expand All @@ -487,7 +480,7 @@ local function handle(info, inputpos, tab, depth, retfalse)

elseif tab.type=="select" then
------------ select ------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))

local values = tab.values
if type(values) == "function" or type(values) == "string" then
Expand Down Expand Up @@ -528,7 +521,7 @@ local function handle(info, inputpos, tab, depth, retfalse)

elseif tab.type=="multiselect" then
------------ multiselect -------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))

local values = tab.values
if type(values) == "function" or type(values) == "string" then
Expand Down Expand Up @@ -565,7 +558,7 @@ local function handle(info, inputpos, tab, depth, retfalse)

--check that the opt is valid
local ok
for k,v in pairs(values) do
for k in pairs(values) do
if strlower(k)==opt then
opt = k -- overwrite with key (in case of case mismatches)
ok = true
Expand Down Expand Up @@ -634,7 +627,7 @@ local function handle(info, inputpos, tab, depth, retfalse)

elseif tab.type=="color" then
------------ color --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return
Expand Down Expand Up @@ -706,7 +699,7 @@ local function handle(info, inputpos, tab, depth, retfalse)

elseif tab.type=="keybinding" then
------------ keybinding --------------------------------------------
local str = strtrim(strlower(str))
local str = strtrim(strlower(strInput))
if str == "" then
--TODO: Show current value
return
Expand Down
Loading

0 comments on commit 620476f

Please sign in to comment.