聊天重做前缓存
This commit is contained in:
55
Media.lua
55
Media.lua
@@ -62,6 +62,27 @@ function SFrames:GetTexture()
|
||||
return self.Media.statusbar
|
||||
end
|
||||
|
||||
function SFrames:ResolveBarTexture(settingKey, fallbackKey)
|
||||
local key
|
||||
if SFramesDB and settingKey then
|
||||
key = SFramesDB[settingKey]
|
||||
end
|
||||
if (not key or key == "") and SFramesDB and fallbackKey then
|
||||
key = SFramesDB[fallbackKey]
|
||||
end
|
||||
if key and key ~= "" then
|
||||
local builtin = self._barTextureLookup[key]
|
||||
if builtin then return builtin end
|
||||
|
||||
local LSM = self:GetSharedMedia()
|
||||
if LSM then
|
||||
local path = LSM:Fetch("statusbar", key, true)
|
||||
if path then return path end
|
||||
end
|
||||
end
|
||||
return self:GetTexture()
|
||||
end
|
||||
|
||||
function SFrames:GetFont()
|
||||
-- 1. Check built-in font key
|
||||
if SFramesDB and SFramesDB.fontKey then
|
||||
@@ -79,6 +100,40 @@ function SFrames:GetFont()
|
||||
return self.Media.font
|
||||
end
|
||||
|
||||
function SFrames:ResolveFont(settingKey, fallbackKey)
|
||||
local key
|
||||
if SFramesDB and settingKey then
|
||||
key = SFramesDB[settingKey]
|
||||
end
|
||||
if (not key or key == "") and SFramesDB and fallbackKey then
|
||||
key = SFramesDB[fallbackKey]
|
||||
end
|
||||
if key and key ~= "" then
|
||||
local builtin = self._fontLookup[key]
|
||||
if builtin then return builtin end
|
||||
local LSM = self:GetSharedMedia()
|
||||
if LSM then
|
||||
local path = LSM:Fetch("font", key, true)
|
||||
if path then return path end
|
||||
end
|
||||
end
|
||||
return self:GetFont()
|
||||
end
|
||||
|
||||
function SFrames:ResolveFontOutline(settingKey, fallbackKey)
|
||||
local outline
|
||||
if SFramesDB and settingKey then
|
||||
outline = SFramesDB[settingKey]
|
||||
end
|
||||
if (not outline or outline == "") and SFramesDB and fallbackKey then
|
||||
outline = SFramesDB[fallbackKey]
|
||||
end
|
||||
if outline and outline ~= "" then
|
||||
return outline
|
||||
end
|
||||
return self.Media.fontOutline or "OUTLINE"
|
||||
end
|
||||
|
||||
function SFrames:GetSharedMediaList(mediaType)
|
||||
local LSM = self:GetSharedMedia()
|
||||
if LSM and LSM.List then return LSM:List(mediaType) end
|
||||
|
||||
Reference in New Issue
Block a user