44 lines
2.0 KiB
Lua
44 lines
2.0 KiB
Lua
|
|
local _, P = ...
|
||
|
|
|
||
|
|
-- Shared reservations used by placement AND diagnostics. Hidden/empty buttons
|
||
|
|
-- still occupy their block, so overlays cannot land in a temporarily blank slot.
|
||
|
|
P.layoutPolicy = {
|
||
|
|
gap = 12, actionRowGap = 4, utilityRowGap = 6,
|
||
|
|
chat = {width = 380, height = 150, minimumWidth = 240, fontSize = 14, edgeGap = 16},
|
||
|
|
controls = {
|
||
|
|
{name="Center controls", "MainActionBar","MultiBarBottomLeft","MultiBarBottomRight","MultiBar5"},
|
||
|
|
{name="Right controls", "MultiBarLeft","MultiBarRight","BagsBar","MicroMenuContainer"},
|
||
|
|
{name="Left controls", "MultiBar6","MultiBar7"},
|
||
|
|
},
|
||
|
|
panels = {"BankFrame","GuildBankFrame","MerchantFrame","QuestFrame","GossipFrame","MailFrame","TradeFrame",
|
||
|
|
"ProfessionsFrame","TradeSkillFrame","PlayerSpellsFrame","SpellBookFrame","WorldMapFrame","QuestLogFrame",
|
||
|
|
"CharacterFrame","AuctionHouseFrame"},
|
||
|
|
}
|
||
|
|
P.controlFrameNames, P.controlFrameSet = {}, {}
|
||
|
|
for _, group in ipairs(P.layoutPolicy.controls) do
|
||
|
|
for _, name in ipairs(group) do
|
||
|
|
P.controlFrameNames[#P.controlFrameNames+1] = name
|
||
|
|
P.controlFrameSet[name] = true
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
function P.ApplyChatDefaults()
|
||
|
|
-- Fresh installs only. Do not overwrite an existing player's font choice.
|
||
|
|
if RuenUICharacter.chatDefaultsVersion or RuenUICharacter.version then return end
|
||
|
|
if ChatFrame1 and ChatFrame1.GetFont and FCF_SetChatWindowFontSize then
|
||
|
|
local font,size,flags=ChatFrame1:GetFont()
|
||
|
|
RuenUICharacter.chatFontOriginal={font=font,size=size,flags=flags}
|
||
|
|
FCF_SetChatWindowFontSize(nil,ChatFrame1,P.layoutPolicy.chat.fontSize)
|
||
|
|
end
|
||
|
|
RuenUICharacter.chatDefaultsVersion=1
|
||
|
|
end
|
||
|
|
|
||
|
|
function P.RestoreChatDefaults()
|
||
|
|
local old=RuenUICharacter.chatFontOriginal
|
||
|
|
if not old or not ChatFrame1 or not ChatFrame1.GetFont then return end
|
||
|
|
local font,size=ChatFrame1:GetFont()
|
||
|
|
if font==old.font and size==P.layoutPolicy.chat.fontSize and FCF_SetChatWindowFontSize then
|
||
|
|
FCF_SetChatWindowFontSize(nil,ChatFrame1,old.size)
|
||
|
|
end
|
||
|
|
end
|