Verified Commit 888cc87d authored by Merathilis's avatar Merathilis

Added a visibility option for the Chat seperator, now you can select which one...

Added a visibility option for the Chat seperator, now you can select which one will show and which not. ToDo: Take account for panel backdrop, to lazy atm.
parent 022ba173
......@@ -96,50 +96,6 @@ function MERL:ShadowOverlay()
self.f:SetAlpha(0.7)
end
function MERL:CreateSeparators()
if E.db.mui.chat.seperators ~= true then return end
--Left Chat Tab Separator
local ltabseparator = CreateFrame('Frame', 'LeftChatTabSeparator', _G.LeftChatPanel)
ltabseparator:SetFrameStrata('BACKGROUND')
ltabseparator:SetFrameLevel(_G.LeftChatPanel:GetFrameLevel() + 2)
ltabseparator:SetHeight(1)
ltabseparator:SetPoint('TOPLEFT', _G.LeftChatPanel, 5, -24)
ltabseparator:SetPoint('TOPRIGHT', _G.LeftChatPanel, -5, -24)
ltabseparator:SetTemplate('Transparent')
--Right Chat Tab Separator
local rtabseparator = CreateFrame('Frame', 'RightChatTabSeparator', _G.RightChatPanel)
rtabseparator:SetFrameStrata('BACKGROUND')
rtabseparator:SetFrameLevel(_G.RightChatPanel:GetFrameLevel() + 2)
rtabseparator:SetHeight(1)
rtabseparator:SetPoint('TOPLEFT', _G.RightChatPanel, 5, -24)
rtabseparator:SetPoint('TOPRIGHT', _G.RightChatPanel, -5, -24)
rtabseparator:SetTemplate('Transparent')
MERL:UpdateSeperators()
end
hooksecurefunc(LO, "CreateChatPanels", MERL.CreateSeparators)
function MERL:UpdateSeperators()
if E.db.mui.chat.seperators ~= true then return end
local panelBackdrop = E.db.chat.panelBackdrop
if panelBackdrop == 'SHOWBOTH' then
_G.LeftChatTabSeparator:Show()
_G.RightChatTabSeparator:Show()
elseif panelBackdrop == 'HIDEBOTH' then
_G.LeftChatTabSeparator:Hide()
_G.RightChatTabSeparator:Hide()
elseif panelBackdrop == 'LEFT' then
_G.LeftChatTabSeparator:Show()
_G.RightChatTabSeparator:Hide()
else
_G.LeftChatTabSeparator:Hide()
_G.RightChatTabSeparator:Show()
end
end
function MERL:ToggleChatPanels()
local panelHeight = E.db.chat.panelHeight
local rightHeight = E.db.chat.separateSizes and E.db.chat.panelHeightRight
......@@ -168,7 +124,6 @@ function MERL:Initialize()
hooksecurefunc(LO, "SetDataPanelStyle", MERL.SetDataPanelStyle)
LO:SetDataPanelStyle()
self:UpdateSeperators()
end
MER:RegisterModule(MERL:GetName())
......@@ -2,6 +2,7 @@ local MER, E, L, V, P, G = unpack(select(2, ...))
local module = MER:NewModule("muiChat", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
local MERS = MER:GetModule("muiSkins")
local CH = E:GetModule("Chat")
local LO = E:GetModule("Layout")
-- Cache global variables
-- Lua functions
......@@ -156,6 +157,50 @@ function module:CreateChatLootIcons(_, message, ...)
return false, message, ...
end
function module:CreateSeparators()
if E.db.mui.chat.seperators.enable ~= true then return end
--Left Chat Tab Separator
local ltabseparator = CreateFrame('Frame', 'LeftChatTabSeparator', _G.LeftChatPanel)
ltabseparator:SetFrameStrata('BACKGROUND')
ltabseparator:SetFrameLevel(_G.LeftChatPanel:GetFrameLevel() + 2)
ltabseparator:SetHeight(1)
ltabseparator:SetPoint('TOPLEFT', _G.LeftChatPanel, 5, -24)
ltabseparator:SetPoint('TOPRIGHT', _G.LeftChatPanel, -5, -24)
ltabseparator:SetTemplate('Transparent')
--Right Chat Tab Separator
local rtabseparator = CreateFrame('Frame', 'RightChatTabSeparator', _G.RightChatPanel)
rtabseparator:SetFrameStrata('BACKGROUND')
rtabseparator:SetFrameLevel(_G.RightChatPanel:GetFrameLevel() + 2)
rtabseparator:SetHeight(1)
rtabseparator:SetPoint('TOPLEFT', _G.RightChatPanel, 5, -24)
rtabseparator:SetPoint('TOPRIGHT', _G.RightChatPanel, -5, -24)
rtabseparator:SetTemplate('Transparent')
module:UpdateSeperators()
end
hooksecurefunc(LO, "CreateChatPanels", module.CreateSeparators)
function module:UpdateSeperators()
if E.db.mui.chat.seperators.enable ~= true then return end
local visibility = E.db.mui.chat.seperators.visibility
if visibility == 'SHOWBOTH' then
_G.LeftChatTabSeparator:Show()
_G.RightChatTabSeparator:Show()
elseif visibility =='HIDEBOTH' then
_G.LeftChatTabSeparator:Hide()
_G.RightChatTabSeparator:Hide()
elseif visibility =='LEFT' then
_G.LeftChatTabSeparator:Show()
_G.RightChatTabSeparator:Hide()
else
_G.LeftChatTabSeparator:Hide()
_G.RightChatTabSeparator:Show()
end
end
function module:Initialize()
if E.private.chat.enable ~= true then return; end
......@@ -179,6 +224,7 @@ function module:Initialize()
self:ChatFilter()
self:DamageMeterFilter()
self:LoadChatFade()
self:UpdateSeperators()
--Custom Emojis
local t = "|TInterface\\AddOns\\ElvUI_MerathilisUI\\media\\textures\\chatEmojis\\%s:16:16|t"
......
......@@ -46,20 +46,43 @@ local function ChatTable()
type = "toggle",
name = L["Emotes"],
},
seperators = {
itemLevelLink = {
order = 7,
type = "toggle",
name = L["Seperators"],
name = L["Item Level Links"],
},
itemLevelLink = {
seperators = {
order = 8,
type = "toggle",
name = L["Item Level Links"],
type = "group",
name = MER:cOption(L["Seperators"]),
guiInline = true,
get = function(info) return E.db.mui.chat.seperators[ info[#info] ] end,
set = function(info, value) E.db.mui.chat.seperators[ info[#info] ] = value; end,
args = {
enable = {
order = 1,
type = "toggle",
name = L["Enable"]
},
visibility = {
order = 2,
type = 'select',
name = L["Visibility"],
get = function(info) return E.db.mui.chat.seperators[ info[#info] ] end,
set = function(info, value) E.db.mui.chat.seperators[ info[#info] ] = value; module:UpdateSeperators() end,
values = {
HIDEBOTH = L["Hide Both"],
SHOWBOTH = L["Show Both"],
LEFT = L["Left Only"],
RIGHT = L["Right Only"],
},
}
},
},
chatFade = {
order = 10,
order = 9,
type = "group",
name = L["Fade Chat"],
name = MER:cOption(L["Fade Chat"]),
guiInline = true,
get = function(info) return E.db.mui.chat.chatFade[ info[#info] ] end,
set = function(info, value) E.db.mui.chat.chatFade[ info[#info] ] = value; module:Configure_ChatFade() end,
......@@ -96,7 +119,7 @@ local function ChatTable()
filter = {
order = 20,
type = "group",
name = L["Filter"],
name = MER:cOption(L["Filter"]),
guiInline = true,
get = function(info) return E.db.mui.chat.filter[ info[#info] ] end,
set = function(info, value) E.db.mui.chat.filter[ info[#info] ] = value; E:StaticPopup_Show("PRIVATE_RL"); end,
......
......@@ -127,7 +127,10 @@ MP.chat = {
timeout = 8,
fadeOutTime = 0.65
},
seperators = true,
seperators = {
enable = true,
visibility = "SHOWBOTH",
},
}
MP.colors = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment