Skip to content

Commit

Permalink
4.73
Browse files Browse the repository at this point in the history
  • Loading branch information
Azilroka committed Aug 27, 2024
1 parent c541287 commit 7af4cef
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 60 deletions.
2 changes: 1 addition & 1 deletion AddOnSkins/AddOnSkins.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 110002
## Title: |cff16C3F2AddOn|r|cFFFFFFFFSkins|r
## Version: 4.72
## Version: 4.73
## Author: Azilroka, Nihilistzsche
## SavedVariables: AddOnSkinsDB, AddOnSkinsDS
## OptionalDeps: AllTheThings, ElvUI
Expand Down
2 changes: 1 addition & 1 deletion AddOnSkins/AddOnSkins_Cata.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 40400
## Title: |cff16C3F2AddOn|r|cFFFFFFFFSkins|r
## Version: 4.72
## Version: 4.73
## Author: Azilroka, Nihilistzsche
## SavedVariables: AddOnSkinsDB, AddOnSkinsDS
## OptionalDeps: AllTheThings, ElvUI
Expand Down
2 changes: 1 addition & 1 deletion AddOnSkins/AddOnSkins_Classic.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 11503
## Title: |cff16C3F2AddOn|r|cFFFFFFFFSkins|r
## Version: 4.72
## Version: 4.73
## Author: Azilroka, Nihilistzsche
## SavedVariables: AddOnSkinsDB, AddOnSkinsDS
## OptionalDeps: AllTheThings, ElvUI
Expand Down
2 changes: 1 addition & 1 deletion AddOnSkins/Core/API.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local AS = unpack(AddOnSkins)
local AS = unpack(_G.AddOnSkins)
local S = AS.Skins

-- Deprecated - Moved to Skins Module
Expand Down
8 changes: 3 additions & 5 deletions AddOnSkins/Core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ local AddOnName = ...
local ES = AS.EmbedSystem

local _G = _G
local pairs, ipairs, type, pcall = pairs, ipairs, type, pcall
local pairs, ipairs, type, pcall, tinsert = pairs, ipairs, type, pcall, tinsert
local floor, print, format, strlower, strmatch, strlen = floor, print, format, strlower, strmatch, strlen
local sort, tinsert = sort, tinsert

local geterrorhandler = geterrorhandler
local IsAddOnLoaded, C_Timer = C_AddOns.IsAddOnLoaded, C_Timer
Expand Down Expand Up @@ -38,8 +37,7 @@ function AS:IsSkinEnabled(name, elvName)
end

function AS:GetColor(name)
local color = '|cff1784d1%s|r'
return (color):format(name)
return format('|cff1784d1%s|r', name)
end

function AS:RGBToHex(r, g, b, header)
Expand Down Expand Up @@ -200,7 +198,7 @@ function AS:UnregisterSkinEvent(addonName, event)
end

function AS:UpdateMedia()
AS.Blank = AS.Libs.LSM:Fetch('background', 'Solid')
AS.Blank = AS.Libs.LSM:Fetch('statusbar', 'Solid')
AS.Font = AS.Libs.LSM:Fetch('font', "Friz Quadrata TT")
AS.PixelFont = AS.Libs.LSM:Fetch('font', "Arial Narrow")
AS.NormTex = AS.Libs.LSM:Fetch('statusbar', "Blizzard")
Expand Down
62 changes: 22 additions & 40 deletions AddOnSkins/Init.lua
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
local _G = _G
local format = format
local strlower = strlower
local CreateFrame = CreateFrame
local GetAddOnEnableState = C_AddOns.GetAddOnEnableState
local GetAddOnInfo = C_AddOns.GetAddOnInfo
local GetAddOnMetadata = C_AddOns.GetAddOnMetadata
local GetNumAddOns = C_AddOns.GetNumAddOns
local GetRealmName = GetRealmName
local UIParent = UIParent
local UnitClass = UnitClass
local UnitName = UnitName
local UnitFactionGroup = UnitFactionGroup
local format, strlower = format, strlower

local GetAddOnEnableState, GetAddOnInfo, GetAddOnMetadata, GetNumAddOns = C_AddOns.GetAddOnEnableState, C_AddOns.GetAddOnInfo, C_AddOns.GetAddOnMetadata, C_AddOns.GetNumAddOns
local UnitName, GetRealmName, UnitClass, UnitFactionGroup = UnitName, GetRealmName, UnitClass, UnitFactionGroup

local UIParent, CreateFrame = UIParent, CreateFrame
local LibStub = _G.LibStub

local AddOnName, Engine = ...
local AS = _G.LibStub('AceAddon-3.0'):NewAddon('AddOnSkins', 'AceConsole-3.0', 'AceEvent-3.0', 'AceHook-3.0', 'AceTimer-3.0')
local _
local AS, _ = LibStub('AceAddon-3.0'):NewAddon('AddOnSkins', 'AceConsole-3.0', 'AceEvent-3.0', 'AceHook-3.0', 'AceTimer-3.0')

AS.EmbedSystem = AS:NewModule('EmbedSystem', 'AceEvent-3.0', 'AceHook-3.0')
AS.Skins = AS:NewModule('Skins', 'AceTimer-3.0', 'AceHook-3.0', 'AceEvent-3.0')

Engine[1] = AS
Engine[2] = {}
Engine[3] = AS.Skins
Engine[4] = {}
_G.AddOnSkins, Engine[1], Engine[2], Engine[3], Engine[4], _G.AddOnSkinsDS = Engine, AS, {}, AS.Skins, {}, {}

_G.AddOnSkins = Engine
_G.AddOnSkinsDS = {}

