Skip to content

Commit

Permalink
Merge branch 'classic_era/dev' into classic_era/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 18, 2024
2 parents 4a02fa6 + e9ab856 commit 4a24eef
Show file tree
Hide file tree
Showing 25 changed files with 164 additions and 102 deletions.
37 changes: 12 additions & 25 deletions .compressor.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
Set-Location $PSScriptRoot

if (-Not (Test-Path "C:\PROGRA~1\7-Zip\7z.exe")) {
Write-Host "7z.exe not found"

return Read-Host
}

Set-Alias 7z "C:\PROGRA~1\7-Zip\7z.exe"

$name = (Get-Item .).Name

if (-Not (Test-Path (".\" + $name + "\" + $name + ".toc"))) {
Expand All @@ -24,33 +16,28 @@ if (Get-Content (".\" + $name + "\" + $name + ".toc") | Where-Object { $_ -match
return Read-Host
}

$includedItems = @(
".\" + $name
$foldersToInclude = @(
".\$name"
)

$filesToRemove = @(
$filesToExclude = @(
"*.doc*"
"*.editorconfig",
"*.git*",
"*.luacheck*",
"*.pkg*",
"*.ps1",
"*.sh",
"*.yml"
)

if (Test-Path ".\temp\") {
Remove-Item ".\temp\" -Recurse -Force
}

New-Item -Path (".\temp\") -ItemType Directory | Out-Null
Copy-Item $includedItems -Destination (".\temp\") -Recurse
Remove-Item ".\temp" -Include $filesToRemove -Recurse -Force

Set-Location ".\temp\"
$temp = ".\temp\"

7z a -tzip -mx9 ($name + "-" + $version + ".zip") (Get-ChildItem -Path "..\temp")

Set-Location "..\"
if (Test-Path $temp) {
Remove-Item $temp -Recurse -Force
}

Move-Item ".\temp\*.zip" -Destination "..\" -Force
Remove-Item ".\temp" -Recurse -Force
New-Item -Path $temp -ItemType Directory | Out-Null
Copy-Item $foldersToInclude -Destination $temp -Exclude $filesToExclude -Recurse
Get-ChildItem $temp | Compress-Archive -DestinationPath "..\$name-$version.zip" -Force
Remove-Item $temp -Recurse -Force
6 changes: 2 additions & 4 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@ globals = {

read_globals = {
"AlertFrame",
"C_AddOns",
"C_Container",
"C_Item",
"C_Timer",
"CreateFrame",
"DressUpItemLink",
"GameTooltip",
"GameTooltip_ShowCompareItem",
"GetAddOnMetadata",
"GetCVarBool",
"GetDetailedItemLevelInfo",
"GetItemInfo",
"GetItemInfoInstant",
"GetLocale",
"GetMoney",
"GetMoneyString",
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## Version 11502.01

- Added 1.15.2 support.
- Updated Simplified Chinese translation. Translated by kuaishan@Curse.

## Version 11500.01

- Added 1.15.0 support.
Expand Down
2 changes: 2 additions & 0 deletions ls_Toasts/core/anchor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ function P:AddAnchor(index)
if not activeAnchors[index] then
activeAnchors[index] = anchors[index] or costructAnchor(index)

P:SetUpQueues(index)

C.db.profile.anchors[index] = P:UpdateTable(D.profile.anchors[1], C.db.profile.anchors[index])

if not options[index] then
Expand Down
4 changes: 2 additions & 2 deletions ls_Toasts/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added 1.15.0 support.
- Added Brazilian Portuguese translation. Translated by paulovnas@GitHub.
- Added 1.15.2 support.
- Updated Simplified Chinese translation. Translated by kuaishan@Curse.
]]
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
18 changes: 10 additions & 8 deletions ls_Toasts/core/queue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ function P:RefreshQueues()
end
end

function P:SetUpQueues(anchorID)
if not queuedToasts[anchorID] then
queuedToasts[anchorID] = {}
end

if not activeToasts[anchorID] then
activeToasts[anchorID] = {}
end
end

local function sortFunc(a, b)
if a._data.dnd == b._data.dnd then
return a._data.order < b._data.order
Expand All @@ -64,14 +74,6 @@ local function sortFunc(a, b)
end

function P:Queue(toast, anchorID)
if not queuedToasts[anchorID] then
queuedToasts[anchorID] = {}
end

if not activeToasts[anchorID] then
activeToasts[anchorID] = {}
end

t_insert(queuedToasts[anchorID], toast)
t_sort(queuedToasts[anchorID], sortFunc)

Expand Down
2 changes: 1 addition & 1 deletion ls_Toasts/embeds/AceConfig-3.0/AceConfig-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if not AceConfig then return end
local pcall, error, type, pairs = pcall, error, type, pairs

-- -------------------------------------------------------------------
-- :RegisterOptionsTable(appName, options, slashcmd, persist)
-- :RegisterOptionsTable(appName, options, slashcmd)
--
-- - appName - (string) application name
-- - options - table or function ref, see AceConfigRegistry
Expand Down
6 changes: 3 additions & 3 deletions ls_Toasts/embeds/AceDB-3.0/AceDB-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
-- @class file
-- @name AceDB-3.0.lua
-- @release $Id$
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 28
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 29
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)

if not AceDB then return end -- No upgrade needed
Expand Down Expand Up @@ -606,8 +606,8 @@ end
-- profile.
-- @param defaultProfile The profile name to use as the default
function DBObjectLib:ResetDB(defaultProfile)
if defaultProfile and type(defaultProfile) ~= "string" then
error(("Usage: AceDBObject:ResetDB(defaultProfile): 'defaultProfile' - string or nil expected, got %q."):format(type(defaultProfile)), 2)
if defaultProfile and type(defaultProfile) ~= "string" and defaultProfile ~= true then
error(("Usage: AceDBObject:ResetDB(defaultProfile): 'defaultProfile' - string or true expected, got %q."):format(type(defaultProfile)), 2)
end

local sv = self.sv
Expand Down
2 changes: 1 addition & 1 deletion ls_Toasts/embeds/AceGUI-3.0-LSWidgets/EditBox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ do
local id = tonumber(value)
if id then
id = "item:" .. id
local info = GetItemInfoInstant(id)
local info = C_Item.GetItemInfoInstant(id)
if info then
self.preview:SetOwner(self.frame, "ANCHOR_NONE")
self.preview:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT", 1, 1)
Expand Down
92 changes: 68 additions & 24 deletions ls_Toasts/embeds/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--[[-----------------------------------------------------------------------------
ColorPicker Widget
-------------------------------------------------------------------------------]]
local Type, Version = "ColorPicker", 25
local Type, Version = "ColorPicker", 28
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

Expand All @@ -11,13 +11,24 @@ local pairs = pairs
-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent

-- Unfortunately we have no way to realistically detect if a client uses inverted alpha
-- as no API will tell you. Wrath uses the old colorpicker, era uses the new one, both are inverted
local INVERTED_ALPHA = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)

--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]
local function ColorCallback(self, r, g, b, a, isAlpha)
if INVERTED_ALPHA and a then
a = 1 - a
end
if not self.HasAlpha then
a = 1
end
-- no change, skip update
if r == self.r and g == self.g and b == self.b and a == self.a then
return
end
self:SetColor(r, g, b, a)
if ColorPickerFrame:IsVisible() then
--colorpicker is still open
Expand Down Expand Up @@ -50,30 +61,63 @@ local function ColorSwatch_OnClick(frame)
ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
ColorPickerFrame:SetClampedToScreen(true)

ColorPickerFrame.func = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = 1 - OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a)
end

ColorPickerFrame.hasOpacity = self.HasAlpha
ColorPickerFrame.opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = 1 - OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a, true)
end

local r, g, b, a = self.r, self.g, self.b, self.a
if self.HasAlpha then
ColorPickerFrame.opacity = 1 - (a or 0)
end
ColorPickerFrame:SetColorRGB(r, g, b)

ColorPickerFrame.cancelFunc = function()
ColorCallback(self, r, g, b, a, true)
if ColorPickerFrame.SetupColorPickerAndShow then -- 10.2.5 color picker overhaul
local r2, g2, b2, a2 = self.r, self.g, self.b, (self.a or 1)
if INVERTED_ALPHA then
a2 = 1 - a2
end

local info = {
swatchFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = ColorPickerFrame:GetColorAlpha()
ColorCallback(self, r, g, b, a)
end,

hasOpacity = self.HasAlpha,
opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = ColorPickerFrame:GetColorAlpha()
ColorCallback(self, r, g, b, a, true)
end,
opacity = a2,

cancelFunc = function()
ColorCallback(self, r2, g2, b2, a2, true)
end,

r = r2,
g = g2,
b = b2,
}

ColorPickerFrame:SetupColorPickerAndShow(info)
else
ColorPickerFrame.func = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a)
end

ColorPickerFrame.hasOpacity = self.HasAlpha
ColorPickerFrame.opacityFunc = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
local a = OpacitySliderFrame:GetValue()
ColorCallback(self, r, g, b, a, true)
end

local r, g, b, a = self.r, self.g, self.b, 1 - (self.a or 1)
if self.HasAlpha then
ColorPickerFrame.opacity = a
end
ColorPickerFrame:SetColorRGB(r, g, b)

ColorPickerFrame.cancelFunc = function()
ColorCallback(self, r, g, b, a, true)
end

ColorPickerFrame:Show()
end

ColorPickerFrame:Show()
end
AceGUI:ClearFocus()
end
Expand Down
10 changes: 4 additions & 6 deletions ls_Toasts/embeds/LibSharedMedia-3.0/LibSharedMedia-3.0.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--@curseforge-project-slug: libsharedmedia-3-0@
--[[
Name: LibSharedMedia-3.0
Revision: $Revision: 128 $
Revision: $Revision: 151 $
Author: Elkano ([email protected])
Inspired By: SurfaceLib by Haste/Otravi ([email protected])
Website: http://www.wowace.com/projects/libsharedmedia-3-0/
Expand All @@ -23,11 +23,9 @@ local type = _G.type
local band = _G.bit.band
local table_sort = _G.table.sort

local RESTRICTED_FILE_ACCESS = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE -- starting with 8.2, some rules for file access have changed; classic still uses the old way

local locale = GetLocale()
local locale_is_western
local LOCALE_MASK = 0
local LOCALE_MASK
lib.LOCALE_BIT_koKR = 1
lib.LOCALE_BIT_ruRU = 2
lib.LOCALE_BIT_zhCN = 4
Expand Down Expand Up @@ -199,7 +197,7 @@ lib.DefaultMedia.statusbar = "Blizzard"

-- SOUND
if not lib.MediaTable.sound then lib.MediaTable.sound = {} end
lib.MediaTable.sound["None"] = RESTRICTED_FILE_ACCESS and 1 or [[Interface\Quiet.ogg]] -- Relies on the fact that PlaySound[File] doesn't error on these values.
lib.MediaTable.sound["None"] = 1 -- Relies on the fact that PlaySoundFile doesn't error on this value
lib.DefaultMedia.sound = "None"

local function rebuildMediaList(mediatype)
Expand Down Expand Up @@ -230,7 +228,7 @@ function lib:Register(mediatype, key, data, langmask)
end
if type(data) == "string" and (mediatype == lib.MediaType.BACKGROUND or mediatype == lib.MediaType.BORDER or mediatype == lib.MediaType.STATUSBAR or mediatype == lib.MediaType.SOUND) then
local path = data:lower()
if RESTRICTED_FILE_ACCESS and not path:find("^interface") then
if not path:find("^interface") then
-- files accessed via path only allowed from interface folder
return false
end
Expand Down
4 changes: 2 additions & 2 deletions ls_Toasts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local tonumber = _G.tonumber

-- Mine
E.VER = {}
E.VER.string = GetAddOnMetadata(addonName, "Version")
E.VER.string = C_AddOns.GetAddOnMetadata(addonName, "Version")
E.VER.number = tonumber(E.VER.string:gsub("%D", ""), nil)

local STRATAS = {
Expand Down Expand Up @@ -407,7 +407,7 @@ E:RegisterEvent("ADDON_LOADED", function(arg1)
type = "execute",
name = L["CHANGELOG_FULL"],
func = function()
showLinkCopyPopup("https://github.com/ls-/ls_Toasts/blob/classic/master/CHANGELOG.md")
showLinkCopyPopup("https://github.com/ls-/ls_Toasts/blob/classic_era/master/CHANGELOG.md")
end,
},
},
Expand Down
2 changes: 1 addition & 1 deletion ls_Toasts/locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ L["Y_OFFSET"] = "Y-Versatz"
L["YOU_LOST"] = "Ihr verliert"
L["YOU_RECEIVED"] = "Ihr erhaltet"

-- Classic
-- Classic Era
L["TYPE_LOOT_ITEMS"] = "Beute (Gegenstände)"
2 changes: 1 addition & 1 deletion ls_Toasts/locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ L["Y_OFFSET"] = "yOffset"
L["YOU_LOST"] = "You Lost"
L["YOU_RECEIVED"] = "You Received"

-- Classic
-- Classic Era
L["ITEM_FILTERS_DESC"] = "These items ignore the loot quality threshold."
L["NEW_ITEM_FILTER_DESC"] = "Enter an item ID."
L["TYPE_LOOT_ITEMS"] = "Loot (Items)"
2 changes: 1 addition & 1 deletion ls_Toasts/locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ L["Y_OFFSET"] = "yOffset"
L["YOU_LOST"] = "Has perdido"
L["YOU_RECEIVED"] = "Has recibido"

-- Classic
-- Classic Era
L["TYPE_LOOT_ITEMS"] = "Botín (Objetos)"
Loading

0 comments on commit 4a24eef

Please sign in to comment.