Skip to content

Commit

Permalink
Merge branch 'classic/dev' into classic/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 18, 2024
2 parents 98c79e4 + 1dc0472 commit f3be2d3
Show file tree
Hide file tree
Showing 34 changed files with 1,182 additions and 89 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
22 changes: 22 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,29 @@ read_globals = {
"AlertFrame",
"C_Container",
"C_CurrencyInfo",
"C_Item",
"C_MountJournal",
"C_PetJournal",
"C_Timer",
"C_ToyBox",
"C_TransmogCollection",
"COLLECTIONS_JOURNAL_TAB_INDEX_APPEARANCES",
"COLLECTIONS_JOURNAL_TAB_INDEX_MOUNTS",
"COLLECTIONS_JOURNAL_TAB_INDEX_PETS",
"COLLECTIONS_JOURNAL_TAB_INDEX_TOYS",
"CollectionsJournal",
"CollectionsJournal_LoadUI",
"CreateFrame",
"DressUpItemLink",
"DressUpVisual",
"Enum",
"FormatLargeNumber",
"FormatShortDate",
"GameTooltip",
"GameTooltip_ShowCompareItem",
"GetAchievementInfo",
"GetAddOnMetadata",
"GetArchaeologyRaceInfoByID",
"GetCurrencyListInfo",
"GetCurrencyListSize",
"GetCVarBool",
Expand Down Expand Up @@ -95,17 +109,25 @@ read_globals = {
"LOOT_ITEM_PUSHED_SELF_MULTIPLE",
"LOOT_ITEM_SELF",
"LOOT_ITEM_SELF_MULTIPLE",
"MountJournal_SelectByMountID",
"NUM_BAG_SLOTS",
"OpenBag",
"PetJournal",
"PetJournal_SelectPet",
"PlaySound",
"PlaySoundFile",
"SearchBagsForItem",
"SetCollectionsJournalShown",
"Settings",
"SettingsPanel",
"ShoppingTooltip1",
"ShoppingTooltip2",
"ShowUIPanel",
"SquareButton_SetIcon",
"ToyBox",
"ToyBox_FindPageForToyID",
"UIParent",
"UnitGUID",
"UnitName",
"WardrobeCollectionFrame",
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## Version 40400.01

- Added 4.4.0 support.
- Added archaeology toasts.
- Added collection toasts.
- Added Blizz store toasts.
- Added transmog toasts.
- Updated Simplified Chinese translation. Translated by kuaishan@Curse.

## Version 30403.03

- Added Brazilian Portuguese translation. Translated by paulovnas@GitHub.
Expand Down
Binary file added ls_Toasts/assets/legacy/toast-bg-archaeology.TGA
Binary file not shown.
Binary file added ls_Toasts/assets/legacy/toast-bg-collection.TGA
Binary file not shown.
Binary file added ls_Toasts/assets/legacy/toast-bg-store.TGA
Binary file not shown.
Binary file added ls_Toasts/assets/legacy/toast-bg-transmog.TGA
Binary file not shown.
Binary file added ls_Toasts/assets/ui-digsite-completion-toast.OGG
Binary file not shown.
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
7 changes: 6 additions & 1 deletion ls_Toasts/core/changelog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ local _G = getfenv(0)

-- Mine
E.CHANGELOG = [[
- Added Brazilian Portuguese translation. Translated by paulovnas@GitHub.
- Added 4.4.0 support.
- Added archaeology toasts.
- Added collection toasts.
- Added Blizz store toasts.
- Added transmog toasts.
- Updated Simplified Chinese translation. Translated by kuaishan@Curse.
]]
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
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
1 change: 1 addition & 0 deletions ls_Toasts/locales/_post.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ local _G = getfenv(0)

-- Mine
-- These rely on custom strings
L["TRANSMOG_REMOVED_RED"] = "|cffdc4436" .. L["TRANSMOG_REMOVED"] .. "|r"
L["YOU_LOST_RED"] = "|cffdc4436" .. L["YOU_LOST"] .. "|r"
Loading

0 comments on commit f3be2d3

Please sign in to comment.