From efceca752f2d4f36eab59e27b10a9cba059a832a Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 24 Apr 2015 01:19:08 +0400 Subject: [PATCH] I can sence that in future people will bitch about this option being only toggle for both panels. --- ElvUI_SLE/defaults/profile.lua | 2 +- ElvUI_SLE/modules/chat.lua | 26 +++++++++++++++++--------- ElvUI_SLE/options/chat_c.lua | 8 +++++++- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index cb85114..d5704eb 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -125,7 +125,7 @@ P['sle'] = { ['enable'] = false, ['alpha'] = 0.5, }, - ['combathide'] = false, + ['combathide'] = "NONE", }, --Combat Icon diff --git a/ElvUI_SLE/modules/chat.lua b/ElvUI_SLE/modules/chat.lua index 5f9a5bc..740c35f 100644 --- a/ElvUI_SLE/modules/chat.lua +++ b/ElvUI_SLE/modules/chat.lua @@ -449,17 +449,25 @@ function CH:SpamFilter() end function CH:Combat(event) - if not E.db.sle.chat.combathide then return end + if E.db.sle.chat.combathide == "NONE" then return end if event == "PLAYER_REGEN_DISABLED" then - RightChatPanel:Hide() - RightChatToggleButton:Hide() - LeftChatPanel:Hide() - LeftChatToggleButton:Hide() + if E.db.sle.chat.combathide == "BOTH" or E.db.sle.chat.combathide == "RIGHT" then + RightChatPanel:Hide() + RightChatToggleButton:Hide() + end + if E.db.sle.chat.combathide == "BOTH" or E.db.sle.chat.combathide == "LEFT" then + LeftChatPanel:Hide() + LeftChatToggleButton:Hide() + end elseif event == "PLAYER_REGEN_ENABLED" then - RightChatPanel:Show() - RightChatToggleButton:Show() - LeftChatPanel:Show() - LeftChatToggleButton:Show() + if not RightChatPanel:IsShown() then + RightChatPanel:Show() + RightChatToggleButton:Show() + end + if not LeftChatPanel:IsShown() then + LeftChatPanel:Show() + LeftChatToggleButton:Show() + end end end diff --git a/ElvUI_SLE/options/chat_c.lua b/ElvUI_SLE/options/chat_c.lua index 066a434..5c8a0e2 100644 --- a/ElvUI_SLE/options/chat_c.lua +++ b/ElvUI_SLE/options/chat_c.lua @@ -60,10 +60,16 @@ local function configTable() }, combathide = { order = 8, - type = "toggle", + type = "select", name = L["Hide In Combat"], get = function(info) return E.db.sle.chat.combathide end, set = function(info, value) E.db.sle.chat.combathide = value; end, + values = { + ["NONE"] = NONE, + ["BOTH"] = L["Both"], + ["LEFT"] = L["Left"], + ["RIGHT"] = L["Right"], + } }, textureAlpha = { order = 10, -- 1.7.9.5