-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
79 additions
and
202 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
------------------------------------------------------------------------ | ||
r152 | funkehdude | 2024-07-09 18:28:54 +0000 (Tue, 09 Jul 2024) | 1 line | ||
Changed paths: | ||
M /trunk/LibSharedMedia-3.0.toc | ||
D /trunk/LibSharedMedia-3.0_Cata.toc | ||
D /trunk/LibSharedMedia-3.0_TBC.toc | ||
D /trunk/LibSharedMedia-3.0_Vanilla.toc | ||
D /trunk/LibSharedMedia-3.0_Wrath.toc | ||
|
||
Merge toc files | ||
------------------------------------------------------------------------ | ||
r151 | funkehdude | 2024-05-05 01:20:21 +0000 (Sun, 05 May 2024) | 1 line | ||
Changed paths: | ||
A /trunk/.luacheckrc | ||
M /trunk/LibSharedMedia-3.0/LibSharedMedia-3.0.lua | ||
|
||
The retail only safety check should no longer be needed | ||
------------------------------------------------------------------------ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Interface: 11502, 11503, 20504, 30403, 40400, 100207, 110000, 110002 | ||
## LoadOnDemand: 1 | ||
|
||
## Title: Lib: SharedMedia-3.0 | ||
## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. | ||
## Author: Elkano | ||
## Version: 3.0-152 | ||
## X-Website: https://www.curseforge.com/wow/addons/libsharedmedia-3-0 | ||
## X-Category: Library | ||
|
||
## X-Revision: 152 | ||
## X-Date: 2024-07-09T18:28:54Z | ||
|
||
LibStub\LibStub.lua | ||
CallbackHandler-1.0\CallbackHandler-1.0.lua | ||
|
||
LibSharedMedia-3.0\lib.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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) | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Script file="LibSharedMedia-3.0.lua" /> | ||
</Ui> | ||
</Ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ | ||
..\FrameXML\UI.xsd"> | ||
<Script file="CallbackHandler-1.0.lua"/> | ||
</Ui> | ||
<Include file="LibSharedMedia-3.0\lib.xml"/> | ||
</Ui> | ||
|