Verified Commit a7370193 authored by Repooc's avatar Repooc

Ability to make chat respect height and still have the ability to use the expand chat button

parent 74e12e43
......@@ -91,6 +91,9 @@ end
function MERL:CreateChatButtons()
if E.db.mui.chat.chatButton ~= true or E.private.chat.enable ~= true then return end
-- Maybe add option to adjust how much the chat panel expands
E.db.mui.chat.expandPanel = 150
local panelBackdrop = E.db.chat.panelBackdrop
local ChatButton = CreateFrame("Frame", "mUIChatButton", _G["LeftChatPanel"].backdrop)
ChatButton:ClearAllPoints()
......@@ -111,11 +114,11 @@ function MERL:CreateChatButtons()
if InCombatLockdown() then return end
if btn == "LeftButton" then
if E.db.mui.chat.isExpanded then
E.db.chat.panelHeight = E.db.mui.chat.panelHeight
E.db.mui.chat.isExpanded = false
E.db.chat.panelHeight = E.db.chat.panelHeight - E.db.mui.chat.expandPanel
CH:PositionChat(true)
E.db.mui.chat.isExpanded = false
else
E.db.chat.panelHeight = 400
E.db.chat.panelHeight = E.db.chat.panelHeight + E.db.mui.chat.expandPanel
CH:PositionChat(true)
E.db.mui.chat.isExpanded = true
end
......@@ -144,20 +147,6 @@ function MERL:CreateChatButtons()
end
GameTooltip:Hide()
end)
ChatButton:RegisterEvent("PLAYER_LEAVING_WORLD")
ChatButton:RegisterEvent("ADDON_LOADED")
ChatButton:SetScript("OnEvent", function(self, event, addon)
if event == "ADDON_LOADED" and addon == "ElvUI_Config" then
E.Options.args.chat.args.panels.args.panelHeight.set = function(info, value) E.db.chat.panelHeight = value; E.db.mui.chat.panelHeight = value; E:GetModule("Chat"):PositionChat(true); end
self:UnregisterEvent(event)
end
if event == "PLAYER_LEAVING_WORLD" then
E.db.chat.panelHeight = E.db.mui.chat.panelHeight or 146
E.db.mui.chat.isExpanded = false
CH:PositionChat(true)
end
end)
end
local function ShowOrHideBar5(bar, button)
......
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