diff --git a/SaftUI/modules/actionbars.lua b/SaftUI/modules/actionbars.lua index 67cb4f6..c7649e4 100644 --- a/SaftUI/modules/actionbars.lua +++ b/SaftUI/modules/actionbars.lua @@ -72,7 +72,6 @@ local function style(self) Border:AllPoints(self) Border:SetTemplate("Transparent") end -hooksecurefunc(T, "StyleActionBarButton", style) function T.UpdateAllActionBars() if InCombatLockdown() then return end @@ -222,6 +221,7 @@ LoadFrame:SetScript("OnEvent", function(self, event, addon) if event == "PLAYER_ENTERING_WORLD" then --If saved variables exist, load them into Tukui's action bar config LoadVariables() + hooksecurefunc(T, "StyleActionBarButton", style) elseif event == "PLAYER_LOGOUT" then --If saved variables don't exist, create then if not SaftUISaved then SaftUISaved = {} end diff --git a/SaftUI/modules/chat.lua b/SaftUI/modules/chat.lua index f2d55f4..75f5874 100644 --- a/SaftUI/modules/chat.lua +++ b/SaftUI/modules/chat.lua @@ -1,5 +1,50 @@ local T, C, L = unpack(Tukui) +local function SetupChat(self) + self:UnregisterAllEvents() + + local general, loot = ChatFrame1, ChatFrame4 + + if C.chat.background then + local leftbg, rightbg = TukuiChatBackgroundLeft, TukuiChatBackgroundRight + + general:ClearAllPoints() + general:SetPoint("BOTTOMLEFT", leftbg, "BOTTOMLEFT", 6, 6) + general:SetPoint("TOPRIGHT", leftbg, "TOPRIGHT", 6, -32) + + loot:ClearAllPoints() + loot:SetPoint("BOTTOMLEFT", rightbg, "BOTTOMLEFT", 6, 6) + loot:SetPoint("TOPRIGHT", rightbg, "TOPRIGHT", 6, -32) + + leftbg:ClearAllPoints() + leftbg:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 6, 6) + + rightbg:ClearAllPoints() + rightbg:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -6, 6) + else + general:ClearAllPoints() + general:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 6, 6) + + loot:ClearAllPoints() + loot:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -6, 6) + + TukuiChatchatEditBoxBackground:Kill() + + for i=1, NUM_CHAT_WINDOWS do + local frame = _G["ChatFrame"..i] + local editbox = _G["ChatFrame"..i.."EditBox"] + editbox:ClearAllPoints() + editbox:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 10, 16) + editbox:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", -10, 16) + end + end +end + +local OnLoad = CreateFrame("Frame") +OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD") +OnLoad:SetScript("OnEvent", SetupChat) + +if true then return end --Leaving all of this code here to use for later, but stop the file execution right here. local leftBG = TukuiChatBackgroundLeft or CreateFrame("Frame", "TukuiChatBackgroundLeft", UIParent) local leftTabs = TukuiTabsLeftBackground local rightBG = TukuiChatBackgroundRight or CreateFrame("Frame", "TukuiChatBackgroundLeft", UIParent)