From 9a10d6180061b9096bf7364c5d9b2e414c4742b8 Mon Sep 17 00:00:00 2001 From: Teelo <49792789+teelolws@users.noreply.github.com> Date: Thu, 7 May 2026 18:57:01 +1200 Subject: [PATCH 1/2] Add anchorTo option to all custom frames --- Source/FrameHandlers/ClassResources.lua | 1 - Source/FrameHandlers/FocusCast.lua | 1 - Source/FrameHandlers/FocusToT.lua | 1 - Source/FrameHandlers/TargetCast.lua | 1 - Source/FrameHandlers/TargetOfTarget.lua | 1 - Source/RegisterFrame.lua | 1 + 6 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/FrameHandlers/ClassResources.lua b/Source/FrameHandlers/ClassResources.lua index 682a782..f289f87 100644 --- a/Source/FrameHandlers/ClassResources.lua +++ b/Source/FrameHandlers/ClassResources.lua @@ -25,7 +25,6 @@ local function initClassResource(classResourceFrame, localText, db) lib:RegisterToggleInCombat(classResourceFrame) lib:SetDontResize(classResourceFrame) lib:RegisterResizable(classResourceFrame) - addon.registerAnchorToDropdown(classResourceFrame) hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function() if not shouldShow(classResourceFrame) then return end addon.ResetFrame(classResourceFrame) diff --git a/Source/FrameHandlers/FocusCast.lua b/Source/FrameHandlers/FocusCast.lua index 3d2916a..c313545 100644 --- a/Source/FrameHandlers/FocusCast.lua +++ b/Source/FrameHandlers/FocusCast.lua @@ -20,6 +20,5 @@ function addon:initFocusCastBar() lib:SetDontResize(FocusFrameSpellBar) lib:RegisterResizable(FocusFrameSpellBar) lib:RegisterHideable(FocusFrameSpellBar) - addon.registerAnchorToDropdown(FocusFrameSpellBar) end end diff --git a/Source/FrameHandlers/FocusToT.lua b/Source/FrameHandlers/FocusToT.lua index 611a885..6b00d4e 100644 --- a/Source/FrameHandlers/FocusToT.lua +++ b/Source/FrameHandlers/FocusToT.lua @@ -21,7 +21,6 @@ function addon:initFocusToT() end end) addon:registerSecureFrameHideable(FocusFrameToT) - addon.registerAnchorToDropdown(FocusFrameToT) end end diff --git a/Source/FrameHandlers/TargetCast.lua b/Source/FrameHandlers/TargetCast.lua index af1fbdf..59735a7 100644 --- a/Source/FrameHandlers/TargetCast.lua +++ b/Source/FrameHandlers/TargetCast.lua @@ -19,7 +19,6 @@ function addon:initTargetCastBar() lib:SetDontResize(TargetFrameSpellBar) lib:RegisterResizable(TargetFrameSpellBar, 10, 500) lib:RegisterHideable(TargetFrameSpellBar) - addon.registerAnchorToDropdown(TargetFrameSpellBar) lib:RegisterSlider(TargetFrameSpellBar, HUD_EDIT_MODE_SETTING_CHAT_FRAME_WIDTH, "Width", function(newValue) diff --git a/Source/FrameHandlers/TargetOfTarget.lua b/Source/FrameHandlers/TargetOfTarget.lua index 4221357..1ce653a 100644 --- a/Source/FrameHandlers/TargetOfTarget.lua +++ b/Source/FrameHandlers/TargetOfTarget.lua @@ -15,6 +15,5 @@ function addon:initTargetOfTarget() end end) addon:registerSecureFrameHideable(TargetFrameToT) - addon.registerAnchorToDropdown(TargetFrameToT) end end diff --git a/Source/RegisterFrame.lua b/Source/RegisterFrame.lua index 5c3d80f..93f1771 100644 --- a/Source/RegisterFrame.lua +++ b/Source/RegisterFrame.lua @@ -9,4 +9,5 @@ function addon:registerFrame(frame, ...) if addon.db.global.EMEOptions.allowSetCoordinates then lib:RegisterCoordinates(frame) end + addon.registerAnchorToDropdown(frame) end \ No newline at end of file From 84419adf3207f7368311e6787e0ff7111eda8473 Mon Sep 17 00:00:00 2001 From: Teelo <49792789+teelolws@users.noreply.github.com> Date: Thu, 7 May 2026 19:45:29 +1200 Subject: [PATCH 2/2] Anchor to option now disabled by default, enable via interface options --- Source/Locales/enus.lua | 2 ++ Source/Options.lua | 6 ++++++ Source/RegisterFrame.lua | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Locales/enus.lua b/Source/Locales/enus.lua index 00d2de8..8d81fa8 100644 --- a/Source/Locales/enus.lua +++ b/Source/Locales/enus.lua @@ -81,6 +81,8 @@ L["TALKING_HEAD_DD_OPT_2"] = "Dialog only, keep sound" L["TALKING_HEAD_DD_OPT_3"] = "Always, and mute sound" L["TALKING_HEAD_DD_OPT_4"] = "In Combat, but keep sound" L["TALKING_HEAD_DD_OPT_5"] = "In combat, and mute sound" +L["OPTION_ANCHOR_TO_NAME"] = "Anchor To" +L["OPTION_ANCHOR_TO_DESC"] = "Enables ability to change anchoring for all custom frames" -- Personal Resource Display L["Health Bar"] = true diff --git a/Source/Options.lua b/Source/Options.lua index 21bd76c..18a56e7 100644 --- a/Source/Options.lua +++ b/Source/Options.lua @@ -80,6 +80,7 @@ local defaults = { targetFrameResize = false, chatFrame = false, battlefieldMap = false, + anchorToEnabled = false, }, QueueStatusButton = {}, TotemFrame = {}, @@ -316,6 +317,11 @@ local options = { desc = L["OPTION_ALLOW_SET_COORDS_DESC"], type = "toggle", }, + anchorToEnabled = { + name = L["OPTION_ANCHOR_TO_NAME"], + desc = L["OPTION_ANCHOR_TO_DESC"], + type = "toggle", + }, playerFrame = { name = HUD_EDIT_MODE_PLAYER_FRAME_LABEL, desc = string.format(L["TOGGLE_ADDITIONAL_OPTIONS_SUPPORT_STRING"], HUD_EDIT_MODE_PLAYER_FRAME_LABEL), diff --git a/Source/RegisterFrame.lua b/Source/RegisterFrame.lua index 93f1771..fd88f3d 100644 --- a/Source/RegisterFrame.lua +++ b/Source/RegisterFrame.lua @@ -5,9 +5,13 @@ local lib = LibStub:GetLibrary("EditModeExpanded-1.0") -- A simple wrapper for lib:RegisterFrame to also call RegisterCoordinates if that option is enabled function addon:registerFrame(frame, ...) + local system = frame.system lib:RegisterFrame(frame, ...) if addon.db.global.EMEOptions.allowSetCoordinates then lib:RegisterCoordinates(frame) end - addon.registerAnchorToDropdown(frame) + -- don't apply anchor to, to system frames + if (not system) and addon.db.global.EMEOptions.anchorToEnabled then + addon.registerAnchorToDropdown(frame) + end end \ No newline at end of file