Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed Oct 25, 2022
2 parents 0f8b57f + f5da687 commit 430279c
Show file tree
Hide file tree
Showing 46 changed files with 882 additions and 328 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## Version 100000.01

- Added 10.0.0 support;
- Added new "Info" panel to the config. It has links to various resourced including my Discord
server dedicated to LS: * addons;
- Renamed "Recipe" toasts to "Profession". Added profession skill line toasts;
- Updated "Collection" toasts;
- Updated embeds.

## Version 90207.01

- Added 9.2.7 support;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use **`/LSTOASTS`** or **`/LST`** to open in-game config.

## Feedback and Feature Requests

If you found a bug or want to share an idea on how to improve my addon, either use the issue tracker on [GitHub](https://github.com/ls-/ls_Toasts/issues), post a comment on [WoWInterfrace](http://www.wowinterface.com/downloads/info24123.html#comments), or simply DM me @ **ls-#9453** on Discord.
If you found a bug or want to share an idea on how to improve my addon, either use the issue tracker on [GitHub](https://github.com/ls-/ls_Toasts/issues) or join our [Discord](https://discord.gg/7QcJgQkDYD) server.

## Localisation

Expand Down
Binary file modified assets/text-bg.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
15 changes: 15 additions & 0 deletions core/changelog.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local _, addonTable = ...
local E = addonTable.E

-- Lua
local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 10.0.0 support;
- Added new "Info" panel to the config. It has links to various resourced including my Discord
server dedicated to LS: * addons;
- Renamed "Recipe" toasts to "Profession". Added profession skill line toasts;
- Updated "Collection" toasts;
- Updated embeds.
]]
2 changes: 1 addition & 1 deletion core/skin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function P:SetSkin(toast, id)
text:SetVertexColor(unpack(skin.text.color))
text:SetJustifyH("CENTER")
text:SetJustifyV("MIDDLE")
text:SetWordWrap(false)
text:SetWordWrap(true)
text:SetShadowOffset(skin.text.shadow and 1 or 0, skin.text.shadow and -1 or 0)

-- .TextBG
Expand Down
22 changes: 11 additions & 11 deletions core/toast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ local unpack = _G.unpack

-- Blizz
local C_Timer = _G.C_Timer
local Lerp = _G.Lerp

--[[ luacheck: globals
BattlePetTooltip CreateFrame GameTooltip GameTooltip_ShowCompareItem GarrisonFollowerTooltip
GarrisonShipyardFollowerTooltip GetCVarBool IsModifiedClick PlaySound ShoppingTooltip1
ShoppingTooltip2 UIParent
]]

-- Mine
local freeToasts = {}
Expand Down Expand Up @@ -158,16 +151,20 @@ end
-- Animated Text
local textsToAnimate = {}

local function lerp(v1, v2, perc)
return v1 + (v2 - v1) * perc
end

C_Timer.NewTicker(0.05, function()
for text, targetValue in next, textsToAnimate do
local newValue

text._elapsed = text._elapsed + 0.05

if text._value >= targetValue then
newValue = m_floor(Lerp(text._value, targetValue, text._elapsed / 0.6))
newValue = m_floor(lerp(text._value, targetValue, text._elapsed / 0.6))
else
newValue = m_ceil(Lerp(text._value, targetValue, text._elapsed / 0.6))
newValue = m_ceil(lerp(text._value, targetValue, text._elapsed / 0.6))
end

if newValue == targetValue then
Expand Down Expand Up @@ -427,12 +424,15 @@ local function constructToast()

local title = toast:CreateFontString(nil, "ARTWORK")
title:SetPoint("TOPLEFT", 50, -2)
title:SetPoint("BOTTOMRIGHT", toast, "TOPRIGHT", -2, -22)
title:SetPoint("TOPRIGHT", -2, -2)
title:SetHeight(14)
toast.Title = title

local text = toast:CreateFontString(nil, "ARTWORK")
text:SetPoint("BOTTOMLEFT", 50, 2)
text:SetPoint("TOPRIGHT", toast, "BOTTOMRIGHT", -2, 22)
text:SetPoint("BOTTOMRIGHT", -2, 2)
text:SetHeight(28)
text:SetMaxLines(2)
text.SetAnimatedValue = text_SetAnimatedValue
toast.Text = text

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 430279c

Please sign in to comment.