From a276cca4443d85893c94e936f0fa4cabf8341008 Mon Sep 17 00:00:00 2001 From: Relationship <139162359+Relationship-OctoWoW@users.noreply.github.com> Date: Thu, 16 Jul 2026 17:34:22 +0100 Subject: [PATCH] Add files via upload --- Core.lua | 31 +++++++++++++++++++++++++++++++ Minimap.lua | 6 +++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Core.lua b/Core.lua index 8fee1d6..8d08bc9 100644 --- a/Core.lua +++ b/Core.lua @@ -616,6 +616,34 @@ local function slashHandler(msg) print("Minimap button shown. Drag to reposition around the minimap.") end end + elseif string.find(msg, "^pos") then + -- /attune pos -- set exact offset from UIParent CENTER. + -- Values may be off-screen (e.g. -9999) to park the button out of + -- the way while still letting MinimapButtonBag collect it. + local _, _, sx, sy = string.find(msg, "pos%s+(%-?%d+%.?%d*)%s+(%-?%d+%.?%d*)") + local x, y = tonumber(sx), tonumber(sy) + if x and y and RA.Minimap then + local o = RelationshipsAttuneDB.options + o.minimapX, o.minimapY = x, y + RA.Minimap:Refresh() + print("Minimap button moved to " .. x .. ", " .. y .. ".") + else + print("Usage: /attune pos (offsets from screen center; can be off-screen)") + end + elseif msg == "offscreen" or msg == "park" then + if RA.Minimap then + local o = RelationshipsAttuneDB.options + o.minimapX, o.minimapY = -10000, -10000 + RA.Minimap:Refresh() + print("Minimap button parked off-screen. MinimapButtonBag (if installed) can still collect it. Use /attune resetpos to bring it back.") + end + elseif msg == "resetpos" then + if RA.Minimap then + local o = RelationshipsAttuneDB.options + o.minimapX, o.minimapY = 0, -140 + RA.Minimap:Refresh() + print("Minimap button position reset.") + end elseif msg == "sync" then if RA.Comm then RA.Comm:RequestSync() end print(L.MSG_SYNC_SENT) @@ -664,6 +692,9 @@ local function slashHandler(msg) print(" /attune show - open the window") print(" /attune hide - close the window (or hide the minimap button)") print(" /attune minimap - toggle the minimap button") + print(" /attune pos x y - place the minimap button at exact offset (can be off-screen)") + print(" /attune offscreen- park the minimap button off-screen (MBB can still collect it)") + print(" /attune resetpos - restore the minimap button to a visible default position") print(" /attune scan - force a rescan of quests + bags") print(" /attune sync - request sync from your group") print(" /attune debug - dump keyring + item detection") diff --git a/Minimap.lua b/Minimap.lua index 1130add..b5bab7a 100644 --- a/Minimap.lua +++ b/Minimap.lua @@ -79,6 +79,9 @@ function MM:Create() btn:RegisterForClicks("LeftButtonUp", "RightButtonUp") btn:RegisterForDrag("LeftButton", "RightButton") btn:SetMovable(true) + -- Allow the button to sit off-screen (via /attune pos or /attune offscreen) + -- while remaining discoverable by MinimapButtonBag. + if btn.SetClampedToScreen then btn:SetClampedToScreen(false) end -- MBB-friendly highlight so the button visually matches other -- minimap buttons once it has been swept into the bag. btn:SetHighlightTexture("Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight") @@ -115,7 +118,8 @@ function MM:Create() GameTooltip:AddLine("Relationships Attune", 1, 0.82, 0) GameTooltip:AddLine("Left-click: open / close window", 0.9, 0.9, 0.9) GameTooltip:AddLine("Drag: move anywhere on screen", 0.9, 0.9, 0.9) - GameTooltip:AddLine("/attune hide - hide this button", 0.6, 0.8, 1) + GameTooltip:AddLine("/attune offscreen - park off-screen (MBB safe)", 0.6, 0.8, 1) + GameTooltip:AddLine("/attune hide - hide this button", 0.6, 0.8, 1) GameTooltip:Show() end) btn:SetScript("OnLeave", function() GameTooltip:Hide() end)