/trunk/TipTop/libs/LibSharedMedia-3.0
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 74 $ |
Revision: $Revision: 89 $ |
Author: Elkano (elkano@gmx.de) |
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) |
Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
License: LGPL v2.1 |
]] |
local MAJOR, MINOR = "LibSharedMedia-3.0", 5000402 -- 5.0.4 v2 / increase manually on changes |
local MAJOR, MINOR = "LibSharedMedia-3.0", 6000201 -- 6.0.2 v1 / increase manually on changes |
local lib = LibStub:NewLibrary(MAJOR, MINOR) |
if not lib then return end |
-- BACKGROUND |
if not lib.MediaTable.background then lib.MediaTable.background = {} end |
lib.MediaTable.background["None"] = [[]] |
lib.MediaTable.background["Blizzard Collections Background"] = [[Interface\Collections\CollectionsBackgroundTile]] |
lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] |
lib.MediaTable.background["Blizzard Dialog Background Dark"] = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]] |
lib.MediaTable.background["Blizzard Dialog Background Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]] |
lib.MediaTable.background["Blizzard Garrison Background"] = [[Interface\Garrison\GarrisonUIBackground]] |
lib.MediaTable.background["Blizzard Garrison Background 2"] = [[Interface\Garrison\GarrisonUIBackground2]] |
lib.MediaTable.background["Blizzard Garrison Background 3"] = [[Interface\Garrison\GarrisonMissionUIInfoBoxBackgroundTile]] |
lib.MediaTable.background["Blizzard Low Health"] = [[Interface\FullScreenTextures\LowHealth]] |
lib.MediaTable.background["Blizzard Marble"] = [[Interface\FrameGeneral\UI-Background-Marble]] |
lib.MediaTable.background["Blizzard Out of Control"] = [[Interface\FullScreenTextures\OutOfControl]] |
if not lib.MediaTable.font then lib.MediaTable.font = {} end |
local SML_MT_font = lib.MediaTable.font |
--[[ |
All font files are currently in all clients, the following table depicts which font supports which charset as of 5.0.4 |
Fonts were checked using langcover.pl from DejaVu fonts (http://sourceforge.net/projects/dejavu/) and FontForge (http://fontforge.org/) |
latin means check for: de, en, es, fr, it, pt |
file name latin koKR ruRU zhCN zhTW |
2002.ttf 2002 X X X - - |
2002B.ttf 2002 Bold X X X - - |
bKAI00M.ttf AR Kaiti Medium B5 - - - - X |
bLEI00D.ttf AR Leisu Demi B5 - - - - X |
FRIZQT__.TTF Friz Quadrata TT X - - - - |
FRIZQT___CYR.TTF FrizQuadrataCTT - - X - - |
FRIZQT___CYR.TTF FrizQuadrataCTT x - X - - |
K_Damage.TTF YDIWingsM - X X - - |
K_Pagetext.TTF MoK X X X - - |
MORPHEUS.TTF Morpheus X - - - - |
NIM_____.ttf Nimrod MT X - X - - |
SKURRI.TTF Skurri X - - - - |
SKURRI_CYR.TTF Skurri X - X - - |
WARNING: Although FRIZQT___CYR is available on western clients, it doesn't support special European characters e.g. é, ï, ö |
Due to this, we cannot use it as a replacement for FRIZQT__.TTF |
]] |
if locale == "koKR" then |
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.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end |
if not mediaTable[mediatype] then mediaTable[mediatype] = {} end |
local mtable = mediaTable[mediatype] |
if mtable[key] then return false end |