AS.Classic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
AS.Retail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
AS.TBC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
AS.Wrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC
AS.Retail, AS.Classic, AS.TBC, AS.Wrath = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE, WOW_PROJECT_ID == WOW_PROJECT_CLASSIC, WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC, WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC

AS.Libs = {
AC = _G.LibStub('AceConfig-3.0'),
ACD = _G.LibStub('AceConfigDialog-3.0-ElvUI', true) or _G.LibStub('AceConfigDialog-3.0'),
ACH = _G.LibStub('LibAceConfigHelper'),
ADB = _G.LibStub('AceDB-3.0'),
ADBO = _G.LibStub('AceDBOptions-3.0'),
ACL = _G.LibStub("AceLocale-3.0-ElvUI", true) or _G.LibStub("AceLocale-3.0"),
EP = _G.LibStub('LibElvUIPlugin-1.0', true),
ACR = _G.LibStub('AceConfigRegistry-3.0'),
GUI = _G.LibStub('AceGUI-3.0'),
LCG = _G.LibStub('LibCustomGlow-1.0', true),
LSM = _G.LibStub('LibSharedMedia-3.0', true),
AC = LibStub('AceConfig-3.0'),
ACD = LibStub('AceConfigDialog-3.0-ElvUI', true) or LibStub('AceConfigDialog-3.0'),
ACH = LibStub('LibAceConfigHelper'),
ADB = LibStub('AceDB-3.0'),
ADBO = LibStub('AceDBOptions-3.0'),
ACL = LibStub("AceLocale-3.0-ElvUI", true) or LibStub("AceLocale-3.0"),
EP = LibStub('LibElvUIPlugin-1.0', true),
ACR = LibStub('AceConfigRegistry-3.0'),
GUI = LibStub('AceGUI-3.0'),
LCG = LibStub('LibCustomGlow-1.0', true),
LSM = LibStub('LibSharedMedia-3.0', true),
}

AS.Title = GetAddOnMetadata(AddOnName, 'Title')
Expand All @@ -55,9 +40,8 @@ _, AS.MyClass = UnitClass('player')
AS.MyName = UnitName('player')
AS.MyRealm = GetRealmName()
AS.Noop = function() end
AS.TexCoords = { .075, .925, .075, .925 }
AS.TexCoords = { .08, .92, .08, .92 }
AS.Faction = UnitFactionGroup('player')
AS.Debug = false

AS.preload = {}
AS.skins = {}
Expand All @@ -73,7 +57,5 @@ for i = 1, GetNumAddOns() do
AS.AddOnVersion[strlower(Name)] = GetAddOnMetadata(Name, 'Version')
end

AS.Libs.LSM:Register('statusbar', 'Solid', [[Interface\Buttons\WHITE8X8]])

AS.Hider = CreateFrame('Frame', nil, UIParent)
AS.Hider:Hide()
29 changes: 18 additions & 11 deletions AddOnSkins/Libs/LibSharedMedia-3.0/LibSharedMedia-3.0.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--@curseforge-project-slug: libsharedmedia-3-0@
--[[
Name: LibSharedMedia-3.0
Revision: $Revision: 91 $
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 @@ -9,7 +10,7 @@ Dependencies: LibStub, CallbackHandler-1.0
License: LGPL v2.1
]]

local MAJOR, MINOR = "LibSharedMedia-3.0", 6010002 -- 6.1.0 v2 / increase manually on changes
local MAJOR, MINOR = "LibSharedMedia-3.0", 8020003 -- 8.2.0 v3 / increase manually on changes
local lib = LibStub:NewLibrary(MAJOR, MINOR)

if not lib then return end
Expand All @@ -20,13 +21,11 @@ local pairs = _G.pairs
local type = _G.type

local band = _G.bit.band

local table_insert = _G.table.insert
local table_sort = _G.table.sort

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 @@ -193,11 +192,12 @@ if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end
lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]]
lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]]
lib.MediaTable.statusbar["Blizzard Raid Bar"] = [[Interface\RaidFrame\Raid-Bar-Hp-Fill]]
lib.MediaTable.statusbar["Solid"] = [[Interface\Buttons\WHITE8X8]]
lib.DefaultMedia.statusbar = "Blizzard"

-- SOUND
if not lib.MediaTable.sound then lib.MediaTable.sound = {} end
lib.MediaTable.sound["None"] = [[Interface\Quiet.ogg]] -- Relies on the fact that PlaySound[File] doesn't error on non-existing input.
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 All @@ -222,18 +222,25 @@ function lib:Register(mediatype, key, data, langmask)
error(MAJOR..":Register(mediatype, key, data, langmask) - key must be string, got "..type(key))
end
mediatype = mediatype:lower()
if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end
if mediatype == lib.MediaType.SOUND and type(data) == "string" then
if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then
-- ignore fonts that aren't flagged as supporting local glyphs on non-western clients
return false
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()
-- Only ogg and mp3 are valid sounds.
if not path:find(".ogg", nil, true) and not path:find(".mp3", nil, true) then
if not path:find("^interface") then
-- files accessed via path only allowed from interface folder
return false
end
if mediatype == lib.MediaType.SOUND and not (path:find(".ogg", nil, true) or path:find(".mp3", nil, true)) then
-- Only ogg and mp3 are valid sounds.
return false
end
end
if not mediaTable[mediatype] then mediaTable[mediatype] = {} end
local mtable = mediaTable[mediatype]
if mtable[key] then return false end

mtable[key] = data
rebuildMediaList(mediatype)
self.callbacks:Fire("LibSharedMedia_Registered", mediatype, key)
Expand Down

0 comments on commit 7af4cef

Please sign in to comment.