From 5869c9f5190713db704fb126e61e077f7de1dd72 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Tue, 24 Mar 2026 13:02:22 +0100 Subject: [PATCH] fixed macrotweak to check properly for scrm, sm and um --- modules/macrotweak.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/modules/macrotweak.lua b/modules/macrotweak.lua index 3d45d862..3ed5414c 100644 --- a/modules/macrotweak.lua +++ b/modules/macrotweak.lua @@ -1,12 +1,24 @@ pfUI:RegisterModule("macrotweak", "vanilla", function () - -- disable macrotweak when macro addons are loaded - if IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros") then return end + local conflictAddons = { "Supermacro", "SuperCleveRoidMacros", "UltimaMacros" } + local disabled = false + + local function CheckConflicts() + for _, name in pairs(conflictAddons) do + if IsAddOnLoaded(name) then + DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpfUI|r: " .. name .. " found, macrotweak disabled.") + disabled = true + return true + end + end + return false + end -- do not write macro calls into chat input history if ChatFrameEditBox._AddHistoryLine then local userinput ChatFrameEditBox._AddHistoryLine = ChatFrameEditBox.AddHistoryLine ChatFrameEditBox.AddHistoryLine = function(self, text) + if disabled then return ChatFrameEditBox._AddHistoryLine(self, text) end if not userinput and text and string.find(text, "^/run(.+)") then return end if not userinput and string.find(text, "^/script(.+)") then return end if not userinput and string.find(text, "^/cast(.+)") then return end @@ -24,6 +36,7 @@ pfUI:RegisterModule("macrotweak", "vanilla", function () -- make sure #showtooltip inside macros won't be sent local hookSendChatMessage = SendChatMessage function _G.SendChatMessage(msg, ...) + if disabled then return hookSendChatMessage(msg, unpack(arg)) end if msg and string.find(msg, "^#showtooltip ") then return end hookSendChatMessage(msg, unpack(arg)) end @@ -51,4 +64,11 @@ pfUI:RegisterModule("macrotweak", "vanilla", function () UseInventoryItem(slot) end end) -end) + + -- Check conflicts after one tick so all addons have finished loading + local watcher = CreateFrame("Frame") + watcher:SetScript("OnUpdate", function() + this:SetScript("OnUpdate", nil) + CheckConflicts() + end) +end) \ No newline at end of file