diff --git a/MoveAnything/Bindings.xml b/MoveAnything/Bindings.xml
new file mode 100644
index 0000000..8e866c6
--- /dev/null
+++ b/MoveAnything/Bindings.xml
@@ -0,0 +1,29 @@
+
+
+ MovAny:ToggleGUI()
+
+
+ MovAny:SafeMoveFrameAtCursor()
+
+
+ MovAny:SafeHideFrameAtCursor()
+
+
+ MovAny:SafeResetFrameAtCursor()
+
+
+ MovAny:MoveFrameAtCursor()
+
+
+ MovAny:HideFrameAtCursor()
+
+
+ MovAny:ResetFrameAtCursor()
+
+
+ MovAny:SyncAllFrames()
+
+
+ MovAny:DebugFrameAtCursor()
+
+
\ No newline at end of file
diff --git a/MoveAnything/MinimapMaskSquare.tga b/MoveAnything/MinimapMaskSquare.tga
new file mode 100644
index 0000000..e06f1e5
Binary files /dev/null and b/MoveAnything/MinimapMaskSquare.tga differ
diff --git a/MoveAnything/MoveAnything.lua b/MoveAnything/MoveAnything.lua
new file mode 100644
index 0000000..5f4d7ae
--- /dev/null
+++ b/MoveAnything/MoveAnything.lua
@@ -0,0 +1,5636 @@
+--[[
+ MoveAnything 3.3-9.1 (dev-13) by Wagthaa @ Earthen Ring EU
+
+ Earlier versions were developed by:
+ MoveAnything! V.2.66 by Vincent
+ MoveAnything! vJ.11000.2 by Jason
+ MA! 1.12 by Skrag
+]]
+
+local addonname, MOVANY = ...
+local MAOptions
+
+local function void() end
+
+-- X: http://lua-users.org/wiki/CopyTable
+local function tdeepcopy(object)
+ local lookup_table = {}
+ local function _copy(object)
+ if type(object) ~= "table" then
+ return object
+ elseif lookup_table[object] then
+ return lookup_table[object]
+ end
+ local new_table = {}
+ lookup_table[object] = new_table
+ for index, value in pairs(object) do
+ new_table[_copy(index)] = _copy(value)
+ end
+ return setmetatable(new_table, getmetatable(object))
+ end
+ return _copy(object)
+end
+
+local function tcopy(object)
+ if type(object) ~= "table" then
+ return object
+ end
+ local new_table = {}
+ for index, value in pairs(object) do
+ new_table[index] = value
+ end
+ return setmetatable(new_table, getmetatable(object))
+end
+
+local function tlen(t)
+ local i = 0
+ if t ~= nil then
+ for k in pairs(t) do
+ i = i + 1
+ end
+ end
+ return i
+end
+
+local function dbg(s)
+ maPrint(s)
+end
+
+MADB = {}
+
+MovAny = {
+ guiLines = -1,
+ resetConfirm = "",
+ bagFrames = {},
+ cats = {},
+ customCat = nil,
+ defFrames = {},
+ frames = {},
+ framesCount = 0,
+ framesIdx = {},
+ framesUnsupported = {},
+ initRun = nil,
+ lastFrameName = nil,
+ lAllowedTypes = {
+ Frame = "Frame",
+ FontString = "FontString",
+ Texture = "Texture",
+ Button = "Button",
+ CheckButton = "CheckButton",
+ StatusBar = "StatusBar",
+ GameTooltip = "GameTooltip",
+ MessageFrame = "MessageFrame",
+ PlayerModel = "PlayerModel",
+ ColorSelect = "ColorSelect",
+ EditBox = "EbitBox",
+ },
+ lDisallowedFrames = {
+ UIParent = "UIParent",
+ WorldFrame = "WorldFrame",
+ CinematicFrame = "CinematicFrame",
+ },
+ lDelayedSync = {
+ PlayerTalentFrame = "PlayerTalentFrame",
+ },
+ lCreateBeforeInteract = {
+ AchievementAlertFrame1 = "AchievementAlertFrameTemplate",
+ AchievementAlertFrame2 = "AchievementAlertFrameTemplate",
+ GroupLootFrame1 = "GroupLootFrameTemplate",
+ GroupLootFrame2 = "GroupLootFrameTemplate",
+ GroupLootFrame3 = "GroupLootFrameTemplate",
+ GroupLootFrame4 = "GroupLootFrameTemplate",
+ },
+ lRunOnceBeforeInteract = {
+ AchievementAlertFrame1 = AchievementFrame_LoadUI,
+ AchievementAlertFrame2 = AchievementFrame_LoadUI,
+ --[[ -- enable the following to auto load standard ui sub addons, will initially use more memory but will avoid the small hickups when they eventually do load. also makes more standard frames available for interaction
+ AuctionFrame = AuctionFrame_LoadUI,
+ BattlefieldMinimap = BattlefieldMinimap_LoadUI,
+ BarberShopFrame = function() BarberShopFrame_LoadUI() ShowUIPanel(BarberShopFrame) HideUIPanel(BarberShopFrame) end,
+ CalendarFrame = Calendar_LoadUI,
+ ClassTrainerFrame = ClassTrainerFrame_LoadUI,
+ GMSurveyFrame = GMSurveyFrame_LoadUI,
+ GuildBankFrame = GuildBankFrame_LoadUI,
+ InspectFrame = InspectFrame_LoadUI,
+ PlayerTalentFrame = TalentFrame_LoadUI,
+ MacroFrame = MacroFrame_LoadUI,
+ TradeSkillFrame = TradeSkillFrame_LoadUI,
+ TimeManagerClockButton = TimeManager_LoadUI,
+ --]]
+ PlayerTalentFrame = function()
+ TalentFrame_LoadUI()
+ if PlayerTalentFrame_Toggle then
+ hooksecurefunc("PlayerTalentFrame_Toggle", MovAny.hPlayerTalentFrame_Toggle)
+ end
+ end,
+ ReputationWatchBar = function()
+ TalentFrame_LoadUI()
+ if ReputationWatchBar_Update then
+ hooksecurefunc("ReputationWatchBar_Update", MovAny.hReputationWatchBar_Update)
+ end
+ end,
+ QuestLogDetailFrame = function()
+ if not QuestLogDetailFrame:IsShown() then
+ ShowUIPanel(QuestLogDetailFrame)
+ HideUIPanel(QuestLogDetailFrame)
+ end
+ end,
+ },
+ lRunBeforeInteract = {
+ MainMenuBar = function ()
+ if not MovAny.frameOptions["VehicleMenuBar"] or not MovAny.frameOptions["VehicleMenuBar"].pos then
+ local v = _G["VehicleMenuBar"]
+ v:ClearAllPoints()
+ v:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", UIParent:GetWidth()/2 - v:GetWidth()/2, 0)
+ end
+ end,
+ MultiBarLeft = function()
+ if MovAny:IsModified("MultiBarLeftHorizontalMover") then
+ MovAny:ResetFrame("MultiBarLeftHorizontalMover")
+ end
+ end,
+ MultiBarRight = function()
+ if MovAny:IsModified("MultiBarRightHorizontalMover") then
+ MovAny:ResetFrame("MultiBarRightHorizontalMover")
+ end
+ end,
+ VehicleMenuBarActionButtonFrame = function()
+ VehicleMenuBarActionButtonFrame:SetHeight(VehicleMenuBarActionButton1:GetHeight() + 2)
+ VehicleMenuBarActionButtonFrame:SetWidth((VehicleMenuBarActionButton1:GetWidth() + 2) * VEHICLE_MAX_ACTIONBUTTONS)
+ end,
+ LFDSearchStatus = function()
+ local opt = MovAny:GetFrameOptions("LFDSearchStatus")
+ if not opt or not opt.frameStrata then
+ LFDSearchStatus:SetFrameStrata("TOOLTIP")
+ end
+ end,
+ },
+ lRunAfterInteract = {},
+ lEnableMouse = {
+ WatchFrame,
+ DurabilityFrame,
+ CastingBarFrame,
+ WorldStateScoreFrame,
+ WorldStateAlwaysUpFrame,
+ AlwaysUpFrame1,
+ AlwaysUpFrame2,
+ WorldStateCaptureBar1,
+ VehicleMenuBar,
+ TargetFrameSpellBar,
+ FocusFrameSpellBar,
+ MirrorTimer1,
+ MiniMapInstanceDifficulty,
+ },
+ lSimpleHide = {},
+ lTranslate = {
+ minimap = "MinimapCluster",
+ tooltip = "TooltipMover",
+ player = "PlayerFrame",
+ target = "TargetFrame",
+ tot = "TargetFrameToT",
+ targetoftarget = "TargetFrameToT",
+ pet = "PetFrame",
+ focus = "FocusFrame",
+ bags = "BagButtonsMover",
+ keyring = "KeyRingFrame",
+ castbar = "CastingBarFrame",
+ buffs = "PlayerBuffsMover",
+ debuffs = "PlayerDebuffsMover",
+ GameTooltip = "TooltipMover",
+ ShapeshiftBarFrame = "ShapeshiftButtonsMover",
+ },
+ lTranslateSec = {
+ PVPFrame = "PVPParentFrame",
+ ShapeshiftBarFrame = "ShapeshiftButtonsMover",
+ BuffFrame = "PlayerBuffsMover",
+ ConsolidatedBuffFrame = "PlayerBuffsMover",
+ },
+ lHideOnScale = {
+ ["MainMenuExpBar"] = {
+ MainMenuXPBarTexture0,
+ MainMenuXPBarTexture1,
+ MainMenuXPBarTexture2,
+ MainMenuXPBarTexture3,
+ ExhaustionTick,
+ ExhaustionTickNormal,
+ ExhaustionTickHighlight,
+ ExhaustionLevelFillBar,
+ MainMenuXPBarTextureLeftCap,
+ MainMenuXPBarTextureRightCap,
+ MainMenuXPBarTextureMid,
+ MainMenuXPBarDiv1,
+ MainMenuXPBarDiv2,
+ MainMenuXPBarDiv3,
+ MainMenuXPBarDiv4,
+ MainMenuXPBarDiv5,
+ MainMenuXPBarDiv6,
+ MainMenuXPBarDiv7,
+ MainMenuXPBarDiv8,
+ MainMenuXPBarDiv9,
+ MainMenuXPBarDiv10,
+ MainMenuXPBarDiv11,
+ MainMenuXPBarDiv12,
+ MainMenuXPBarDiv13,
+ MainMenuXPBarDiv14,
+ MainMenuXPBarDiv15,
+ MainMenuXPBarDiv16,
+ MainMenuXPBarDiv17,
+ MainMenuXPBarDiv18,
+ MainMenuXPBarDiv19,
+ },
+ ["ReputationWatchBar"] = {
+ ReputationWatchBarTexture0,
+ ReputationWatchBarTexture1,
+ ReputationWatchBarTexture2,
+ ReputationWatchBarTexture3,
+ ReputationXPBarTexture0,
+ ReputationXPBarTexture1,
+ ReputationXPBarTexture2,
+ ReputationXPBarTexture3,
+ },
+ },
+ lLinkedScaling = {
+ ["BasicActionButtonsMover"] = {
+ ActionBarDownButton = "ActionBarDownButton",
+ ActionBarUpButton = "ActionBarUpButton",
+ },
+ ["ReputationWatchBar"] = {
+ ReputationWatchStatusBar = "ReputationWatchStatusBar",
+ },
+ ["PlayerFrame"] = {
+ ComboFrame = "ComboFrame",
+ }
+ },
+ rendered = nil,
+ nextFrameIdx = 1,
+ pendingActions = {},
+ pendingFrames = {},
+ SCROLL_HEIGHT = 24,
+ currentMover = nil,
+ moverPrefix = "MAMover",
+ moverNextId = 1,
+ movers = {},
+ frameEditors = {},
+ DDMPointList = {
+ {text = "Top Left", value = "TOPLEFT"},
+ {text = "Top", value = "TOP"},
+ {text = "Top Right", value = "TOPRIGHT"},
+ {text = "Left", value = "LEFT"},
+ {text = "Center", value = "CENTER"},
+ {text = "Right", value = "RIGHT"},
+ {text = "Bottom Left", value = "BOTTOMLEFT"},
+ {text = "Bottom", value = "BOTTOM"},
+ {text = "Bottom Right", value = "BOTTOMRIGHT"},
+ },
+ DDMStrataList = {
+ --{text = "Parent", value = "PARENT"},
+ {text = "Background", value = "BACKGROUND"},
+ {text = "Low", value = "LOW"},
+ {text = "Medium", value = "MEDIUM"},
+ {text = "High", value = "HIGH"},
+ {text = "Dialog", value = "DIALOG"},
+ {text = "Fullscreen", value = "FULLSCREEN"},
+ {text = "Fullscreen Dialog", value = "FULLSCREEN_DIALOG"},
+ {text = "Tooltip", value = "TOOLTIP"},
+ },
+ ScaleWH = {
+ MainMenuExpBar = "MainMenuExpBar",
+ ReputationWatchBar = "ReputationWatchBar",
+ ReputationWatchStatusBar = "ReputationWatchStatusBar",
+ WatchFrame = "WatchFrame",
+ },
+ DetachFromParent = {
+ MainMenuBarPerformanceBarFrame = "UIParent",
+ TargetofFocusFrame = "UIParent",
+ PetFrame = "UIParent",
+ PartyMemberFrame1PetFrame = "UIParent",
+ PartyMemberFrame2PetFrame = "UIParent",
+ PartyMemberFrame3PetFrame = "UIParent",
+ PartyMemberFrame4PetFrame = "UIParent",
+ DebuffButton1 = "UIParent",
+ ReputationWatchBar = "UIParent",
+ MainMenuExpBar = "UIParent",
+ TimeManagerClockButton = "UIParent",
+ --[[VehicleMenuBarHealthBar = "UIParent",
+ VehicleMenuBarLeaveButton = "UIParent",
+ VehicleMenuBarPowerBar = "UIParent",]]
+ MultiCastActionBarFrame = "UIParent",
+ MainMenuBarRightEndCap = "UIParent",
+ MainMenuBarMaxLevelBar = "UIParent",
+ TargetFrameSpellBar = "UIParent",
+ FocusFrameSpellBar = "UIParent",
+ --LFDSearchStatus = "UIParent",
+ MultiBarBottomLeft = "UIParent",
+ MANudger = "UIParent",
+ MultiBarBottomRight = "UIParent",
+ MultiBarBottomLeft = "UIParent",
+ PlayerDebuffsMover = "UIParent",
+ },
+ HideList = {
+ VehicleMenuBar = {
+ {"VehicleMenuBar", "ARTWORK","BACKGROUND","BORDER","OVERLAY"},
+ {"VehicleMenuBarArtFrame", "ARTWORK","BACKGROUND","BORDER","OVERLAY"},
+ {"VehicleMenuBarActionButtonFrame", "ARTWORK","BACKGROUND","BORDER","OVERLAY"},
+ },
+ MAOptions = {
+ {"MAOptions", "ARTWORK","BORDER"},
+ },
+ GameMenuFrame = {
+ {"GameMenuFrame", "BACKGROUND","ARTWORK","BORDER"},
+ },
+ MainMenuBar = {
+ {"MainMenuBarArtFrame", "BACKGROUND","ARTWORK"},
+ {"PetActionBarFrame", "OVERLAY"},
+ {"ShapeshiftBarFrame", "OVERLAY"},
+ {"MainMenuBar", "DISABLEMOUSE"},
+ {"BonusActionBarFrame", "OVERLAY", "DISABLEMOUSE"},
+ },
+ MinimapBackdrop = {
+ {"MinimapBackdrop", "ARTWORK"},
+ },
+ },
+ HideUsingWH = {},
+ MoveOnlyWhenVisible = {
+ WorldStateCaptureBar1 = "WorldStateCaptureBar1",
+ AlwaysUpFrame1 = "AlwaysUpFrame1",
+ AlwaysUpFrame2 = "AlwaysUpFrame2",
+ VehicleMenuBarHealthBar = "VehicleMenuBarHealthBar",
+ VehicleMenuBarPowerBar = "VehicleMenuBarPowerBar",
+ ArenaEnemyFrame1 = "ArenaEnemyFrame1",
+ ArenaEnemyFrame2 = "ArenaEnemyFrame2",
+ ArenaEnemyFrame3 = "ArenaEnemyFrame3",
+ ArenaEnemyFrame4 = "ArenaEnemyFrame4",
+ ArenaEnemyFrame5 = "ArenaEnemyFrame5",
+ },
+ NoAlpha = {
+ CastingBarFrame = "CastingBarFrame",
+ TargetFrameSpellBar = "TargetFrameSpellBar",
+ FocusFrameSpellBar = "FocusFrameSpellBar",
+ MinimapBackdrop = "MinimapBackdrop",
+ MinimapNorthTag = "MinimapNorthTag",
+ },
+ NoHide = {
+ FramerateLabel = "FramerateLabel",
+ UIPanelMover1 = "UIPanelMover1",
+ UIPanelMover2 = "UIPanelMover2",
+ WorldMapFrame = "WorldMapFrame",
+ },
+ NoMove = {
+ PVPFrame = "PVPFrame",
+ MinimapBackdrop = "MinimapBackdrop",
+ MinimapNorthTag = "MinimapNorthTag",
+ WorldMapFrame = "WorldMapFrame",
+ },
+ NoScale = {
+ WorldStateAlwaysUpFrame = "WorldStateAlwaysUpFrame",
+ MainMenuBarArtFrame = "MainMenuBarArtFrame",
+ MainMenuBarMaxLevelBar = "MainMenuBarMaxLevelBar",
+ MinimapBorderTop = "MinimapBorderTop",
+ MinimapBackdrop = "MinimapBackdrop",
+ MinimapNorthTag = "MinimapNorthTag",
+ WorldMapFrame = "WorldMapFrame",
+ },
+ NoReparent = {
+ TargetFrameSpellBar = "TargetFrameSpellBar",
+ FocusFrameSpellBar = "FocusFrameSpellBar",
+ VehicleMenuBarHealthBar = "VehicleMenuBarHealthBar",
+ VehicleMenuBarLeaveButton = "VehicleMenuBarLeaveButton",
+ VehicleMenuBarPowerBar = "VehicleMenuBarPowerBar",
+ },
+ NoUnanchorRelatives= {
+ FramerateLabel = "FramerateLabel",
+ WorldStateAlwaysUpFrame = "WorldStateAlwaysUpFrame",
+ },
+ NoUnanchoring = {
+ BuffFrame = "BuffFrame",
+ RuneFrame = "RuneFrame",
+ TotemFrame = "TotemFrame",
+ ComboFrame = "ComboFrame",
+ MANudger = "MANudger",
+ TimeManagerClockButton = "TimeManagerClockButton",
+ TemporaryEnchantFrame = "TemporaryEnchantFrame",
+ PartyMember1DebuffsMover = "PartyMember1DebuffsMover",
+ PartyMember2DebuffsMover = "PartyMember2DebuffsMover",
+ PartyMember3DebuffsMover = "PartyMember3DebuffsMover",
+ PartyMember4DebuffsMover = "PartyMember4DebuffsMover",
+ PetDebuffsMover = "PetDebuffsMover",
+ TargetBuffsMover = "TargetBuffsMover",
+ TargetDebuffsMover = "TargetDebuffsMover",
+ FocusDebuffsMover = "FocusDebuffsMover",
+ TargetFrameToTDebuffsMover = "TargetFrameToTDebuffsMover",
+ },
+ lAllowedMAFrames = {
+ MAOptions = "MAOptions",
+ MANudger = "MANudger",
+ GameMenuButtonMoveAnything = "GameMenuButtonMoveAnything",
+ },
+ DefaultFrameList = {
+ {"", "Achievements & Quests"},
+ {"AchievementFrame", "Achievements"},
+ {"AchievementAlertFrame1", "Achievement Alert 1"},
+ {"AchievementAlertFrame2", "Achievement Alert 2"},
+ {"WatchFrame", "Tracker"},
+ {"QuestLogDetailFrame", "Quest Details"},
+ {"QuestLogFrame", "Quest Log"},
+ {"QuestTimerFrame", "Quest Timer"},
+
+ {"", "Action Bars"},
+ {"BasicActionButtonsMover", "Action Bar"},
+ {"BasicActionButtonsVerticalMover", "Action Bar - Vertical"},
+ {"MultiBarBottomLeft", "Bottom Left Action Bar"},
+ {"MultiBarBottomRight", "Bottom Right Action Bar"},
+ {"MultiBarRight", "Right Action Bar"},
+ {"MultiBarRightHorizontalMover", "Right Action Bar - Horizontal"},
+ {"MultiBarLeft", "Right Action Bar 2"},
+ {"MultiBarLeftHorizontalMover", "Right Action Bar 2 - Horizontal"},
+ {"MainMenuBarPageNumber", "Action Bar Page Number"},
+ {"ActionBarUpButton", "Action Bar Page Up"},
+ {"ActionBarDownButton", "Action Bar Page Down"},
+ {"PetActionButtonsMover", "Pet Action Bar"},
+ {"PetActionButtonsVerticalMover", "Pet Action Bar - Vertical"},
+ {"ShapeshiftButtonsMover", "Stance / Aura / Shapeshift Buttons"},
+ {"ShapeshiftButtonsVerticalMover", "Stance / Aura / Shapeshift - Vertical"},
+ {"MultiCastActionBarFrame", "Timers"},
+
+ {"", "Arena"},
+ {"ArenaEnemyFrame1", "Arena Enemy 1"},
+ {"ArenaEnemyFrame2", "Arena Enemy 2"},
+ {"ArenaEnemyFrame3", "Arena Enemy 3"},
+ {"ArenaEnemyFrame4", "Arena Enemy 4"},
+ {"ArenaEnemyFrame5", "Arena Enemy 5"},
+ {"PVPTeamDetails", "Arena Team Details"},
+ {"ArenaFrame", "Arena Queue List"},
+ {"ArenaRegistrarFrame", "Arena Registrar"},
+ {"PVPBannerFrame", "Arena Banner"},
+
+ {"", "Bags"},
+ {"BagButtonsMover", "Bag Buttons"},
+ {"BagButtonsVerticalMover", "Bag Buttons - Vertical"},
+ {"BagFrame1", "Backpack"},
+ {"BagFrame2", "Bag 1"},
+ {"BagFrame3", "Bag 2"},
+ {"BagFrame4", "Bag 3"},
+ {"BagFrame5", "Bag 4"},
+ {"KeyRingFrame", "Key Ring"},
+ {"CharacterBag0Slot", "Bag Button 1"},
+ {"CharacterBag1Slot", "Bag Button 2"},
+ {"CharacterBag2Slot", "Bag Button 3"},
+ {"CharacterBag3Slot", "Bag Button 4"},
+ {"KeyRingButton", "Key Ring Button"},
+
+ {"", "Bank"},
+ {"BankFrame", "Bank"},
+ {"BankBagFrame1", "Bank Bag 1"},
+ {"BankBagFrame2", "Bank Bag 2"},
+ {"BankBagFrame3", "Bank Bag 3"},
+ {"BankBagFrame4", "Bank Bag 4"},
+ {"BankBagFrame5", "Bank Bag 5"},
+ {"BankBagFrame6", "Bank Bag 6"},
+ {"BankBagFrame7", "Bank Bag 7"},
+
+ {"", "Battlegrounds & PvP"},
+ {"PVPParentFrame", "PVP Window"},
+ {"BattlefieldMinimap", "Battlefield Minimap"},
+ {"BattlefieldFrame", "Battleground Queue"},
+ {"WorldStateScoreFrame", "Battleground Score"},
+ {"WorldStateCaptureBar1", "Flag Capture Timer Bar"},
+
+ {"", "Bottom Bar"},
+ {"MainMenuBar", "Main Bar"},
+ {"MainMenuBarLeftEndCap", "Left Gryphon"},
+ {"MainMenuBarRightEndCap", "Right Gryphon"},
+ {"MainMenuExpBar", "Experience Bar"},
+ {"MainMenuBarMaxLevelBar", "Max Level Bar Filler"},
+ {"ReputationWatchBar", "Reputation Tracker Bar"},
+ {"MicroButtonsMover", "Micro Menu"},
+ {"MicroButtonsVerticalMover", "Micro Menu - Vertical"},
+ {"MainMenuBarVehicleLeaveButton", "Leave Vehicle Button"},
+
+ {"", "Dungeons & Raids"},
+ {"LFDParentFrame", "Dungeon Finder"},
+ {"DungeonCompletionAlertFrame1", "Dungeon Completion Alert"},
+ {"LFDSearchStatus", "Dungeon Search Status Tooltip"},
+ {"LFDDungeonReadyDialog", "Dungeon Ready Dialog"},
+ {"LFDDungeonReadyPopup", "Dungeon Ready Popup"},
+ {"LFDDungeonReadyStatus", "Dungeon Ready Status"},
+ {"LFDRoleCheckPopup", "Dungeon Role Check Popup"},
+ {"RaidBossEmoteFrame", "Raid Boss Emotes"},
+ {"Boss1TargetFrame", "Raid Boss Health Bar 1"},
+ {"Boss2TargetFrame", "Raid Boss Health Bar 2"},
+ {"Boss3TargetFrame", "Raid Boss Health Bar 3"},
+ {"Boss4TargetFrame", "Raid Boss Health Bar 4"},
+ {"LFRParentFrame", "Raid Browser"},
+ {"RaidPullout1", "Raid Group Pullout 1"},
+ {"RaidPullout2", "Raid Group Pullout 2"},
+ {"RaidPullout3", "Raid Group Pullout 3"},
+ {"RaidPullout4", "Raid Group Pullout 4"},
+ {"RaidPullout5", "Raid Group Pullout 5"},
+ {"RaidPullout6", "Raid Group Pullout 6"},
+ {"RaidPullout7", "Raid Group Pullout 7"},
+ {"RaidPullout8", "Raid Group Pullout 8"},
+ {"RaidWarningFrame", "Raid Warnings"},
+
+ {"", "Focus"},
+ {"FocusFrame", "Focus"},
+ {"FocusFrameSpellBar", "Focus Casting Bar"},
+ {"FocusDebuffsMover", "Focus Debuffs"},
+ {"FocusFrameToT", "Target of Focus"},
+ {"FocusFrameToTDebuff1", "Target of Focus Debuffs"},
+
+ {"", "Game Menu"},
+ {"GameMenuFrame", "Game Menu"},
+ {"VideoOptionsFrame", "Video Options"},
+ {"AudioOptionsFrame", "Sound & Voice Options"},
+ {"InterfaceOptionsFrame", "Interface Options"},
+ {"KeyBindingFrame", "Keybinding Options"},
+
+ {"", "Guild"},
+ {"GuildBankFrame", "Guild Bank"},
+ {"GuildInfoFrame", "Guild Info"},
+ {"GuildMemberDetailFrame", "Guild Member Details"},
+ {"GuildControlPopupFrame", "Guild Control"},
+ {"GuildRegistrarFrame", "Guild Registrar"},
+
+ {"", "Info Panels"},
+ {"UIPanelMover1", "Generic Info Panel 1"},
+ {"UIPanelMover2", "Generic Info Panel 2"},
+ {"CharacterFrame", "Character / Pet / Reputation / Skills / Currency"},
+ {"LFDParentFrame", "Dungeon Finder"},
+ {"TaxiFrame", "Flight Paths"},
+ {"FriendsFrame", "Social - Friends / Who / Guild / Chat / Raid"},
+ {"GossipFrame", "Gossip"},
+ {"InspectFrame", "Inspect"},
+ {"LFRParentFrame", "Looking For Raid"},
+ {"MacroFrame", "Macros"},
+ {"MailFrame", "Mailbox"},
+ {"MerchantFrame", "Merchant"},
+ {"OpenMailFrame", "Open Mail"},
+ {"PetStableFrame", "Pet Stable"},
+ {"SpellBookFrame", "Spell Book"},
+ {"TabardFrame", "Tabard Design"},
+ {"PlayerTalentFrame", "Talents"},
+ {"TradeFrame", "Trade"},
+ {"TradeSkillFrame", "Trade Skills"},
+ {"ClassTrainerFrame", "Trainer"},
+ {"DressUpFrame", "Wardrobe"},
+
+ {"", "Loot"},
+ {"LootFrame", "Loot"},
+ {"GroupLootFrame1", "Loot Roll 1"},
+ {"GroupLootFrame2", "Loot Roll 2"},
+ {"GroupLootFrame3", "Loot Roll 3"},
+ {"GroupLootFrame4", "Loot Roll 4"},
+
+ {"", "Minimap"},
+ {"MinimapCluster", "MiniMap"},
+ {"MinimapZoneTextButton", "Zone Text"},
+ {"MinimapBorderTop", "Top Border"},
+ {"MinimapBackdrop", "Round Border"},
+ {"MinimapNorthTag", "North Indicator"},
+ {"MiniMapBattlefieldFrame", "Battleground Button"},
+ {"GameTimeFrame", "Calendar Button"},
+ {"TimeManagerClockButton", "Clock Button"},
+ {"MiniMapInstanceDifficulty", "Dungeon Difficulty"},
+ {"MiniMapLFGFrame", "LFD/R Button"},
+ {"LFDSearchStatus", "LFD/R Search Status"},
+ {"MiniMapMailFrame", "Mail Notification"},
+ {"MiniMapTracking", "Tracking Button"},
+ {"MinimapZoomIn", "Zoom In Button"},
+ {"MinimapZoomOut", "Zoom Out Button"},
+ {"MiniMapWorldMapButton", "World Map Button"},
+
+ {"", "Miscellaneous"},
+ {"TimeManagerFrame", "Alarm Clock"},
+ {"AuctionFrame", "Auction House"},
+ {"BarberShopFrame", "Barber Shop"},
+ {"MirrorTimer1", "Breath/Fatigue Bar"},
+ {"CalendarFrame", "Calendar"},
+ {"CalendarViewEventFrame", "Calendar Event"},
+ {"CastingBarFrame", "Casting Bar"},
+ {"ChatConfigFrame", "Chat Channel Configuration"},
+ {"ColorPickerFrame", "Color Picker"},
+ {"TokenFramePopup", "Currency Options"},
+ {"ItemRefTooltip", "Chat Popup"},
+ --{"DebuffFrame1", "Debuffs"},
+ {"DurabilityFrame", "Durability Figure"},
+ {"UIErrorsFrame", "Errors & Warnings"},
+ {"FramerateLabel", "Framerate"},
+ {"GearManagerDialog", "Equipment Manager"},
+ {"ItemSocketingFrame", "Gem Socketing"},
+ {"HelpFrame", "GM Help"},
+ {"MacroPopupFrame", "Macro Name & Icon"},
+ {"StaticPopup1", "Static Popup 1"},
+ {"StaticPopup2", "Static Popup 2"},
+ {"StaticPopup3", "Static Popup 3"},
+ {"StaticPopup4", "Static Popup 4"},
+ {"ItemTextFrame", "Reading Materials"},
+ {"ReputationDetailFrame", "Reputation Details"},
+ {"TemporaryEnchantFrame", "Temporary item buffs"},
+ {"TicketStatusFrame", "Ticket Status"},
+ {"TooltipMover", "Tooltip"},
+ {"BagItemTooltipMover", "Tooltip - Bag Item"},
+ {"WorldStateAlwaysUpFrame", "Top Center Status Display"},
+ --{"TutorialFrame", "Tutorials"},
+ --{"TutorialFrameAlertButton", "Tutorials Alert Button"},
+ {"VoiceChatTalkers", "Voice Chat Talkers"},
+ {"ZoneTextFrame", "Zoning Zone Text"},
+ {"SubZoneTextFrame", "Zoning Subzone Text"},
+
+ {"", "MoveAnything"},
+ {"MAOptions", "MoveAnything Window"},
+ {"MANudger", "MoveAnything Nudger"},
+ {"GameMenuButtonMoveAnything", "MoveAnything Game Menu Button"},
+
+ {"", "Party"},
+ {"PartyMemberFrame1", "Party Member 1"},
+ {"PartyMember1DebuffsMover", "Party Member 1 Debuffs"},
+ {"PartyMemberFrame2", "Party Member 2"},
+ {"PartyMember2DebuffsMover", "Party Member 2 Debuffs"},
+ {"PartyMemberFrame3", "Party Member 3"},
+ {"PartyMember3DebuffsMover", "Party Member 3 Debuffs"},
+ {"PartyMemberFrame4", "Party Member 4"},
+ {"PartyMember4DebuffsMover", "Party Member 4 Debuffs"},
+
+ {"", "Pets"},
+ {"PetFrame", "Pet"},
+ {"PetDebuffsMover", "Pet Debuffs"},
+ {"PartyMemberFrame1PetFrame", "Party Pet 1"},
+ {"PartyMemberFrame2PetFrame", "Party Pet 2"},
+ {"PartyMemberFrame3PetFrame", "Party Pet 3"},
+ {"PartyMemberFrame4PetFrame", "Party Pet 4"},
+
+ {"", "Player"},
+ {"PlayerFrame", "Player"},
+ {"PlayerBuffsMover", "Player Buffs"},
+ {"ConsolidatedBuffsTooltip", "Player Buffs - Consolidated Tooltip"},
+ {"PlayerDebuffsMover", "Player Debuffs"},
+ {"RuneFrame", "Deathknight Runes"},
+ {"TotemFrame", "Shaman Totem Timers"},
+
+ {"", "Target"},
+ {"TargetFrame", "Target"},
+ {"TargetBuffsMover", "Target Buffs"},
+ {"ComboFrame", "Target Combo Points Display"},
+ {"TargetDebuffsMover", "Target Debuffs"},
+ {"TargetFrameSpellBar", "Target Casting Bar"},
+ {"TargetFrameToT", "Target of Target"},
+ {"TargetFrameToTDebuffsMover", "Target of Target Debuffs"},
+
+ {"", "Vehicle"},
+ {"VehicleMenuBar", "Vehicle Bar"},
+ {"VehicleMenuBarActionButtonFrame", "Vehicle Action Bar"},
+ {"VehicleMenuBarHealthBar", "Vehicle Health Bar"},
+ {"VehicleMenuBarLeaveButton", "Vehicle Leave Button"},
+ {"VehicleMenuBarPowerBar", "Vehicle Power Bar"},
+ {"VehicleSeatIndicator", "Vehicle Seat Indicator"},
+
+ {"", "Custom Frames"},
+ },
+
+
+----------------------------------------------------------------
+--X: hook replacements
+
+ ContainerFrame_GenerateFrame = function (frame, size, id)
+ --dbg("ContainerFrame_GenerateFrame")
+ MovAny:GrabContainerFrame(frame, MovAny:GetBag(id))
+ end,
+
+ CloseAllWindows = function ()
+ local opt, f, fn
+ -- should iterate frameSettings instead
+ for i, v in pairs(MovAny.frames) do
+ fn = v.name
+ if v and v.name and MovAny:IsModified(fn) then
+ opt = MovAny:GetFrameOptions(fn)
+ if opt and opt.UIPanelWindows then
+ f = _G[fn]
+ if f ~= nil and f ~= GameMenuFrame then
+ if f.IsShown and f:IsShown() then
+ if InCombatLockdown() and MovAny:IsProtected(f) then
+ local closure = function(f)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ f:Hide()
+ end
+ end
+ MovAny.pendingActions[fn..":Hide"] = closure(f)
+ else
+ f:Hide()
+ end
+ end
+ end
+ end
+ end
+ end
+ if MADB.closeGUIOnEscape and MAOptions:IsShown() then
+ MAOptions:Hide()
+ end
+ end,
+
+ hCreateFrame = function(frameType, name, parent, inherit)
+ if name and MovAny:IsModified(name) then
+ if MovAny:HookFrame(name) then
+ local f = _G[name]
+ if f and MovAny:IsValidObject(f) then
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ MovAny:ApplyAll(f)
+ else
+ MovAny.pendingFrames[name] = MovAny:GetFrameOptions(name)
+ end
+ end
+ end
+ end
+ end,
+
+ ShowUIPanel = function (f)
+ MovAny:SetLeftFrameLocation()
+ MovAny:SetCenterFrameLocation()
+ end,
+
+ HideUIPanel = function (f)
+ MovAny:SetLeftFrameLocation()
+ MovAny:SetCenterFrameLocation()
+ end,
+
+ hPlayerTalentFrame_Toggle = function()
+ if MovAny:IsModified("PlayerTalentFrame") then
+ MovAny:SyncFrame("PlayerTalentFrame")
+ MovAny.lDelayedSync["PlayerTalentFrame"] = nil
+ end
+ end,
+
+ hReputationWatchBar_Update = function()
+ if MovAny:IsModified("ReputationWatchBar") then
+ MovAny:SyncFrame("ReputationWatchBar")
+ end
+ end,
+
+ CaptureBar_Create = function(id)
+ local f= MovAny.oCaptureBar_Create(id)
+ local opts = MovAny:GetFrameOptions("WorldStateCaptureBar1")
+ if opts then
+ MovAny:ApplyAll(f, opts)
+ end
+ if not opts or not opts.pos then
+ f:ClearAllPoints()
+ f:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, -175)
+ end
+ return f
+ end,
+
+ AchievementAlertFrame_OnLoad = function(f)
+ f.RegisterForClicks = void
+ MovAny.oAchievementAlertFrame_OnLoad(f)
+ local opts = MovAny:GetFrameOptions(f:GetName())
+ if opts then
+ MovAny:ApplyAll(f, opts)
+ end
+ end,
+
+ AchievementAlertFrame_GetAlertFrame = function()
+ local f = MovAny.oAchievementAlertFrame_GetAlertFrame()
+ if not f then
+ return
+ end
+ local opts = MovAny:GetFrameOptions(f:GetName())
+ if opts then
+ MovAny:ApplyAll(f, opts)
+ end
+ return f
+ end,
+}
+
+BINDING_HEADER_MOVEANYTHING = "MoveAnything"
+
+MoveAnything_CustomFrames = {}
+MoveAnything_CharacterSettings = {}
+MoveAnything_UseCharacterSettings = nil
+
+StaticPopupDialogs["MOVEANYTHING_RESET_PROFILE_CONFIRM"] = {
+ text = MOVANY.PROFILE_RESET_CONFIRM,
+ button1 = TEXT(YES),
+ button2 = TEXT(NO),
+ OnAccept = function()
+ MovAny:ResetProfile()
+ end,
+ timeout = 0,
+ exclusive = 0,
+ showAlert = 1,
+ whileDead = 1,
+ hideOnEscape = 1
+}
+
+StaticPopupDialogs["MOVEANYTHING_RESET_ALL_CONFIRM"] = {
+ text = MOVANY.RESET_ALL_CONFIRM,
+ button1 = TEXT(YES),
+ button2 = TEXT(NO),
+ OnAccept = function()
+ MovAny:ResetAllFrames()
+ MovAny_OptionsOnShow()
+ end,
+ timeout = 0,
+ exclusive = 0,
+ showAlert = 1,
+ whileDead = 1,
+ hideOnEscape = 1
+}
+
+function MovAny:Boot()
+ if self.inited then
+ return
+ end
+
+ MAOptions = _G["MAOptions"]
+
+ if not MADB.noMMMW and Minimap:GetScript("OnMouseWheel") == nil then
+ Minimap:SetScript("OnMouseWheel", function(self, dir)
+ if dir < 0 then
+ Minimap_ZoomOut()
+ else
+ Minimap_ZoomIn()
+ end
+ end)
+ Minimap:EnableMouseWheel(true)
+ end
+
+ local autoShowUI = nil
+ if MoveAnything_CharacterSettings == nil then
+ autoShowUI = true
+ end
+
+ self:VerifyData()
+
+ local MADB_Defaults = {
+ autoShowNext = nil,
+ playSound = nil,
+ alwaysShowNudger = nil,
+ frameListRows = 18,
+ }
+
+ for i, v in pairs(MADB_Defaults) do
+ if MADB[i] ~= nil then
+ else
+ MADB[i] = v
+ end
+ end
+
+ MADB.collapsed = true
+
+ if MADB.squareMM then
+ Minimap:SetMaskTexture("Interface\\AddOns\\MoveAnything\\MinimapMaskSquare")
+ end
+
+ self:SetNumRows(MADB.frameListRows, false)
+
+ MAOptionsMoveHeader:SetText(MOVANY.LIST_HEADING_MOVER)
+ MAOptionsHideHeader:SetText(MOVANY.LIST_HEADING_HIDE)
+
+ MAOptionsToggleFrameEditors:SetChecked(true)
+
+ self:ParseData()
+
+ -- hooks
+ if not MADB.dontHookCreateFrame and CreateFrame then
+ hooksecurefunc("CreateFrame", self.hCreateFrame)
+ end
+ if ContainerFrame_GenerateFrame then
+ hooksecurefunc("ContainerFrame_GenerateFrame", self.ContainerFrame_GenerateFrame)
+ end
+ if CloseAllWindows then
+ hooksecurefunc("CloseAllWindows", self.CloseAllWindows)
+ end
+ if ShowUIPanel then
+ hooksecurefunc("ShowUIPanel", self.ShowUIPanel)
+ end
+ if HideUIPanel then
+ hooksecurefunc("HideUIPanel", self.HideUIPanel)
+ end
+ if GameTooltip_SetDefaultAnchor then
+ hooksecurefunc("GameTooltip_SetDefaultAnchor", self.hGameTooltip_SetDefaultAnchor)
+ end
+ if GameTooltip and GameTooltip.SetOwner then
+ hooksecurefunc(GameTooltip, "SetOwner", self.hGameTooltip_SetOwner)
+ end
+ if updateContainerFrameAnchors then
+ hooksecurefunc("updateContainerFrameAnchors", self.hUpdateContainerFrameAnchors)
+ end
+
+ if ExtendedUI and ExtendedUI.CAPTUREPOINT then
+ self.oCaptureBar_Create = ExtendedUI.CAPTUREPOINT.create
+ ExtendedUI.CAPTUREPOINT.create = self.CaptureBar_Create
+ end
+
+ if AchievementAlertFrame_OnLoad then
+ self.oAchievementAlertFrame_OnLoad = AchievementAlertFrame_OnLoad
+ AchievementAlertFrame_OnLoad = self.AchievementAlertFrame_OnLoad
+ end
+
+ if AchievementAlertFrame_GetAlertFrame then
+ self.oAchievementAlertFrame_GetAlertFrame = AchievementAlertFrame_GetAlertFrame
+ AchievementAlertFrame_GetAlertFrame = self.AchievementAlertFrame_GetAlertFrame
+ end
+
+ self.inited = true
+ if MADB.autoShowNext == true then
+ autoShowUI = true
+ MADB.autoShowNext = nil
+ end
+ if autoShowUI == true then
+ MAOptions:Show()
+ end
+end
+
+function MovAny:OnPlayerLogout()
+ if MAOptions:IsShown() then
+ MADB.autoShowNext = true
+ end
+
+ if type(MoveAnything_CustomFrames) == "table" then
+ for i, v in pairs(MoveAnything_CustomFrames) do
+ v.idx = nil
+ v.cat = nil
+ end
+ end
+ MovAny:CleanProfile(MovAny:GetProfileName())
+end
+
+function MovAny:CleanProfile(pn)
+ if pn and type(MoveAnything_CharacterSettings[pn]) == "table" then
+ local f
+ for i, v in pairs(MoveAnything_CharacterSettings[pn]) do
+ f = _G[i]
+ if f and f.SetUserPlaced and (f:IsMovable() or f:IsResizable()) then
+ f:SetUserPlaced(nil)
+ f:SetMovable(nil)
+ end
+ v.ignoreFramePositionManager = nil
+ v.cat = nil
+ v.originalScale = nil
+ v.orgPos = nil
+ v.MANAGED_FRAME = nil
+ v.UIPanelWindows = nil
+ end
+ end
+end
+
+function MovAny:VerifyData()
+ if MoveAnything_CharacterSettings[self:GetProfileName()] == nil then
+ MoveAnything_CharacterSettings[self:GetProfileName()] = {}
+ end
+
+ local fRel
+ local remList = {}
+ for pi, profile in pairs(MoveAnything_CharacterSettings) do
+ --dbg(" cleaning data for "..pi)
+ table.wipe(remList)
+ for fn, opt in pairs(profile) do
+ --dbg(" cleaning "..i)
+ if not opt or opt == nil then
+ break
+ end
+ opt.cat = nil
+
+ opt.originalLeft = nil
+ opt.originalBottom = nil
+
+ opt.originalWidth = nil
+ opt.originalHeight = nil
+
+ opt.orgPos = nil
+
+ opt.originalScale = nil
+
+ opt.MANAGED_FRAME = nil
+ opt.UIPanelWindows = nil
+
+ if opt.scale and opt.scale > 0.991 and opt.scale < 1.009 then
+ opt.scale = 1
+ end
+
+ if opt.x ~= nil and opt.y ~= nil then
+ f = _G[fn]
+
+ fRel = self:ForcedDetachFromParent(fn, opt)
+ if not fRel then
+ p = f and f.GetParent and f:GetParent() ~= nil and f:GetParent():GetName() or "UIParent"
+ end
+
+ opt.pos = {"BOTTOMLEFT", p, "BOTTOMLEFT", opt.x, opt.y}
+ opt.x = nil
+ opt.y = nil
+ else
+ opt.x = nil
+ opt.y = nil
+ end
+ --[[
+ if opt.width and opt.originalWidth and opt.width == opt.originalWidth then
+ opt.width = nil
+ end
+ if opt.height and opt.originalHeight and opt.height == opt.originalHeight then
+ opt.height = nil
+ end
+ ]]
+
+ if not opt.hidden and opt.pos == nil and opt.scale == nil and opt.width == nil and opt.height == nil and opt.alpha == nil then
+ tinsert(remList, fn)
+ end
+ end
+ for i, v in ipairs(remList) do
+ --dbg("pruning "..v.." from "..pi)
+ MoveAnything_CharacterSettings[pi][v] = nil
+ end
+ end
+end
+
+function MovAny:ParseData()
+ local sepLast = nil, sep
+
+ if MADB.noList then
+ for i, v in pairs(self.DefaultFrameList) do
+ if v[1] then
+ if v[1] == "" then
+ sep = {}
+ sep.name = nil
+ sep.helpfulName = v[2]
+ sep.sep = true
+ sep.collapsed = MADB.collapsed
+ sepLast = sep
+ end
+ end
+ end
+ sep.idx = self.nextFrameIdx
+ self.nextFrameIdx = self.nextFrameIdx + 1
+ tinsert(self.frames, sepLast)
+ tinsert(self.cats, sepLast)
+ self.framesCount = self.framesCount + 1
+ else
+ for i, v in pairs(self.DefaultFrameList) do
+ if v[1] then
+ if v[1] == "" then
+ sep = {}
+ sep.idx = self.nextFrameIdx
+ self.nextFrameIdx = self.nextFrameIdx + 1
+ sep.name = nil
+ sep.helpfulName = v[2]
+ sep.sep = true
+ sep.collapsed = MADB.collapsed
+ tinsert(self.frames, sep)
+ tinsert(self.cats, sep)
+ self.framesCount = self.framesCount + 1
+ sepLast = sep
+ else
+ self:AddFrameToMovableList(v[1], v[2], 2)
+ if sepLast then
+ self.frames[ self.nextFrameIdx - 1 ].cat = sepLast
+ end
+ if not self.defFrames[ v[1] ] then
+ self:AddCustomFrameIfNew(v[1])
+ end
+ end
+ end
+ end
+ end
+
+ self.DefaultFrameList = nil
+ self.customCat = sepLast
+
+ self.frameOptions = MoveAnything_CharacterSettings[self:GetProfileName()]
+
+ table.sort(self.frameOptions, function(o1,o2)
+ return o1.name:lower() < o2.name:lower()
+ end)
+ for i, v in pairs(self.frameOptions) do
+ if not self:GetFrame(v.name) then
+ self:AddFrameToMovableList(v.name, v.helpfulName, 1)
+ self.frames[ self.nextFrameIdx - 1 ].cat = self.customCat
+ end
+ end
+end
+
+function MovAny:VerifyFrameData(fn)
+ local opt = self:GetFrameOptions(fn)
+ if opt and (not opt.hidden and opt.pos == nil and opt.scale == nil and opt.width == nil and opt.height == nil and opt.alpha == nil) then
+ --dbg("purging "..fn)
+ MovAny.frameOptions[fn] = nil
+ end
+end
+
+function MovAny:AddCustomFrameIfNew(name)
+ local found = nil
+ for i in pairs(MoveAnything_CustomFrames) do
+ if MoveAnything_CustomFrames[i].name == name then
+ found = i
+ break
+ end
+ end
+ if found == nil then
+ tinsert(MoveAnything_CustomFrames, {name = name, helpfulName = name})
+ self.guiLines = -1
+ self:UpdateGUIIfShown(true)
+ return true
+ end
+end
+
+function MovAny:ForcedDetachFromParent(fn, opt)
+ if self.DetachFromParent[fn] then
+ return self.DetachFromParent[fn]
+ end
+ if UIPanelWindows[fn] then
+ return "UIParent"
+ end
+ if not opt then
+ opt = self.frameOptions[fn]
+ if not opt then
+ return "UIParent"
+ end
+ end
+ if opt.UIPanelWindows then
+ return "UIParent"
+ end
+end
+
+function MovAny:ErrorNotInCombat(f, quiet)
+ if f and self:IsProtected(f) and InCombatLockdown() then
+ if not quiet then
+ maPrint(string.format(MOVANY.FRAME_PROTECTED_DURING_COMBAT, f:GetName()))
+ end
+ return true
+ end
+end
+
+function MovAny:IsScalableFrame(f)
+ if not f.SetScale then
+ return
+ end
+ if self.NoScale[f:GetName()] or self.ScaleWH[f:GetName()] then
+ return
+ end
+ return true
+end
+
+function MovAny:CanBeScaled(f)
+ if f.GetName and self.ScaleWH[ f:GetName() ] then
+ return true
+ end
+ if not f or not f.GetScale or self.NoScale[ f:GetName() ] or f:GetObjectType() == "FontString" then
+ return
+ end
+ return true
+end
+
+function MovAny:IsValidObject(f, silent)
+ if type(f) == "string" then
+ f = _G[ f ]
+ end
+ if not f then
+ return
+ end
+ if type(f) ~= "table" then
+ if not silent then
+ maPrint(string.format(MOVANY.UNSUPPORTED_TYPE, type(f)))
+ end
+ return
+ end
+ if self.lDisallowedFrames[f:GetName()] then
+ if not silent then
+ maPrint(string.format(MOVANY.UNSUPPORTED_FRAME, f:GetName()))
+ end
+ return
+ end
+
+ local type = f:GetObjectType()
+ if not self.lAllowedTypes[type] then
+ if not silent then
+ maPrint(string.format(MOVANY.UNSUPPORTED_TYPE, f:GetObjectType()))
+ end
+ return
+ end
+
+ if MovAny:IsMAFrame(f:GetName()) then
+ if MovAny.lAllowedMAFrames[f:GetName()] or string.sub(f:GetName(), 1, 5) == "MA_FE" then
+ --dbg("MA Frame: "..f:GetName())
+ return true
+ end
+ return
+ end
+ return true
+end
+
+function MovAny:IsDefaultFrame(f)
+ if not f.GetName then
+ return
+ end
+ local fn = f:GetName()
+ for i, v in ipairs(MovAny.frames) do
+ if v.name == fn then
+ return v.default
+ end
+ end
+end
+
+function MovAny:SyncAllFrames(dontReset)
+ if not self.rendered then
+ dontReset = true
+ end
+ self.pendingFrames = tcopy(self.frameOptions)
+ self:SyncFrames(dontReset)
+end
+
+function MovAny:SyncFrames(dontReset)
+ if not self.inited or self.syncingFrames then
+ return
+ end
+
+ local i = 0
+ for k in pairs(self.pendingFrames) do
+ i = i + 1
+ break
+ end
+ --dbg("Syncing "..i.." frames")
+
+ if i == 0 then
+ return
+ end
+
+ self.syncingFrames = true
+
+ local f, parent, handled
+ local skippedFrames = {}
+
+ if dontReset then
+ for fn, opt in pairs(self.pendingFrames) do
+ f = _G[fn]
+ if f then
+ self:UnanchorRelatives(f, opt)
+ end
+ end
+ end
+
+ for fn, opt in pairs(self.pendingFrames) do
+ if not self:GetMoverByFrameName(fn) then
+ handled = nil
+ if self.lRunOnceBeforeInteract[fn] then
+ if not self.lRunOnceBeforeInteract[fn]() then
+ self.lRunOnceBeforeInteract[fn] = nil
+ end
+ end
+ if not opt.disabled and not self.lDelayedSync[fn] then
+ if not self.lRunBeforeInteract[fn] or not self.lRunBeforeInteract[fn]() then
+ f = _G[fn]
+ if f and self:IsValidObject(f, true) then
+ if not self:IsProtected(f) or not InCombatLockdown() then
+ if dontReset == nil or not dontReset then
+ self:ResetAll(f, opt, true)
+ end
+ if self:IsModified(fn) then
+ if self:HookFrame(fn, f, not dontReset) then
+ self:ApplyAll(f, opt)
+ handled = true
+ end
+ end
+ end
+ end
+ end
+ if self.lRunAfterInteract[fn] then
+ self.lRunAfterInteract[fn](handled)
+ end
+ end
+ if not handled then
+ --dbg(" "..fn.." unsyncable at the moment")
+ skippedFrames[fn] = opt
+ end
+ end
+ end
+ self.pendingFrames = skippedFrames
+
+ local postponed = {}
+ for k, f in pairs(self.pendingActions) do
+ if f() then
+ tinsert(postponed, f)
+ end
+ end
+ self.pendingActions = postponed
+
+ self:SetLeftFrameLocation()
+ self:SetCenterFrameLocation()
+
+ self.rendered = true
+ self.syncingFrames = nil
+end
+
+function MovAny:SyncFrame(fn, opt, dontReset)
+ if not opt then
+ opt = self.frameOptions[fn]
+ if not opt then
+ return
+ end
+ end
+
+ if opt.disabled then
+ return
+ end
+
+ local handled = nil
+
+ if self.lRunOnceBeforeInteract[fn] then
+ self.lRunOnceBeforeInteract[fn]()
+ self.lRunOnceBeforeInteract[fn] = nil
+ end
+
+ if not self.lRunBeforeInteract[fn] or not self.lRunBeforeInteract[fn]() then
+ f = _G[fn]
+ if f and self:IsValidObject(f, true) then
+ if not self:IsProtected(f) or not InCombatLockdown() then
+ local mover = self:GetMoverByFrameName(fn)
+ if mover then
+ MovAny:DetachMover(mover)
+ end
+ if not dontReset then
+ self:ResetAll(f, opt, true)
+ end
+ if self:IsModified(fn) and self:HookFrame(fn, f) then
+ self:ApplyAll(f, opt)
+ handled = true
+ end
+ if mover then
+ MovAny:AttachMover(fn)
+ end
+ end
+ end
+ end
+ if self.lRunAfterInteract[fn] then
+ self.lRunAfterInteract[fn](handled)
+ end
+ if not handled then
+ self.pendingFrames[fn] = opt
+ end
+end
+
+function MovAny:IsProtected(f)
+ return f:IsProtected() or f.MAProtected
+end
+
+function MovAny:GetProfileName(override)
+ local val = MoveAnything_UseCharacterSettings
+ if override ~= nil then
+ val = override
+ end
+ if val then
+ return GetCVar("realmName").." "..UnitName("player")
+ else
+ return "default"
+ end
+end
+
+function MovAny:CopySettings(fromName, toName)
+ if MoveAnything_CharacterSettings[toName] == nil then
+ MoveAnything_CharacterSettings[toName] = {}
+ end
+ local l
+ for i, val in pairs(MoveAnything_CharacterSettings[fromName]) do
+ l = tcopy(val)
+ l.cat = nil
+ MoveAnything_CharacterSettings[toName][i] = l
+ end
+end
+
+function MovAny:UpdateProfile(profile)
+ self:ResetProfile(true)
+ --self:VerifyData()
+ self.frameOptions = MoveAnything_CharacterSettings[self:GetProfileName()]
+ self:SyncAllFrames(true)
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:GetFrameCount()
+ return self.framesCount
+end
+
+function MovAny:ClearFrameOptions(fn)
+ self.frameOptions[fn] = nil
+ self:RemoveIfCustom(fn)
+end
+
+function MovAny:GetFrameOptions(fn, noSymLink, create)
+ if MovAny.frameOptions == nil then
+ return nil
+ end
+
+ if not noSymLink and not MovAny.frameOptions[fn] and MovAny.lTranslateSec[fn] then
+ --dbg(""..fn.." translated to "..self.lTranslateSec[fn])
+ fn = MovAny.lTranslateSec[fn]
+ end
+
+ if create and MovAny.frameOptions[fn] == nil then
+ MovAny.frameOptions[fn] = {name = fn, cat = MovAny.customCat}
+ end
+ return MovAny.frameOptions[fn]
+end
+
+function MovAny:GetFrame(fn)
+ for i,v in pairs(self.frames) do
+ if v.name == fn then
+ return v
+ end
+ end
+end
+
+function MovAny:GetFrameIDX(o)
+ for i,v in pairs(self.frames) do
+ if v == o then
+ return i
+ end
+ end
+end
+
+function MovAny:RemoveIfCustom(fn)
+ local removed = nil
+ for i in pairs(MoveAnything_CustomFrames) do
+ if MoveAnything_CustomFrames[i].name == fn then
+ table.remove(MoveAnything_CustomFrames, i)
+ self.guiLines = -1
+ removed = true
+ break
+ end
+ end
+
+ if removed then
+ for i in pairs(self.frames) do
+ if self.frames[i].name == fn then
+ table.remove(self.frames, i)
+ self.framesCount = self.framesCount - 1
+ break
+ end
+ end
+ end
+end
+
+function MovAny.hShow(f, ...)
+ --dbg(f:GetName()..":Show() hooked")
+ if f.MAHidden then
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ local opt = MovAny:GetFrameOptions(f:GetName())
+ if opt ~= nil then
+ MovAny.pendingFrames[ f:GetName() ] = opt
+ end
+ else
+ f.MAHidden = nil
+ f:Hide()
+ f.MAHidden = true
+ end
+ end
+end
+
+function MovAny:LockVisibility(f)
+ f.MAHidden = true
+
+ if not f.MAShowHook then
+ hooksecurefunc(f, "Show", MovAny.hShow)
+ f.MAShowHook = true
+ end
+
+ f.MAWasShown = f:IsShown()
+ if f.MAWasShown then
+ f:Hide()
+ end
+
+ if self.lSimpleHide[ f ] then
+ --f:Hide()
+ return
+ end
+
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ self:LockVisibility(v)
+ end
+ end
+end
+
+function MovAny:UnlockVisibility(f)
+ if not f.MAHidden then
+ return
+ end
+ f.MAHidden = nil
+ if self.lSimpleHide[ f ] then
+ f:Show()
+ return
+ end
+
+ if f.MAWasShown then
+ f.MAWasShown = nil
+ f:Show()
+ end
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ self:UnlockVisibility(v)
+ end
+ end
+end
+
+function MovAny.hSetPoint(f, ...)
+ --dbg(f:GetName()..":SetPoint hook called")
+ if f.MAPoint then
+ --dbg(f:GetName()..":SetPoint hook called. got locked point")
+ local fn = f:GetName()
+ if string.match(fn, "^ContainerFrame[1-9][0-9]*$") then
+ fn = MovAny:GetBagInContainerFrame(f):GetName()
+ end
+
+ if InCombatLockdown() and MovAny:IsProtected(f) then
+ MovAny.pendingFrames[fn] = MovAny:GetFrameOptions(fn)
+ else
+ local p = f.MAPoint
+ f.MAPoint = nil
+ f:ClearAllPoints()
+ f:SetPoint(unpack(p))
+ f.MAPoint = p
+ p = nil
+ end
+ end
+end
+
+function MovAny:LockPoint( f )
+ if not f.MAPoint then
+ if not f.MALockPointHook then
+ hooksecurefunc(f, "SetPoint", MovAny.hSetPoint)
+ --hooksecurefunc(f, "ClearAllPoints", MovAny.hSetPoint)
+ f.MALockPointHook = true
+ end
+ f.MAPoint = {f:GetPoint(1)}
+ end
+end
+
+function MovAny:UnlockPoint( f )
+ f.MAPoint = nil
+end
+
+function MovAny:LockParent(f)
+ if not f.MAParented and not f.MAParentHook then
+ hooksecurefunc(f, "SetParent", MovAny.hSetParent)
+ f.MAParentHook = true
+ end
+ f.MAParented = f:GetParent()
+end
+
+function MovAny:UnlockParent(f)
+ f.MAParented = nil
+end
+
+function MovAny.hSetParent(f, ...)
+ if f.MAParented then
+ if InCombatLockdown() and MovAny:IsProtected(f) then
+ MovAny.pendingFrames[ f:GetName() ] = MovAny:GetFrameOptions(f:GetName())
+ else
+ --dbg("SetParent hook repositioning: "..fn)
+ local p = f.MAParented
+ MovAny:UnlockParent(f)
+ f:SetParent(p)
+ MovAny:LockParent(f)
+ end
+ end
+end
+--[[
+function MovAny.hSetWidth(f, ...)
+ if f.MAScaled then
+ local fn = f:GetName()
+
+ if string.match(fn, "^ContainerFrame[0-9]+$") then
+ local bag = MovAny:GetBagInContainerFrame(f)
+ fn = bag:GetName()
+ end
+
+ MovAny.pendingFrames[fn] = MovAny:GetFrameOptions(fn)
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ MovAny:SyncFrames()
+ end
+ end
+end
+
+function MovAny.hSetHeight(f, ...)
+ if f.MAScaled then
+ local fn = f:GetName()
+
+ if string.match(fn, "^ContainerFrame[0-9]+$") then
+ local bag = MovAny:GetBagInContainerFrame(f)
+ fn = bag:GetName()
+ end
+
+ MovAny.pendingFrames[fn] = MovAny:GetFrameOptions(fn)
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ MovAny:SyncFrames()
+ end
+ end
+end
+
+function MovAny.hSetScale(f, ...)
+ if f.MAScaled then
+ local fn = f:GetName()
+
+ if string.match(fn, "^ContainerFrame[0-9]+$") then
+ local bag = MovAny:GetBagInContainerFrame(f)
+ fn = bag:GetName()
+ end
+
+ MovAny.pendingFrames[fn] = MovAny:GetFrameOptions(fn)
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ MovAny:SyncFrames()
+ end
+ end
+end
+
+function MovAny:LockScale( f )
+ if f.SetScale and not f.MAScaleLocked then
+ --dbg("Locking scale on "..f:GetName())
+ if not f.MAScaleHook then
+ -- the following doesnt work. it needs to be hooked through the metatable somehow, these hooksecurefunc's never fires
+ if f.SetWidth then
+ hooksecurefunc(f, "SetWidth", MovAny.hSetWidth)
+ end
+ if f.SetHeight then
+ hooksecurefunc(f, "SetHeight", MovAny.hSetHeight)
+ end
+ if f.SetScale then
+ hooksecurefunc(f, "SetScale", MovAny.hSetScale)
+ end
+ f.MAScaleHook = true
+ end
+ end
+end
+
+function MovAny:UnlockScale( f )
+ f.MAScaleLocked = nil
+end
+]]
+
+function MovAny.hSetScale(f, ...)
+ if f.MAScaled then
+ --dbg(f:GetName()..":SetScale intercepted, locked scale: "..f.MAScaled)
+ local fn = f:GetName()
+
+ if string.match(fn, "^ContainerFrame[1-9][0-9]*$") then
+ local bag = MovAny:GetBagInContainerFrame(f)
+ fn = bag:GetName()
+ end
+
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ MovAny.pendingFrames[fn] = MovAny:GetFrameOptions(fn)
+ MovAny:SyncFrames()
+ else
+ MovAny:Rescale(f, f.MAScaled)
+ end
+ end
+end
+
+function MovAny:LockScale( f )
+ if f.SetScale and not f.MAScaled then
+ local meta = getmetatable(f).__index
+ if not meta.MAScaleHook then
+ if meta.SetScale then
+ hooksecurefunc(meta, "SetScale", MovAny.hSetScale)
+ end
+ meta.MAScaleHook = true
+ end
+ f.MAScaled = f:GetScale()
+ end
+end
+
+function MovAny:UnlockScale( f )
+ f.MAScaled = nil
+end
+
+function MovAny:Rescale(f, scale)
+ MovAny:UnlockScale(f)
+ f:SetScale(scale)
+ MovAny:LockScale(f)
+end
+
+function MovAny:HookFrame(fn, f, dontUnanchor)
+ if not f then
+ f = _G[fn]
+ end
+ if not f then
+ return
+ end
+
+ if not self:IsValidObject(f) then
+ return
+ end
+
+ --dbg("Hooking frame: "..fn)
+ local opt = self:GetFrameOptions(fn, true, true)
+ if opt.name == nil then
+ opt.name = fn
+ end
+
+ if f.OnMAHook and f.OnMAHook(f) ~= nil then
+ return
+ end
+
+ if opt.disabled then
+ opt.disabled = nil
+ end
+ --f.MAOpts = opt
+
+ if not opt.orgPos then
+ MovAny:StoreOrgPoints(f, opt)
+ end
+
+ if not dontUnanchor and not self.NoUnanchorRelatives[fn] then
+ self:UnanchorRelatives(f, opt)
+ end
+
+ if self.DetachFromParent[fn] and not self.NoReparent[fn] and not f.MAOrgParent then
+ f.MAOrgParent = f:GetParent()
+ f:SetParent(_G[ self.DetachFromParent[fn] ])
+ --self:LockParent(f)
+ end
+
+ if f.OnMAPostHook and f.OnMAPostHook(f) ~= nil then
+ return
+ end
+
+ return opt
+end
+
+-- XXX: verify that frame is properly hooked instead of just checking stored options?
+function MovAny:IsModified( fn )
+ if fn == nil then
+ return
+ end
+ local opt = self:GetFrameOptions(fn)
+ if opt and (opt.pos or opt.hidden or opt.scale ~= nil or opt.alpha ~= nil or opt.frameStrata ~= nil or
+ opt.disableLayerArtwork ~= nil or opt.disableLayerBackground ~= nil or opt.disableLayerBorder ~= nil or opt.disableLayerHighlight ~= nil or opt.disableLayerOverlay ~= nil) then
+ return true
+ end
+ return
+end
+
+function MovAny:IsFrameHidden(fn, opt)
+ if fn == nil then
+ return
+ end
+ opt = opt or self:GetFrameOptions(fn)
+ if opt and opt.hidden then
+ return true
+ end
+ return
+end
+
+function MovAny:StoreOrgPoints(f, opt)
+ local np = f:GetNumPoints()
+ if np == 1 then
+ opt.orgPos = self:GetSerializedPoint(f)
+ elseif np > 1 then
+ opt.orgPos = {}
+ for i = 1, np, 1 do
+ opt.orgPos[i] = self:GetSerializedPoint(f, i)
+ end
+ end
+ if not opt.orgPos then
+ if f == TargetFrameSpellBar then
+ opt.orgPos = {"BOTTOM", "TargetFrame", "BOTTOM", -15, 10}
+ elseif f == FocusFrameSpellBar then
+ opt.orgPos = {"BOTTOM", "FocusFrame", "BOTTOM", 0, 0}
+ elseif f == VehicleMenuBarHealthBar then
+ opt.orgPos = {"BOTTOMLEFT", "VehicleMenuBarArtFrame", "BOTTOMLEFT", 119, 3}
+ elseif f == VehicleMenuBarPowerBar then
+ opt.orgPos = {"BOTTOMRIGHT", "VehicleMenuBarArtFrame", "BOTTOMRIGHT", -119, 3}
+ elseif f == VehicleMenuBarLeaveButton then
+ opt.orgPos = {"BOTTOMRIGHT", "VehicleMenuBar", "BOTTOMRIGHT", 177, 15}
+ --[[
+ elseif f == LFDDungeonReadyDialog then
+ opt.orgPos = {"TOP", "UIParent", "TOP", 0, -135}
+ elseif f == LFDDungeonReadyPopup then
+ opt.orgPos = {"TOP", "UIParent", "TOP", 0, -135}
+ elseif f == LFDDungeonReadyStatus then
+ ]]
+ else
+ --dbg("Unable to generate restore point for "..f:GetName()..". OrgPos set to default")
+ opt.orgPos = {"TOP", "UIParent", "TOP", 0, -135}
+ end
+ end
+end
+
+function MovAny:RestoreOrgPoints(f, opt, readOnly)
+ --dbg("Restoring point to "..f:GetName().."")
+ f:ClearAllPoints()
+
+ if opt then -- and not opt.UIPanelWindows
+ if type(opt.orgPos) == "table" then
+ if type(opt.orgPos[1]) == "table" then
+ for i,v in pairs(opt.orgPos) do
+ f:SetPoint(unpack(v))
+ end
+ else
+ f:SetPoint(unpack(opt.orgPos))
+ end
+ end
+ if not readOnly then
+ opt.orgPos = nil
+ end
+ end
+end
+
+function MovAny:GetFirstOrgPoint(opt)
+ if opt then -- and not opt.UIPanelWindows
+ if type(opt.orgPos) == "table" then
+ if type(opt.orgPos[1]) == "table" then
+ return opt.orgPos[1]
+ else
+ return opt.orgPos
+ end
+ end
+ end
+end
+
+function MovAny:GetSerializedPoint(f, num)
+ num = num or 1
+ --dbg("GetSerializedPoint"..(f.GetName and ": "..f:GetName() or ""))
+ local point, rel, relPoint, x, y = f:GetPoint(num)
+ if point then
+ if rel and rel.GetName and rel:GetName() ~= "" then
+ rel = rel:GetName()
+ else
+ rel = "UIParent"
+ end
+ --[[
+ if f.GetEffectiveScale then
+ x = x / f:GetEffectiveScale()
+ y = y / f:GetEffectiveScale()
+ else
+ x = x / UIParent:GetEffectiveScale()
+ y = y / UIParent:GetEffectiveScale()
+ end
+ --]]
+ return {point, rel, relPoint, x, y}
+ end
+ return nil
+end
+
+function MovAny:GetRelativePoint(o, f, lockRel)
+ if not o then
+ o = {"BOTTOMLEFT", UIParent, "BOTTOMLEFT"}
+ end
+ local rel = o[2]
+ if rel == nil then
+ rel = UIParent
+ end
+ if type(rel) == "string" then
+ rel = _G[rel]
+ end
+ if not rel then
+ return
+ end
+
+ local point = o[1]
+ local relPoint = o[3]
+
+ if not lockRel then
+ local newRel = self:ForcedDetachFromParent(f:GetName())
+ if newRel then
+ rel = _G[newRel]
+ point = "BOTTOMLEFT"
+ relPoint = "BOTTOMLEFT"
+ end
+ if not rel then
+ return
+ end
+ end
+
+ local rX, rY, pX, pY
+
+ if rel:GetLeft() ~= nil then
+ if relPoint == "TOPRIGHT" then
+ rY = rel:GetTop()
+ rX = rel:GetRight()
+ elseif relPoint == "TOPLEFT" then
+ rY = rel:GetTop()
+ rX = rel:GetLeft()
+ elseif relPoint == "TOP" then
+ rY = rel:GetTop()
+ rX = (rel:GetRight() + rel:GetLeft()) / 2
+ elseif relPoint == "BOTTOMRIGHT" then
+ rY = rel:GetBottom()
+ rX = rel:GetRight()
+ elseif relPoint == "BOTTOMLEFT" then
+ rY = rel:GetBottom()
+ rX = rel:GetLeft()
+ elseif relPoint == "BOTTOM" then
+ rY = rel:GetBottom()
+ rX = (rel:GetRight() + rel:GetLeft()) / 2
+ elseif relPoint == "CENTER" then
+ rY = (rel:GetTop() + rel:GetBottom()) / 2
+ rX = (rel:GetRight() + rel:GetLeft()) / 2
+ elseif relPoint == "LEFT" then
+ rY = (rel:GetTop() + rel:GetBottom()) / 2
+ rX = rel:GetLeft()
+ elseif relPoint == "RIGHT" then
+ rY = (rel:GetTop() + rel:GetBottom()) / 2
+ rX = rel:GetRight()
+ else
+ return
+ end
+
+ if rel.GetEffectiveScale then
+ rY = rY * rel:GetEffectiveScale()
+ rX = rX * rel:GetEffectiveScale()
+ else
+ rY = rY * UIParent:GetEffectiveScale()
+ rX = rX * UIParent:GetEffectiveScale()
+ end
+ end
+
+ if f:GetLeft() ~= nil then
+ if point == "TOPRIGHT" then
+ pY = f:GetTop()
+ pX = f:GetRight()
+ elseif point == "TOPLEFT" then
+ pY = f:GetTop()
+ pX = f:GetLeft()
+ elseif point == "TOP" then
+ pY = f:GetTop()
+ pX = (f:GetRight() + f:GetLeft()) / 2
+ elseif point == "BOTTOMRIGHT" then
+ pY = f:GetBottom()
+ pX = f:GetRight()
+ elseif point == "BOTTOMLEFT" then
+ pY = f:GetBottom()
+ pX = f:GetLeft()
+ elseif point == "BOTTOM" then
+ pY = f:GetBottom()
+ pX = (f:GetRight() + f:GetLeft()) / 2
+ elseif point == "CENTER" then
+ pY = (f:GetTop() + f:GetBottom()) / 2
+ pX = (f:GetRight() + f:GetLeft()) / 2
+ elseif point == "LEFT" then
+ pY = (f:GetTop() + f:GetBottom()) / 2
+ pX = f:GetLeft()
+ elseif point == "RIGHT" then
+ pY = (f:GetTop() + f:GetBottom()) / 2
+ pX = f:GetRight()
+ else
+ return
+ end
+
+ if f.GetEffectiveScale then
+ pY = pY * f:GetEffectiveScale()
+ pX = pX * f:GetEffectiveScale()
+ else
+ pY = pY * UIParent:GetEffectiveScale()
+ pX = pX * UIParent:GetEffectiveScale()
+ end
+ end
+
+ if rY ~= nil and rX ~= nil and pY ~= nil and pX ~= nil then
+ rX = pX - rX
+ rY = pY - rY
+
+ if f.GetEffectiveScale then
+ rY = rY / f:GetEffectiveScale()
+ rX = rX / f:GetEffectiveScale()
+ else
+ rY = rY / UIParent:GetEffectiveScale()
+ rX = rX / UIParent:GetEffectiveScale()
+ end
+ else
+ rX = 0
+ rY = 0
+ end
+
+ return {point, rel:GetName(), relPoint, rX, rY}
+end
+
+function MovAny:AddFrameToMovableList( fn, helpfulName, default )
+ if not self:GetFrame(fn) then
+ if helpfulName == nil then
+ helpfulName = fn
+ end
+
+ local opts = {}
+ opts.name = fn
+ opts.helpfulName = helpfulName
+ opts.cat = self.customCat
+
+ opts.idx = self.nextFrameIdx
+ self.nextFrameIdx = self.nextFrameIdx + 1
+
+ tinsert(self.frames, opts)
+ self.framesCount = self.framesCount + 1
+
+ if default == 2 then
+ opts.default = true
+ self.defFrames[ opts.name ] = opts
+ else
+ if default ~= 1 then
+ tinsert(MoveAnything_CustomFrames, opts)
+ self.guiLines = -1
+ end
+ end
+ if self.inited then
+ self:UpdateGUIIfShown()
+ end
+ end
+end
+
+function MovAny:AttachMover(fn, helpfulName)
+ if self.NoMove[fn] and self.NoScale[fn] and self.NoHide[fn] and self.NoAlpha[fn] then
+ string.format(MOVANY.UNSUPPORTED_FRAME, fn)
+ return
+ end
+
+ if self.NoMove[fn] and self.NoScale[fn] and self.NoAlpha[fn] then
+ maPrint(string.format(MOVANY.FRAME_VISIBILITY_ONLY, fn))
+ return
+ end
+
+ local f = _G[fn]
+
+ if self.MoveOnlyWhenVisible[fn] and (f == nil or not f:IsShown()) then
+ maPrint(string.format(MOVANY.ONLY_WHEN_VISIBLE, fn))
+ return
+ end
+
+ if self:ErrorNotInCombat(f) then
+ return
+ end
+
+ if not self:GetMoverByFrameName(fn) then
+ if self.lRunOnceBeforeInteract[fn] then
+ self.lRunOnceBeforeInteract[fn]()
+ self.lRunOnceBeforeInteract[fn] = nil
+ end
+ if self.lRunBeforeInteract[fn] and self.lRunBeforeInteract[fn]() then
+ return
+ end
+ local created = nil
+ local handled = nil
+
+ if self.lCreateBeforeInteract[fn] and _G[fn] == nil then
+ CreateFrame("Frame", fn, UIParent, self.lCreateBeforeInteract[fn])
+ created = true
+ end
+ f = _G[fn]
+
+ self.lastFrameName = fn
+ if self:IsValidObject(f) then
+ local mover = self:GetAvailableMover()
+ if f.OnMAOnAttach then
+ f.OnMAOnAttach(f, mover)
+ end
+ self:AddFrameToMovableList(fn, helpfulName)
+ if self:HookFrame(fn) then
+ if self:AttachMoverToFrame(mover, f) then
+ handled = true
+ mover.createdTagged = created
+ if f.OnMAPostAttach then
+ f.OnMAPostAttach(f, mover)
+ end
+ self:UpdateGUIIfShown()
+ end
+ end
+ end
+
+ if self.lRunAfterInteract[fn] then
+ self.lRunAfterInteract[fn](handled)
+ end
+ return true
+ end
+end
+
+function MovAny:GetAvailableMover()
+ local f
+ for id = 1, 1000000, 1 do
+ f = _G[self.moverPrefix..id]
+ if not f then
+ f = CreateFrame("Frame", self.moverPrefix..id, UIParent, "MAMoverTemplate")
+ f:SetID(id)
+ break
+ end
+ if not f.tagged then
+ break
+ end
+ end
+
+ if f then
+ tinsert(self.movers, f)
+ return f
+ end
+end
+
+function MovAny:GetDefaultFrameParent(f)
+ local c = f
+ while c and c ~= UIParent and c ~= nil do
+ if c.MAParent then
+ return c.MAParent
+ --c = c.MAParent
+ end
+ if c.GetName and c:GetName() ~= nil and c:GetName() ~= "" then
+ local m = string.match(c:GetName(),"^ContainerFrame[1-9][0-9]*$")
+ if m then
+ local bag = self:GetBagInContainerFrame(_G[ m ])
+ return _G[ bag:GetName() ]
+ end
+
+ local transName = self:Translate(c:GetName(),true,true)
+
+ if self:GetFrameOptions(transName) ~= nil then
+ return _G[ transName ]
+ else
+ local frame = self:GetFrame(transName)
+ if frame then
+ return _G[frame.name]
+ end
+ end
+ end
+ c = c:GetParent()
+ end
+ return nil
+end
+
+function MovAny:GetTopFrameParent(f)
+ local c = f
+ local l = nil
+ local ln
+ local n
+ while c and c ~= UIParent do
+ if c:IsToplevel() then
+ n = c:GetName()
+ if n ~= nil and n ~= "" then
+ return c
+ elseif ln ~= nil then
+ return ln
+ else
+ maPrint(MOVANY.NO_NAMED_FRAMES_FOUND)
+ return nil
+ end
+ end
+ l = c
+ n = c:GetName()
+ if n ~= nil and n ~= "" then
+ ln = c
+ end
+ c = c:GetParent()
+ end
+ if c == UIParent then
+ return l
+ end
+ return nil
+end
+
+function MovAny:ToggleMove( fn )
+ local ret = nil
+ if self:GetMoverByFrameName( fn ) then
+ ret = self:StopMoving( fn )
+ else
+ ret = self:AttachMover( fn )
+ end
+
+ self.lastFrameName = fn
+ self:UpdateGUIIfShown(true)
+ return ret
+end
+
+function MovAny:ToggleHide( fn )
+ local ret = nil
+ if self:IsFrameHidden(fn) then
+ ret = self:ShowFrame(fn)
+ else
+ ret = self:HideFrame(fn)
+ end
+
+ self.lastFrameName = fn
+ self:UpdateGUIIfShown(true)
+ return ret
+end
+
+--X: bindings
+function MovAny:SafeMoveFrameAtCursor()
+ local obj = GetMouseFocus()
+ while 1 == 1 and obj do
+ while 1 == 1 and obj do
+ if self:IsMAFrame(obj:GetName()) then
+ if self:IsMover(obj:GetName()) then
+ if obj.tagged then
+ obj = obj.tagged
+ else
+ return
+ end
+ elseif not self:IsValidObject(obj, true) then
+ obj = obj:GetParent()
+ if not obj or obj == UIParent then
+ return
+ end
+ else
+ break
+ end
+ else
+ break
+ end
+ end
+ local transName = self:Translate(obj:GetName(), 1)
+
+ if transName ~= obj:GetName() then
+ self:ToggleMove(transName)
+ break
+ end
+
+ local p = obj:GetParent()
+ -- check for minimap button
+ if (p == MinimapBackdrop or p == Minimap or p == MinimapCluster) and obj ~= Minimap then
+ self:ToggleMove(obj:GetName())
+ break
+ end
+
+ local objTest = self:GetDefaultFrameParent(obj)
+
+ if objTest then
+ self:ToggleMove(objTest:GetName())
+ break
+ end
+
+ objTest = self:GetTopFrameParent(obj)
+ if objTest then
+ self:ToggleMove(objTest:GetName())
+ break
+ end
+
+ if obj and obj ~= WorldFrame and obj ~= UIParent and obj.GetName then
+ self:ToggleMove(obj:GetName())
+ end
+ break
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:MoveFrameAtCursor()
+ local obj = GetMouseFocus()
+ if self:IsMAFrame(obj:GetName()) then
+ if self:IsMover(obj:GetName()) and obj.tagged then
+ obj = obj.tagged
+ elseif not self:IsValidObject(obj) then
+ return
+ end
+ end
+ if obj and obj ~= WorldFrame and obj ~= UIParent and obj:GetName() then
+ self:ToggleMove(obj:GetName())
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:SafeHideFrameAtCursor()
+ local obj = GetMouseFocus()
+
+ while 1 do
+ if self:IsMAFrame(obj:GetName()) then
+ if self:IsMover(obj:GetName()) and obj.tagged then
+ obj = obj.tagged
+ elseif not self:IsValidObject(obj, true) then
+ obj = obj:GetParent()
+ end
+ end
+ local transName = self:Translate(obj:GetName(), 1)
+ if transName ~= obj:GetName() then
+ --dbg("Hiding translated "..transName)
+ self:ToggleHide(transName)
+ break
+ end
+ local objTest = self:GetDefaultFrameParent(obj)
+ if objTest then
+ --dbg("Hiding default "..objTest:GetName())
+ self:ToggleHide(objTest:GetName())
+ break
+ end
+ objTest = self:GetTopFrameParent(obj)
+ if objTest then
+ --dbg("Hiding top frame "..objTest:GetName())
+ self:AddFrameToMovableList(objTest:GetName(), nil)
+ self:ToggleHide(objTest:GetName())
+ break
+ end
+ if obj and obj ~= WorldFrame and obj ~= UIParent then
+ --dbg("Hiding "..obj:GetName())
+ self:AddFrameToMovableList(obj:GetName(), nil)
+ self:ToggleHide(obj:GetName())
+ break
+ end
+ break
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:HideFrameAtCursor()
+ local obj = GetMouseFocus()
+ if self:IsMAFrame(obj:GetName()) then
+ if self:IsMover(obj:GetName()) and obj.tagged then
+ obj = obj.tagged
+ else
+ return
+ end
+ end
+ if obj and obj ~= WorldFrame and obj ~= UIParent then
+ self:ToggleHide(obj:GetName())
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:SafeResetFrameAtCursor()
+ local obj = GetMouseFocus()
+ local fn = obj:GetName()
+
+ while 1 do
+ if fn and self.frameOptions[fn] then
+ self:ResetFrameConfirm(fn)
+ break
+ end
+ if self:IsMAFrame(fn) then
+ if self:IsMover(fn) and obj.tagged then
+ obj = obj.tagged
+ self:ResetFrameConfirm(obj:GetName())
+ break
+ elseif not self:IsValidObject(obj, true) then
+ obj = obj:GetParent()
+ end
+ fn = obj:GetName()
+ end
+
+ local transName = self:Translate(fn, 1)
+ if transName ~= fn and self.frameOptions[fn] then
+ self:ResetFrameConfirm(fn)
+ break
+ end
+ local objTest = self:GetDefaultFrameParent(obj)
+ if objTest and self.frameOptions[ objTest:GetName() ] then
+ self:ResetFrameConfirm(objTest:GetName())
+ break
+ end
+ objTest = self:GetTopFrameParent(obj)
+ if objTest and self.frameOptions[ objTest:GetName() ] then
+ self:ResetFrameConfirm(objTest:GetName())
+ break
+ end
+ if obj and obj ~= WorldFrame and obj ~= UIParent and self.frameOptions[fn] then
+ self:ResetFrameConfirm(fn)
+ break
+ end
+ break
+ end
+end
+
+function MovAny:ResetFrameAtCursor()
+ local obj = GetMouseFocus()
+ if self:IsMAFrame(obj:GetName()) then
+ if self:IsMover(obj:GetName()) and obj.tagged then
+ obj = obj.tagged
+ else
+ return
+ end
+ end
+
+ if InCombatLockdown() and MovAny:IsProtected(obj) then
+ self:ErrorNotInCombat(obj)
+ return
+ end
+
+ local fn = obj:GetName()
+
+ if self.frameOptions[fn] then
+ self:ResetFrameConfirm(fn)
+ end
+end
+
+function MovAny:IsMover(fn)
+ if fn ~= nil and string.match(fn, "^"..self.moverPrefix.."[0-9]+$") ~= nil then
+ return true
+ end
+end
+
+function MovAny:IsMAFrame(fn)
+ if fn ~= nil and (string.match(fn, "^MoveAnything") ~= nil or string.match(fn, "^MA") ~= nil) then
+ return true
+ end
+end
+
+function MovAny:IsContainer(fn)
+ if type(fn) == "string" and string.match(fn, "^ContainerFrame[1-9][0-9]*$") then
+ return true
+ end
+end
+
+function MovAny:Translate(f,secondary,nofirst)
+ if not nofirst and self.lTranslate[ f ] then
+ --dbg("primary translation: "..self.lTranslate[ f ])
+ return self.lTranslate[ f ]
+ end
+
+ if secondary and self.lTranslateSec[ f ] then
+ --dbg("secondary translation: "..self.lTranslateSec[ f ])
+ return self.lTranslateSec[ f ]
+ end
+
+ if f == "last" then
+ return MovAny.lastFrameName
+ else
+ return f
+ end
+end
+
+function MovAny:GetMoverByFrameName( fn )
+ if not fn then
+ return
+ end
+ for i, m in ipairs(self.movers) do
+ if type(m) ~= "nil" and m:IsShown() and m.tagged == _G[fn] then
+ return m
+ end
+ end
+ return nil
+end
+
+function MovAny:AttachMoverToFrame( mover, f )
+ --[[
+ if mover.tagged then
+ self:DetachMover(mover)
+ end
+ ]]--
+ self:UnlockPoint(f)
+
+ local listOptions = self:GetFrame(f:GetName())
+ local frameOptions = self:GetFrameOptions(f:GetName())
+
+ mover.helpfulName = listOptions.helpfulName
+
+ if f.OnMAMoving then
+ if not f:OnMAMoving() then
+ self:DetachMover(mover)
+ return
+ end
+ end
+
+ local x, y
+ x = 0
+ y = 0
+ if f:GetLeft() == nil and not f:IsShown() then
+ f:Show()
+ f:Hide()
+ end
+
+ --[[
+ if f:GetLeft() == nil then
+ maPrint(string.format(MOVANY.FRAME_UNPOSITIONED, f:GetName()))
+ self:DetachMover(mover)
+ return
+ end
+ ]]
+
+ mover.attaching = true
+ mover.dontUpdate = nil
+
+ mover:SetClampedToScreen(f:IsClampedToScreen())
+ --[[
+ if not f:IsShown() then
+ mover.taggedShown = true
+ f:Show()
+ end
+ ]]
+
+ local opt = self:GetFrameOptions(f:GetName())
+ if not opt.pos then
+ opt.pos = self:GetRelativePoint(self:GetFirstOrgPoint(opt), f)
+ end
+
+ mover:ClearAllPoints()
+ mover:SetPoint("CENTER", f, "CENTER")
+
+ mover:SetWidth( f:GetWidth() * MAGetScale( f , 1 ) / UIParent:GetScale() )
+ mover:SetHeight( f:GetHeight() * MAGetScale( f , 1 ) / UIParent:GetScale() )
+
+ local p = self:GetRelativePoint({"BOTTOMLEFT", UIParent, "BOTTOMLEFT"}, mover)
+ mover:ClearAllPoints()
+ mover:SetPoint(unpack(p))
+
+ if f.GetFrameLevel then
+ mover:SetFrameLevel( f:GetFrameLevel() + 1 )
+ end
+
+ --dbg(" attaching "..f:GetName().." to "..mover:GetName())
+ f:ClearAllPoints()
+ f:SetPoint( "BOTTOMLEFT", mover, "BOTTOMLEFT", 0, 0 )
+
+ if not self.NoMove[fn] then
+ f.orgX = x
+ f.orgY = y
+ end
+
+ mover.tagged = f
+
+ local label = _G[ mover:GetName().."BackdropInfoLabel"]
+ label:Hide()
+ label:ClearAllPoints()
+ label:SetPoint("CENTER", label:GetParent(), "CENTER", 0, 0)
+
+ mover:Show()
+
+ mover.attaching = nil
+end
+
+function MovAny:DetachMover( mover )
+ if mover.tagged and not mover.attaching then
+ if not mover.dontUpdate then
+ self:MoverUpdatePosition( mover )
+ end
+
+ local f = mover.tagged
+
+ self:ApplyPosition(f, self:GetFrameOptions(f:GetName()))
+ --[[
+ if mover.taggedShown then
+ f:Hide()
+ end
+ ]]
+ if mover.createdTagged then
+ mover.tagged:Hide()
+ end
+ if f.OnMAOnDetach then
+ f.OnMAOnDetach(f, mover)
+ end
+ end
+
+ mover:Hide()
+ mover.tagged = nil
+ mover.attaching = nil
+ mover.infoShown = nil
+
+ local found
+
+ for i, m in ipairs(self.movers) do
+ if m == mover then
+ tremove(self.movers, i)
+ end
+ end
+
+ if self.currentMover == mover then
+ self:NudgerChangeMover(1)
+ else
+ self:NudgerFrameRefresh()
+ end
+end
+
+function MovAny:StopMoving(fn)
+ local mover = self:GetMoverByFrameName(fn)
+ if mover and not self:ErrorNotInCombat(_G[fn]) then
+ self:DetachMover(mover)
+ self:UpdateGUIIfShown()
+ end
+end
+
+function MovAny:ResetFrameConfirm(fn)
+ local f = _G[fn]
+ if InCombatLockdown() and self:IsProtected(f) then
+ self:ErrorNotInCombat(f)
+ return
+ end
+ if self.resetConfirm == fn and self.resetConfirmTime + 5 >= time() then
+ self.resetConfirm = nil
+ maPrint(string.format(MOVANY.RESETTING_FRAME, fn))
+ self:ResetFrame(fn)
+ return true
+ else
+ self.resetConfirm = fn
+ self.resetConfirmTime = time()
+ maPrint(string.format(MOVANY.RESET_FRAME_CONFIRM, fn))
+ end
+end
+
+function MovAny:ResetFrame(f, dontUpdate, readOnly)
+ if not f then
+ return
+ end
+ local fn
+ if type(f) == "string" then
+ fn = f
+ f = _G[fn]
+ elseif f and f.GetName then
+ fn = f:GetName()
+ end
+ if not fn then
+ return
+ end
+
+ if self:ErrorNotInCombat(f) or (InCombatLockdown() and f.UMFP) then
+ return
+ end
+
+ self:StopMoving(fn)
+
+ self.lastFrameName = fn
+
+ if not f then
+ if not readOnly then
+ self:ClearFrameOptions(fn)
+ end
+ if not dontUpdate then
+ self:UpdateGUIIfShown(true)
+ end
+ return
+ end
+
+ local opt = self:GetFrameOptions(fn, true)
+ if opt == nil then
+ opt = {}
+ end
+ if not opt.disabled then
+ if f.OnMAPreReset then
+ f.OnMAPreReset(f, opt)
+ end
+
+ local width = nil
+ local height = nil
+ if opt then
+ width = opt.originalWidth
+ height = opt.originalHeight
+ end
+
+ self:ResetAll(f, opt, readOnly)
+
+ if width then
+ f:SetWidth(width)
+ end
+ if height then
+ f:SetHeight(height)
+ end
+ end
+ f.attachedChildren = nil
+
+ if not readOnly then
+ self:ClearFrameOptions(fn)
+ end
+
+ if f.OnMAPostReset then
+ f.OnMAPostReset(f, readOnly)
+ end
+
+ if not dontUpdate then
+ self:UpdateGUIIfShown(true)
+ end
+end
+
+function MovAny:ToggleGUI()
+ if MAOptions:IsShown() then
+ MAOptions:Hide()
+ else
+ MAOptions:Show()
+ end
+end
+
+function MovAny:OnMoveCheck(button)
+ if not self:ToggleMove(self.frames[ button:GetParent().idx ].name) then
+ button:SetChecked(nil)
+ return
+ end
+end
+
+function MovAny:OnHideCheck(button)
+ if not self:ToggleHide(self.frames[ button:GetParent().idx ].name) then
+ button:SetChecked(nil)
+ return
+ end
+end
+
+function MovAny:OnResetCheck(button)
+ local f = _G[self.frames[ button:GetParent().idx ].name]
+ if f then
+ if self:ErrorNotInCombat(f) then
+ return
+ end
+ else
+ f = self.frames[ button:GetParent().idx ].name
+ end
+ self:ResetFrame(f)
+end
+
+function MovAny:HideFrame(f, readOnly)
+ local fn
+ if type(f) == "string" then
+ fn = f
+ f = _G[fn]
+ end
+ if not fn then
+ fn = f:GetName()
+ end
+
+ local opt
+ if readOnly then
+ opt = {}
+ else
+ opt = self:GetFrameOptions(fn, nil, true)
+ opt.hidden = true
+ end
+ if not f then
+ return true
+ end
+
+ if not self:IsValidObject(f) or not self:HookFrame( fn ) or self:ErrorNotInCombat(f) then
+ return
+ end
+
+ f.MAWasShown = f:IsShown()
+
+ if f.GetAttribute then
+ opt.unit = f:GetAttribute("unit")
+ if opt.unit then
+ f:SetAttribute("unit", nil)
+ end
+ end
+
+ if self.HideList[fn] then
+ for hIndex, hideEntry in pairs(self.HideList[fn]) do
+ local val = _G[hideEntry[1]]
+ local hideType
+ for i = 2, table.getn(hideEntry) do
+ hideType = hideEntry[ i ]
+ if type(hideType) == "function" then
+ hideType(nil)
+ elseif hideType == "DISABLEMOUSE" then
+ val:EnableMouse(nil)
+ elseif hideType == "FRAME" then
+ self:LockVisibility(val)
+ elseif hideType == "WH" then
+ self:StopMoving(fn)
+ val:SetWidth(1)
+ val:SetHeight(1)
+ else
+ val:DisableDrawLayer( hideType )
+ end
+ end
+ end
+ elseif self.HideUsingWH[fn] then
+ self:StopMoving(fn)
+ f:SetWidth(1)
+ f:SetHeight(1)
+ self:LockVisibility(f)
+ else
+ self:LockVisibility(f)
+ end
+ if f.OnMAHide then
+ f.OnMAHide(f, true)
+ end
+
+ return true
+end
+
+function MovAny:ShowFrame( f, readOnly )
+ local fn
+ if type(f) == "string" then
+ fn = f
+ f = _G[ f ]
+ end
+ if not fn then
+ fn = f:GetName()
+ end
+
+ local opt = self:GetFrameOptions(fn)
+ if readOnly == nil and opt then
+ opt.hidden = nil
+ opt.unit = nil
+ end
+ if not f then
+ self:VerifyFrameData(fn)
+ return true
+ end
+ if not self:IsValidObject(f) or not self:HookFrame(fn) or self:ErrorNotInCombat(f) then
+ return
+ end
+ if opt.unit and f.SetAttribute then
+ f:SetAttribute("unit", opt.unit)
+ end
+ if self.HideList[fn] then
+ for hIndex, hideEntry in pairs(self.HideList[fn]) do
+ local val = _G[hideEntry[1]]
+ local hideType
+ for i = 2, table.getn(hideEntry) do
+ hideType = hideEntry[i]
+ if type(hideType) == "function" then
+ hideType(true)
+ elseif hideType == "DISABLEMOUSE" then
+ val:EnableMouse(true)
+ elseif hideType == "FRAME" then
+ self:UnlockVisibility(val)
+ elseif hideType == "WH" then
+ if type(opt.originalWidth) == "number" then
+ val:SetWidth(opt.originalWidth)
+ end
+ if type(opt.originalHeight) == "number" then
+ val:SetHeight(opt.originalHeight)
+ end
+ else
+ val:EnableDrawLayer(hideType)
+ end
+ end
+ end
+ self:ApplyLayers(f, opt)
+ elseif self.HideUsingWH[fn] then
+ if type(opt.originalWidth) == "number" then
+ f:SetWidth(opt.originalWidth)
+ end
+ if type(opt.originalHeight) == "number" then
+ f:SetHeight(opt.originalHeight)
+ end
+ self:UnlockVisibility(f)
+ else
+ self:UnlockVisibility(f)
+ end
+ if f.OnMAHide then
+ f.OnMAHide(f, nil)
+ end
+ self:VerifyFrameData(fn)
+ return true
+end
+
+function MovAny:OnCheckCharacterSpecific( button )
+ if InCombatLockdown() then
+ button:SetChecked(not button:GetChecked())
+ maPrint(MOVANY.PROFILES_CANT_SWITCH_DURING_COMBAT)
+ return
+ end
+ local oldName = self:GetProfileName()
+ if button:GetChecked() then
+ MoveAnything_UseCharacterSettings = true
+ else
+ MoveAnything_UseCharacterSettings = nil
+ end
+ local newProfile = self:GetProfileName()
+
+ local i = 0
+ if MoveAnything_CharacterSettings[newProfile] == nil then
+ MoveAnything_CharacterSettings[newProfile] = {}
+ else
+ for v in pairs(MoveAnything_CharacterSettings[newProfile]) do
+ i = i + 1
+ end
+ end
+ if i == 0 then
+ self:CopySettings(oldName, newProfile)
+ end
+ --MovAny:CleanProfile(oldName)
+ self:UpdateProfile()
+
+ local a = {}
+ for i, o in pairs(MoveAnything_CharacterSettings) do
+ tinsert(a, i)
+ end
+ table.sort(a, function(o1,o2)
+ return o1:lower() < o2:lower()
+ end)
+ local s = ""
+ for i, o in pairs(a) do
+ s = s.." "..o.."\n"
+ end
+ MAOptCharacterSpecific.tooltipText = "Use character specific settings\n\n Current profile: "..MovAny.GetProfileName().."\n\n Profiles: \n"..s.."\n\n Cmds:\n /movelist\n /moveimport\n /moveexport\n /movedelete"
+end
+
+function MovAny:OnCheckToggleCategories( button )
+ local state = button:GetChecked()
+ if state then
+ MADB.collapsed = true
+ else
+ MADB.collapsed = nil
+ end
+ for i, v in pairs(self.cats) do
+ v.collapsed = state
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:OnCheckToggleModifiedFramesOnly( button )
+ local state = button:GetChecked()
+ if state then
+ MADB.modifiedFramesOnly = true
+ else
+ MADB.modifiedFramesOnly = nil
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:MoverUpdatePosition( mover )
+ --dbg("MovAny:MoverUpdatePosition \""..mover:GetName().."\" \""..mover.tagged:GetName().."\"")
+ local x, y, parent
+ x = nil
+ y = nil
+ parent = nil
+ if mover.tagged then
+ local f = mover.tagged
+ if self.NoMove[ f:GetName() ] then
+ return
+ end
+ local opt = self:GetFrameOptions(f:GetName())
+ opt.pos = self:GetRelativePoint(opt.pos or self:GetFirstOrgPoint(opt) or {"BOTTOMLEFT", "UIParent", "BOTTOMLEFT"}, f)
+
+ if f.OnMAPosition then
+ f.OnMAPosition(f)
+ end
+
+ self:UpdateGUIIfShown()
+ end
+end
+
+function MovAny:MoverOnSizeChanged( mover )
+ if mover.tagged then
+ if mover.attaching then
+ return
+ end
+ local s, w, h, f, opt
+ f = mover.tagged
+ opt = self:GetFrameOptions(f:GetName())
+ if self.ScaleWH[ f:GetName() ] then
+ if opt.width ~= mover:GetWidth() or opt.height ~= mover:GetHeight() then
+ opt.width = mover:GetWidth()
+ opt.height = mover:GetHeight()
+ self:ApplyScale(f, opt)
+ --dbg("MoverSizeChanged WH w: "..numfor(opt.width).." h: "..numfor(opt.height))
+ end
+ else
+ if mover.MASizingAnchor == "LEFT" or mover.MASizingAnchor == "RIGHT" then
+ w = mover:GetWidth()
+ h = w * (f:GetHeight() / f:GetWidth())
+ if h < 8 then
+ h = 8
+ w = h * (f:GetWidth() / f:GetHeight())
+ end
+ else
+ h = mover:GetHeight()
+ w = h * (f:GetWidth() / f:GetHeight())
+ if w < 8 then
+ w = 8
+ h = w * (f:GetHeight() / f:GetWidth())
+ end
+ end
+ s = mover:GetWidth() / f:GetWidth()
+ s = s / MAGetScale(f:GetParent(), 1 ) * UIParent:GetScale()
+ if s > 0.991 and s < 1 then
+ s = 1
+ end
+
+ if mover.tagged.GetScale and s ~= mover.tagged:GetScale() then
+ opt.scale = s
+
+ --dbg("MoverSizeChanged w: "..numfor(w).." h: "..numfor(h).." s: "..numfor(s))
+ self:ApplyScale(f, opt)
+ --self:MoverUpdatePosition(mover)
+ end
+ mover:SetWidth(w)
+ mover:SetHeight(h)
+
+ local label = _G[ mover:GetName().."BackdropInfoLabel"]
+ label:SetWidth(w+100)
+ label:SetHeight(h)
+ end
+
+ local label = _G[ mover:GetName().."BackdropInfoLabel"]
+ label:ClearAllPoints()
+ label:SetPoint("TOP", label:GetParent(), "TOP", 0, 0)
+
+ local brief, long
+ if mover.tagged and MovAny:CanBeScaled(mover.tagged) then
+ if MovAny.ScaleWH[mover.tagged:GetName()] then
+ brief = "W: "..numfor(mover.tagged:GetWidth()).." H:"..numfor(mover.tagged:GetHeight())
+ long = brief
+ else
+ brief = numfor(mover.tagged:GetScale())
+ long = "Scale: "..brief
+ end
+ label:Show()
+ label:SetText(brief)
+ if mover == self.currentMover then
+ _G[ "MANudgerInfoLabel"]:Show()
+ _G[ "MANudgerInfoLabel"]:SetText(long)
+ end
+ end
+
+ label = _G[ mover:GetName().."BackdropMovingFrameName" ]
+ label:ClearAllPoints()
+ label:SetPoint("TOP", label:GetParent(), "TOP", 0, 20)
+
+ self:UpdateGUIIfShown(true)
+ end
+end
+
+function MovAny:MoverOnMouseWheel(mover, arg1)
+ if not mover.tagged or MovAny.NoAlpha[ mover.tagged:GetName() ] then
+ return
+ end
+ local alpha = mover.tagged:GetAlpha()
+ if arg1 > 0 then
+ alpha = alpha + 0.05
+ else
+ alpha = alpha - 0.05
+ end
+ if alpha < 0 then
+ alpha = 0
+ mover.tagged.alphaAttempts = nil
+ elseif alpha > 0.99 then
+ alpha = 1
+ mover.tagged.alphaAttempts = nil
+ elseif alpha > 0.92 then
+ if not mover.tagged.alphaAttempts then
+ mover.tagged.alphaAttempts = 1
+ elseif mover.tagged.alphaAttempts > 2 then
+ alpha = 1
+ mover.tagged.alphaAttempts = nil
+ else
+ mover.tagged.alphaAttempts = mover.tagged.alphaAttempts + 1
+ end
+ else
+ mover.tagged.alphaAttempts = nil
+ end
+
+ alpha = tonumber(numfor(alpha))
+
+ local opt = self:GetFrameOptions(mover.tagged:GetName())
+ opt.alpha = alpha
+ self:ApplyAlpha(mover.tagged, opt)
+
+ if opt.alpha == opt.originalAlpha then
+ opt.alpha = nil
+ opt.originalAlpha = nil
+ end
+
+ local label = _G[ mover:GetName().."BackdropInfoLabel"]
+ label:Show()
+ label:SetText(numfor(alpha* 100).."%")
+ if mover == self.currentMover then
+ _G[ "MANudgerInfoLabel"]:Show()
+ _G[ "MANudgerInfoLabel"]:SetText("Alpha:"..numfor(alpha * 100).."%")
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:ResetProfile(readOnly)
+ for i,v in pairs(self.frameOptions) do
+ self:ResetFrame(v.name, true, true)
+ end
+ self:ReanchorRelatives()
+ if not readOnly then
+ self.frameOptions = {}
+ MoveAnything_CharacterSettings[self:GetProfileName()] = self.frameOptions
+ end
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:ResetAllFrames(confirm)
+ for i,v in pairs(self.frameOptions) do
+ self:ResetFrame(v.name, true, true)
+ end
+ self:ReanchorRelatives()
+
+ if MADB.squareMM then
+ Minimap:SetMaskTexture("Textures\\MinimapMask")
+ end
+
+ MoveAnything_UseCharacterSettings = false
+ self.frameOptions = {}
+ MoveAnything_CharacterSettings = {}
+ MoveAnything_CharacterSettings[self:GetProfileName()] = self.frameOptions
+ MoveAnything_CustomFrames = {}
+ MADB = {}
+ MADB.collapsed = true
+ MAOptionsToggleCategories:SetChecked(true)
+ MovAny:OnCheckToggleCategories(MAOptionsToggleCategories)
+
+ self:UpdateGUIIfShown(true)
+end
+
+function MovAny:OnShow()
+ if MADB.playSound then
+ PlaySound("igMainMenuOpen")
+ end
+
+ MANudger:Show()
+ self:NudgerFrameRefresh()
+ self:UpdateGUI()
+
+ for i,v in pairs(self.lEnableMouse) do
+ if v and v.EnableMouse and ( not MovAny:IsProtected(v) or not InCombatLockdown()) then
+ v:EnableMouse(true)
+ end
+ end
+end
+
+function MovAny:OnHide()
+ if MADB.playSound then
+ PlaySound("igMainMenuClose")
+ end
+
+ if not MADB.alwaysShowNudger then
+ MANudger:Hide()
+ end
+
+ for i,v in pairs(self.lEnableMouse) do
+ if v and v.EnableMouse and ( not MovAny:IsProtected(v) or not InCombatLockdown()) then
+ v:EnableMouse(nil)
+ end
+ end
+end
+
+function MovAny:RowTitleClicked(title)
+ local o = self.frames[ MAGetParent(title).idx ]
+
+ if o.sep then
+ if o.collapsed then
+ o.collapsed = nil
+ else
+ o.collapsed = true
+ end
+
+ self:UpdateGUI(1)
+ else
+ if self.FrameEditor then
+ self:FrameEditor(o.name)
+ end
+ end
+end
+
+function MovAny:CountGUIItems()
+ local items = 0
+ local nextSepItems = 0
+ local curSep = nil
+
+ if self.searchWord and self.searchWord ~= "" then
+ for i, o in pairs(MovAny.frames) do
+ if not o.sep and o.cat then
+ if (not MADB.dontSearchFrameNames and string.match(string.lower(o.name), self.searchWord)) or (o.helpfulName and string.match(string.lower(o.helpfulName), self.searchWord)) then
+ if MADB.modifiedFramesOnly then
+ if MovAny:IsModified(o.name) then
+ items = items + 1
+ end
+ else
+ items = items + 1
+ end
+ end
+ end
+ end
+ else
+ for i, o in pairs(MovAny.frames) do
+ if o.sep then
+ if curSep then
+ curSep.items = nextSepItems
+ nextSepItems = 0
+ end
+ curSep = o
+ else
+ if MADB.modifiedFramesOnly then
+ if MovAny:IsModified(o.name) then
+ nextSepItems = nextSepItems + 1
+ end
+ else
+ nextSepItems = nextSepItems + 1
+ end
+ end
+ end
+
+ if curSep then
+ curSep.items = nextSepItems
+ end
+
+ for i, o in pairs(MovAny.frames) do
+ if o.sep then
+ if not MADB.modifiedFramesOnly then
+ if o.collapsed then
+ items = items + 1
+ else
+ items = items + o.items + 1
+ end
+ else
+ if o.items > 0 then
+ if o.collapsed then
+ items = items + 1
+ else
+ items = items + o.items + 1
+ end
+ end
+ end
+ end
+ end
+ end
+ self.guiLines = items
+ --dbg("GUI line counted: "..items)
+end
+
+function MovAny:UpdateGUI(recount)
+ if recount or MovAny.guiLines == -1 then
+ MovAny:CountGUIItems()
+ end
+
+ FauxScrollFrame_Update(MAScrollFrame, MovAny.guiLines, MADB.frameListRows, MovAny.SCROLL_HEIGHT)
+ local topOffset = FauxScrollFrame_GetOffset(MAScrollFrame)
+
+ local displayList = {}
+
+ if MovAny.searchWord and MovAny.searchWord ~= "" then
+ local results = {}
+ local skip = topOffset
+ for i, o in pairs(MovAny.frames) do
+ if not o.sep then
+ if (not MADB.dontSearchFrameNames and string.match(string.lower(o.name), MovAny.searchWord)) or (o.helpfulName and string.match(string.lower(o.helpfulName), MovAny.searchWord)) then
+ if MADB.modifiedFramesOnly then
+ if MovAny:IsModified(o.name) then
+ tinsert(results, o)
+ end
+ else
+ tinsert(results, o)
+ end
+ end
+ end
+ end
+ table.sort(results, function(o1,o2)
+ return o1.helpfulName:lower() < o2.helpfulName:lower()
+ end)
+ for i, o in pairs(results) do
+ if skip > 0 then
+ skip = skip - 1
+ else
+ tinsert(displayList, o)
+ end
+ end
+ results = nil
+ else
+ local startOffset = 0
+ local hidden = 0
+ local shown = 0
+ local lastSep = nil
+ for i, o in pairs(MovAny.frames) do
+ if startOffset == 0 and shown >= topOffset then
+ startOffset = topOffset + hidden
+ break
+ end
+
+ if o.sep then
+ lastSep = o
+ if MADB.modifiedFramesOnly then
+ if o.items == 0 then
+ hidden = hidden + 1
+ else
+ shown = shown + 1
+ end
+ else
+ shown = shown + 1
+ end
+ else
+ if lastSep and lastSep.collapsed then
+ elseif MADB.modifiedFramesOnly then
+ if lastSep.items > 0 then
+ shown = shown + 1
+ else
+ hidden = hidden + 1
+ end
+ else
+ shown = shown + 1
+ end
+ end
+ end
+
+ if startOffset ~= 0 then
+ -- X: fix off by one
+ if startOffset > 0 then
+ startOffset = startOffset + 1
+ end
+ end
+
+ local sepOffset, wtfOffset
+ sepOffset = 0
+ wtfOffset = 0
+ local skip = topOffset
+
+ for i=1, MADB.frameListRows, 1 do
+ local index = i + sepOffset + wtfOffset
+
+ local o
+ -- forward to next shown element
+ while 1 do
+ if index > MovAny.framesCount then
+ --dbg("UpdateGUI - index out of bounds: "..index.." / "..MovAny.framesCount)
+ o = nil
+ break
+ end
+ o = MovAny.frames[ index ]
+ if o.sep then
+ if MADB.modifiedFramesOnly then
+ if o.items > 0 then
+ if skip > 0 then
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ skip = skip -1
+ else
+ if o.sep and o.collapsed then
+ sepOffset = sepOffset + o.items
+ end
+ break
+ end
+ else
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ end
+ else
+ if skip > 0 then
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ skip = skip -1
+ else
+ if o.sep and o.collapsed then
+ sepOffset = sepOffset + o.items
+ end
+ break
+ end
+ end
+ elseif o.cat then
+ local c = o.cat
+ if c.collapsed then
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ else
+ if MADB.modifiedFramesOnly then
+ if MovAny:IsModified(o.name) then
+ if skip > 0 then
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ skip = skip -1
+ else
+ break
+ end
+ else
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ end
+ else
+ if skip > 0 then
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ skip = skip -1
+ else
+ break
+ end
+ end
+ end
+ else
+ --dbg("UpdateGUI - Error: Element neither a frame or category. index:"..index)
+ index = index + 1
+ wtfOffset = wtfOffset + 1
+ end
+ end
+ if o then
+ tinsert(displayList, o)
+ else
+ break
+ end
+ end
+ end
+
+ local prefix, move, backdrop, hide
+ prefix = "MAMove"
+ move = "Move"
+ hide = "Hide"
+
+ local skip = topOffset
+
+ for i = 1, MADB.frameListRows, 1 do
+ local o = displayList[i]
+ local row = _G[ prefix..i ]
+
+ if not o then
+ row:Hide()
+ else
+ local fn = o.name
+ local opts = MovAny:GetFrameOptions(fn)
+ local moveCheck = _G[ prefix..i..move ]
+ local hideCheck = _G[ prefix..i..hide ]
+ local text, frameNameLabel
+ local idx = MovAny:GetFrameIDX(o)
+
+ frameNameLabel = _G[ prefix..i.."FrameName" ]
+ frameNameLabel.idx = idx
+ row.idx = idx
+ row.name = o.name
+ row:Show()
+
+
+ if o.sep then
+ text = _G[ prefix..i.."FrameNameText" ]
+ text:Hide()
+ text = _G[ prefix..i.."FrameNameHighlight" ]
+ text:Show()
+ if o.collapsed and o.items > 0 then
+ text:SetText("+ "..o.helpfulName)
+ else
+ text:SetText(" "..o.helpfulName)
+ end
+ frameNameLabel.tooltipLines = nil
+ else
+ text = _G[ prefix..i.."FrameNameHighlight" ]
+ text:Hide()
+ text = _G[ prefix..i.."FrameNameText" ]
+ text:Show()
+ text:SetText((opts and opts.disabled and "*" or "")..o.helpfulName)
+ end
+
+ if fn then
+ _G[ prefix..i.."Backdrop" ]:Show()
+
+ if MovAny.NoMove[fn] and MovAny.NoScale[fn] and MovAny.NoAlpha[fn] then
+ moveCheck:Hide()
+ else
+ moveCheck:SetChecked(MovAny:GetMoverByFrameName(fn) and 1 or nil)
+ moveCheck:Show()
+ end
+ if MovAny.NoHide[fn] then
+ hideCheck:Hide()
+ else
+ hideCheck:SetChecked(opts and opts.hidden or nil)
+ hideCheck:Show()
+ end
+
+ if MovAny:IsModified(fn) then
+ _G[ prefix..i.."Reset" ]:Show()
+ else
+ if o.default then
+ _G[ prefix..i.."Reset" ]:Hide()
+ else
+ _G[ prefix..i.."Reset" ]:Show()
+ end
+ end
+ else
+ _G[ prefix..i.."Backdrop" ]:Hide()
+ moveCheck:Hide()
+ hideCheck:Hide()
+ _G[ prefix..i.."Reset" ]:Hide()
+ end
+ end
+ end
+
+ MAOptionsToggleCategories:SetChecked(MADB.collapsed)
+ MAOptionsToggleModifiedFramesOnly:SetChecked(MADB.modifiedFramesOnly)
+
+ if MovAny.searchWord and MovAny.searchWord ~= "" then
+ MAOptionsFrameNameHeader:SetText(string.format(MOVANY.LIST_HEADING_SEARCH_RESULTS, MovAny.guiLines))
+ else
+ MAOptionsFrameNameHeader:SetText(MOVANY.LIST_HEADING_CATEGORY_AND_FRAMES)
+ end
+ MovAny:TooltipHide()
+end
+
+function MovAny:UpdateGUIIfShown(recount, dontUpdateEditors)
+ if recount then
+ self.guiLines = -1
+ end
+ if MAOptions and MAOptions:IsShown() then
+ self:UpdateGUI()
+ end
+
+ if not dontUpdateEditors then
+ for fn, fe in pairs(self.frameEditors) do
+ if fe:IsShown() and not fe.updating then
+ fe:UpdateEditor()
+ end
+ end
+ end
+end
+
+function MovAny:NudgerChangeMover(dir)
+ local p
+ local first, sel
+ local cur = self.currentMover
+ local matchNext = false
+
+ for i, m in ipairs(self.movers) do
+ if not first then
+ first = m
+ end
+ if matchNext then
+ self.currentMover = m
+ matchNext = nil
+ break
+ end
+ if m == cur then
+ if dir < 0 then
+ if first == m then
+ for i2, m2 in ipairs(self.movers) do
+ sel = m2
+ end
+ self.currentMover = sel
+ else
+ self.currentMover = p
+ end
+ break
+ else
+ matchNext = true
+ end
+ end
+ p = m
+ end
+ if matchNext then
+ self.currentMover = first
+ end
+
+ self:NudgerFrameRefresh()
+end
+
+function MovAny:GetFirstMover()
+ for i, m in ipairs(self.movers) do
+ if m and m.IsShown and m:IsShown() then
+ return m
+ end
+ end
+ return nil
+end
+
+function MovAny:MoverOnShow(mover)
+ local mn = mover:GetName()
+
+ MANudger:Show()
+ self.currentMover = mover
+ self:NudgerFrameRefresh()
+
+ mover.startAlpha = mover.tagged:GetAlpha()
+ _G[mn.."Backdrop"]:Show()
+ _G[mn.."BackdropMovingFrameName"]:SetText( mover.helpfulName )
+ if not mover.tagged or not MovAny:CanBeScaled(mover.tagged) then
+ _G[mn.."Resize_TOP"]:Hide()
+ _G[mn.."Resize_LEFT"]:Hide()
+ _G[mn.."Resize_BOTTOM"]:Hide()
+ _G[mn.."Resize_RIGHT"]:Hide()
+ else
+ _G[mn.."Resize_TOP"]:Show()
+ _G[mn.."Resize_LEFT"]:Show()
+ _G[mn.."Resize_BOTTOM"]:Show()
+ _G[mn.."Resize_RIGHT"]:Show()
+ end
+
+ _G[ mn.."BackdropInfoLabel"]:SetText("")
+ if mover == self.currentMover then
+ _G[ "MANudgerInfoLabel"]:SetText("")
+ end
+end
+
+function MovAny:MoverOnHide()
+ local firstMover = self:GetFirstMover()
+ if not MADB.alwaysShowNudger and firstMover == nil then
+ MANudger:Hide()
+ else
+ self.currentMover = firstMover
+ self:NudgerFrameRefresh()
+ end
+end
+
+function MovAny:NudgerOnShow()
+ if not MADB.alwaysShowNudger then
+ local firstMover = self:GetFirstMover()
+ if firstMover == nil then
+ MANudger:Hide()
+ return
+ end
+ end
+ self:NudgerFrameRefresh()
+end
+
+function MovAny:NudgerFrameRefresh()
+ local labelText = ""
+
+ if self.currentMover ~= nil then
+ local cur = 0
+ for i, m in ipairs(self.movers) do
+ cur = cur + 1
+ if m == self.currentMover then
+ break
+ end
+ end
+ labelText = cur.." / "..#self.movers
+
+ local f = self.currentMover.tagged
+ if f then
+ local fn = f:GetName()
+ if fn then
+ labelText = labelText.."\n"..fn
+ MANudger.idx = MovAny:GetFrame(fn).idx
+ if self.NoHide[fn] then
+ MANudger_Hide:Hide()
+ else
+ MANudger_Hide:Show()
+ end
+ end
+ end
+ end
+ if #self.movers > 1 then
+ MANudger_MoverMinus:Show()
+ MANudger_MoverPlus:Show()
+ else
+ MANudger_MoverMinus:Hide()
+ MANudger_MoverPlus:Hide()
+ end
+ MANudgerTitle:SetText(labelText)
+end
+
+function MovAny:NudgerOnUpdate()
+ local obj = GetMouseFocus()
+ local text = ""
+ local text2 = ""
+ local label = MANudgerMouseOver
+ local labelSafe = MANudgerMouseOver
+ local name
+
+ if obj and obj ~= WorldFrame and obj:GetName() then
+ local objTest = self:GetDefaultFrameParent(obj)
+ if objTest then
+ name = objTest:GetName()
+ if name then
+ text = text.."Safe: "..name
+ end
+ else
+ objTest = self:GetTopFrameParent(obj)
+ if objTest then
+ name = objTest:GetName()
+ if name then
+ text = text.."Safe: "..objTest:GetName()
+ end
+ end
+ end
+ end
+
+ if obj and obj ~= WorldFrame and obj:GetName() then
+ name = obj:GetName()
+ if name then
+ text2 = "Mouseover: "..text2..name
+ end
+ if obj:GetParent() and obj:GetParent() ~= WorldFrame and obj:GetParent():GetName() then
+ name = obj:GetParent():GetName()
+ if name then
+ text2 = text2.."\nParent: "..name
+ end
+ if obj:GetParent():GetParent() and obj:GetParent():GetParent() ~= WorldFrame and obj:GetParent():GetParent():GetName() then
+ name = obj:GetParent():GetParent():GetName()
+ if name then
+ text2 = text2.."\nParent's Parent: "..name
+ end
+ end
+ end
+ end
+
+ if not string.find(text2, "MANudger") then
+ label:SetText(text2.."\n"..text)
+ else
+ label:SetText(text)
+ end
+end
+
+function MovAny:Center(lock)
+ local mover = self.currentMover
+ if lock == 0 then
+ -- Both
+ mover:ClearAllPoints()
+ mover:SetPoint("CENTER",0,0)
+ else
+ local x, y
+ x = mover:GetLeft()
+ y = mover:GetBottom()
+
+ mover:ClearAllPoints()
+ if lock == 1 then
+ --Horizontal
+ mover:SetPoint("CENTER",0,0)
+ x = mover:GetLeft()
+ mover:ClearAllPoints()
+ mover:SetPoint("BOTTOMLEFT",x,y)
+ elseif lock == 2 then
+ -- Vertical
+ mover:SetPoint("CENTER",0,0)
+ y = mover:GetBottom()
+ mover:ClearAllPoints()
+ mover:SetPoint("BOTTOMLEFT",x,y)
+ end
+ end
+
+ self:MoverUpdatePosition(mover)
+end
+
+function MovAny:Nudge(dir, button)
+ local x, y, offsetX, offsetY, parent, mover, offsetAmount
+ mover = self.currentMover
+
+ if not mover:IsShown() then
+ return
+ end
+
+ x = mover:GetLeft()
+ y = mover:GetBottom()
+
+ if button == "RightButton" then
+ if IsShiftKeyDown() then
+ offsetAmount = 250
+ else
+ offsetAmount = 50
+ end
+ else
+ if IsShiftKeyDown() then
+ offsetAmount = 10
+ elseif IsAltKeyDown() then
+ offsetAmount = 0.1
+ else
+ offsetAmount = 1
+ end
+ end
+
+ if dir == 1 then
+ offsetX = 0
+ offsetY = offsetAmount
+ elseif dir == 2 then
+ offsetX = 0
+ offsetY = -offsetAmount
+ elseif dir == 3 then
+ offsetX = -offsetAmount
+ offsetY = 0
+ elseif dir == 4 then
+ offsetX = offsetAmount
+ offsetY = 0
+ end
+
+ mover:ClearAllPoints()
+ mover:SetPoint("BOTTOMLEFT","UIParent","BOTTOMLEFT",x + offsetX, y + offsetY)
+ self:MoverUpdatePosition(mover)
+end
+
+function MovAny:SizingAnchor( button )
+ local s, e = string.find( button:GetName(), "Resize_" )
+ local anchorto = string.sub( button:GetName(), e + 1 )
+ local anchor
+
+ if anchorto == "LEFT" then
+ anchor = "RIGHT"
+ elseif anchorto == "RIGHT" then
+ anchor = "LEFT"
+ elseif anchorto == "TOP" then
+ anchor = "BOTTOM"
+ elseif anchorto == "BOTTOM" then
+ anchor = "TOP"
+ end
+ return anchorto, anchor
+end
+
+function MovAny:SetLeftFrameLocation()
+ local f = GetUIPanel("left")
+ if f and (f ~= LootFrame or GetCVar("lootUnderMouse") ~= "1") and not self:IsModified(f:GetName()) and not self:GetMoverByFrameName(f:GetName()) then
+ if self:IsModified("UIPanelMover1") then
+ local closure = function(f)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ MovAny:UnlockPoint(f)
+ f:ClearAllPoints()
+ f:SetPoint("TOPLEFT", "UIPanelMover1", "TOPLEFT")
+
+ if not f.MAOrgScale then
+ f.MAOrgScale = f:GetScale()
+ end
+ f:SetScale(MAGetScale( UIPanelMover1 ), 1)
+
+ if not f.MAOrgAlpha then
+ f.MAOrgAlpha = f:GetAlpha()
+ end
+ f:SetAlpha(UIPanelMover1:GetAlpha())
+ end
+ end
+ if self:IsProtected(f) and InCombatLockdown() then
+ MovAny.pendingActions[f:GetName()..":UIPanel"] = closure(f)
+ else
+ closure(f)()
+ end
+ else
+ local closure = function(f)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ if f.MAOrgScale then
+ f:SetScale(f.MAOrgScale)
+ f.MAOrgScale = nil
+ end
+ if f.MAOrgAlpha then
+ f:SetAlpha(f.MAOrgAlpha)
+ f.MAOrgAlpha = nil
+ end
+ end
+ end
+ if self:IsProtected(f) and InCombatLockdown() then
+ MovAny.pendingActions[f:GetName()..":UIPanel"] = closure(f)
+ else
+ closure(f)()
+ end
+ end
+ end
+end
+
+function MovAny:SetCenterFrameLocation()
+ if GetUIPanel("left") then
+ local f = GetUIPanel("center")
+ if f and (f ~= LootFrame or GetCVar("lootUnderMouse") ~= "1") and not self:IsModified(f:GetName()) and not self:GetMoverByFrameName(f:GetName()) then
+ if self:IsModified("UIPanelMover2" ) then
+ local closure = function(f)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ MovAny:UnlockPoint(f)
+ f:ClearAllPoints()
+ f:SetPoint("TOPLEFT", "UIPanelMover2", "TOPLEFT")
+
+ if not f.OrgScale then
+ f.OrgScale = f:GetScale()
+ end
+ f:SetScale(MAGetScale( UIPanelMover2 ), 1)
+
+ if not f.OrgAlpha then
+ f.OrgAlpha = f:GetAlpha()
+ end
+ f:SetAlpha(UIPanelMover2:GetAlpha())
+ end
+ end
+ if self:IsProtected(f) and InCombatLockdown() then
+ MovAny.pendingActions[f:GetName()..":UIPanel"] = closure(f)
+ else
+ closure(f)()
+ end
+ else
+ local closure = function(f)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ if f.OrgScale then
+ f:SetScale(f.OrgScale)
+ f.OrgScale = nil
+ end
+ if f.OrgAlpha then
+ f:SetAlpha(f.OrgAlpha)
+ f.OrgAlpha = nil
+ end
+ end
+ end
+ if self:IsProtected(f) and InCombatLockdown() then
+ MovAny.pendingActions[f:GetName()..":UIPanel"] = closure(f)
+ else
+ closure(f)()
+ end
+ end
+ end
+ end
+end
+
+function MovAny:GetContainerFrame( id )
+ local i = 1
+ local container
+ while 1 do
+ container = _G["ContainerFrame"..i]
+ if not container then
+ break
+ end
+ if container:IsShown() and container:GetID() == id then
+ return container
+ end
+ i = i + 1
+ end
+ return nil
+end
+
+function MovAny:GetBagInContainerFrame( f )
+ return self:GetBag(f:GetID())
+end
+
+function MovAny:GetBag(id)
+ return self.bagFrames[ id ]
+end
+
+function MovAny:SetBag(id, bag)
+ self.bagFrames[ id ] = bag
+end
+
+function MovAny:GrabContainerFrame( container, movableBag )
+ if movableBag and MovAny:IsModified(movableBag:GetName()) then
+ movableBag:Show()
+
+ MovAny:UnlockScale(container)
+ container:SetScale(MAGetScale( movableBag ))
+ MovAny:LockScale(container)
+
+ MovAny:UnlockPoint(container)
+ container:ClearAllPoints()
+ --container:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", movableBag:GetLeft(), movableBag:GetBottom())
+ container:SetPoint("CENTER", movableBag, "CENTER", 0, 0)
+ MovAny:LockPoint(container)
+
+ movableBag.attachedChildren = {}
+ tinsert(movableBag.attachedChildren, container)
+
+ --local opts = MovAny:GetFrameOptions(movableBag:GetName())
+ --MovAny:ApplyAlpha(container, opts)
+ container:SetAlpha(movableBag:GetAlpha())
+ else
+ local opts = {alpha = 1.0, scale = 1.0}
+ MovAny:ApplyAlpha(container, opts)
+ MovAny:ApplyScale(container, opts)
+ end
+end
+
+function MovAny:ApplyAll(f, opt)
+ opt = opt or MovAny:GetFrameOptions(f:GetName())
+ if opt.disabled then
+ return
+ end
+ --dbg(" applying stored settings to "..(f:GetName() or "unnamed frame"))
+ MovAny:ApplyScale(f, opt)
+ MovAny:ApplyPosition(f, opt)
+ MovAny:ApplyAlpha(f, opt)
+ MovAny:ApplyHide(f, opt)
+ MovAny:ApplyLayers(f, opt)
+ MovAny:ApplyMisc(f, opt)
+end
+
+function MovAny:ResetAll(f, opt, readOnly)
+ opt = opt or MovAny:GetFrameOptions(f:GetName())
+
+ MovAny:ResetScale(f, opt, readOnly)
+ MovAny:ResetPosition(f, opt, readOnly)
+ MovAny:ResetAlpha(f, opt, readOnly)
+ MovAny:ResetHide(f, opt, readOnly)
+ MovAny:ResetLayers(f, opt, readOnly)
+ MovAny:ResetMisc(f, opt, readOnly)
+end
+
+function MovAny:UnanchorRelatives(f, opt)
+ if f.GetName and f:GetName() ~= nil and (MovAny.NoUnanchorRelatives[ f:GetName() ] ) then
+ -- semi nasty hack to avoid unanchoring buffs/debuffs
+ -- or string.match(f:GetName(), "[Bb]uff")
+ return
+ end
+ if not f.GetParent then
+ return
+ end
+ local p = f:GetParent()
+ if not p then
+ return
+ end
+
+ opt = opt or self:GetFrameOptions(f:GetName())
+
+ --dbg("searching for relatives to "..f:GetName().." in "..p:GetName())
+
+ local named = {}
+
+ self:_AddNamedChildren(named, f)
+
+ local relatives = tcopy(named)
+ relatives[ f ] = f
+
+ if p.GetRegions then
+ local children = {p:GetRegions()}
+ if children ~= nil then
+ --dbg(" regions: "..tlen(children))
+ for i, v in ipairs(children) do
+ self:_AddDependents(relatives, v)
+ end
+ end
+ end
+
+ if p.GetChildren then
+ local children = {p:GetChildren()}
+ if children ~= nil then
+ --dbg(" siblings: "..tlen(children))
+ for i, v in ipairs(children) do
+ self:_AddDependents(relatives, v)
+ end
+ end
+ end
+
+ relatives[ f ] = nil
+ relatives[GameTooltip] = nil
+
+ for i, v in pairs(named) do
+ relatives[ v ] = nil
+ end
+
+ --local fRel = self:ForcedDetachFromParent(f:GetName())
+ local fRel = select(2, opt.orgPos)
+ if fRel == nil then
+ fRel = select(2, f:GetPoint(1))
+ end
+ local size = tlen(relatives)
+ if size > 0 then
+ --dbg("unanchoring relatives for "..f:GetName().." from "..p:GetName()..". children found: "..size)
+ local unanchored = {}
+ local x, y, i
+ for i, v in pairs(relatives) do
+ if --[[self:IsDefaultFrame(v) and ]]not self:IsContainer(v:GetName()) and not string.match(v:GetName(), "BagFrame[1-9][0-9]*") and not self.NoUnanchoring[ v:GetName() ] and not v.MAPoint then -- alternatively use not self:GetFrameOptions(v:GetName()) instead of v.MAPoint
+ if v:GetRight() ~= nil and v:GetTop() ~= nil then
+ --dbg(" unanchoring "..v:GetName().." from "..f:GetName())
+
+ local p = {v:GetPoint(1)}
+ p[2] = fRel
+ p = MovAny:GetRelativePoint(p, v, true)
+ --print(unpack(p))
+ if MovAny:IsProtected(v) and InCombatLockdown() then
+ MovAny:AddPendingPoint(v, p)
+ else
+ v.MAOrgPoint = {v:GetPoint(1)}
+ MovAny:UnlockPoint(v)
+ v:ClearAllPoints()
+ v:SetPoint(unpack(p))
+ MovAny:LockPoint(v)
+ end
+ unanchored[ i ] = v
+ end
+ --else
+ --dbg(" skipping "..v:GetName().." <- "..f:GetName().."")
+ end
+ end
+ if i ~= nil then
+ f.MAUnanchoredRelatives = unanchored
+ end
+ end
+end
+
+function MovAny:_AddDependents(l, f)
+ local p = select(2, f:GetPoint(1))
+ if p and l[ p ] then
+ l[ f ] = f
+ end
+end
+
+function MovAny:_AddNamedChildren(l, f)
+ local n
+
+ if f.GetChildren then
+ local children = {f:GetChildren()}
+ if children ~= nil then
+ for i, v in pairs(children) do
+ self:_AddNamedChildren(l, v)
+ if v.GetName then
+ n = v:GetName()
+ if n then
+ l[ v ] = v
+ end
+ end
+ end
+ end
+ end
+
+ if f.attachedChildren then
+ local children = f.attachedChildren
+ if children ~= nil then
+ for i, v in pairs(children) do
+ self:_AddNamedChildren(l, v)
+ if v.GetName then
+ n = v:GetName()
+ if n then
+ l[ v ] = v
+ end
+ end
+ end
+ end
+ end
+end
+
+function MovAny:ReanchorRelatives()
+ local f
+ for i,v in pairs(self.frameOptions) do
+ f = _G[ v.name ]
+ if f and f.MAUnanchoredRelatives then
+ --dbg(f:GetName().." restoring relatives anchors")
+ for k, r in pairs(f.MAUnanchoredRelatives) do
+ --dbg(" restoring anchor to "..r:GetName().." ")
+ if not MovAny:IsModified(r) then
+ MovAny:UnlockPoint(r)
+ if r.MAOrgPoint then
+ r:SetPoint(unpack(r.MAOrgPoint))
+ r.MAOrgPoint = nil
+ end
+ end
+ end
+ f.MAUnanchoredRelatives = nil
+ end
+ end
+end
+
+function MovAny:AddPendingPoint(f, p)
+ local closure = function(f, p)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ if not f.MAOrgPoint then
+ f.MAOrgPoint = {f:GetPoint(1)}
+ end
+ MovAny:UnlockPoint(f)
+ f:ClearAllPoints()
+ --MovAny:SetPoint(f, p)
+ f:SetPoint(unpack(p))
+ MovAny:LockPoint(f)
+ end
+ end
+ MovAny.pendingActions[fn..":Point"] = closure(f, p)
+end
+
+function MovAny:ApplyPosition(f, opt)
+ if not opt or self.NoMove[ f:GetName() ] then
+ return
+ end
+
+ if opt.pos then
+ local fn = f:GetName()
+ if opt.orgPos == nil and not self:IsContainer(f:GetName()) and string.match("BagFrame", f:GetName()) ~= nil then
+ MovAny:StoreOrgPoints(f, opt)
+ end
+
+ if UIPARENT_MANAGED_FRAME_POSITIONS[fn] then
+ f.ignoreFramePositionManager = true
+ end
+
+ self:UnlockPoint(f)
+ f:ClearAllPoints()
+ f:SetPoint(unpack(opt.pos))
+ self:LockPoint(f)
+
+ if f.OnMAPosition then
+ f.OnMAPosition(f)
+ end
+
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ if not v.ignoreFramePositionManager and v.GetName and UIPARENT_MANAGED_FRAME_POSITIONS[v:GetName()] and not v.ignoreFramePositionManager and not MovAny:IsModified(v) and v.GetName and UIPARENT_MANAGED_FRAME_POSITIONS[v:GetName()] then
+ v.UMFP = true
+ v.ignoreFramePositionManager = true
+ end
+ end
+ end
+
+ if UIPanelWindows[fn] and f ~= GameMenuFrame then
+ local left = GetUIPanel("left")
+ local center = GetUIPanel("center")
+
+ if f == left then
+ UIParent.left = nil
+ if center then
+ UIParent.center = nil
+ UIParent.left = center
+ end
+ elseif f == center then
+ UIParent.center = nil
+ end
+
+ local wasShown = f:IsShown()
+ if wasShown and (not MovAny:IsProtected(f) or not InCombatLockdown()) then
+ HideUIPanel(f)
+ end
+ local opt = self:GetFrameOptions(fn)
+ if opt then
+ opt.UIPanelWindows = UIPanelWindows[fn]
+ end
+ UIPanelWindows[fn] = nil
+ f:SetAttribute("UIPanelLayout-enabled", false)
+
+ if wasShown and f ~= MerchantFrame and (not MovAny:IsProtected(f) or not InCombatLockdown()) then
+ f:Show()
+ end
+ end
+ end
+end
+
+function MovAny:ResetPosition(f, opt, readOnly)
+ if not opt or (f.GetName and MovAny.NoMove[ f:GetName() ]) then
+ return
+ end
+ MovAny:UnlockPoint(f)
+
+ local umfp = nil
+ if f.ignoreFramePositionManager then
+ umfp = true
+ f.ignoreFramePositionManager = nil
+ end
+
+ if opt.orgPos then
+ self:RestoreOrgPoints(f, opt, readOnly)
+ else
+ --f:ClearAllPoints()
+ return
+ end
+ --[[
+ if not readOnly and f.MAUnanchoredRelatives then
+ --dbg(f:GetName().." got unanchored relatives")
+ for i, v in pairs(f.MAUnanchoredRelatives) do
+ if not MovAny:IsModified(v:GetName()) then
+ --dbg(" restoring anchor to "..v:GetName().." ")
+ MovAny:UnlockPoint(v)
+ if v.MAOrgPoint then
+ v:SetPoint(unpack(v.MAOrgPoint))
+ v.MAOrgPoint = nil
+ end
+ --else
+ --dbg("skipping hooked relative: "..v:GetName())
+ end
+ end
+ f.MAUnanchoredRelatives = nil
+ end
+ --]]
+ if f.OnMAPositionReset then
+ f.OnMAPositionReset(f, opt, readOnly)
+ end
+ if not readOnly then
+ opt.pos = nil
+ end
+
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ if v and not MovAny:IsModified(v) and v.GetName and v.UMFP then
+ v.UMFP = nil
+ v.ignoreFramePositionManager = nil
+ umfp = true
+ end
+ end
+ end
+
+ if opt.UIPanelWindows then
+ UIPanelWindows[ f:GetName() ] = opt.UIPanelWindows
+ if not readOnly then
+ opt.UIPanelWindows = nil
+ end
+ f:SetAttribute("UIPanelLayout-enabled", true)
+ if f:IsShown() and (not MovAny:IsProtected(f) or not InCombatLockdown()) then
+ f:Hide()
+ ShowUIPanel(f)
+ end
+ end
+
+ if umfp and not InCombatLockdown() then
+ UIParent_ManageFramePositions()
+ end
+
+ f.MAOrgParent = nil
+end
+
+function MovAny:ApplyAlpha(f, opt)
+ if not opt or MovAny.NoAlpha[ f:GetName() ] then
+ return
+ end
+ local alpha = opt.alpha
+
+ if alpha and alpha >= 0 and alpha <= 1 then
+ if opt.originalAlpha == nil then
+ opt.originalAlpha = f:GetAlpha()
+ end
+ f:SetAlpha(alpha)
+
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ if v:GetAlpha() ~= 1 then
+ v.MAOrgAlpha = v:GetAlpha()
+ end
+ v:SetAlpha(alpha)
+ end
+ end
+ if f.OnMAAlpha then
+ f.OnMAAlpha(f, alpha)
+ end
+ end
+end
+
+function MovAny:ResetAlpha(f, opt, readOnly)
+ if not opt or MovAny.NoAlpha[ f:GetName() ] then
+ return
+ end
+
+ local alpha = opt.originalAlpha
+ if alpha == nil or alpha > 1 then
+ alpha = 1
+ elseif alpha < 0 then
+ alpha = 0
+ end
+
+ f:SetAlpha(alpha)
+
+ if f.attachedChildren then
+ for i, v in pairs(f.attachedChildren) do
+ v:SetAlpha(alpha)
+ end
+ end
+
+ if f.OnMAAlpha then
+ f.OnMAAlpha(f, alpha)
+ end
+end
+
+function MovAny:ApplyHide(f, opt, readOnly)
+ if not opt or MovAny.NoHide[ f:GetName() ] then
+ return
+ end
+
+ -- HideFrame fires OnMAHide event now
+ if opt.hidden then
+ self:HideFrame(f, readOnly)
+ end
+end
+
+function MovAny:ResetHide(f, opt, readOnly)
+ if not opt or MovAny.NoHide[ f:GetName() ] then
+ return
+ end
+
+ local wasHidden = opt.hidden
+ if not readOnly then
+ opt.hidden = nil
+ end
+
+ if wasHidden then
+ self:ShowFrame(f, readOnly)
+ end
+
+ if f.OnMAHide then
+ f.OnMAHide(f, nil)
+ end
+end
+
+function MovAny:ApplyScale( f, opt, readOnly )
+ if not opt or not self:CanBeScaled(f) then
+ return
+ end
+
+ self:UnlockScale(f)
+ if f.GetName and self.ScaleWH[ f:GetName() ] then
+ if opt.width or opt.height then
+ --dbg(f:GetName().."::ApplyScale WH w:"..opt.width.." h:"..opt.height)
+
+ if opt.width and opt.originalWidth == nil then
+ opt.originalWidth = f:GetWidth()
+ end
+ if opt.height and opt.originalHeight == nil then
+ opt.originalHeight = f:GetHeight()
+ end
+ if self.lHideOnScale[ f:GetName() ] then
+ for i,v in pairs(self.lHideOnScale[ f:GetName() ]) do
+ self:LockVisibility(v)
+ end
+ end
+ if opt.width ~= nil and opt.width > 0 then
+ f:SetWidth(opt.width)
+ end
+ if opt.height ~= nil and opt.height > 0 then
+ f:SetHeight(opt.height)
+ end
+ self:LockScale(f)
+ if self.lLinkedScaling[ f:GetName() ] then
+ for i,v in pairs(self.lLinkedScaling[ f:GetName() ]) do
+ if not self:IsModified(v) then
+ self:ApplyScale(_G[v], opt)
+ end
+ end
+ end
+ if f.OnMAScale then
+ f.OnMAScale(f, opt.width, opt.height)
+ end
+ end
+ elseif opt.scale ~= nil and opt.scale >= 0 then
+ if readOnly == nil and not opt.originalScale then
+ --dbg("no org scale, setting "..f:GetName().." to: "..f:GetScale())
+ opt.originalScale = f:GetScale()
+ end
+
+ f:SetScale(opt.scale)
+ self:LockScale(f)
+
+ if self.lHideOnScale[ f:GetName() ] then
+ for i,v in pairs(self.lHideOnScale[ f:GetName() ]) do
+ self:LockVisibility(v)
+ end
+ end
+
+ if f.attachedChildren and not f.MANoScaleChildren then
+ for i, v in pairs(f.attachedChildren) do
+ self:ApplyScale(v, opt)
+ end
+ end
+
+ if self.lLinkedScaling[ f:GetName() ] then
+ for i,v in pairs(self.lLinkedScaling[ f:GetName() ]) do
+ if not self:IsModified(v) then
+ self:ApplyScale(_G[v], opt)
+ end
+ end
+ end
+ if f.OnMAScale then
+ f.OnMAScale(f, opt.scale)
+ end
+ end
+end
+
+function MovAny:ResetScale(f, opt, readonly)
+ -- XX: should prolly change second condition to self:CanBeScaled(f)
+ if not opt or (f.GetName and self.NoScale[ f:GetName() ]) then
+ return
+ end
+
+ self:UnlockScale(f)
+ if self.ScaleWH[ f:GetName() ] then
+ if (opt.originalWidth and f:GetWidth() ~= opt.originalWidth) or (opt.originalHeight and f:GetHeight() ~= opt.originalHeight) then
+ if opt.originalWidth ~= nil and opt.originalWidth > 0 then
+ f:SetWidth(opt.originalWidth)
+ end
+ if opt.originalHeight ~= nil and opt.originalHeight > 0 then
+ f:SetHeight(opt.originalHeight)
+ end
+ if self.lHideOnScale[ f:GetName() ] then
+ for i,v in pairs(self.lHideOnScale[ f:GetName() ]) do
+ self:UnlockVisibility(v)
+ end
+ end
+ if self.lLinkedScaling[ f:GetName() ] then
+ local lf
+ for i,v in pairs(self.lLinkedScaling[ f:GetName() ]) do
+ if not self:IsModified(v) then
+ lf = _G[v]
+ if self:CanBeScaled(lf) then
+ if self:IsProtected(lf) and InCombatLockdown() then
+ self.pendingFrames[v] = opt
+ else
+ self:ResetScale(lf, opt)
+ end
+ end
+ end
+ end
+ end
+ if f.OnMAScale then
+ f.OnMAScale(f, {opt.width, opt.height})
+ end
+ end
+ elseif self:IsScalableFrame(f) then
+ local scale = opt.originalScale or 1
+ if scale == nil then
+ return
+ end
+ if scale ~= f:GetScale() then
+ f:SetScale(scale)
+ end
+
+ if self.lHideOnScale[ f:GetName() ] then
+ for i,v in pairs(self.lHideOnScale[ f:GetName() ]) do
+ self:UnlockVisibility(v)
+ end
+ end
+ if f.attachedChildren and not f.MANoScaleChildren then
+ for i, v in pairs(f.attachedChildren) do
+ if not self:IsModified(v) then
+ if self:CanBeScaled(v) then
+ if self:IsProtected(v) and InCombatLockdown() then
+ self.pendingFrames[i] = opt
+ else
+ self:ResetScale(v, opt)
+ end
+ end
+ end
+ end
+ end
+ if self.lLinkedScaling[ f:GetName() ] then
+ for i,v in pairs(self.lLinkedScaling[ f:GetName() ]) do
+ self:ResetScale(_G[v], opt)
+ end
+ end
+ if f.OnMAScale then
+ f.OnMAScale(f, scale)
+ end
+ end
+end
+
+function MovAny:ApplyLayers(f, opt, readOnly)
+ if not opt then
+ return
+ end
+ if opt.disableLayerArtwork then
+ f:DisableDrawLayer("ARTWORK")
+ end
+ if opt.disableLayerBackground then
+ f:DisableDrawLayer("BACKGROUND")
+ end
+ if opt.disableLayerBorder then
+ f:DisableDrawLayer("BORDER")
+ end
+ if opt.disableLayerHighlight then
+ f:DisableDrawLayer("HIGHLIGHT")
+ end
+ if opt.disableLayerOverlay then
+ f:DisableDrawLayer("OVERLAY")
+ end
+end
+
+function MovAny:ResetLayers(f, opt, readOnly)
+ if not opt then
+ return
+ end
+ if not f.EnableDrawLayer then
+ if not readOnly then
+ opt.disableLayerArtwork = nil
+ opt.disableLayerBackground = nil
+ opt.disableLayerBorder = nil
+ opt.disableLayerHighlight = nil
+ opt.disableLayerOverlay = nil
+ return
+ end
+ end
+ if opt.disableLayerArtwork then
+ f:EnableDrawLayer("ARTWORK")
+ if not readOnly then
+ opt.disableLayerArtwork = nil
+ end
+ end
+ if opt.disableLayerBackground then
+ f:EnableDrawLayer("BACKGROUND")
+ if not readOnly then
+ opt.disableLayerBackground = nil
+ end
+ end
+ if opt.disableLayerBorder then
+ f:EnableDrawLayer("BORDER")
+ if not readOnly then
+ opt.disableLayerBorder = nil
+ end
+ end
+ if opt.disableLayerHighlight then
+ f:EnableDrawLayer("HIGHLIGHT")
+ if not readOnly then
+ opt.disableLayerHighlight = nil
+ end
+ end
+ if opt.disableLayerOverlay then
+ f:EnableDrawLayer("OVERLAY")
+ if not readOnly then
+ opt.disableLayerOverlay = nil
+ end
+ end
+end
+
+function MovAny:ApplyMisc(f, opt, readOnly)
+ if not opt then
+ return
+ end
+
+ if opt.frameStrata then
+ if not opt.orgFrameStrata then
+ opt.orgFrameStrata = f:GetFrameStrata()
+ end
+ f:SetFrameStrata(opt.frameStrata)
+ end
+
+ if opt.clampToScreen then
+ if not opt.orgClampToScreen then
+ opt.orgClampToScreen = f:IsClampedToScreen()
+ end
+ f:SetClampedToScreen(opt.clampToScreen)
+ end
+
+ if opt.enableMouse ~= nil then
+ opt.orgEnableMouse = f:IsMouseEnabled()
+ f:EnableMouse(opt.enableMouse)
+ end
+
+ if opt.movable ~= nil then
+ opt.orgMovable = f:IsMovable()
+ f:SetMovable(opt.movable)
+ end
+end
+
+function MovAny:ResetMisc(f, opt, readOnly)
+ if not opt then
+ return
+ end
+ if opt.orgFrameStrata then
+ f:SetFrameStrata(opt.orgFrameStrata)
+ if not readOnly then
+ opt.frameStrata = nil
+ opt.orgFrameStrata = nil
+ end
+ end
+
+ if opt.orgEnableMouse then
+ f:EnableMouse(opt.orgEnableMouse)
+ if not readOnly then
+ opt.orgEnableMouse = nil
+ opt.enableMouse = nil
+ end
+ end
+
+ if opt.orgMovable then
+ f:SetMovable(opt.orgMovable)
+ if not readOnly then
+ opt.orgMovable = nil
+ opt.movable = nil
+ end
+ end
+end
+
+-- modfied version of blizzards updateContainerFrameAnchors
+-- to prevent this from hooking the original updateContainerFrameAnchors do a "/run MADB.noBags = true" followed by "/reload"
+function MovAny:hUpdateContainerFrameAnchors()
+ if MADB.noBags then
+ return
+ end
+ local frame, xOffset, yOffset, screenHeight, freeScreenHeight, leftMostPoint, column
+ local screenWidth = GetScreenWidth()
+ local containerScale = 1
+ local leftLimit = 0
+
+ while ( containerScale > CONTAINER_SCALE ) do
+ screenHeight = GetScreenHeight() / containerScale
+ -- Adjust the start anchor for bags depending on the multibars
+ xOffset = CONTAINER_OFFSET_X / containerScale
+ yOffset = CONTAINER_OFFSET_Y / containerScale
+ -- freeScreenHeight determines when to start a new column of bags
+ freeScreenHeight = screenHeight - yOffset
+ leftMostPoint = screenWidth - xOffset
+ column = 1
+ local frameHeight
+ for index, frameName in ipairs(ContainerFrame1.bags) do
+ frameHeight = _G[frameName]:GetHeight()
+ if freeScreenHeight < frameHeight then
+ -- Start a new column
+ column = column + 1
+ leftMostPoint = screenWidth - ( column * CONTAINER_WIDTH * containerScale ) - xOffset
+ freeScreenHeight = screenHeight - yOffset
+ end
+ freeScreenHeight = freeScreenHeight - frameHeight - VISIBLE_CONTAINER_SPACING
+ end
+ if leftMostPoint < leftLimit then
+ containerScale = containerScale - 0.01
+ else
+ break
+ end
+ end
+
+ if containerScale < CONTAINER_SCALE then
+ containerScale = CONTAINER_SCALE
+ end
+
+ screenHeight = GetScreenHeight() / containerScale
+ -- Adjust the start anchor for bags depending on the multibars
+ xOffset = CONTAINER_OFFSET_X / containerScale
+ yOffset = CONTAINER_OFFSET_Y / containerScale
+ -- freeScreenHeight determines when to start a new column of bags
+ freeScreenHeight = screenHeight - yOffset
+ column = 0
+
+ local bag = nil
+ local lastBag = nil
+ for index, frameName in ipairs(ContainerFrame1.bags) do
+ frame = _G[frameName]
+ bag = MovAny:GetBagInContainerFrame(frame)
+ if not bag or ( bag and not MovAny:IsModified(bag:GetName()) and not MovAny:GetMoverByFrameName(bag:GetName()) ) then
+ --dbg("uCFA: "..bag:GetName().."")
+
+ MovAny:UnlockScale(frame)
+ frame:SetScale(containerScale)
+
+ MovAny:UnlockPoint(frame)
+ frame:ClearAllPoints()
+ if lastBag == nil then
+ -- First bag
+ frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", GetScreenWidth()-xOffset-CONTAINER_WIDTH, yOffset )
+ elseif freeScreenHeight < frame:GetHeight() then
+ -- Start a new column
+ --dbg("new column: "..frame:GetName())
+ column = column + 1
+ freeScreenHeight = screenHeight - yOffset
+ frame:SetPoint("BOTTOMLEFT", frame:GetParent(), "BOTTOMLEFT", GetScreenWidth()-xOffset-(column * CONTAINER_WIDTH) - CONTAINER_WIDTH, yOffset )
+ else
+ -- Anchor to the previous bag
+ --dbg("attaching bag: "..frame:GetName().." to "..(select(4, lastBag:GetPoint(1)))..", "..(lastBag:GetTop() + CONTAINER_SPACING))
+ frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", select(4, lastBag:GetPoint(1)), lastBag:GetTop() + CONTAINER_SPACING)
+ end
+ freeScreenHeight = freeScreenHeight - frame:GetHeight() - VISIBLE_CONTAINER_SPACING
+
+ lastBag = frame
+ end
+ end
+end
+
+----------------------------------------------------------------
+-- X: slash commands
+
+SLASH_MAMOVE1 = "/move"
+SlashCmdList["MAMOVE"] = function( msg )
+ if msg == nil or string.len( msg ) == 0 then
+ MovAny:ToggleGUI()
+ else
+ MovAny:ToggleMove(MovAny:Translate(msg))
+ end
+end
+
+SLASH_MAUNMOVE1= "/unmove"
+SlashCmdList["MAUNMOVE"] = function( msg )
+ if msg then
+ if MovAny.frameOptions[ msg ] then
+ MovAny:ResetFrame(msg)
+ elseif MovAny.frameOptions[ MovAny:Translate(msg) ] then
+ MovAny:ResetFrame(MovAny:Translate(msg))
+ end
+ else
+ maPrint(MOVANY.CMD_SYNTAX_UNMOVE)
+ end
+end
+
+SLASH_MAHIDE1 = "/hide"
+SlashCmdList["MAHIDE"] = function( msg )
+ if msg == nil or string.len( msg ) == 0 then
+ maPrint(MOVANY.CMD_SYNTAX_HIDE)
+ return
+ end
+ MovAny:ToggleHide(MovAny:Translate(msg))
+end
+
+SLASH_MAIMPORT1 = "/moveimport"
+SlashCmdList["MAIMPORT"] = function( msg )
+ if msg == nil or string.len(msg) == 0 then
+ maPrint(MOVANY.CMD_SYNTAX_IMPORT)
+ return
+ end
+
+ if InCombatLockdown() then
+ maPrint(MOVANY.DISABLED_DURING_COMBAT)
+ return
+ end
+
+ if MoveAnything_CharacterSettings[msg] == nil then
+ maPrint(string.format(MOVANY.PROFILE_UNKNOWN, msg))
+ return
+ end
+
+ MovAny:CopySettings(msg, MovAny:GetProfileName())
+ MovAny:UpdateProfile()
+ maPrint(string.format(MOVANY.PROFILE_IMPORTED, msg))
+end
+
+SLASH_MAEXPORT1 = "/moveexport"
+SlashCmdList["MAEXPORT"] = function( msg )
+ if msg == nil or string.len(msg) == 0 then
+ maPrint(MOVANY.CMD_SYNTAX_EXPORT)
+ return
+ end
+
+ MovAny:CopySettings(MovAny:GetProfileName(), msg)
+ maPrint(string.format(MOVANY.PROFILE_EXPORTED, msg))
+end
+
+
+SLASH_MALIST1 = "/movelist"
+SlashCmdList["MALIST"] = function( msg )
+ maPrint(MOVANY.PROFILES..":")
+ for i, val in pairs(MoveAnything_CharacterSettings) do
+ local str = " \""..i.."\""
+ if val == MovAny.frameOptions then
+ str = str.." <- "..MOVANY.PROFILE_CURRENT
+ end
+ maPrint(str)
+ end
+end
+
+SLASH_MADELETE1 = "/movedelete"
+SLASH_MADELETE2 = "/movedel"
+SlashCmdList["MADELETE"] = function( msg )
+ if msg == nil or string.len( msg ) == 0 then
+ maPrint(MOVANY.CMD_SYNTAX_DELETE)
+ return
+ end
+
+ if MoveAnything_CharacterSettings[msg] == nil then
+ maPrint(string.format(MOVANY.PROFILE_UNKNOWN, msg))
+ return
+ end
+
+ if msg == MovAny:GetProfileName() then
+ if InCombatLockdown() then
+ maPrint(MOVANY.PROFILE_CANT_DELETE_CURRENT_IN_COMBAT)
+ return
+ end
+ MovAny:ResetProfile()
+ else
+ MoveAnything_CharacterSettings[msg] = nil
+ end
+ maPrint(string.format(MOVANY.PROFILE_DELETED, msg))
+end
+
+----------------------------------------------------------------
+-- X: global functions
+
+function numfor(n, decimals)
+ if n == nil then
+ return "nil"
+ end
+ n = string.format("%."..(decimals or 2).."f", n)
+ if decimals == nil then
+ decimals = 2
+ end
+ while decimals > 0 do
+ if string.sub(n, -1) == "0" then
+ n = string.sub(n, 1, -2)
+ end
+ decimals = decimals - 1
+ end
+ if string.sub(n, -1) == "." then
+ n = string.sub(n, 1, -2)
+ end
+ return n
+end
+
+function MAGetParent( f )
+ if not f or not f.GetParent then
+ return
+ end
+ local p = f:GetParent()
+ if p == nil then
+ return UIParent
+ end
+
+ return p
+end
+
+function MAGetScale( f, effective )
+ if not f or not f.GetScale then
+ return 1
+ elseif MovAny.NoScale[f:GetName()] then
+ return f:GetScale()
+ else
+ if not f.GetScale or f:GetScale() == nil then
+ return 1
+ end
+
+ if effective then
+ return f:GetEffectiveScale()
+ else
+ return f:GetScale()
+ end
+ end
+end
+
+function maPrint( msgKey, msgHighlight, msgAdditional, r, g, b, frame )
+ local msgOutput
+ if frame then
+ msgOutput = frame
+ else
+ msgOutput = DEFAULT_CHAT_FRAME
+ end
+
+ if msgKey == "" then
+ return
+ end
+ if msgKey == nil then
+ msgKey = ""
+ end
+ if msgHighlight == nil or msgHighlight == "" then
+ msgHighlight = " "
+ end
+ if msgAdditional == nil or msgAdditional == "" then
+ msgAdditional = " "
+ end
+ if msgOutput then
+ msgOutput:AddMessage( "|caaff0000MoveAnything|r|caaffff00>|r "..msgKey.." |caaaaddff"..msgHighlight.."|r"..msgAdditional, r, g, b )
+ end
+end
+
+----------------------------------------------------------------
+function MovAny:ToggleEnableFrame(fn, opt)
+ local opt = opt or MovAny:GetFrameOptions(fn)
+ if opt.disabled then
+ self:EnableFrame(fn)
+ else
+ self:DisableFrame(fn)
+ end
+ MovAny:UpdateGUIIfShown()
+end
+
+function MovAny:EnableFrame(fn)
+ if fn == nil then
+ return
+ end
+
+ local opts = self:GetFrameOptions(fn)
+ if not opts then
+ return
+ end
+ opts.disabled = nil
+
+ local f = _G[fn]
+ if not f then
+ return
+ end
+ if not self:HookFrame(fn, f) then
+ return
+ end
+ self:ApplyAll(f, opts)
+end
+
+function MovAny:DisableFrame(fn)
+ if fn==nil then
+ return
+ end
+ self:StopMoving(fn)
+
+ local opt = self:GetFrameOptions(fn, nil, true)
+ if not opt then
+ return
+ end
+
+ local f = _G[fn]
+ if not f then
+ return
+ end
+ self:ResetFrame(f, nil, true)
+ opt.disabled = true
+end
+
+function MovAny:HookTooltip(mover)
+ local l, r, t, b, anchor
+ local tooltip = GameTooltip
+ l = mover:GetLeft() * mover:GetEffectiveScale()
+ r = mover:GetRight() * mover:GetEffectiveScale()
+ t = mover:GetTop() * mover:GetEffectiveScale()
+ b = mover:GetBottom() * mover:GetEffectiveScale()
+
+ anchor = "CENTER"
+ if ((b + t) / 2) < ((UIParent:GetTop() * UIParent:GetScale()) / 2) - 25 then
+ anchor = "BOTTOM"
+ elseif ((b + t) / 2) > ((UIParent:GetTop() * UIParent:GetScale()) / 2) + 25 then
+ anchor = "TOP"
+ end
+ if anchor ~= "CENTER" then
+ if ((l + r) / 2) > ((UIParent:GetRight() * UIParent:GetScale()) / 2) + 25 then
+ anchor = anchor.."RIGHT"
+ elseif ((l + r) / 2) < ((UIParent:GetRight() * UIParent:GetScale()) / 2) - 25 then
+ anchor = anchor.."LEFT"
+ end
+ end
+ MovAny:UnlockPoint(tooltip)
+ tooltip:ClearAllPoints()
+
+ if tooltip:GetOwner() then
+ tooltip.MASkip = true
+ tooltip:SetOwner(tooltip:GetOwner(), "ANCHOR_NONE")
+ tooltip.MASkip = nil
+ end
+
+ tooltip:SetPoint(anchor, mover, anchor, 0, 0)
+ tooltip:SetParent(mover)
+ --tooltip.default = 1
+
+ MovAny:LockPoint(tooltip)
+
+ local opt = MovAny:GetFrameOptions(mover:GetName())
+ --MovAny:ApplyScale(tooltip, opt, true)
+ --MovAny:ApplyAlpha(tooltip, opt, true)
+ MovAny:ApplyHide(tooltip, opt, true)
+ mover.attachedChildren = {tooltip}
+end
+
+function MovAny:hGameTooltip_SetDefaultAnchor(relative)
+ local tooltip = GameTooltip
+ if tooltip.MASkip then
+ return
+ end
+ --dbg("GTt SDA "..relative:GetName())
+ if MovAny:IsModified("TooltipMover") then
+ --dbg("Hooked: TooltipMover")
+ MovAny:HookTooltip(_G["TooltipMover"])
+ elseif MovAny:IsModified("BagItemTooltipMover") then
+ --dbg("Hooked: BagItemTooltipMover")
+ local opt = {alpha= 1.0, scale = 1.0}
+ MovAny:UnlockPoint(tooltip)
+ MovAny:ApplyScale(tooltip, opt, true)
+ MovAny:ApplyAlpha(tooltip, opt, true)
+ MovAny:ResetHide(tooltip, opt, true)
+ if not tooltip:IsProtected() then
+ tooltip.MASkip = true
+ GameTooltip_SetDefaultAnchor(tooltip, relative)
+ tooltip.MASkip = nil
+ end
+ end
+end
+
+function MovAny:hGameTooltip_SetOwner(owner, anchor)
+ if GameTooltip.MASkip then
+ return
+ end
+ --dbg("GTt SO ")
+ if owner:GetName() ~= nil and string.match(owner:GetName(), "ContainerFrame[1-9][0-9]*") then
+ if MovAny:IsModified("BagItemTooltipMover") then
+ MovAny:HookTooltip(_G["BagItemTooltipMover"])
+ end
+ end
+end
+
+-- X: MA tooltip funcs
+function MovAny:TooltipShow(self)
+ if not self.tooltipText then
+ return
+ end
+ if self.alwaysShowTooltip or (MADB.tooltips and not IsShiftKeyDown()) or (not MADB.tooltips and IsShiftKeyDown()) then
+ GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
+ GameTooltip:ClearLines()
+ GameTooltip:AddLine(self.tooltipText)
+ GameTooltip:Show()
+ end
+end
+
+function MovAny:TooltipHide()
+ GameTooltip:Hide()
+end
+
+function MovAny:TooltipShowMultiline(self)
+ local tooltipLines = self.tooltipLines
+ if tooltipLines == nil then
+ tooltipLines = MovAny:GetFrameTooltipLines(MovAny.frames[ self.idx ].name)
+ end
+ if tooltipLines == nil then
+ return
+ end
+ local g = 0
+ for k in pairs(tooltipLines) do
+ g = 1
+ break
+ end
+ if i == 0 then
+ return
+ end
+ if self.alwaysShowTooltip or (MADB.tooltips and not IsShiftKeyDown()) or (not MADB.tooltips and IsShiftKeyDown()) then
+ GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
+ GameTooltip:ClearLines()
+ for i,v in ipairs(tooltipLines) do
+ GameTooltip:AddLine(v)
+ end
+ GameTooltip:Show()
+ end
+end
+
+function MovAny:GetFrameTooltipLines(fn)
+ if not fn then
+ return
+ end
+
+ local opts = MovAny:GetFrameOptions(fn)
+ local o = MovAny:GetFrame(fn)
+ local msgs = {}
+ local enough = nil
+ local added = nil
+
+ tinsert(msgs, o.helpfulName or fn)
+ if opts then
+ if opts.hidden then
+ if MovAny.HideList[fn] then
+ tinsert(msgs, "Specially hidden")
+ else
+ tinsert(msgs, "Hidden")
+ end
+ enough = true
+ end
+ end
+ if o and o.helpfulName and o.helpfulName ~= fn and fn ~= nil then
+ tinsert(msgs, " ")
+ tinsert(msgs, "Frame: "..fn)
+ end
+ if opts then
+ if opts.pos then
+ if not added then
+ tinsert(msgs, " ")
+ end
+ tinsert(msgs, "Position: "..numfor(opts.pos[4])..", "..numfor(opts.pos[5]))
+ enough = true
+ added = true
+ end
+ if opts.scale then
+ if not added then
+ tinsert(msgs, " ")
+ end
+ tinsert(msgs, "Scale: "..numfor(opts.scale))
+ enough = true
+ added = true
+ end
+ if opts.alpha then
+ if not added then
+ tinsert(msgs, " ")
+ end
+ tinsert(msgs, "Alpha: "..numfor(opts.alpha))
+ enough = true
+ added = true
+ end
+
+ added = nil
+ if opts.scale then
+ if not added then
+ tinsert(msgs, " ")
+ end
+ tinsert(msgs, "Original Scale: "..numfor(opts.originalScale or 1))
+ enough = true
+ added = true
+ end
+ if opts.alpha and opts.originalAlpha and opts.alpha ~= opts.originalAlpha then
+ if not added then
+ tinsert(msgs, " ")
+ end
+ tinsert(msgs, "Original Alpha: "..numfor(opts.originalAlpha))
+ enough = true
+ added = true
+ end
+ end
+ --[[-- enable this to only show tooltips if actual modifications have been made to the frame
+ if not enough then
+ table.wipe(msgs)
+ end
+ --]]
+ return msgs
+end
+
+----------------------------------------------------------------
+-- X: debugging code
+
+function echo(...)
+ local msg = ""
+ for k,v in pairs({...}) do
+ msg = msg .. k .. "=[" .. tostring(v) .."] "
+ end
+ DEFAULT_CHAT_FRAME:AddMessage(msg)
+end
+
+function decho(...)
+ local msg = ""
+ for k,v in pairs({...}) do
+ if type(v) == "table" then
+ msg = msg .. k .. "=[" .. dechoSub(v, 1) .."] \n"
+ else
+ msg = msg .. k .. "=[" .. tostring(v) .."] \n"
+ end
+ end
+ DEFAULT_CHAT_FRAME:AddMessage(msg)
+end
+
+function dechoSub(t, d)
+ local msg = ""
+ if d > 10 then
+ return msg
+ end
+ for k,v in pairs(t) do
+ if type(v) == "table" then
+ msg = msg .. k .. "=[" .. dechoSub(v, d + 1) .."] \n"
+ else
+ msg = msg .. k .. "=[" .. tostring(v) .."] \n"
+ end
+ end
+ return msg
+end
+
+function necho(...)
+ local msg = ""
+ for k,v in pairs({...}) do
+ msg = msg .. k .. "=[" .. numfor(v) .."] "
+ end
+ DEFAULT_CHAT_FRAME:AddMessage(msg)
+end
+
+function MovAny:DebugFrameAtCursor()
+ local o = GetMouseFocus()
+ if o then
+ if self:IsMAFrame(o:GetName()) then
+ if self:IsMover(o:GetName()) and o.tagged then
+ o = o.tagged
+ end
+ end
+
+ if o ~= WorldFrame and o ~= UIParent then
+ MovAny:Dump(o)
+ end
+ end
+end
+
+function MovAny:Dump(o)
+ if type(o) ~= "table" then
+ maPrint(string.format(MOVANY.UNSUPPORTED_TYPE, type(o)))
+ return
+ end
+
+ maPrint("Name: "..o:GetName())
+
+ if o.GetObjectType then
+ maPrint("Type: "..o:GetObjectType())
+ end
+
+ local p = o:GetParent()
+ if p == nil then
+ p = UIParent
+ end
+ if o ~= p then
+ maPrint("Parent: "..(p:GetName() or "unnamed"))
+ end
+
+ if o.MAParent then
+ maPrint("MA Parent: "..(o.MAParent:GetName() or "unnamed"))
+ end
+
+ local point = {o:GetPoint()}
+ if point and point[1] and point[2] and point[3] and point[4] and point[5] then
+ if not point[2] then
+ point[2] = UIParent
+ end
+ maPrint("Point: "..point[1]..", "..point[2]:GetName()..", "..point[3]..", "..point[4]..", "..point[5])
+ end
+
+ if o:GetTop() then
+ maPrint("Top: "..o:GetTop())
+ end
+ if o:GetRight() then
+ maPrint("Right: "..o:GetRight())
+ end
+ if o:GetBottom() then
+ maPrint("Bottom: "..o:GetBottom())
+ end
+ if o:GetLeft() then
+ maPrint("Left: "..o:GetLeft())
+ end
+ if o:GetHeight() then
+ maPrint("Height: "..o:GetHeight())
+ end
+ if o:GetWidth() then
+ maPrint("Width: "..o:GetWidth())
+ end
+ if o.GetScale then
+ maPrint("Scale: "..o:GetScale())
+ end
+ if o.GetEffectiveScale then
+ maPrint("Scale Effective: "..o:GetEffectiveScale())
+ end
+ if o.GetAlpha then
+ maPrint("Alpha: "..o:GetAlpha())
+ end
+ if o.GetEffectiveAlpha then
+ maPrint("Alpha Effective: "..o:GetEffectiveAlpha())
+ end
+ if o.GetFrameLevel then
+ maPrint("Level: "..o:GetFrameLevel())
+ end
+ if o.GetFrameStrata then
+ maPrint("Strata: "..o:GetFrameStrata())
+ end
+ if o.IsUserPlaced then
+ if o:IsUserPlaced() then
+ maPrint("UserPlaced: true")
+ else
+ maPrint("UserPlaced: false")
+ end
+ end
+ if o.IsMovable then
+ if o:IsMovable() then
+ maPrint("Movable: true")
+ else
+ maPrint("Movable: false")
+ end
+ end
+ if o.IsResizable then
+ if o:IsResizable() then
+ maPrint("Resizable: true")
+ else
+ maPrint("Resizable: false")
+ end
+ end
+ if o.IsTopLevel and o:IsToplevel() then
+ maPrint("Top Level: true")
+ end
+ if o.IsProtected and o:IsProtected() then
+ maPrint("Protected: true")
+ elseif o.MAProtected then
+ maPrint("Virtually protected: true")
+ end
+ if o.IsKeyboardEnabled then
+ if o:IsKeyboardEnabled() then
+ maPrint("KeyboardEnabled: true")
+ else
+ maPrint("KeyboardEnabled: false")
+ end
+ end
+ if o.IsMouseEnabled then
+ if o:IsMouseEnabled() then
+ maPrint("MouseEnabled: true")
+ else
+ maPrint("MouseEnabled: false")
+ end
+ end
+ if o.IsMouseWheelEnabled then
+ if o:IsMouseWheelEnabled() then
+ maPrint("MouseWheelEnabled: true")
+ else
+ maPrint("MouseWheelEnabled: false")
+ end
+ end
+
+ local opts = self:GetFrameOptions(o:GetName())
+ if opts ~= nil then
+ maPrint("MA stored variables:")
+ for i,v in pairs(opts) do
+--[[
+ if i == "cat" then
+ maPrint(" category: "..v.helpfulName)
+ elseif i ~= "name" then
+ ]]
+ if i ~= "cat" and i ~= "name" then
+ if v == nil then
+ maPrint(" "..i..": nil")
+ elseif v == true then
+ maPrint(" "..i..": true")
+ elseif v == false then
+ maPrint(" "..i..": false")
+ elseif type(v) == "number" then
+ maPrint(" "..i..": "..numfor(v))
+ elseif type(v) == "table" then
+ maPrint(" "..i..": table")
+ decho(v)
+ else
+ maPrint(" "..i.." is a "..type(v).."")
+ end
+ end
+ end
+ end
+end
+
+SLASH_MADBG1 = "/madbg"
+SlashCmdList["MADBG"] = function( msg )
+ if msg == nil or msg == "" then
+ MADebug()
+ return
+ end
+ local f = _G[msg]
+ if f == nil then
+ local tr = MovAny:Translate(msg)
+ if tr then
+ f = _G[tr]
+ end
+ end
+ if f == nil then
+ maPrint(string.format(MOVANY.ELEMENT_NOT_FOUND_NAMED, msg))
+ else
+ MovAny:Dump(f)
+ end
+end
+
+function MADebug()
+ local ct = 0
+ --[[
+ maPrint("Frames: "..table.getn(MovAny.frames))
+ for i, o in pairs(MovAny.frames) do
+ ct = ct + 1
+ if o.sep then
+ maPrint(ct.." Category: "..MovAny.frames[i].helpfulName)
+ else
+ maPrint(ct.." Frame: "..MovAny.frames[i].name)
+ end
+ end
+ --]]
+ ct = 0
+ maPrint("Custom frames: "..tlen(MoveAnything_CustomFrames))
+ for i, v in pairs(MoveAnything_CustomFrames) do
+ ct = ct + 1
+ maPrint(ct..": "..v.name)
+ end
+
+ ct = 0
+ maPrint("Frame options: "..tlen(MovAny.frameOptions))
+ for i, v in pairs(MovAny.frameOptions) do
+ ct = ct + 1
+ maPrint(ct..": "..v.name)
+ end
+end
+
+MovAny.dbg = dbg
+
+-- x: Blizzard Interface Options functions
+function MovAny:OptionCheckboxChecked(button, var)
+ if var == "squareMM" then
+ if button:GetChecked() then
+ Minimap:SetMaskTexture("Interface\\AddOns\\MoveAnything\\MinimapMaskSquare")
+ else
+ Minimap:SetMaskTexture("Textures\\MinimapMask")
+ end
+ end
+ MADB[var] = button:GetChecked()
+ MovAny:UpdateGUIIfShown()
+end
+
+function MovAny:SetOptions()
+ MoveAnything_UseCharacterSettings = MAOptCharacterSpecific:GetChecked()
+
+ MADB.alwaysShowNudger = MAOptAlwaysShowNudger:GetChecked()
+ MADB.noBags = MAOptNoBags:GetChecked()
+ MADB.noMMMW = MAOptNoMMMW:GetChecked()
+ MADB.playSound = MAOptPlaySound:GetChecked()
+ MADB.tooltips = MAOptShowTooltips:GetChecked()
+ MADB.closeGUIOnEscape = MAOptCloseGUIOnEscape:GetChecked()
+ MADB.squareMM = MAOptsSquareMM:GetChecked()
+ MADB.dontSearchFrameNames = MAOptDontSearchFrameNames:GetChecked()
+ MADB.frameListRows = MAOptRowsSlider:GetValue()
+end
+
+function MovAny:SetDefaultOptions()
+ MoveAnything_UseCharacterSettings = nil
+ if MADB.squareMM then
+ Minimap:SetMaskTexture("Textures\\MinimapMask")
+ end
+
+ MADB.alwaysShowNudger = nil
+ MADB.noBags = nil
+ MADB.noMMMW = nil
+ MADB.playSound = nil
+ MADB.tooltips = nil
+ MADB.closeGUIOnEscape = nil
+ MADB.squareMM = nil
+ MADB.dontSearchFrameNames = nil
+ MADB.frameListRows = 18
+
+ MovAny_OptionsOnShow()
+ MovAny:UpdateGUIIfShown()
+end
+
+function MovAny_OptionsOnLoad(f)
+ f.name = GetAddOnMetadata("MoveAnything", "Title")
+ f.okay = MovAny.SetOptions
+ f.default = MovAny.SetDefaultOptions
+ InterfaceOptions_AddCategory(f)
+end
+
+function MovAny_OptionsOnShow()
+ MAOptVersion:SetText("Version: |cffeeeeee"..GetAddOnMetadata("MoveAnything", "Version").."|r")
+ MAOptAlwaysShowNudger:SetChecked(MADB.alwaysShowNudger)
+ MAOptNoBags:SetChecked(MADB.noBags)
+ MAOptPlaySound:SetChecked(MADB.playSound)
+ MAOptShowTooltips:SetChecked(MADB.tooltips)
+ MAOptCloseGUIOnEscape:SetChecked(MADB.closeGUIOnEscape)
+ MAOptSquareMM:SetChecked(MADB.squareMM)
+ MAOptNoMMMW:SetChecked(MADB.noMMMW)
+ MAOptCharacterSpecific:SetChecked(MoveAnything_UseCharacterSettings)
+ MAOptDontSearchFrameNames:SetChecked(MADB.dontSearchFrameNames)
+ if MADB.frameListRows then
+ MAOptRowsSlider:SetValue(MADB.frameListRows)
+ end
+
+ local a = {}
+ for i, o in pairs(MoveAnything_CharacterSettings) do
+ tinsert(a, i)
+ end
+ table.sort(a, function(o1,o2)
+ return o1:lower() < o2:lower()
+ end)
+ local s = ""
+ for i, o in pairs(a) do
+ s = s.." "..o.."\n"
+ end
+ MAOptCharacterSpecific.tooltipText = "Use character specific settings\n\n Current profile: "..MovAny.GetProfileName().."\n\n Profiles: \n"..s.."\n\n Cmds:\n /movelist\n /moveimport\n /moveexport\n /movedelete"
+end
+
+function MovAny:SetNumRows(num, dontUpdate)
+ MADB.frameListRows = num
+
+ local base = 0
+ local h = 24
+
+ MAOptions:SetHeight(base + 81 + (num * h))
+ MAScrollFrame:SetHeight(base + 11 + (num * h))
+ MAScrollBorder:SetHeight(base - 22 + (num * h))
+
+ for i = 1, 100, 1 do
+ local row = _G["MAMove"..i]
+ if num >= i then
+ if not row then
+ row = CreateFrame("Frame", "MAMove"..i, MAOptions, "MAListRowTemplate")
+ if i == 1 then
+ row:SetPoint("TOPLEFT", "MAOptionsFrameNameHeader", "BOTTOMLEFT", -8, -4)
+ else
+ row:SetPoint("TOPLEFT", "MAMove"..(i - 1), "BOTTOMLEFT")
+ end
+
+ local label = _G[ "MAMove"..i.."FrameName" ]
+ label:SetScript("OnEnter", MovAny_TooltipShowMultiline)
+ label:SetScript("OnLeave", MovAny_TooltipHide)
+ end
+ else
+ if row then
+ row:Hide()
+ end
+ end
+ end
+
+ if not dontUpdate then
+ self:UpdateGUIIfShown(true)
+ end
+end
+
+function MovAny_TooltipShow(a,b,c,d,e)
+ MovAny:TooltipShow(a,b,c,d,e)
+end
+
+function MovAny_TooltipHide(a,b,c,d,e)
+ MovAny:TooltipHide(a,b,c,d,e)
+end
+
+function MovAny_TooltipShowMultiline(a,b,c,d,e)
+ MovAny:TooltipShowMultiline(a,b,c,d,e)
+end
+
+function MovAny:Search(searchWord)
+ if searchWord ~= MOVANY.SEARCH_TEXT then
+ searchWord = string.gsub(string.gsub(string.lower(searchWord), "([%(%)%%%.%[%]%+%-%?])", "%%%1"), "%*", "[%%w %%c]*")
+ if self.searchWord ~= searchWord then
+ -- searchWord ~= MOVANY.SEARCH_TEXT
+ self.searchWord = searchWord
+ self:UpdateGUIIfShown(true)
+ end
+ else
+ self.searchWord = nil
+ self:UpdateGUIIfShown()
+ end
+end
+
+function MovAny_OnEvent(self, event, ...)
+ if event == "PLAYER_REGEN_ENABLED" then
+ --MovAny:SyncFrames()
+ elseif event == "ADDON_LOADED" or event == "RAID_ROSTER_UPDATE" then
+ MovAny:SyncFrames()
+ elseif event == "PLAYER_LOGOUT" then
+ MovAny.OnPlayerLogout()
+ elseif event == "PLAYER_ENTERING_WORLD" then
+ if MovAny.Boot ~= nil then
+ MovAny:Boot()
+ MovAny.Boot = nil
+ MovAny.ParseData = nil
+ end
+ MovAny:SyncAllFrames()
+ elseif event == "PLAYER_FOCUS_CHANGED" then
+ if MovAny.frameOptions["FocusFrame"] then
+ MovAny.pendingFrames["FocusFrame"] = MovAny.frameOptions["FocusFrame"]
+ MovAny:SyncFrames()
+ end
+ else
+ MovAny:SyncAllFrames()
+ end
+end
+
+function MAMoverTemplate_OnMouseWheel(self, dir)
+ MovAny:MoverOnMouseWheel(self, dir)
+end
+
+function MANudgeButton_OnClick(self, event, button)
+ MovAny:Nudge(self.dir, button)
+end
+
+function MANudger_OnMouseWheel(self, dir)
+ MovAny:NudgerChangeMover(dir)
+end
+
+function MovAny:Serialize(o)
+ if type(o) ~= "table" then
+ return MovAny:SerializeAtom(o)
+ end
+ local s = "{"
+ if #o > 0 and tlen(o) == #o then
+ for i, v in ipairs(o) do
+ s = s.."["..i.."]="..MovAny:Serialize(v)..","
+ end
+ else
+ for i, v in pairs(o) do
+ if type(i) == "number" then
+ s = s.."["..i.."]="..MovAny:Serialize(v)..","
+ elseif type(i) == "string" then
+ s = s.."[\""..i.."\"]="..MovAny:Serialize(v)..","
+ else
+ maPrint("non number/string index used in list. skipping")
+ end
+ end
+ end
+ s = s.."}"
+ return s
+end
+
+function MovAny:SerializeAtom(o)
+ if type(o) == "nil" then
+ return "nil"
+ elseif type(o) == "string" then
+ return "\""..string.gsub(o, "[\n\r\"]", "\\%1").."\""
+ elseif type(o) == "boolean" then
+ return o and "true" or "false"
+ else
+ return o
+ end
+end
\ No newline at end of file
diff --git a/MoveAnything/MoveAnything.toc b/MoveAnything/MoveAnything.toc
new file mode 100644
index 0000000..5b29da0
--- /dev/null
+++ b/MoveAnything/MoveAnything.toc
@@ -0,0 +1,14 @@
+## Interface: 30300
+## Title: MoveAnything
+## Notes: 11.b2 by Wagthaa
+## Version: 11.b2
+## Author: Classic: Skrag - Mod: Jason - TBC: Vincent - WotLK & Cataclysm: Wagthaa @ Earthen Ring EU wagthaa@gmail.com
+## SavedVariables: MoveAnything_CustomFrames, MoveAnything_CharacterSettings, MoveAnything_UseCharacterSettings, MADB
+
+localization.en.lua
+MoveAnything.lua
+MoveAnything.xml
+MoveAnythingBlizzardOptions.xml
+MoveAnythingFrameEditor.lua
+MoveAnythingVirtualMovers.xml
+UserMods.lua
\ No newline at end of file
diff --git a/MoveAnything/MoveAnything.xml b/MoveAnything/MoveAnything.xml
new file mode 100644
index 0000000..7020c01
--- /dev/null
+++ b/MoveAnything/MoveAnything.xml
@@ -0,0 +1,1007 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[ self:GetName().."Backdrop" ]:SetBackdropColor(1,1,1,.25)
+ _G[ self:GetName().."Backdrop" ]:SetBackdropBorderColor(1,1,1,.15)
+
+
+ if self.tagged and self.infoShown then
+ local f = self.tagged
+ local str = numfor(f:GetLeft()).." , "..numfor(f:GetBottom())
+ local label = _G[self:GetName().."BackdropInfoLabel"]
+ label:Show()
+ label:SetText(str)
+
+ if self == MovAny.currentMover then
+ _G["MANudgerInfoLabel"]:Show()
+ _G["MANudgerInfoLabel"]:SetText(str)
+ end
+ end
+
+
+ local button = GetMouseButtonClicked()
+ if self.tagged then
+ local f = self.tagged
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ MovAny:UnlockPoint(f)
+ f:ClearAllPoints()
+ f:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", 0, 0)
+ MovAny:LockPoint(f)
+ end
+ if button == "LeftButton" and not MovAny.NoMove[ self.tagged:GetName() ] then
+ local str = numfor(f:GetLeft()).." , "..numfor(f:GetBottom())
+ _G[self:GetName().."BackdropInfoLabel"]:SetText(str)
+ if self == MovAny.currentMover then
+ _G["MANudgerInfoLabel"]:SetText(str)
+ _G["MANudgerInfoLabel"]:Show()
+ end
+ self.infoShown = true
+ if f.OnMAPosition then
+ f:OnMAPosition(f)
+ end
+ self:StartMoving()
+ end
+ end
+
+
+ local button = GetMouseButtonClicked()
+ if self.tagged and not MovAny.NoMove[ self.tagged:GetName() ] then
+ if button ~= "RightButton" then
+ MovAny:MoverUpdatePosition(self)
+ end
+ self:StopMovingOrSizing()
+ end
+ if button == "RightButton" and self.tagged and not MovAny:ErrorNotInCombat(self.tagged) then
+ if IsShiftKeyDown() then
+ local t = _G[self:GetName().."Backdrop"]
+ if t:IsVisible() then
+ t:Hide()
+ else
+ t:Show()
+ end
+ else
+ local name = self.tagged:GetName()
+ if IsControlKeyDown() then
+ MovAny:FrameEditor(name)
+ else
+ MovAny:StopMoving(name)
+ end
+ end
+ end
+ --MovAny:TooltipHide()
+
+
+
+ MovAny:MoverOnSizeChanged(self)
+
+
+ MovAny:MoverOnShow(self)
+
+
+ MovAny:MoverOnHide()
+ if self == MovAny.currentMover then
+ _G[ "MANudgerInfoLabel"]:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:SetBackdropColor(.03, .03, .03)
+ self:SetBackdropBorderColor(.4, .4, .4)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MovAny:RowTitleClicked(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MovAny:OnMoveCheck(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MovAny:OnHideCheck(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("FS")
+ self.tooltipText = "Toggle Blizzard's framestack tooltip.\n\n A very helpful tool for figuring out frame names for use with /move."
+
+
+ UIParentLoadAddOn("Blizzard_DebugTools")
+ FrameStackTooltip_Toggle()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("FE")
+ self.tooltipText = "Toggle visibility on frame editors."
+
+
+ MovAny:ToggleFrameEditors()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("MF")
+ self.tooltipText = "Show only modified frames"
+
+
+ MovAny:OnCheckToggleModifiedFramesOnly(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("CE")
+ self.tooltipText = "Toggle all categories"
+
+
+ MovAny:OnCheckToggleCategories(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:SetText(MOVANY.SEARCH_TEXT)
+
+
+
+
+ self:HighlightText(0, 0)
+ if self:GetText() == MOVANY.SEARCH_TEXT then
+ self:SetText("")
+ end
+
+
+ self:HighlightText(0, 0)
+ if self:GetText() == "" or self:GetText() == nil then
+ self:SetText(MOVANY.SEARCH_TEXT)
+ end
+ MovAny:Search(self:GetText())
+
+
+ self:ClearFocus()
+
+
+ MovAny:Search(self:GetText())
+ self:ClearFocus()
+
+
+ if self:GetText() ~= MOVANY.SEARCH_TEXT then
+ MovAny:Search(self:GetText())
+ end
+
+
+ if self:GetText() == "" or self:GetText() == nil then
+ self:SetText(MOVANY.SEARCH_TEXT)
+ elseif self:GetText() ~= MOVANY.SEARCH_TEXT then
+ MovAny:Search(self:GetText())
+ end
+ self:ClearFocus()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FauxScrollFrame_OnVerticalScroll(self, offset, MovAny.SCROLL_HEIGHT, MovAny.UpdateGUI)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:SetBackdropColor(.1, .1, .1)
+ self:SetBackdropBorderColor(.4, .4, .4)
+
+
+
+
+
+
+
+
+ self:RegisterEvent("ADDON_LOADED")
+ self:RegisterEvent("PLAYER_LOGOUT")
+ self:RegisterEvent("PLAYER_ENTERING_WORLD")
+ self:RegisterEvent("PLAYER_REGEN_ENABLED")
+ self:RegisterEvent("RAID_ROSTER_UPDATE")
+ self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
+ self:RegisterEvent("PLAYER_FOCUS_CHANGED")
+
+
+ MovAny:OnShow()
+
+
+ MovAny:OnHide()
+
+
+
+
+
+
+
+
diff --git a/MoveAnything/MoveAnythingBlizzardOptions.xml b/MoveAnything/MoveAnythingBlizzardOptions.xml
new file mode 100644
index 0000000..9a93de0
--- /dev/null
+++ b/MoveAnything/MoveAnythingBlizzardOptions.xml
@@ -0,0 +1,320 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("# of rows")
+ _G[self:GetName().."High"]:SetText("100")
+ _G[self:GetName().."Low"]:SetText("2")
+ self:SetMinMaxValues(2, 100)
+ self:SetValueStep(1)
+
+
+ MARowCount:SetText(self:GetValue())
+ MovAny:SetNumRows(self:GetValue())
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ _G[self:GetName().."Text"]:SetText("Use character specific settings")
+
+
+ MovAny:OnCheckCharacterSpecific(self)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Enable to show the nudger with the main window\n\nBy default the Nudger is only shown when interacting with frames."
+ _G[self:GetName().."Text"]:SetText("Show Nudger with main window")
+
+
+ local reshowGUI = nil
+ if MAOptions:IsShown() and MADB.alwaysShowNudger ~= MAOptAlwaysShowNudger:GetChecked() then
+ reshowGUI = true
+ end
+ MovAny:OptionCheckboxChecked(self, "alwaysShowNudger")
+ if reshowGUI then
+ MAOptions:Hide()
+ MAOptions:Show()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles display of tooltips on/off\n\nPressing Shift when mousing over elements will reverse tooltip display behavior."
+ _G[self:GetName().."Text"]:SetText("Show tooltips")
+
+
+ MovAny:OptionCheckboxChecked(self, "tooltips")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles if MoveAnything should play a sound when opening and closing the main window."
+ _G[self:GetName().."Text"]:SetText("Play sound")
+
+
+ MovAny:OptionCheckboxChecked(self, "playSound")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _G[self:GetName().."Text"]:SetText("Escape key closes main window")
+
+
+ MovAny:OptionCheckboxChecked(self, "closeGUIOnEscape")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Disables searching of actual frame names."
+ _G[self:GetName().."Text"]:SetText("Dont search frame names")
+
+
+ MovAny:OptionCheckboxChecked(self, "dontSearchFrameNames")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles if MoveAnything will hook containers.\n\nThis should be checked if you use another addon to move your bags."
+ _G[self:GetName().."Text"]:SetText("Disable bag container hook")
+
+
+ MovAny:OptionCheckboxChecked(self, "noBags")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles if MoveAnything will hook CreateFrame.\n\nRequires UI reload to take effect."
+ _G[self:GetName().."Text"]:SetText("Disable frame creation hook")
+
+
+ MovAny:OptionCheckboxChecked(self, "dontHookCreateFrame")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles square MiniMap on/off.\n\nHide \"Round Border\" in the \"Minimap\" category to get rid of the overlaying border."
+ _G[self:GetName().."Text"]:SetText("Enable square Minimap")
+
+
+ MovAny:OptionCheckboxChecked(self, "squareMM")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.alwaysShowTooltip = true
+ self.tooltipText = "Toggles Minimap mousewheel zoom on/off.\n\nRequires reload to take effect."
+ _G[self:GetName().."Text"]:SetText("Disable Minimap mousewheel zoom")
+
+
+ MovAny:OptionCheckboxChecked(self, "noMMMW")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.tooltipText = "Reset profile\n\nResets the profile, deleting all stored frame settings for this profile."
+ self.alwaysShowTooltip = true
+
+
+
+
+ if MADB.playSound then
+ PlaySound("igMainMenuOption")
+ end
+ StaticPopup_Show("MOVEANYTHING_RESET_PROFILE_CONFIRM")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.tooltipText = "Reset all\n\nReset MoveAnything to default settings. Deletes all frame settings, as well as the custom frame list"
+ self.alwaysShowTooltip = true
+
+
+
+
+ if MADB.playSound then
+ PlaySound("igMainMenuOption")
+ end
+ StaticPopup_Show("MOVEANYTHING_RESET_ALL_CONFIRM")
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MoveAnything/MoveAnythingFrameEditor.lua b/MoveAnything/MoveAnythingFrameEditor.lua
new file mode 100644
index 0000000..dafeb31
--- /dev/null
+++ b/MoveAnything/MoveAnythingFrameEditor.lua
@@ -0,0 +1,2234 @@
+local addonname, MOVANY = ...
+
+local function tdeepcopy(object)
+ local lookup_table = {}
+ local function _copy(object)
+ if type(object) ~= "table" then
+ return object
+ elseif lookup_table[object] then
+ return lookup_table[object]
+ end
+ local new_table = {}
+ lookup_table[object] = new_table
+ for index, value in pairs(object) do
+ new_table[_copy(index)] = _copy(value)
+ end
+ return setmetatable(new_table, getmetatable(object))
+ end
+ return _copy(object)
+end
+
+function MovAny:ToggleFrameEditors()
+ local show = MAOptionsToggleFrameEditors:GetChecked()
+ for i,fe in pairs(MovAny.frameEditors) do
+ if show then
+ fe:Show()
+ else
+ fe:Hide()
+ end
+ end
+end
+
+function MovAny:FrameEditor(name)
+ --decho(o)
+
+ if MovAny.frameEditors[name] then
+ MovAny.frameEditors[name]:CloseDialog()
+ return
+ end
+
+ if MovAny.MoveOnlyWhenVisible[name] then
+ maPrint(string.format(MOVANY.ONLY_WHEN_VISIBLE, name))
+ return
+ end
+
+ local f
+ for id = 1, 1000, 1 do
+ f = _G["MA_FE"..id]
+ if not f then
+ f = MovAny:CreateFrameEditor(id, name)
+ break
+ end
+ if not f.o then
+ f:LoadFrame(name)
+ f:Show()
+ break
+ end
+ id = id + 1
+ end
+end
+
+function MovAny:CreateFrameEditor(id, name)
+ local funcClearFocus = function(self)
+ self:ClearFocus()
+ end
+
+ local leftColumnWidth = 50
+ local centerColumnWidth = 30
+ local secondColumnOffset = leftColumnWidth + 10
+
+ local fn = "MA_FE"..id
+ local fe = CreateFrame("Frame", fn, UIParent)
+
+ fe:SetWidth(610)
+ fe:SetHeight(465)
+ fe:SetFrameStrata("FULLSCREEN")
+ fe:SetFrameLevel(1)
+ fe:SetPoint("CENTER")
+ fe:EnableMouse(true)
+ fe:SetMovable(true)
+ fe:RegisterForDrag("LeftButton")
+ fe:SetScript("OnDragStart", fe.StartMoving)
+ fe:SetScript("OnDragStop", fe.StopMovingOrSizing)
+ fe:SetBackdrop({
+ bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
+ tile = "true",
+ tileSize = 32,
+ })
+ fe:SetBackdropColor(0, 0, 0)
+ fe:SetBackdropBorderColor(0, 0, 0)
+
+ local closeButton = CreateFrame("Button", fn.."Close", fe, "MAButtonTemplate")
+ closeButton:SetText("X")
+ closeButton:SetWidth(20)
+ closeButton:SetHeight(20)
+ closeButton:SetPoint("TOPRIGHT", -1, 0)
+ closeButton:SetScript("OnClick", function()
+ fe:CloseDialog()
+ end)
+
+ local helpfulNameLabel = fe:CreateFontString()
+ helpfulNameLabel:SetFontObject("GameFontNormalSmall")
+ helpfulNameLabel:SetWidth(leftColumnWidth)
+ helpfulNameLabel:SetHeight(20)
+ helpfulNameLabel:SetJustifyH("LEFT")
+ helpfulNameLabel:SetPoint("TOPLEFT", fe, "TOPLEFT", 12, -8)
+ helpfulNameLabel:SetText("Frame:")
+
+ local helpfulName = fe:CreateFontString(fn.."HelpfulName")
+ helpfulName:SetFontObject("GameFontHighlightSmall")
+ helpfulName:SetWidth(270)
+ helpfulName:SetHeight(20)
+ helpfulName:SetJustifyH("LEFT")
+ helpfulName:SetPoint("TOPLEFT", helpfulNameLabel, "TOPRIGHT", 6, 0)
+
+
+ local realNameLabel = fe:CreateFontString()
+ realNameLabel:SetFontObject("GameFontNormalSmall")
+ realNameLabel:SetWidth(leftColumnWidth)
+ realNameLabel:SetHeight(20)
+ realNameLabel:SetJustifyH("LEFT")
+ realNameLabel:SetPoint("TOPLEFT", helpfulNameLabel, "BOTTOMLEFT", 0, -2)
+ realNameLabel:SetText("Name:")
+
+ local realName = fe:CreateFontString(fn.."RealName")
+ realName:SetFontObject("GameFontHighlightSmall")
+ realName:SetWidth(270)
+ realName:SetHeight(20)
+ realName:SetJustifyH("LEFT")
+ realName:SetPoint("TOPLEFT", realNameLabel, "TOPRIGHT", 6, 0)
+
+
+ local enabledCheck = CreateFrame("CheckButton", fn.."Enabled", fe, "MACheckButtonTemplate")
+ enabledCheck:SetPoint("TOPLEFT", realNameLabel, "BOTTOMLEFT", 2, -2)
+ enabledCheck:SetScript("OnClick", function(self) MovAny:ToggleEnableFrame(fe.editFrame:GetName()) end)
+
+ local enabledLabel = fe:CreateFontString()
+ enabledLabel:SetFontObject("GameFontNormalSmall")
+ --enabledLabel:SetWidth(leftColumnWidth)
+ enabledLabel:SetHeight(20)
+ enabledLabel:SetJustifyH("LEFT")
+ enabledLabel:SetPoint("TOPLEFT", enabledCheck, "TOPRIGHT", 1, 2)
+ enabledLabel:SetText("Enabled")
+
+
+ local hideCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+ hideCheck:SetPoint("TOPLEFT", enabledLabel, "TOPRIGHT", 9, -2)
+ hideCheck:SetScript("OnClick", function(self) if not MovAny:ToggleHide(fe.editFrame:GetName()) then self:SetChecked(nil) end end)
+
+ local hideLabel = fe:CreateFontString()
+ hideLabel:SetFontObject("GameFontNormalSmall")
+ --hideLabel:SetWidth(leftColumnWidth)
+ hideLabel:SetHeight(20)
+ hideLabel:SetJustifyH("LEFT")
+ hideLabel:SetPoint("TOPLEFT", hideCheck, "TOPRIGHT", 1, 2)
+ hideLabel:SetText("Hidden")
+
+
+ local clampToScreenCheck = CreateFrame("CheckButton", fn.."ClampToScreenButton", fe, "MACheckButtonTemplate")
+ clampToScreenCheck:SetPoint("TOPLEFT", hideLabel, "TOPRIGHT", 9, -2)
+ clampToScreenCheck:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+
+ if opt.clampToScreen then
+ opt.clampToScreen = nil
+ else
+ opt.clampToScreen = true
+ end
+ if fe.editFrame and fe.editFrame.SetClampedToScreen then
+ fe.editFrame:SetClampedToScreen(opt.clampToScreen)
+ local mover = MovAny:GetMoverByFrameName(fe.o.name)
+ if mover then
+ mover:SetClampedToScreen(opt.clampToScreen)
+ end
+ end
+ end)
+
+ local clampToScreenLabel = fe:CreateFontString()
+ clampToScreenLabel:SetFontObject("GameFontNormalSmall")
+ clampToScreenLabel:SetWidth(100)
+ clampToScreenLabel:SetHeight(20)
+ clampToScreenLabel:SetJustifyH("LEFT")
+ clampToScreenLabel:SetPoint("TOPLEFT", clampToScreenCheck, "TOPRIGHT", 0, 0)
+ clampToScreenLabel:SetText("Clamp to screen")
+
+ --[[
+ local positionHeading = fe:CreateFontString()
+ positionHeading:SetFontObject("GameFontNormalSmall")
+ positionHeading:SetWidth(leftColumnWidth)
+ positionHeading:SetHeight(20)
+ positionHeading:SetJustifyH("LEFT")
+ positionHeading:SetPoint("TOPLEFT", enabledCheck, "BOTTOMLEFT", -3, -2)
+ positionHeading:SetText("Position")
+ ]]
+
+ local dropDownClickFunc = function(self)
+ ToggleDropDownMenu(1, nil, self, self, 6, 7, nil, self)
+ end
+
+ local pointLabel = fe:CreateFontString()
+ pointLabel:SetFontObject("GameFontNormalSmall")
+ pointLabel:SetWidth(leftColumnWidth)
+ pointLabel:SetHeight(18)
+ pointLabel:SetJustifyH("LEFT")
+ pointLabel:SetPoint("TOPLEFT", enabledCheck, "BOTTOMLEFT", -2, -4)
+ pointLabel:SetText("Attach")
+
+ local pointDropDownButton = CreateFrame("Button", fn.."Point", fe, "UIDropDownMenuTemplate")
+ pointDropDownButton:SetID(1)
+ pointDropDownButton:SetScript("OnClick", dropDownClickFunc)
+
+ local pointFunc = function(self)
+ UIDropDownMenu_SetSelectedValue(pointDropDownButton, self.value)
+
+ fe:VerifyOpt()
+ if fe.opt.pos[1] ~= self.value then
+ fe.opt.pos[1] = self.value
+ fe:WritePoint()
+ end
+ end
+
+ local pointDropDown_MenuInit = function()
+ local point
+ if fe.opt and fe.opt.pos and fe.opt.pos[1] then
+ point = fe.opt.pos[1]
+ elseif fe.editFrame then
+ point = fe.editFrame:GetPoint()
+ end
+
+ local info
+ for _, infoTab in pairs(MovAny.DDMPointList) do
+ info = UIDropDownMenu_CreateInfo()
+ info.text = infoTab.text
+ info.value = infoTab.value
+ info.func = pointFunc
+ if point == infoTab.value then
+ info.checked = true
+ end
+ UIDropDownMenu_AddButton(info)
+ end
+ end
+
+ pointDropDownButton:SetPoint("TOPLEFT", pointLabel, "TOPRIGHT", -12, 1)
+ UIDropDownMenu_Initialize(pointDropDownButton, pointDropDown_MenuInit)
+ UIDropDownMenu_SetWidth(pointDropDownButton, 100)
+
+
+ local pointResetButton = CreateFrame("Button", fn.."PointResetButton", fe, "MAButtonTemplate")
+ pointResetButton:SetWidth(20)
+ pointResetButton:SetHeight(20)
+ pointResetButton:SetPoint("TOPLEFT", pointDropDownButton, "TOPRIGHT", 0, -2.5)
+ pointResetButton:SetText("R")
+ pointResetButton:SetScript("OnClick", function()
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ if not p then
+ return
+ end
+ p = p[1]
+
+ if fe.opt and fe.opt.pos[1] ~= p then
+ UIDropDownMenu_Initialize(pointDropDownButton, pointDropDown_MenuInit)
+ UIDropDownMenu_SetSelectedValue(pointDropDownButton, p)
+ fe.opt.pos[1] = p
+ fe:WritePoint()
+ end
+ end)
+
+
+ local relPointLabel = fe:CreateFontString()
+ relPointLabel:SetFontObject("GameFontNormalSmall")
+ relPointLabel:SetWidth(leftColumnWidth)
+ relPointLabel:SetHeight(18)
+ --relPointLabel:SetJustifyH("LEFT")
+ relPointLabel:SetPoint("TOPLEFT", pointLabel, "BOTTOMLEFT", 0, -10)
+ relPointLabel:SetText("to")
+
+ local relPointDropDownButton = CreateFrame("Button", fn.."RelPoint", fe, "UIDropDownMenuTemplate")
+ relPointDropDownButton:SetID(2)
+ relPointDropDownButton:SetScript("OnClick", dropDownClickFunc)
+
+ local relPointFunc = function(self)
+ UIDropDownMenu_SetSelectedValue(relPointDropDownButton, self.value)
+
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[3] ~= self.value then
+ fe.opt.pos[3] = self.value
+ fe:WritePoint(updateEditor)
+ end
+ end
+
+ local relPointDropDown_MenuInit = function()
+ local info
+ for _, infoTab in pairs(MovAny.DDMPointList) do
+ info = UIDropDownMenu_CreateInfo()
+ info.text = infoTab.text
+ info.value = infoTab.value
+ info.func = relPointFunc
+ info.checked = nil
+ UIDropDownMenu_AddButton(info)
+ end
+ end
+
+ relPointDropDownButton:SetPoint("TOPLEFT", relPointLabel, "TOPRIGHT", -12, 1)
+ UIDropDownMenu_Initialize(relPointDropDownButton, relPointDropDown_MenuInit)
+ UIDropDownMenu_SetWidth(relPointDropDownButton, 100)
+
+
+ local relPointResetButton = CreateFrame("Button", fn.."RelPointResetButton", fe, "MAButtonTemplate")
+ relPointResetButton:SetWidth(20)
+ relPointResetButton:SetHeight(20)
+ relPointResetButton:SetPoint("TOPLEFT", relPointDropDownButton, "TOPRIGHT", 0, -2.5)
+ relPointResetButton:SetText("R")
+ relPointResetButton:SetScript("OnClick", function()
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ if not p then
+ return
+ end
+ p = p[3]
+ if fe.opt and fe.opt.pos[3] ~= p then
+ UIDropDownMenu_Initialize(relPointDropDownButton, relPointDropDown_MenuInit)
+ UIDropDownMenu_SetSelectedValue(relPointDropDownButton, p)
+ fe.opt.pos[3] = p
+ fe:WritePoint()
+ end
+ end)
+
+
+
+ local relToLabel = fe:CreateFontString()
+ relToLabel:SetFontObject("GameFontNormalSmall")
+ relToLabel:SetWidth(leftColumnWidth)
+ relToLabel:SetHeight(18)
+ --relToLabel:SetJustifyH("LEFT")
+ relToLabel:SetPoint("TOPLEFT", relPointLabel, "BOTTOMLEFT", 0, -15)
+ relToLabel:SetText("of")
+
+ local relToEdit = CreateFrame("EditBox", fn.."RelToEdit", fe, "InputBoxTemplate")
+
+ local relToFunc = function(self)
+ self = self or relToEdit
+ local value = self:GetText()
+
+ if value == "" then
+ if fe.opt and fe.opt.pos then
+ self:SetText(fe.opt.pos[2])
+ else
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ p = p[2]
+ self:SetText(p)
+ end
+ elseif _G[value] then
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[2] ~= value then
+ fe.opt.pos[2] = value
+ fe:WritePoint(updateEditor)
+ end
+ else
+ maPrint(string.format(MOVANY.ELEMENT_NOT_FOUND_NAMED, value))
+ end
+
+ self:ClearFocus()
+ end
+
+ local relToEscapeFunc = function(self)
+ local value = self:GetText()
+ if _G[value] then
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[2] ~= value then
+ fe.opt.pos[2] = value
+ fe:WritePoint(updateEditor)
+ end
+ else
+ if fe.opt and fe.opt.pos then
+ self:SetText(fe.opt.pos[2])
+ else
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ p = p[2]
+ self:SetText(p)
+ end
+ end
+ self:ClearFocus()
+ end
+
+ relToEdit:SetFontObject("GameFontHighlightSmall")
+ relToEdit:SetWidth(300)
+ relToEdit:SetHeight(20)
+ relToEdit:SetJustifyH("LEFT")
+ relToEdit:SetAutoFocus(false)
+ relToEdit:SetPoint("TOPLEFT", relToLabel, "TOPRIGHT", 10, 0)
+ relToEdit:SetScript("OnTabPressed", relToFunc)
+ relToEdit:SetScript("OnEnterPressed", relToFunc)
+ relToEdit:SetScript("OnEscapePressed", relToEscapeFunc)
+
+
+ local relToResetButton = CreateFrame("Button", fn.."RelToResetButton", fe, "MAButtonTemplate")
+ relToResetButton:SetWidth(20)
+ relToResetButton:SetHeight(20)
+ relToResetButton:SetPoint("TOPLEFT", relToEdit, "TOPRIGHT", 7, 0)
+ relToResetButton:SetText("R")
+ relToResetButton:SetScript("OnClick", function()
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ if not p then
+ return
+ end
+ p = p[2]
+
+ if relToEdit:GetText() ~= p then
+ relToEdit:SetText(p)
+ relToFunc()
+ end
+ end)
+
+
+ local xLabel = fe:CreateFontString()
+ xLabel:SetFontObject("GameFontNormalSmall")
+ xLabel:SetWidth(leftColumnWidth)
+ xLabel:SetHeight(18)
+ xLabel:SetJustifyH("LEFT")
+ xLabel:SetPoint("TOPLEFT", relToLabel, "BOTTOMLEFT", 0, -13)
+ xLabel:SetText("X offset")
+
+
+ local xEdit = CreateFrame("EditBox", fn.."XEdit", fe, "InputBoxTemplate")
+
+ local xSlider = CreateFrame("Slider", fn.."XSlider", fe, "OptionsSliderTemplate")
+
+ xEdit:SetFontObject("GameFontHighlightSmall")
+ xEdit:SetMaxLetters(10)
+ xEdit:SetWidth(59)
+ xEdit:SetHeight(20)
+ xEdit:SetJustifyH("CENTER")
+ xEdit:SetAutoFocus(false)
+ xEdit:SetPoint("TOPLEFT", xLabel, "TOPRIGHT", 10, 0)
+ xEdit:SetText("0")
+
+ local xSliderFunc
+ local xEditFunc = function(self)
+ self:ClearFocus()
+
+ local v = tonumber(xEdit:GetText())
+ if v == nil then
+ return
+ end
+
+ xSlider:SetScript("OnValueChanged", nil)
+ xSlider:SetMinMaxValues(v - 200, v + 200)
+ xSlider:SetValue(v)
+
+ v = numfor(v)
+ _G[xSlider:GetName().."Low"]:SetText(v - 200)
+ _G[xSlider:GetName().."High"]:SetText(v + 200)
+ _G[xSlider:GetName().."Text"]:SetText(v)
+
+ xSlider:SetScript("OnValueChanged", xSliderFunc)
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[4] ~= tonumber(xEdit:GetText()) then
+ fe.opt.pos[4] = tonumber(xEdit:GetText())
+ fe:WritePoint(updateEditor)
+ end
+ end
+ xEdit:SetScript("OnEnterPressed", xEditFunc)
+ xEdit:SetScript("OnTabPressed", xEditFunc)
+ xEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ xSlider:SetScale(.75)
+ xSlider:SetWidth(535)
+ xSlider:SetMinMaxValues(-200, 200)
+ xSlider:SetValue(0)
+ xSlider:SetValueStep(1)
+ xSlider:SetPoint("TOPLEFT", xEdit, "TOPRIGHT", 10, -2)
+ xSlider:SetScript("OnMouseUp", function(self)
+ local v = numfor(xSlider:GetValue())
+ xSlider:SetScript("OnValueChanged", nil)
+ xSlider:SetMinMaxValues(v - 200, v + 200)
+ xSlider:SetScript("OnValueChanged", xSliderFunc)
+ _G[xSlider:GetName().."Low"]:SetText(v - 200)
+ _G[xSlider:GetName().."High"]:SetText(v + 200)
+ _G[xSlider:GetName().."Text"]:SetText(v)
+ end)
+ xSliderFunc = function(self)
+ local v = numfor(xSlider:GetValue())
+ _G[xSlider:GetName().."Text"]:SetText(v)
+
+ xEdit:SetText(numfor(xSlider:GetValue()))
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[4] ~= xSlider:GetValue() then
+ fe.opt.pos[4] = xSlider:GetValue()
+ fe:WritePoint(updateEditor)
+ end
+ end
+ xSlider:SetScript("OnValueChanged", xSliderFunc)
+
+
+ local xResetButton = CreateFrame("Button", fn.."XResetButton", fe, "MAButtonTemplate")
+ xResetButton:SetWidth(20)
+ xResetButton:SetHeight(20)
+ xResetButton:SetPoint("TOPLEFT", xSlider, "TOPRIGHT", 12, 2)
+ xResetButton:SetText("R")
+ xResetButton:SetScript("OnClick", function()
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ if not p then
+ return
+ end
+ p = p[4]
+
+ xSlider:SetScript("OnValueChanged", nil)
+ xSlider:SetMinMaxValues(p-200, p+200)
+ xSlider:SetScript("OnValueChanged", xSliderFunc)
+ xSlider:SetValue(p)
+ end)
+
+
+ local xZeroButton = CreateFrame("Button", fn.."XZeroButton", fe, "MAButtonTemplate")
+ xZeroButton:SetWidth(20)
+ xZeroButton:SetHeight(20)
+ xZeroButton:SetPoint("TOPLEFT", xResetButton, "TOPRIGHT", 5, 0)
+ xZeroButton:SetText("0")
+ xZeroButton:SetScript("OnClick", function()
+ xSlider:SetScript("OnValueChanged", nil)
+ xSlider:SetMinMaxValues(-200, 200)
+ xSlider:SetScript("OnValueChanged", xSliderFunc)
+ xSlider:SetValue(0)
+ end)
+
+
+ local yLabel = fe:CreateFontString()
+ yLabel:SetFontObject("GameFontNormalSmall")
+ yLabel:SetWidth(leftColumnWidth)
+ yLabel:SetHeight(18)
+ yLabel:SetJustifyH("LEFT")
+ yLabel:SetPoint("TOPLEFT", xLabel, "BOTTOMLEFT", 0, -13)
+ yLabel:SetText("Y offset")
+
+
+ local yEdit = CreateFrame("EditBox", fn.."YEdit", fe, "InputBoxTemplate")
+
+ local ySlider = CreateFrame("Slider", fn.."YSlider", fe, "OptionsSliderTemplate")
+
+ yEdit:SetFontObject("GameFontHighlightSmall")
+ yEdit:SetMaxLetters(10)
+ yEdit:SetWidth(59)
+ yEdit:SetHeight(20)
+ yEdit:SetJustifyH("CENTER")
+ yEdit:SetAutoFocus(false)
+ yEdit:SetPoint("TOPLEFT", yLabel, "TOPRIGHT", 10, 0)
+ yEdit:SetText("0")
+ local ySliderFunc
+ local yEditFunc = function(self)
+ self:ClearFocus()
+
+ local v = tonumber(yEdit:GetText())
+ if not v then
+ return
+ end
+
+ ySlider:SetScript("OnValueChanged", nil)
+ ySlider:SetMinMaxValues(v - 200, v + 200)
+ ySlider:SetValue(v)
+
+ v = numfor(v)
+ _G[ySlider:GetName().."Low"]:SetText(v - 200)
+ _G[ySlider:GetName().."High"]:SetText(v + 200)
+ _G[ySlider:GetName().."Text"]:SetText(v)
+
+ ySlider:SetScript("OnValueChanged", ySliderFunc)
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[5] ~= tonumber(yEdit:GetText()) then
+ fe.opt.pos[5] = tonumber(yEdit:GetText())
+ fe:WritePoint(updateEditor)
+ end
+ end
+ yEdit:SetScript("OnEnterPressed", yEditFunc)
+ yEdit:SetScript("OnTabPressed", yEditFunc)
+ yEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ ySlider:SetScale(.75)
+ ySlider:SetWidth(535)
+ ySlider:SetMinMaxValues(-200, 200)
+ ySlider:SetValue(0)
+ ySlider:SetValueStep(1)
+ ySlider:SetPoint("TOPLEFT", yEdit, "TOPRIGHT", 10, -2)
+ ySlider:SetScript("OnMouseUp", function(self)
+ local v = numfor(ySlider:GetValue())
+ ySlider:SetScript("OnValueChanged", nil)
+ ySlider:SetMinMaxValues(v - 200, v + 200)
+ ySlider:SetScript("OnValueChanged", ySliderFunc)
+ _G[ySlider:GetName().."Low"]:SetText(v - 200)
+ _G[ySlider:GetName().."High"]:SetText(v + 200)
+ _G[ySlider:GetName().."Text"]:SetText(v)
+ end)
+
+ ySliderFunc = function(self)
+ local v = numfor(ySlider:GetValue())
+ _G[ySlider:GetName().."Text"]:SetText(v)
+
+ yEdit:SetText(numfor(ySlider:GetValue()))
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if not fe.opt.orgPos and fe.editFrame then
+ MovAny:StoreOrgPoints(fe.editFrame, fe.opt)
+ end
+ local updateEditor
+ if not fe.opt.pos then
+ fe.opt.pos = MovAny:GetRelativePoint(MovAny:GetFirstOrgPoint(fe.opt), fe)
+ updateEditor = true
+ end
+ if fe.opt.pos[5] ~= self:GetValue() then
+ fe.opt.pos[5] = self:GetValue()
+ fe:WritePoint(updateEditor)
+ end
+ end
+ ySlider:SetScript("OnValueChanged", ySliderFunc)
+
+
+ local yResetButton = CreateFrame("Button", fn.."YResetButton", fe, "MAButtonTemplate")
+ yResetButton:SetWidth(20)
+ yResetButton:SetHeight(20)
+ yResetButton:SetPoint("TOPLEFT", ySlider, "TOPRIGHT", 12, 2)
+ yResetButton:SetText("R")
+ yResetButton:SetScript("OnClick", function()
+ local p = MovAny:GetFirstOrgPoint(fe:VerifyOpt())
+ if not p then
+ return
+ end
+ p = p[5]
+
+ ySlider:SetScript("OnValueChanged", nil)
+ ySlider:SetMinMaxValues(p-200, p+200)
+ ySlider:SetScript("OnValueChanged", ySliderFunc)
+ ySlider:SetValue(p)
+ end)
+
+
+ local yZeroButton = CreateFrame("Button", fn.."YZeroButton", fe, "MAButtonTemplate")
+ yZeroButton:SetWidth(20)
+ yZeroButton:SetHeight(20)
+ yZeroButton:SetPoint("TOPLEFT", yResetButton, "TOPRIGHT", 5, 0)
+ yZeroButton:SetText("0")
+ yZeroButton:SetScript("OnClick", function()
+ ySlider:SetScript("OnValueChanged", nil)
+ ySlider:SetMinMaxValues(-200, 200)
+ ySlider:SetScript("OnValueChanged", ySliderFunc)
+ ySlider:SetValue(0)
+ end)
+
+
+ local widthLabel = fe:CreateFontString()
+ widthLabel:SetFontObject("GameFontNormalSmall")
+ widthLabel:SetWidth(leftColumnWidth)
+ widthLabel:SetHeight(18)
+ widthLabel:SetJustifyH("LEFT")
+ widthLabel:SetPoint("TOPLEFT", yLabel, "BOTTOMLEFT", 0, -13)
+ widthLabel:SetText("Width")
+
+
+ local widthEdit = CreateFrame("EditBox", fn.."WidthEdit", fe, "InputBoxTemplate")
+
+ local widthSlider = CreateFrame("Slider", fn.."WidthSlider", fe, "OptionsSliderTemplate")
+
+ widthEdit:SetFontObject("GameFontHighlightSmall")
+ widthEdit:SetMaxLetters(10)
+ widthEdit:SetWidth(59)
+ widthEdit:SetHeight(20)
+ widthEdit:SetJustifyH("CENTER")
+ widthEdit:SetAutoFocus(false)
+ widthEdit:SetPoint("TOPLEFT", widthLabel, "TOPRIGHT", 10, 0)
+ widthEdit:SetText("0")
+ local widthSliderFunc
+ local widthEditFunc = function(self)
+ self:ClearFocus()
+ local v = tonumber(widthEdit:GetText())
+ if v == nil or v < 1 then
+ return
+ end
+
+
+ local lowV = v - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ widthSlider:SetScript("OnValueChanged", nil)
+ widthSlider:SetMinMaxValues(lowV, lowV + 400)
+ widthSlider:SetValue(v)
+ widthSlider:SetScript("OnValueChanged", widthSliderFunc)
+ v = numfor(v)
+ _G[widthSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[widthSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ _G[widthSlider:GetName().."Text"]:SetText(v)
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+
+ fe:WriteDimentions()
+ end
+
+ widthEdit:SetScript("OnEnterPressed", widthEditFunc)
+ widthEdit:SetScript("OnTabPressed", widthEditFunc)
+ widthEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ widthSlider:SetScale(.75)
+ widthSlider:SetWidth(535)
+ widthSlider:SetMinMaxValues(-200, 200)
+ widthSlider:SetValue(0)
+ widthSlider:SetValueStep(1)
+ widthSlider:SetPoint("TOPLEFT", widthEdit, "TOPRIGHT", 10, -2)
+ widthSlider:SetScript("OnMouseUp", function(self)
+ local v = widthSlider:GetValue()
+
+ local lowV = v - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ v = numfor(v)
+ widthSlider:SetMinMaxValues(lowV, lowV + 400)
+ _G[widthSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[widthSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ _G[widthSlider:GetName().."Text"]:SetText(v)
+ end)
+ widthSliderFunc = function(self)
+ local v = numfor(widthSlider:GetValue())
+ _G[widthSlider:GetName().."Text"]:SetText(v)
+
+ widthEdit:SetText(numfor(widthSlider:GetValue()))
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+
+ fe:WriteDimentions()
+ end
+ widthSlider:SetScript("OnValueChanged", widthSliderFunc)
+
+
+ local widthResetButton = CreateFrame("Button", fn.."WidthResetButton", fe, "MAButtonTemplate")
+ widthResetButton:SetWidth(20)
+ widthResetButton:SetHeight(20)
+ widthResetButton:SetPoint("TOPLEFT", widthSlider, "TOPRIGHT", 12, 2)
+ widthResetButton:SetText("R")
+ widthResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ local p = opt.originalWidth
+ if not p then
+ return
+ end
+
+ local lowV = p - 200
+ if lowV < 0 then
+ lowV = 0
+ end
+
+ widthSlider:SetScript("OnValueChanged", nil)
+ widthSlider:SetMinMaxValues(lowV, lowV + 400)
+ widthSlider:SetScript("OnValueChanged", widthSliderFunc)
+ widthSlider:SetValue(p)
+
+ _G[heightSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[heightSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ end)
+
+
+ local heightLabel = fe:CreateFontString()
+ heightLabel:SetFontObject("GameFontNormalSmall")
+ heightLabel:SetWidth(leftColumnWidth)
+ heightLabel:SetHeight(18)
+ heightLabel:SetJustifyH("LEFT")
+ heightLabel:SetPoint("TOPLEFT", widthLabel, "BOTTOMLEFT", 0, -13)
+ heightLabel:SetText("Height")
+
+
+ local heightEdit = CreateFrame("EditBox", fn.."HeightEdit", fe, "InputBoxTemplate")
+
+ local heightSlider = CreateFrame("Slider", fn.."HeightSlider", fe, "OptionsSliderTemplate")
+
+ heightEdit:SetFontObject("GameFontHighlightSmall")
+ heightEdit:SetMaxLetters(10)
+ heightEdit:SetWidth(59)
+ heightEdit:SetHeight(20)
+ heightEdit:SetJustifyH("CENTER")
+ heightEdit:SetAutoFocus(false)
+ heightEdit:SetPoint("TOPLEFT", heightLabel, "TOPRIGHT", 10, 0)
+ heightEdit:SetText("0")
+ local heightSliderFunc
+ local heightEditFunc = function(self)
+ self:ClearFocus()
+ local v = tonumber(heightEdit:GetText())
+ if v == nil or v < 1 then
+ return
+ end
+
+ local lowV = v - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ heightSlider:SetScript("OnValueChanged", nil)
+ heightSlider:SetMinMaxValues(lowV, lowV + 400)
+ heightSlider:SetValue(v)
+
+ v = numfor(v)
+ _G[heightSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[heightSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ _G[heightSlider:GetName().."Text"]:SetText(v)
+ heightSlider:SetScript("OnValueChanged", heightSliderFunc)
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+
+ fe:WriteDimentions()
+ end
+
+ heightEdit:SetScript("OnEnterPressed", heightEditFunc)
+ heightEdit:SetScript("OnTabPressed", heightEditFunc)
+ heightEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ heightSlider:SetScale(.75)
+ heightSlider:SetWidth(535)
+ heightSlider:SetMinMaxValues(-200, 200)
+ heightSlider:SetValue(0)
+ heightSlider:SetValueStep(1)
+ heightSlider:SetPoint("TOPLEFT", heightEdit, "TOPRIGHT", 10, -2)
+ heightSlider:SetScript("OnMouseUp", function(self)
+ local v = heightSlider:GetValue()
+
+ local lowV = v - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ v = numfor(v)
+ heightSlider:SetMinMaxValues(lowV, lowV + 400)
+ _G[heightSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[heightSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ end)
+
+ heightSliderFunc = function(self)
+ local v = numfor(heightSlider:GetValue())
+ _G[heightSlider:GetName().."Text"]:SetText(v)
+
+ heightEdit:SetText(numfor(heightSlider:GetValue()))
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+
+ fe:WriteDimentions()
+ end
+ heightSlider:SetScript("OnValueChanged", heightSliderFunc)
+
+
+ local heightResetButton = CreateFrame("Button", fn.."HeightResetButton", fe, "MAButtonTemplate")
+ heightResetButton:SetWidth(20)
+ heightResetButton:SetHeight(20)
+ heightResetButton:SetPoint("TOPLEFT", heightSlider, "TOPRIGHT", 12, 2)
+ heightResetButton:SetText("R")
+ heightResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ local p = opt.originalHeight
+ if not p then
+ return
+ end
+
+ local lowV = p - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+
+ heightSlider:SetScript("OnValueChanged", nil)
+ heightSlider:SetMinMaxValues(lowV, lowV + 400)
+ heightSlider:SetScript("OnValueChanged", heightSliderFunc)
+ heightSlider:SetValue(p)
+ local v = heightSlider:GetValue()
+
+ _G[heightSlider:GetName().."Low"]:SetText(numfor(lowV))
+ _G[heightSlider:GetName().."High"]:SetText(numfor(lowV + 400))
+ end)
+
+
+ local scaleLabel = fe:CreateFontString()
+ scaleLabel:SetFontObject("GameFontNormalSmall")
+ scaleLabel:SetWidth(leftColumnWidth)
+ scaleLabel:SetHeight(20)
+ scaleLabel:SetJustifyH("LEFT")
+ scaleLabel:SetPoint("TOPLEFT", heightLabel, "BOTTOMLEFT", 0, -20)
+ scaleLabel:SetText("Scale:")
+
+ local scaleEdit = CreateFrame("EditBox", fn.."ScaleEdit", fe, "InputBoxTemplate")
+
+ local scaleSlider = CreateFrame("Slider", fn.."ScaleSlider", fe, "OptionsSliderTemplate")
+
+ scaleEdit:SetFontObject("GameFontHighlightSmall")
+ scaleEdit:SetMaxLetters(6)
+ scaleEdit:SetWidth(59)
+ scaleEdit:SetHeight(20)
+ scaleEdit:SetJustifyH("CENTER")
+ scaleEdit:SetAutoFocus(false)
+ scaleEdit:SetPoint("TOPLEFT", scaleLabel, "TOPRIGHT", 10, 0)
+ scaleEdit:SetText("1")
+ local scaleSliderFunc
+ local scaleEditFunc = function(self)
+ self:ClearFocus()
+ local v = tonumber(self:GetText())
+ if not v then
+ return
+ end
+ _G[scaleSlider:GetName().."Text"]:SetText(v)
+
+ scaleSlider:SetScript("OnValueChanged", nil)
+ scaleSlider:SetValue(v)
+ scaleSlider:SetScript("OnValueChanged", scaleSliderFunc)
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if fe.opt.scale ~= tonumber(self:GetText()) then
+ fe.opt.scale = tonumber(self:GetText())
+ fe:WriteScale()
+ end
+ end
+ scaleEdit:SetScript("OnEnterPressed", scaleEditFunc)
+ scaleEdit:SetScript("OnTabPressed", scaleEditFunc)
+ scaleEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ scaleSlider:SetScale(.75)
+ scaleSlider:SetWidth(535)
+ scaleSlider:SetMinMaxValues(0,10)
+ scaleSlider:SetValue(1)
+ scaleSlider:SetValueStep(.01)
+ scaleSlider:SetPoint("TOPLEFT", scaleEdit, "TOPRIGHT", 10, -2)
+ scaleSlider:SetScript("OnMouseUp", function(self)
+ _G[self:GetName().."Text"]:SetText(numfor(self:GetValue(), 2))
+ end)
+ _G[scaleSlider:GetName().."Low"]:SetText("0")
+ _G[scaleSlider:GetName().."High"]:SetText("10")
+
+ scaleSliderFunc = function(self)
+ if not self.GetValue then
+ return
+ end
+ local v = numfor(self:GetValue(), 2)
+ _G[self:GetName().."Text"]:SetText(v)
+
+ scaleEdit:SetText(v)
+
+ if fe.updating then
+ return
+ end
+ fe:VerifyOpt()
+ if fe.opt.scale ~= self:GetValue() then
+ fe.opt.scale = self:GetValue()
+ fe:WriteScale()
+ end
+ end
+ scaleSlider:SetScript("OnValueChanged", scaleSliderFunc)
+
+
+ local scaleResetButton = CreateFrame("Button", fn.."ScaleResetButton", fe, "MAButtonTemplate")
+ scaleResetButton:SetWidth(20)
+ scaleResetButton:SetHeight(20)
+ scaleResetButton:SetPoint("TOPLEFT", scaleSlider, "TOPRIGHT", 12, 2)
+ scaleResetButton:SetText("R")
+ scaleResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ local p = opt.originalScale
+ if not p then
+ return
+ end
+ scaleSlider:SetValue(p)
+ end)
+
+
+ local scaleOneButton = CreateFrame("Button", fn.."ScaleOneButton", fe, "MAButtonTemplate")
+ scaleOneButton:SetWidth(20)
+ scaleOneButton:SetHeight(20)
+ scaleOneButton:SetPoint("TOPLEFT", scaleResetButton, "TOPRIGHT", 5, 0)
+ scaleOneButton:SetText("1")
+ scaleOneButton:SetScript("OnClick", function()
+ scaleSlider:SetValue(1)
+ end)
+
+
+ local alphaLabel = fe:CreateFontString()
+ alphaLabel:SetFontObject("GameFontNormalSmall")
+ alphaLabel:SetWidth(leftColumnWidth)
+ alphaLabel:SetHeight(20)
+ alphaLabel:SetJustifyH("LEFT")
+ alphaLabel:SetPoint("TOPLEFT", scaleLabel, "BOTTOMLEFT", 0, -2)
+ alphaLabel:SetText("Alpha:")
+
+ local alphaEdit = CreateFrame("EditBox", fn.."AlphaEdit", fe, "InputBoxTemplate")
+
+ local alphaSlider = CreateFrame("Slider", fn.."AlphaSlider", fe, "OptionsSliderTemplate")
+
+ alphaEdit:SetFontObject("GameFontHighlightSmall")
+ alphaEdit:SetMaxLetters(5)
+ alphaEdit:SetWidth(59)
+ alphaEdit:SetHeight(20)
+ alphaEdit:SetJustifyH("CENTER")
+ alphaEdit:SetAutoFocus(false)
+ alphaEdit:SetPoint("TOPLEFT", alphaLabel, "TOPRIGHT", 10, 0)
+ alphaEdit:SetText("100")
+ local alphaSliderFunc
+ local alphaEditFunc = function(self)
+ self:ClearFocus()
+ local v = tonumber(self:GetText())
+ if v == nil then
+ return
+ end
+ if v > 100 then
+ v = 100
+ self:SetText(v)
+ elseif v < 0 then
+ v = 0
+ self:SetText(v)
+ end
+ _G[alphaSlider:GetName().."Text"]:SetText(v.."%")
+
+ alphaSlider:SetScript("OnValueChanged", nil)
+ alphaSlider:SetValue(v / 100)
+ alphaSlider:SetScript("OnValueChanged", alphaSliderFunc)
+
+ if fe.updating then
+ return
+ end
+ fe:WriteAlpha()
+ end
+ alphaEdit:SetScript("OnEnterPressed", alphaEditFunc)
+ alphaEdit:SetScript("OnTabPressed", alphaEditFunc)
+ alphaEdit:SetScript("OnEscapePressed", funcClearFocus)
+
+ alphaSlider:SetScale(.75)
+ alphaSlider:SetWidth(535)
+ alphaSlider:SetMinMaxValues(0,1)
+ alphaSlider:SetValue(1)
+ alphaSlider:SetValueStep(.01)
+ alphaSlider:SetPoint("TOPLEFT", alphaEdit, "TOPRIGHT", 10, -2)
+ alphaSlider:SetScript("OnMouseUp", function(self)
+ _G[self:GetName().."Text"]:SetText(numfor(alphaSlider:GetValue() * 100, 0).."%")
+ end)
+
+ alphaSliderFunc = function(self)
+ local v = numfor(alphaSlider:GetValue() * 100, 0)
+ _G[self:GetName().."Text"]:SetText(v.."%")
+ alphaEdit:SetText(v)
+
+ if fe.updating then
+ return
+ end
+ fe:WriteAlpha()
+ end
+ alphaSlider:SetScript("OnValueChanged", alphaSliderFunc)
+ _G[alphaSlider:GetName().."Low"]:SetText("0%")
+ _G[alphaSlider:GetName().."High"]:SetText("100%")
+
+ local alphaResetButton = CreateFrame("Button", fn.."AlphaResetButton", fe, "MAButtonTemplate")
+ alphaResetButton:SetWidth(20)
+ alphaResetButton:SetHeight(20)
+ alphaResetButton:SetPoint("TOPLEFT", alphaSlider, "TOPRIGHT", 12, 2)
+ alphaResetButton:SetText("R")
+ alphaResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ local p = opt.originalAlpha
+ if not p then
+ return
+ end
+ alphaSlider:SetValue(p)
+ end)
+
+
+ local alphaFullButton = CreateFrame("Button", fn.."AlphaFullButton", fe, "MAButtonTemplate")
+ alphaFullButton:SetWidth(20)
+ alphaFullButton:SetHeight(20)
+ alphaFullButton:SetPoint("TOPLEFT", alphaResetButton, "TOPRIGHT", 5, 0)
+ alphaFullButton:SetText("1")
+ alphaFullButton:SetScript("OnClick", function()
+ alphaSlider:SetValue(1)
+ end)
+
+
+ local hideArtworkCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+ local hideBackgroundCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+ local hideBorderCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+ local hideHighlightCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+ local hideOverlayCheck = CreateFrame("CheckButton", fn.."Hide", fe, "MACheckButtonTemplate")
+
+ local hideLayerFunc = function(self)
+ fe:VerifyOpt()
+
+ MovAny:ResetLayers(fe.editFrame, fe.opt, true)
+
+ if self == hideArtworkCheck then
+ fe.opt.disableLayerArtwork = self:GetChecked()
+ elseif self == hideBackgroundCheck then
+ fe.opt.disableLayerBackground = self:GetChecked()
+ elseif self == hideBorderCheck then
+ fe.opt.disableLayerBorder = self:GetChecked()
+ elseif self == hideHighlightCheck then
+ fe.opt.disableLayerHighlight = self:GetChecked()
+ elseif self == hideOverlayCheck then
+ fe.opt.disableLayerOverlay = self:GetChecked()
+ end
+
+ MovAny:ApplyLayers(fe.editFrame, fe.opt)
+ end
+
+
+ local hideLayersHeading = fe:CreateFontString()
+ hideLayersHeading:SetFontObject("GameFontNormalSmall")
+ hideLayersHeading:SetWidth(85)
+ hideLayersHeading:SetHeight(20)
+ hideLayersHeading:SetJustifyH("LEFT")
+ hideLayersHeading:SetPoint("TOPLEFT", alphaLabel, "BOTTOMLEFT", 0, -10)
+ hideLayersHeading:SetText("Hide Layer")
+
+ local layersResetButton = CreateFrame("Button", fn.."PointResetButton", fe, "MAButtonTemplate")
+ layersResetButton:SetWidth(20)
+ layersResetButton:SetHeight(20)
+ layersResetButton:SetPoint("TOPLEFT", hideLayersHeading, "TOPRIGHT", 0, -1)
+ layersResetButton:SetText("R")
+ layersResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ if fe.editFrame and opt then
+ MovAny:ResetLayers(fe.editFrame, opt)
+ hideArtworkCheck:SetChecked(nil)
+ hideBackgroundCheck:SetChecked(nil)
+ hideBorderCheck:SetChecked(nil)
+ hideHighlightCheck:SetChecked(nil)
+ hideOverlayCheck:SetChecked(nil)
+ end
+ end)
+
+ hideArtworkCheck:SetWidth(20)
+ hideArtworkCheck:SetHeight(20)
+ hideArtworkCheck:SetPoint("TOPLEFT", hideLayersHeading, "BOTTOMLEFT", 4, -2)
+ hideArtworkCheck:SetScript("OnClick", hideLayerFunc)
+
+ local hideArtworkLabel = fe:CreateFontString()
+ hideArtworkLabel:SetFontObject("GameFontNormalSmall")
+ --hideArtworkLabel:SetWidth(leftColumnWidth)
+ hideArtworkLabel:SetHeight(16)
+ hideArtworkLabel:SetJustifyH("LEFT")
+ hideArtworkLabel:SetPoint("TOPLEFT", hideArtworkCheck, "TOPRIGHT", 3, 0)
+ hideArtworkLabel:SetText("Artwork")
+
+
+ hideBackgroundCheck:SetWidth(20)
+ hideBackgroundCheck:SetHeight(20)
+ hideBackgroundCheck:SetPoint("TOPLEFT", hideArtworkCheck, "BOTTOMLEFT", 0, -1)
+ hideBackgroundCheck:SetScript("OnClick", hideLayerFunc)
+
+ local hideBackgroundLabel = fe:CreateFontString()
+ hideBackgroundLabel:SetFontObject("GameFontNormalSmall")
+ --hideBackgroundLabel:SetWidth(leftColumnWidth)
+ hideBackgroundLabel:SetHeight(16)
+ hideBackgroundLabel:SetJustifyH("LEFT")
+ hideBackgroundLabel:SetPoint("TOPLEFT", hideBackgroundCheck, "TOPRIGHT", 3, 0)
+ hideBackgroundLabel:SetText("Background")
+
+
+ hideBorderCheck:SetWidth(20)
+ hideBorderCheck:SetHeight(20)
+ hideBorderCheck:SetPoint("TOPLEFT", hideBackgroundCheck, "BOTTOMLEFT", 0, -1)
+ hideBorderCheck:SetScript("OnClick", hideLayerFunc)
+
+ local hideBorderLabel = fe:CreateFontString()
+ hideBorderLabel:SetFontObject("GameFontNormalSmall")
+ --hideBorderLabel:SetWidth(leftColumnWidth)
+ hideBorderLabel:SetHeight(16)
+ hideBorderLabel:SetJustifyH("LEFT")
+ hideBorderLabel:SetPoint("TOPLEFT", hideBorderCheck, "TOPRIGHT", 3, 0)
+ hideBorderLabel:SetText("Border")
+
+
+ hideHighlightCheck:SetWidth(20)
+ hideHighlightCheck:SetHeight(20)
+ hideHighlightCheck:SetPoint("TOPLEFT", hideBorderCheck, "BOTTOMLEFT", 0, -1)
+ hideHighlightCheck:SetScript("OnClick", hideLayerFunc)
+
+ local hideHighlightLabel = fe:CreateFontString()
+ hideHighlightLabel:SetFontObject("GameFontNormalSmall")
+ --hideHighlightLabel:SetWidth(leftColumnWidth)
+ hideHighlightLabel:SetHeight(16)
+ hideHighlightLabel:SetJustifyH("LEFT")
+ hideHighlightLabel:SetPoint("TOPLEFT", hideHighlightCheck, "TOPRIGHT", 3, 0)
+ hideHighlightLabel:SetText("Highlight")
+
+
+ hideOverlayCheck:SetWidth(20)
+ hideOverlayCheck:SetHeight(20)
+ hideOverlayCheck:SetPoint("TOPLEFT", hideHighlightCheck, "BOTTOMLEFT", 0, -1)
+ hideOverlayCheck:SetScript("OnClick", hideLayerFunc)
+
+ local hideOverlayLabel = fe:CreateFontString()
+ hideOverlayLabel:SetFontObject("GameFontNormalSmall")
+ --hideOverlayLabel:SetWidth(leftColumnWidth)
+ hideOverlayLabel:SetHeight(16)
+ hideOverlayLabel:SetJustifyH("LEFT")
+ hideOverlayLabel:SetPoint("TOPLEFT", hideOverlayCheck, "TOPRIGHT", 3, 0)
+ hideOverlayLabel:SetText("Overlay")
+
+
+ local strataLabel = fe:CreateFontString()
+ strataLabel:SetFontObject("GameFontNormalSmall")
+ strataLabel:SetWidth(leftColumnWidth)
+ strataLabel:SetHeight(20)
+ strataLabel:SetJustifyH("LEFT")
+ strataLabel:SetPoint("TOPLEFT", layersResetButton, "TOPRIGHT", 30, 0)
+ strataLabel:SetText("Strata:")
+
+ local strataDropDownButton = CreateFrame("Button", fn.."Strata", fe, "UIDropDownMenuTemplate")
+ strataDropDownButton:SetID(3)
+ strataDropDownButton:SetScript("OnClick", dropDownClickFunc)
+
+ local strataFunc = function(self)
+ UIDropDownMenu_SetSelectedValue(strataDropDownButton, self.value)
+
+ local opt = fe:VerifyOpt()
+ if opt.frameStrata ~= self.value then
+ opt.frameStrata = self.value
+
+ local editFrame = fe.editFrame
+ if editFrame then
+ if not opt.orgFrameStrata then
+ opt.orgFrameStrata = editFrame:GetFrameStrata()
+ end
+ if not InCombatLockdown() or not MovAny:IsProtected(editFrame) then
+ editFrame:SetFrameStrata(opt.frameStrata)
+ else
+ local closure = function(f, fs)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ f:SetFrameStrata(fs)
+ end
+ end
+ MovAny.pendingActions[fe.o.name..":SetFrameStrata"] = closure(editFrame, opt.frameStrata)
+ end
+ end
+ end
+ end
+
+ local strataDropDown_MenuInit = function()
+ local frameStrata = (fe.opt and fe.opt.frameStrata) or (fe.editFrame and fe.editFrame:GetFrameStrata()) or nil
+
+ local info
+ for _, infoTab in pairs(MovAny.DDMStrataList) do
+ info = UIDropDownMenu_CreateInfo()
+ info.text = infoTab.text
+ info.value = infoTab.value
+ info.func = strataFunc
+
+
+ if frameStrata == infoTab.value then
+ info.checked = true
+ end
+ UIDropDownMenu_AddButton(info)
+ end
+ end
+
+ strataDropDownButton:SetPoint("TOPLEFT", strataLabel, "TOPRIGHT", -12, 1)
+ UIDropDownMenu_Initialize(strataDropDownButton, strataDropDown_MenuInit)
+ UIDropDownMenu_SetWidth(strataDropDownButton, 130)
+ --[[
+ strataDropDownButton:SetScript("OnClick", function()
+ ToggleDropDownMenu(1, nil, nil, strataDropDownButton, 0, 0, nil, strataDropDownButton)
+ end)
+ ]]
+
+
+ local strataResetButton = CreateFrame("Button", fn.."StrataResetButton", fe, "MAButtonTemplate")
+ strataResetButton:SetWidth(20)
+ strataResetButton:SetHeight(20)
+ strataResetButton:SetPoint("TOPLEFT", strataDropDownButton, "TOPRIGHT", 0, -2.5)
+ strataResetButton:SetText("R")
+ strataResetButton:SetScript("OnClick", function()
+ local opt = fe:VerifyOpt()
+ local fs = opt.orgFrameStrata
+ local editFrame = fe.editFrame
+ if not fs then
+ return
+ end
+
+
+ if strataDropDownButton:GetText() ~= fs then
+ if editFrame then
+ if not InCombatLockdown() or not MovAny:IsProtected(editFrame) then
+ editFrame:SetFrameStrata(fs)
+ else
+ local closure = function(f, fs)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ f:SetFrameStrata(fs)
+ end
+ end
+ MovAny.pendingActions[fe.o.name..":SetFrameStrata"] = closure(editFrame, fs)
+ end
+ end
+ opt.frameStrata = fs
+
+ UIDropDownMenu_Initialize(strataDropDownButton, strataDropDown_MenuInit)
+ UIDropDownMenu_SetSelectedValue(strataDropDownButton, fs)
+
+ opt.orgFrameStrata = nil
+ opt.frameStrata = nil
+ end
+ end)
+
+
+ local revertButton = CreateFrame("Button", fn.."RevertButton", fe, "MAButtonTemplate")
+ revertButton:SetWidth(75)
+ revertButton:SetHeight(22)
+ revertButton:SetPoint("TOPLEFT", strataResetButton, "TOPRIGHT", 25, 0)
+ revertButton:SetText("Revert")
+ revertButton.tooltipText = "Reverts the frame to the modifications it had when this editor was opened."
+ revertButton:SetScript("OnClick", function()
+ if fe.editFrame and (InCombatLockdown() and MovAny:IsProtected(fe.editFrame)) then
+ maPrint(string.format(MOVANY.FRAME_PROTECTED_DURING_COMBAT, fe.o.name))
+ else
+ if fe.editFrame then
+ MovAny:ResetAll(fe.editFrame, MovAny:GetFrameOptions(fe.o.name), true)
+ end
+ local opt = tdeepcopy(fe.initialOpt)
+ MovAny.frameOptions[fe.o.name] = opt
+ fe.opt = opt
+ MovAny:SyncFrame(fe.o.name, opt, true)
+ fe:UpdateEditor()
+ end
+ end)
+
+
+ local resetButton = CreateFrame("Button", fn.."ResetButton", fe, "MAButtonTemplate")
+ resetButton:SetWidth(75)
+ resetButton:SetHeight(22)
+ resetButton:SetPoint("TOPLEFT", revertButton, "BOTTOMLEFT", 0, -10)
+ resetButton:SetText("Reset")
+ resetButton.tooltipText = "Resets the frame, undoing all modifications you have made with MoveAnything."
+ resetButton:SetScript("OnClick", function()
+ if not fe.editFrame then
+ return
+ end
+
+ MovAny:ResetFrameConfirm(fe.o.name)
+ end)
+
+
+ local exportButton = CreateFrame("Button", fn.."ExportButton", fe, "MAButtonTemplate")
+ exportButton:SetWidth(75)
+ exportButton:SetHeight(22)
+ exportButton:SetPoint("TOPLEFT", resetButton, "BOTTOMLEFT", 0, -10)
+ exportButton:SetText("Export")
+ exportButton:Disable()
+ exportButton.tooltipText = "Not yet implemented."
+ exportButton:SetScript("OnClick", function() end)
+
+
+ local syncButton = CreateFrame("Button", fn.."SyncButton", fe, "MAButtonTemplate")
+ syncButton:SetWidth(75)
+ syncButton:SetHeight(22)
+ syncButton:SetPoint("TOPLEFT", exportButton, "BOTTOMLEFT", 0, -10)
+ syncButton:SetText("Sync")
+ syncButton:Disable()
+ syncButton.tooltipText = "Synchronize the frame with all modifications made in MoveAnything."
+ syncButton:SetScript("OnClick", function()
+ if fe.editFrame then
+ MovAny:SyncFrame(fe.o.name)
+ end
+ end)
+
+
+ local moverButton = CreateFrame("Button", fn.."MoverButton", fe, "MAButtonTemplate")
+ moverButton:SetWidth(75)
+ moverButton:SetHeight(22)
+ moverButton:SetPoint("TOPLEFT", revertButton, "TOPRIGHT", 10, 0)
+ moverButton:SetText("Mover")
+ moverButton.tooltipText = "Toggles a mover on/off for the frame."
+ moverButton:SetScript("OnClick", function(self)
+ MovAny:ToggleMove(fe.o.name)
+ fe:UpdateButtons()
+ end)
+
+
+ local showButton = CreateFrame("Button", fn.."ShowButton", fe, "MAButtonTemplate")
+ showButton:SetWidth(75)
+ showButton:SetHeight(22)
+ showButton:SetPoint("TOPLEFT", moverButton, "BOTTOMLEFT", 0, -10)
+ showButton:SetText("Show")
+ showButton.tooltipText = "Toggles visibility of the frame, any change is not permanent. For permanent hiding use the \"Hidden\" checkbox."
+ showButton:SetScript("OnClick", function(self)
+ local opt = fe.opt
+ local f = fe.editFrame
+ if not f then
+ return
+ end
+ if not MovAny:IsProtected(f) or not InCombatLockdown() then
+ if f:IsShown() then
+ if (opt and opt.UIPanelWindows) or UIPanelWindows[ f:GetName() ] then
+ HideUIPanel(f)
+ else
+ f:Hide()
+ end
+ else
+ if (opt and opt.UIPanelWindows) or UIPanelWindows[ f:GetName() ] then
+ ShowUIPanel(f)
+ else
+ f:Show()
+ end
+ end
+ fe:UpdateButtons()
+ else
+ maPrint(string.format(MOVANY.FRAME_PROTECTED_DURING_COMBAT, f:GetName()))
+ end
+ end)
+
+
+ local importButton = CreateFrame("Button", fn.."ImportButton", fe, "MAButtonTemplate")
+ importButton:SetWidth(75)
+ importButton:SetHeight(22)
+ importButton:SetPoint("TOPLEFT", showButton, "BOTTOMLEFT", 0, -10)
+ importButton:SetText("Import")
+ importButton:Disable()
+ importButton.tooltipText = "Not yet implemented."
+ importButton:SetScript("OnClick", function() end)
+
+
+
+ local actualsHeading = fe:CreateFontString()
+ actualsHeading:SetFontObject("GameFontNormalSmall")
+ actualsHeading:SetWidth(140)
+ actualsHeading:SetHeight(20)
+ actualsHeading:SetJustifyH("LEFT")
+ actualsHeading:SetPoint("TOPRIGHT", fe, "TOPRIGHT", -25, -4)
+ actualsHeading:SetText("Absolute values")
+
+ local infoTextWidthLabel = fe:CreateFontString()
+ infoTextWidthLabel:SetFontObject("GameFontNormalSmall")
+ infoTextWidthLabel:SetWidth(leftColumnWidth)
+ infoTextWidthLabel:SetHeight(16)
+ infoTextWidthLabel:SetJustifyH("RIGHT")
+ infoTextWidthLabel:SetPoint("TOPLEFT", actualsHeading, "BOTTOMLEFT", -55, -1)
+ infoTextWidthLabel:SetText("Width:")
+
+ local infoTextWidth = fe:CreateFontString()
+ infoTextWidth:SetFontObject("GameFontNormalSmall")
+ infoTextWidth:SetWidth(60)
+ infoTextWidth:SetHeight(16)
+ infoTextWidth:SetJustifyH("LEFT")
+ infoTextWidth:SetPoint("TOPLEFT", infoTextWidthLabel, "TOPRIGHT", 3, 0)
+
+
+ local infoTextXLabel = fe:CreateFontString()
+ infoTextXLabel:SetFontObject("GameFontNormalSmall")
+ infoTextXLabel:SetWidth(leftColumnWidth)
+ infoTextXLabel:SetHeight(16)
+ infoTextXLabel:SetJustifyH("RIGHT")
+ infoTextXLabel:SetPoint("TOPLEFT", infoTextWidthLabel, "BOTTOMLEFT", 0, -1)
+ infoTextXLabel:SetText("X:")
+
+ local infoTextX = fe:CreateFontString()
+ infoTextX:SetFontObject("GameFontNormalSmall")
+ infoTextX:SetWidth(60)
+ infoTextX:SetHeight(16)
+ infoTextX:SetJustifyH("LEFT")
+ infoTextX:SetPoint("TOPLEFT", infoTextXLabel, "TOPRIGHT", 3, 0)
+
+
+ local infoTextAlphaLabel = fe:CreateFontString()
+ infoTextAlphaLabel:SetFontObject("GameFontNormalSmall")
+ infoTextAlphaLabel:SetWidth(leftColumnWidth)
+ infoTextAlphaLabel:SetHeight(16)
+ infoTextAlphaLabel:SetJustifyH("RIGHT")
+ infoTextAlphaLabel:SetPoint("TOPLEFT", infoTextXLabel, "BOTTOMLEFT", 0, -1)
+ infoTextAlphaLabel:SetText("Alpha:")
+
+ local infoTextAlpha = fe:CreateFontString()
+ infoTextAlpha:SetFontObject("GameFontNormalSmall")
+ infoTextAlpha:SetWidth(60)
+ infoTextAlpha:SetHeight(16)
+ infoTextAlpha:SetJustifyH("LEFT")
+ infoTextAlpha:SetPoint("TOPLEFT", infoTextAlphaLabel, "TOPRIGHT", 3, 0)
+
+
+ local infoTextHeightLabel = fe:CreateFontString()
+ infoTextHeightLabel:SetFontObject("GameFontNormalSmall")
+ infoTextHeightLabel:SetWidth(leftColumnWidth)
+ infoTextHeightLabel:SetHeight(16)
+ infoTextHeightLabel:SetJustifyH("RIGHT")
+ infoTextHeightLabel:SetPoint("TOPLEFT", actualsHeading, "BOTTOMLEFT", 55, -1)
+ infoTextHeightLabel:SetText("Height:")
+
+ local infoTextHeight = fe:CreateFontString()
+ infoTextHeight:SetFontObject("GameFontNormalSmall")
+ infoTextHeight:SetWidth(60)
+ infoTextHeight:SetHeight(16)
+ infoTextHeight:SetJustifyH("LEFT")
+ infoTextHeight:SetPoint("TOPLEFT", infoTextHeightLabel, "TOPRIGHT", 3, 0)
+
+
+ local infoTextYLabel = fe:CreateFontString()
+ infoTextYLabel:SetFontObject("GameFontNormalSmall")
+ infoTextYLabel:SetWidth(leftColumnWidth)
+ infoTextYLabel:SetHeight(16)
+ infoTextYLabel:SetJustifyH("RIGHT")
+ infoTextYLabel:SetPoint("TOPLEFT", infoTextHeightLabel, "BOTTOMLEFT", 0, -1)
+ infoTextYLabel:SetText("Y:")
+
+ local infoTextY = fe:CreateFontString()
+ infoTextY:SetFontObject("GameFontNormalSmall")
+ infoTextY:SetWidth(60)
+ infoTextY:SetHeight(16)
+ infoTextY:SetJustifyH("LEFT")
+ infoTextY:SetPoint("TOPLEFT", infoTextYLabel, "TOPRIGHT", 3, 0)
+
+
+ local infoTextScaleLabel = fe:CreateFontString()
+ infoTextScaleLabel:SetFontObject("GameFontNormalSmall")
+ infoTextScaleLabel:SetWidth(leftColumnWidth)
+ infoTextScaleLabel:SetHeight(16)
+ infoTextScaleLabel:SetJustifyH("RIGHT")
+ infoTextScaleLabel:SetPoint("TOPLEFT", infoTextYLabel, "BOTTOMLEFT", 0, -1)
+ infoTextScaleLabel:SetText("Scale:")
+
+ local infoTextScale = fe:CreateFontString()
+ infoTextScale:SetFontObject("GameFontNormalSmall")
+ infoTextScale:SetWidth(60)
+ infoTextScale:SetHeight(16)
+ infoTextScale:SetJustifyH("LEFT")
+ infoTextScale:SetPoint("TOPLEFT", infoTextScaleLabel, "TOPRIGHT", 3, 0)
+ --[[
+
+ Width
+ Height
+ Lock proportions
+
+
+ ]]
+
+ fe.LoadFrame = function(self, name)
+ if self.o then
+ MovAny.frameEditors[self.o.name] = nil
+ end
+
+ self.editFrame = _G[name]
+ self.opt = MovAny:GetFrameOptions(name, nil, true)
+ self.o = MovAny:GetFrame(name)
+
+ self.initialOpt = tdeepcopy(self.opt)
+
+ MovAny.frameEditors[name] = self
+ self:UpdateEditor()
+ end
+
+ fe.UpdateEditor = function()
+ fe.updating = true
+
+ local o = fe.o
+ local fn = o.name
+ local opt = MovAny:GetFrameOptions(fn)
+ fe.opt = opt
+ local editFrame = fe.editFrame
+
+ local frameHeight = 460
+
+ realName:SetText(fn)
+ helpfulName:SetText(o.helpfulName)
+
+ enabledCheck:SetChecked(not opt or not opt.disabled)
+
+ if not MovAny.NoHide[fn] then
+ hideLabel:Show()
+ hideCheck:Show()
+ hideCheck:SetChecked(opt and opt.hidden)
+ else
+ hideLabel:Hide()
+ hideCheck:Hide()
+ end
+
+ if not editFrame or editFrame.SetClampedToScreen then
+ clampToScreenCheck:Show()
+ clampToScreenLabel:Show()
+ clampToScreenCheck:SetChecked((opt and opt.clampToScreen) or (editFrame and editFrame:IsClampedToScreen()))
+ else
+ clampToScreenCheck:Hide()
+ clampToScreenLabel:Hide()
+ end
+
+
+ local nextPoint = {"TOPLEFT", enabledCheck, "BOTTOMLEFT", -2, -4}
+
+ if not MovAny.NoMove[fn] then
+ pointLabel:SetPoint(unpack(nextPoint))
+ nextPoint = {"TOPLEFT", yLabel, "BOTTOMLEFT", 0, -20}
+
+ pointLabel:Show()
+ pointDropDownButton:Show()
+ pointResetButton:Show()
+ relPointLabel:Show()
+ relPointDropDownButton:Show()
+ relPointResetButton:Show()
+ relToLabel:Show()
+ relToEdit:Show()
+ relToResetButton:Show()
+ xLabel:Show()
+ xEdit:Show()
+ xSlider:Show()
+ xResetButton:Show()
+ yLabel:Show()
+ yEdit:Show()
+ ySlider:Show()
+ yResetButton:Show()
+
+ local p
+ if opt and opt.pos then
+ p = opt.pos
+ elseif editFrame then
+ local mover = MovAny:GetMoverByFrameName(fn)
+ if mover then
+ p = {mover:GetPoint()}
+ else
+ p = {editFrame:GetPoint()}
+ end
+ end
+ if p then
+ UIDropDownMenu_Initialize(pointDropDownButton, pointDropDown_MenuInit)
+ UIDropDownMenu_SetSelectedValue(pointDropDownButton, p[1] or "TOPLEFT")
+
+ local relPoint = p[3] or p[1] or "TOPLEFT"
+ UIDropDownMenu_Initialize(relPointDropDownButton, relPointDropDown_MenuInit)
+ UIDropDownMenu_SetSelectedValue(relPointDropDownButton, relPoint)
+
+ local relativeTo = "UIParent"
+ if p[2] then
+ if type(p[2]) == "string" then
+ relativeTo = p[2]
+ elseif type(p[2]) == "table" and p[2]:GetName() then
+ relativeTo = p[2]:GetName()
+ end
+ end
+ relToEdit:SetText(relativeTo)
+
+ local v = tonumber(numfor(p[4])) or 0
+ xSlider:SetMinMaxValues(v - 200, v + 200)
+ _G[xSlider:GetName().."Low"]:SetText(v - 200)
+ _G[xSlider:GetName().."High"]:SetText(v + 200)
+ xSlider:SetValue(numfor(p[4] or 0))
+
+ v = tonumber(numfor(p[5])) or 0
+ ySlider:SetMinMaxValues(v - 200, v + 200)
+ _G[ySlider:GetName().."Low"]:SetText(v - 200)
+ _G[ySlider:GetName().."High"]:SetText(v + 200)
+ ySlider:SetValue(numfor(p[5] or 0))
+ end
+ else
+ frameHeight = frameHeight - 150
+
+ pointLabel:Hide()
+ pointDropDownButton:Hide()
+ pointResetButton:Hide()
+ relPointLabel:Hide()
+ relPointDropDownButton:Hide()
+ relPointResetButton:Hide()
+ relToLabel:Hide()
+ relToEdit:Hide()
+ relToResetButton:Hide()
+ xLabel:Hide()
+ xEdit:Hide()
+ xSlider:Hide()
+ xResetButton:Hide()
+ yLabel:Hide()
+ yEdit:Hide()
+ ySlider:Hide()
+ yResetButton:Hide()
+ end
+
+ if editFrame and MovAny:CanBeScaled(editFrame) and editFrame.GetScale then
+ if MovAny.ScaleWH[fn] then
+ frameHeight = frameHeight + 27
+
+ widthLabel:SetPoint(unpack(nextPoint))
+ nextPoint = {"TOPLEFT", heightLabel, "BOTTOMLEFT", 0, -20}
+
+ scaleLabel:Hide()
+ scaleEdit:Hide()
+ scaleSlider:Hide()
+ scaleResetButton:Hide()
+
+ widthLabel:Show()
+ widthEdit:Show()
+ widthSlider:Show()
+ widthResetButton:Show()
+ heightLabel:Show()
+ heightEdit:Show()
+ heightSlider:Show()
+ heightResetButton:Show()
+
+ local v = 1
+ if opt and (opt.width or opt.originalWidth) then
+ if opt.width then
+ v = opt.width
+ elseif opt.originalWidth then
+ v = opt.originalWidth
+ end
+ elseif fe.editFrame then
+ v = fe.editFrame:GetWidth()
+ end
+ local lowV = tonumber(numfor(v)) - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ --widthEdit:SetText(v)
+ widthSlider:SetMinMaxValues(lowV, lowV + 400)
+ widthSlider:SetValue(v)
+ _G[widthSlider:GetName().."Low"]:SetText(lowV)
+ _G[widthSlider:GetName().."High"]:SetText(lowV + 400)
+
+ v = 1
+ if opt and (opt.height or opt.originalHeight) then
+ if opt.height then
+ v = opt.height
+ elseif opt.originalHeight then
+ v = opt.originalHeight
+ end
+ elseif fe.editFrame then
+ v = fe.editFrame:GetHeight()
+ end
+ lowV = tonumber(numfor(v)) - 200
+ if lowV < 1 then
+ lowV = 1
+ end
+ --heightEdit:SetText(v)
+ heightSlider:SetMinMaxValues(lowV, lowV + 400)
+ heightSlider:SetValue(v)
+ _G[heightSlider:GetName().."Low"]:SetText(lowV)
+ _G[heightSlider:GetName().."High"]:SetText(lowV + 400)
+ else
+ scaleLabel:SetPoint(unpack(nextPoint))
+ nextPoint = {"TOPLEFT", scaleLabel, "BOTTOMLEFT", 0, -20}
+
+ scaleLabel:Show()
+ scaleEdit:Show()
+ scaleSlider:Show()
+ scaleResetButton:Show()
+
+ widthLabel:Hide()
+ widthEdit:Hide()
+ widthSlider:Hide()
+ widthResetButton:Hide()
+ heightLabel:Hide()
+ heightEdit:Hide()
+ heightSlider:Hide()
+ heightResetButton:Hide()
+
+ local scale = opt and opt.scale or 1
+ if scale then
+ --scaleEdit:SetText(numfor(scale))
+ scaleSlider:SetValue(scale)
+ else
+ frameHeight = frameHeight - 40
+ scaleLabel:Hide()
+ scaleEdit:Hide()
+ scaleSlider:Hide()
+ scaleResetButton:Hide()
+ end
+ end
+ else
+ frameHeight = frameHeight - 40
+ scaleLabel:Hide()
+ scaleEdit:Hide()
+ scaleSlider:Hide()
+ scaleResetButton:Hide()
+ end
+
+ if editFrame and not MovAny.NoAlpha[fn] and editFrame.GetAlpha then
+ alphaLabel:SetPoint(unpack(nextPoint))
+ nextPoint = {"TOPLEFT", alphaLabel, "BOTTOMLEFT", 0, -20}
+
+ alphaLabel:Show()
+ alphaEdit:Show()
+ alphaSlider:Show()
+ alphaResetButton:Show()
+
+ local alpha = opt and opt.alpha or 1
+ --alphaEdit:SetText(numfor(alpha * 100))
+ alphaSlider:SetValue(alpha)
+ else
+ frameHeight = frameHeight - 40
+ alphaLabel:Hide()
+ alphaEdit:Hide()
+ alphaSlider:Hide()
+ alphaResetButton:Hide()
+ end
+ fe:SetHeight(frameHeight)
+
+ hideLayersHeading:SetPoint(unpack(nextPoint))
+
+ if fe.editFrame and fe.editFrame.DisableDrawLayer then
+ hideLayersHeading:Show()
+
+ hideArtworkCheck:Show()
+ hideBackgroundCheck:Show()
+ hideBorderCheck:Show()
+ hideHighlightCheck:Show()
+ hideOverlayCheck:Show()
+
+ hideArtworkLabel:Show()
+ hideBackgroundLabel:Show()
+ hideBorderLabel:Show()
+ hideHighlightLabel:Show()
+ hideOverlayLabel:Show()
+
+ hideArtworkCheck:SetChecked(fe.opt and fe.opt.disableLayerArtwork)
+ hideBackgroundCheck:SetChecked(fe.opt and fe.opt.disableLayerBackground)
+ hideBorderCheck:SetChecked(fe.opt and fe.opt.disableLayerBorder)
+ hideHighlightCheck:SetChecked(fe.opt and fe.opt.disableLayerHighlight)
+ hideOverlayCheck:SetChecked(fe.opt and fe.opt.disableLayerOverlay)
+ else
+ hideLayersHeading:Hide()
+
+ hideArtworkCheck:Hide()
+ hideBackgroundCheck:Hide()
+ hideBorderCheck:Hide()
+ hideHighlightCheck:Hide()
+ hideOverlayCheck:Hide()
+
+ hideArtworkLabel:Hide()
+ hideBackgroundLabel:Hide()
+ hideBorderLabel:Hide()
+ hideHighlightLabel:Hide()
+ hideOverlayLabel:Hide()
+ end
+
+ if (opt and opt.frameStrata) or (editFrame and editFrame.GetFrameStrata and editFrame:GetFrameStrata()) then
+ strataLabel:Show()
+ strataDropDownButton:Show()
+ local frameStrata = (opt and opt.frameStrata) or (editFrame and editFrame:GetFrameStrata()) or nil
+ UIDropDownMenu_Initialize(strataDropDownButton, strataDropDown_MenuInit)
+ if frameStrata then
+ UIDropDownMenu_SetSelectedValue(strataDropDownButton, frameStrata)
+ else
+ UIDropDownMenu_SetSelectedValue(strataDropDownButton, "BACKGROUND")
+ end
+ else
+ strataLabel:Hide()
+ strataDropDownButton:Hide()
+ end
+
+ fe:UpdateButtons()
+ fe:UpdateActuals()
+
+ fe.updating = nil
+ end
+
+ fe.UpdateButtons = function()
+
+ if MovAny:GetFrameOptions(fe.o.name) then
+ resetButton:Enable()
+ else
+ resetButton:Disable()
+ end
+
+ if fe.editFrame then
+ local mover = MovAny:GetMoverByFrameName(fe.o.name)
+ moverButton:Enable()
+ moverButton:SetText(mover and "Detach" or "Attach")
+ if mover then
+ syncButton:Disable()
+ else
+ syncButton:Enable()
+ end
+ else
+ moverButton:Disable()
+ syncButton:Disable()
+ end
+
+ if fe.editFrame then
+ showButton:Enable()
+ showButton:SetText(fe.editFrame:IsShown() and "Hide" or "Show")
+ else
+ showButton:Disable()
+ end
+ end
+
+ fe.CloseDialog = function()
+ if IsShiftKeyDown() and IsControlKeyDown() and IsAltKeyDown() then
+ ReloadUI()
+ else
+ fe:Hide()
+ MovAny.frameEditors[fe.o.name] = nil
+ fe.o = nil
+ fe.opt = nil
+ fe.editFrame = nil
+ fe.initialOpt = nil
+ end
+ end
+
+ fe.VerifyOpt = function(self, dontCreate)
+ local opt = MovAny:GetFrameOptions(fe.o.name)
+ if not opt then
+ if dontCreate then
+ fe.opt = nil
+ else
+ fe.opt = MovAny:HookFrame(fe.o.name)
+ end
+ end
+ return fe.opt
+ end
+
+ fe.WritePoint = function(self, updateEditor)
+ if fe.updating then
+ return
+ end
+
+ local fn = fe.o.name
+ local editFrame = fe.editFrame
+ local opt = fe:VerifyOpt()
+
+ if fe.editFrame and not opt.orgPos then
+ MovAny:StoreOrgPoints(editFrame, opt)
+ end
+
+ fe.updating = true
+ local mover = MovAny:GetMoverByFrameName(fn)
+ if editFrame then
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ mover.dontUpdate = true
+ MovAny:DetachMover(mover)
+ end
+ if not InCombatLockdown() or not MovAny:IsProtected(editFrame) then
+ MovAny:ApplyPosition(editFrame, opt)
+ else
+ local closure = function(f, opt)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ MovAny:ApplyPosition(f, opt)
+ end
+ end
+ MovAny.pendingActions[fe.o.name..":SetPoint"] = closure(editFrame, opt)
+ end
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ MovAny:AttachMover(fn)
+ end
+ end
+
+ if updateEditor then
+ fe:UpdateEditor()
+ else
+ fe:UpdateButtons()
+ fe:UpdateActuals()
+ end
+ fe.updating = nil
+ end
+
+ fe.WriteScale = function()
+ if fe.updating then
+ return
+ end
+ local fn = fe.o.name
+ local editFrame = fe.editFrame
+ local opt = fe:VerifyOpt()
+
+ local scale = scaleSlider:GetValue()
+
+ fe.updating = true
+
+ local mover = MovAny:GetMoverByFrameName(fn)
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ mover.dontUpdate = true
+ MovAny:StopMoving(fn)
+ end
+
+ if scale > 0 then
+ opt.scale = scale
+ if editFrame then
+ if not InCombatLockdown() or not MovAny:IsProtected(editFrame) then
+ MovAny:ApplyScale(editFrame, opt)
+ else
+ local closure = function(f, opt)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ MovAny:ApplyScale(f, opt)
+ end
+ end
+ MovAny.pendingActions[fn..":SetScale"] = closure(editFrame, opt)
+ end
+ end
+ end
+
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ MovAny:AttachMover(fn)
+ end
+
+ fe:UpdateButtons()
+ fe:UpdateActuals()
+ fe.updating = nil
+ end
+
+ fe.WriteDimentions = function()
+ if fe.updating then
+ return
+ end
+ local fn = fe.o.name
+ local editFrame = fe.editFrame
+ local opt = fe:VerifyOpt()
+
+ if editFrame then
+ if type(opt.originalWidth) == "nil" then
+ opt.originalWidth = editFrame:GetWidth()
+ end
+
+ if type(opt.originalHeight) == "nil" then
+ opt.originalHeight = editFrame:GetHeight()
+ end
+ end
+
+ fe.updating = true
+ local mover = MovAny:GetMoverByFrameName(fn)
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ mover.dontUpdate = true
+ MovAny:StopMoving(fn)
+ end
+
+ local width = widthSlider:GetValue()
+ if width >= 0 then
+ opt.width = width
+ end
+
+ local height = heightSlider:GetValue()
+ if height >= 0 then
+ opt.height = height
+ end
+
+ if editFrame then
+ if not InCombatLockdown() or not MovAny:IsProtected(editFrame) then
+ MovAny:ApplyScale(editFrame, opt)
+ else
+ local closure = function(f, opt)
+ return function()
+ if MovAny:IsProtected(f) and InCombatLockdown() then
+ return true
+ end
+ MovAny:ApplyScale(f,opt)
+ end
+ end
+ MovAny.pendingActions[fn..":Scale"] = closure(editFrame, opt)
+ end
+ end
+ if mover and (not InCombatLockdown() or not MovAny:IsProtected(editFrame)) then
+ MovAny:AttachMover(fn)
+ end
+ fe:UpdateButtons()
+ fe:UpdateActuals()
+ fe.updating = nil
+ end
+
+ fe.WriteAlpha = function()
+ if fe.updating then
+ return
+ end
+ local fn = fe.o.name
+ local opt = fe:VerifyOpt()
+
+ fe.updating = true
+ if opt.alpha ~= tonumber(alphaSlider:GetValue()) then
+ opt.alpha = tonumber(alphaSlider:GetValue())
+
+ if fe.editFrame then
+ MovAny:ApplyAlpha(fe.editFrame, opt)
+ end
+ if opt.alpha == opt.originalAlpha then
+ opt.alpha = nil
+ opt.originalAlpha = nil
+ end
+ end
+
+ fe:UpdateButtons()
+ fe:UpdateActuals()
+ fe.updating = nil
+ end
+
+ fe.UpdateActuals = function()
+ local editFrame = fe.editFrame
+ if not editFrame then
+ actualsHeading:Hide()
+ infoTextWidthLabel:Hide()
+ infoTextWidth:Hide()
+ infoTextHeightLabel:Hide()
+ infoTextHeight:Hide()
+ infoTextXLabel:Hide()
+ infoTextX:Hide()
+ infoTextYLabel:Hide()
+ infoTextY:Hide()
+ infoTextScaleLabel:Hide()
+ infoTextScale:Hide()
+ infoTextAlphaLabel:Hide()
+ infoTextAlpha:Hide()
+ return
+ end
+
+ actualsHeading:Show()
+ infoTextWidthLabel:Show()
+ infoTextWidth:Show()
+ infoTextHeightLabel:Show()
+ infoTextHeight:Show()
+ infoTextXLabel:Show()
+ infoTextX:Show()
+ infoTextYLabel:Show()
+ infoTextY:Show()
+
+ if editFrame.GetEffectiveScale or editFrame.GetScale then
+ local scale
+ if editFrame.GetScale then
+ scale = editFrame:GetScale()
+ elseif editFrame.GetEffectiveScale then
+ scale = editFrame:GetEffectiveScale() / UIParent:GetScale()
+ end
+
+ if editFrame:GetLeft() then
+ infoTextX:SetText(numfor(editFrame:GetLeft() * scale))
+ else
+ infoTextX:SetText("?")
+ end
+ if editFrame:GetBottom() then
+ infoTextY:SetText(numfor(editFrame:GetBottom() * scale))
+ end
+
+ if editFrame:GetWidth() then
+ infoTextWidth:SetText(numfor(editFrame:GetWidth() * scale))
+ end
+ if editFrame:GetHeight() then
+ infoTextHeight:SetText(numfor(editFrame:GetHeight() * scale))
+ end
+
+ infoTextScaleLabel:Show()
+ infoTextScale:Show()
+ infoTextScale:SetText(numfor(scale * 100).."%")
+ else
+ infoTextX:SetText(numfor(editFrame:GetLeft()))
+ infoTextY:SetText(numfor(editFrame:GetBottom()))
+
+ infoTextWidth:SetText(numfor(editFrame:GetWidth()))
+ infoTextHeight:SetText(numfor(editFrame:GetHeight()))
+
+ infoTextScaleLabel:Hide()
+ infoTextScale:Hide()
+ end
+ if editFrame.GetEffectiveAlpha or editFrame.GetAlpha then
+ infoTextAlphaLabel:Show()
+ infoTextAlpha:Show()
+ local alpha
+ if editFrame.GetEffectiveAlpha then
+ alpha = editFrame:GetEffectiveAlpha()
+ elseif editFrame.GetAlpha then
+ alpha = editFrame:GetAlpha()
+ end
+ infoTextAlpha:SetText(numfor(alpha * 100, 0).."%")
+ else
+ infoTextAlphaLabel:Hide()
+ infoTextAlpha:Hide()
+ end
+ end
+
+ fe:LoadFrame(name)
+end
\ No newline at end of file
diff --git a/MoveAnything/MoveAnythingVirtualMovers.xml b/MoveAnything/MoveAnythingVirtualMovers.xml
new file mode 100644
index 0000000..ed24ed1
--- /dev/null
+++ b/MoveAnything/MoveAnythingVirtualMovers.xml
@@ -0,0 +1,1587 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local updFunc = function()
+ MovAny:SetLeftFrameLocation()
+ MovAny:SetCenterFrameLocation()
+ end
+ self.OnMAOnAttach = updFunc
+ self.OnMAPosition = updFunc
+ self.OnMAAlpha = updFunc
+ self.OnMAScale = updFunc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local updFunc = function()
+ MovAny:SetLeftFrameLocation()
+ MovAny:SetCenterFrameLocation()
+ end
+ self.OnMAOnAttach = updFunc
+ self.OnMAPosition = updFunc
+ self.OnMAAlpha = updFunc
+ self.OnMAScale = updFunc
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:SetFrameLevel(GameTooltip:GetFrameLevel() + 1)
+
+
+ self.OnMAPostHook = function(self)
+ MovAny:HookTooltip(self)
+ end
+ self.OnMAPosition = function(self)
+ MovAny:HookTooltip(self)
+ end
+ self.OnMAPreReset = function(self, opt)
+ local tooltip = GameTooltip
+ MovAny:UnlockPoint(tooltip)
+ MovAny:ResetScale(tooltip, opt, true)
+ MovAny:ResetAlpha(tooltip, opt, true)
+ MovAny:ResetHide(tooltip, opt, true)
+ self.attachedChildren = nil
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self:SetFrameLevel(GameTooltip:GetFrameLevel() + 1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MainMenuBarBackpackButton.MAParent = self
+
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("BagButtonsVerticalMover") then
+ MovAny:ResetFrame("BagButtonsVerticalMover")
+ end
+ self.attachedChildren = {}
+ if not MovAny:IsModified("MainMenuBarBackpackButton") then
+ MainMenuBarBackpackButton:ClearAllPoints()
+ MainMenuBarBackpackButton:SetPoint("RIGHT", self, "RIGHT", 0, 0)
+ tinsert(self.attachedChildren, MainMenuBarBackpackButton)
+ end
+ if not MovAny:IsModified("CharacterBag0Slot") then
+ MovAny:UnlockPoint(CharacterBag0Slot)
+ CharacterBag0Slot:ClearAllPoints()
+ CharacterBag0Slot:SetPoint("RIGHT", "MainMenuBarBackpackButton", "LEFT", -4, 0)
+ tinsert(self.attachedChildren, CharacterBag0Slot)
+ end
+ if not MovAny:IsModified("CharacterBag1Slot") then
+ MovAny:UnlockPoint(CharacterBag1Slot)
+ CharacterBag1Slot:ClearAllPoints()
+ CharacterBag1Slot:SetPoint("RIGHT", "CharacterBag0Slot", "LEFT", -4, 0)
+ tinsert(self.attachedChildren, CharacterBag1Slot)
+ end
+ if not MovAny:IsModified("CharacterBag2Slot") then
+ MovAny:UnlockPoint(CharacterBag2Slot)
+ CharacterBag2Slot:ClearAllPoints()
+ CharacterBag2Slot:SetPoint("RIGHT", "CharacterBag1Slot", "LEFT", -4, 0)
+ tinsert(self.attachedChildren, CharacterBag2Slot)
+ end
+ if not MovAny:IsModified("CharacterBag3Slot") then
+ MovAny:UnlockPoint(CharacterBag3Slot)
+ CharacterBag3Slot:ClearAllPoints()
+ CharacterBag3Slot:SetPoint("RIGHT", "CharacterBag2Slot", "LEFT", -4, 0)
+ tinsert(self.attachedChildren, CharacterBag3Slot)
+ end
+ self:Show()
+ end
+ self.OnMAPosition = function(self)
+ local last = self
+ if not MovAny:IsModified("MainMenuBarBackpackButton") then
+ MainMenuBarBackpackButton:ClearAllPoints()
+ MainMenuBarBackpackButton:SetPoint("RIGHT", last, "RIGHT", 0, 0)
+ last = MainMenuBarBackpackButton
+ end
+ if not MovAny:IsModified("CharacterBag0Slot") then
+ CharacterBag0Slot:ClearAllPoints()
+ CharacterBag0Slot:SetPoint("RIGHT", last, "LEFT", -4, 0)
+ last = CharacterBag0Slot
+ end
+ if not MovAny:IsModified("CharacterBag1Slot") then
+ CharacterBag1Slot:ClearAllPoints()
+ CharacterBag1Slot:SetPoint("RIGHT", last, "LEFT", -4, 0)
+ last = CharacterBag1Slot
+ end
+ if not MovAny:IsModified("CharacterBag2Slot") then
+ CharacterBag2Slot:ClearAllPoints()
+ CharacterBag2Slot:SetPoint("RIGHT", last, "LEFT", -4, 0)
+ last = CharacterBag2Slot
+ end
+ if not MovAny:IsModified("CharacterBag3Slot") then
+ CharacterBag3Slot:ClearAllPoints()
+ CharacterBag3Slot:SetPoint("RIGHT", last, "LEFT", -4, 0)
+ last = CharacterBag3Slot
+ end
+ end
+ self.OnMAPostReset = function(self)
+ MainMenuBarBackpackButton:ClearAllPoints()
+ MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT", "MainMenuBarArtFrame", "BOTTOMRIGHT", -6, 2)
+ CharacterBag0Slot:ClearAllPoints()
+ CharacterBag0Slot:SetPoint("RIGHT", "MainMenuBarBackpackButton", "LEFT", -4, 0)
+ CharacterBag1Slot:ClearAllPoints()
+ CharacterBag1Slot:SetPoint("RIGHT", "CharacterBag0Slot", "LEFT", -4, 0)
+ CharacterBag2Slot:ClearAllPoints()
+ CharacterBag2Slot:SetPoint("RIGHT", "CharacterBag1Slot", "LEFT", -4, 0)
+ CharacterBag3Slot:ClearAllPoints()
+ CharacterBag3Slot:SetPoint("RIGHT", "CharacterBag2Slot", "LEFT", -4, 0)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("BagButtonsMover") then
+ MovAny:ResetFrame("BagButtonsMover")
+ end
+ MainMenuBarBackpackButton:ClearAllPoints()
+ MainMenuBarBackpackButton:SetPoint("BOTTOM", self, "BOTTOM", 0, 0)
+ CharacterBag0Slot:ClearAllPoints()
+ CharacterBag0Slot:SetPoint("BOTTOM", "MainMenuBarBackpackButton", "TOP", 0, 3)
+ CharacterBag1Slot:ClearAllPoints()
+ CharacterBag1Slot:SetPoint("BOTTOM", "CharacterBag0Slot", "TOP", 0, 3)
+ CharacterBag2Slot:ClearAllPoints()
+ CharacterBag2Slot:SetPoint("BOTTOM", "CharacterBag1Slot", "TOP", 0, 3)
+ CharacterBag3Slot:ClearAllPoints()
+ CharacterBag3Slot:SetPoint("BOTTOM", "CharacterBag2Slot", "TOP", 0, 3)
+ MainMenuBarBackpackButton.MAParent = self
+ CharacterBag0Slot.MAParent = self
+ CharacterBag1Slot.MAParent = self
+ CharacterBag2Slot.MAParent = self
+ CharacterBag3Slot.MAParent = self
+ self.attachedChildren = {}
+ tinsert(self.attachedChildren, _G["MainMenuBarBackpackButton"])
+ for i = 0, 3, 1 do
+ tinsert(self.attachedChildren, _G[ "CharacterBag"..i.."Slot" ])
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ MainMenuBarBackpackButton:ClearAllPoints()
+ MainMenuBarBackpackButton:SetPoint("BOTTOMRIGHT", "MainMenuBarArtFrame", "BOTTOMRIGHT", -6, 0)
+ CharacterBag0Slot:ClearAllPoints()
+ CharacterBag0Slot:SetPoint("RIGHT", "MainMenuBarBackpackButton", "LEFT", -4, 0)
+ CharacterBag1Slot:ClearAllPoints()
+ CharacterBag1Slot:SetPoint("RIGHT", "CharacterBag0Slot", "LEFT", -4, 0)
+ CharacterBag2Slot:ClearAllPoints()
+ CharacterBag2Slot:SetPoint("RIGHT", "CharacterBag1Slot", "LEFT", -4, 0)
+ CharacterBag3Slot:ClearAllPoints()
+ CharacterBag3Slot:SetPoint("RIGHT", "CharacterBag2Slot", "LEFT", -4, 0)
+ MainMenuBarBackpackButton.MAParent = BagButtonsMover
+ CharacterBag0Slot.MAParent = BagButtonsMover
+ CharacterBag1Slot.MAParent = BagButtonsMover
+ CharacterBag2Slot.MAParent = BagButtonsMover
+ CharacterBag3Slot.MAParent = BagButtonsMover
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+ local x,y
+ x = -80
+ y = 45 + (self:GetID() * 45)
+ self:SetPoint("BOTTOMRIGHT", "UIParent", "BOTTOMRIGHT", x, y)
+
+ local CONTAINER_FRAME_TABLE = {
+ [0] = {"Interface\\ContainerFrame\\UI-BackpackBackground", 256, 256, 239},
+ [1] = {"Interface\\ContainerFrame\\UI-Bag-1x4", 256, 128, 96},
+ [2] = {"Interface\\ContainerFrame\\UI-Bag-1x4", 256, 128, 96},
+ [3] = {"Interface\\ContainerFrame\\UI-Bag-1x4", 256, 128, 96},
+ [4] = {"Interface\\ContainerFrame\\UI-Bag-1x4", 256, 128, 96},
+ [5] = {"Interface\\ContainerFrame\\UI-Bag-1x4+2", 256, 128, 116},
+ [6] = {"Interface\\ContainerFrame\\UI-Bag-1x4+2", 256, 128, 116},
+ [7] = {"Interface\\ContainerFrame\\UI-Bag-1x4+2", 256, 128, 116},
+ [8] = {"Interface\\ContainerFrame\\UI-Bag-2x4", 256, 256, 137},
+ [9] = {"Interface\\ContainerFrame\\UI-Bag-2x4+2", 256, 256, 157},
+ [10] = {"Interface\\ContainerFrame\\UI-Bag-2x4+2", 256, 256, 157},
+ [11] = {"Interface\\ContainerFrame\\UI-Bag-2x4+2", 256, 256, 157},
+ [12] = {"Interface\\ContainerFrame\\UI-Bag-3x4", 256, 256, 178},
+ [13] = {"Interface\\ContainerFrame\\UI-Bag-3x4+2", 256, 256, 198},
+ [14] = {"Interface\\ContainerFrame\\UI-Bag-3x4+2", 256, 256, 198},
+ [15] = {"Interface\\ContainerFrame\\UI-Bag-3x4+2", 256, 256, 198},
+ [16] = {"Interface\\ContainerFrame\\UI-Bag-4x4", 256, 256, 219},
+ [18] = {"Interface\\ContainerFrame\\UI-Bag-4x4+2", 256, 256, 239},
+ [20] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 259},
+ [22] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 279},
+ [24] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 299},
+ [26] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 319},
+ [28] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 339},
+ [30] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 359},
+ [32] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 379},
+ [34] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 399},
+ [36] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 419},
+ [38] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 439},
+ [40] = {"Interface\\ContainerFrame\\UI-Bag-5x4", 256, 256, 459},
+ }
+ self.realID = self:GetID()
+ if self:GetName() == "KeyRingFrame" then
+ self.realID = KEYRING_CONTAINER
+ end
+ MovAny:SetBag(self.realID, self)
+
+ self.OnMAHook = function(self)
+ if self.realID == KEYRING_CONTAINER then
+ self.size = GetKeyRingSize()
+ else
+ self.size = GetContainerNumSlots(self.realID)
+ end
+ local conSettings = self.realID == 0 and CONTAINER_FRAME_TABLE[0] or CONTAINER_FRAME_TABLE[self.size ~= 0 and self.size or 8]
+ self:SetWidth(CONTAINER_WIDTH)
+ self:SetHeight(conSettings[4])
+ local container = MovAny:GetContainerFrame(self.realID)
+ if container then
+ self:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", container:GetLeft(), container:GetBottom())
+ MovAny:GrabContainerFrame(container, MovAny:GetBag(self.realID))
+ end
+ end
+
+ local posFunc = function(self)
+ local container = MovAny:GetContainerFrame(self.realID)
+ if container then
+ MovAny:UnlockPoint(container)
+ container:ClearAllPoints()
+ container:SetPoint("CENTER", self, "CENTER", 0, 0)
+ MovAny:LockPoint(container)
+ end
+ end
+ self.OnMAPosition = posFunc
+ self.OnMAPreReset = posFunc
+
+ self.OnMAPostReset = function(self)
+ local container = MovAny:GetContainerFrame(self.realID)
+ if container then
+ MovAny:UnlockPoint(container)
+ MovAny:UnlockScale(container)
+ container:ClearAllPoints()
+ end
+ updateContainerFrameAnchors()
+ end
+
+ self.OnMAPostAttach = function(self)
+ posFunc(self)
+ updateContainerFrameAnchors()
+ end
+
+ local alphaer = function(ref, alpha)
+ local con = MovAny:GetContainerFrame(ref.realID)
+ if con then
+ con:SetAlpha(alpha)
+ end
+ end
+ self.OnMAAlpha = alphaer
+
+ local scaler = function(ref, scale)
+ local con = MovAny:GetContainerFrame(ref.realID)
+ if con and scale and scale >= 0 then
+ MovAny:UnlockScale(con)
+ con:SetScale(scale)
+ MovAny:LockScale(con)
+ posFunc(ref)
+ end
+ end
+ self.OnMAScale = scaler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local grab = { CharacterMicroButton, SpellbookMicroButton,
+ TalentMicroButton, AchievementMicroButton, QuestLogMicroButton,
+ SocialsMicroButton, PVPMicroButton, LFDMicroButton,
+ MainMenuMicroButton, HelpMicroButton }
+ for i, v in pairs(grab) do
+ v.MAParent = self
+ end
+
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("MicroButtonsVerticalMover") then
+ MovAny:ResetFrame("MicroButtonsVerticalMover")
+ end
+ self.attachedChildren = {}
+ for i in pairs(grab) do
+ local b = grab[i]
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT")
+ end
+ b.MAParent = self
+ MovAny:LockPoint(b)
+ tinsert(self.attachedChildren, b)
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ for i in pairs(grab) do
+ MovAny:UnlockPoint(grab[i])
+ end
+ CharacterMicroButton:ClearAllPoints()
+ CharacterMicroButton:SetPoint("BOTTOMLEFT", "MainMenuBarArtFrame", "BOTTOMLEFT", 548, 2)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local grab = { CharacterMicroButton, SpellbookMicroButton,
+ TalentMicroButton, AchievementMicroButton, QuestLogMicroButton,
+ SocialsMicroButton, PVPMicroButton, LFDMicroButton,
+ MainMenuMicroButton, HelpMicroButton }
+
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("MicroButtonsMover") then
+ MovAny:ResetFrame("MicroButtonsMover")
+ end
+ self.attachedChildren = {}
+
+ --MovAny:LockPoint(CharacterMicroButton)
+
+ local b, pb
+ for i in pairs(grab) do
+ b = grab[i]
+
+ b:ClearAllPoints()
+ if i == 1 then
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 0, 24)
+ else
+ grab[i]:SetPoint("TOPLEFT", pb, "BOTTOMLEFT", 0, 24)
+ end
+ b.MAParent = self
+ MovAny:LockPoint(b)
+ tinsert(self.attachedChildren, b)
+ pb = b
+ end
+ self:Show()
+ end
+ self.OnMAPreReset = function (self)
+ local p = _G["MicroButtonsMover"]
+ if self.attachedChildren then
+ for i, b in pairs(self.attachedChildren) do
+ b.MAParent = p
+ MovAny:UnlockPoint(b)
+ end
+ end
+ end
+ self.OnMAPostReset = function(self)
+ CharacterMicroButton:ClearAllPoints()
+ CharacterMicroButton:SetPoint("BOTTOMLEFT", "MainMenuBarArtFrame", "BOTTOMLEFT", 546, 2)
+
+ local b, pb
+ for i in pairs(grab) do
+ b = grab[i]
+ if i > 1 then
+ b:ClearAllPoints()
+ b:SetPoint("BOTTOMLEFT", pb, "BOTTOMRIGHT", -2, 0)
+ end
+ pb = b
+ end
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ local i, b
+ for i = 1, 12 do
+ b = _G[ "ActionButton"..i ]
+ b.MAParent = self
+ end
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ local b, bab
+ if MovAny:IsModified("BasicActionButtonsVerticalMover") then
+ MovAny:ResetFrame("BasicActionButtonsVerticalMover")
+ end
+ ActionButton1:ClearAllPoints()
+ ActionButton1:SetPoint("LEFT", self, "LEFT")
+ ActionBarUpButton:ClearAllPoints()
+ ActionBarUpButton:SetPoint("TOPLEFT", "ActionButton12", "TOPRIGHT", 0, 7)
+ ActionBarDownButton:ClearAllPoints()
+ ActionBarDownButton:SetPoint("BOTTOMLEFT", "ActionButton12", "BOTTOMRIGHT", 0, -9)
+ self.attachedChildren = {}
+ for i = 1, 12, 1 do
+ b = _G["ActionButton"..i]
+ if i > 1 then
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", "ActionButton"..(i-1), "RIGHT", 6, 0)
+ end
+ bab = _G[ "BonusActionButton"..i ]
+ bab:ClearAllPoints()
+ bab:SetPoint("CENTER", b, "CENTER")
+ bab.MAParent = self
+ tinsert(self.attachedChildren, _G["ActionButton"..i])
+ tinsert(self.attachedChildren, _G["BonusActionButton"..i])
+ end
+ tinsert(self.attachedChildren, ActionBarUpButton)
+ tinsert(self.attachedChildren, ActionBarDownButton)
+
+ --MovAny:UnanchorRelatives(ActionButton1)
+
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b
+ ActionButton1:ClearAllPoints()
+ ActionButton1:SetPoint("BOTTOMLEFT", "MainMenuBarArtFrame", "BOTTOMLEFT", 8, 4)
+ ActionBarUpButton:ClearAllPoints()
+ ActionBarUpButton:SetPoint("CENTER", "MainMenuBarArtFrame", "TOPLEFT", 522, -22)
+ ActionBarDownButton:ClearAllPoints()
+ ActionBarDownButton:SetPoint("CENTER", "MainMenuBarArtFrame", "TOPLEFT", 522, -42)
+ for i = 1, 12, 1 do
+ b = _G[ "ActionButton"..i ]
+ if i > 1 then
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", "ActionButton"..(i-1), "RIGHT", 6, 0)
+ end
+ _G[ "BonusActionButton"..i ]:ClearAllPoints()
+ _G[ "BonusActionButton"..i ]:SetPoint("CENTER", b, "CENTER")
+ end
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ local b, pb
+ if MovAny:IsModified("BasicActionButtonsMover") then
+ MovAny:ResetFrame("BasicActionButtonsMover")
+ end
+ ActionButton1:ClearAllPoints()
+ ActionButton1:SetPoint("TOP", self, "TOP", 0, 0)
+ self.attachedChildren = {}
+ for i = 1, 12, 1 do
+ b = _G[ "ActionButton"..i ]
+ tinsert(self.attachedChildren, _G[ "ActionButton"..i ])
+ tinsert(self.attachedChildren, _G[ "BonusActionButton"..i ])
+ if i > 1 then
+ pb = _G[ "ActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("TOP", pb, "BOTTOM", 0, -2)
+ end
+ b.MAParent = self
+ _G[ "BonusActionButton"..i ]:ClearAllPoints()
+ _G[ "BonusActionButton"..i ]:SetPoint("CENTER", b, "CENTER")
+ end
+ tinsert(self.attachedChildren, ActionBarUpButton)
+ tinsert(self.attachedChildren, ActionBarDownButton)
+ ActionBarUpButton:ClearAllPoints()
+ ActionBarUpButton:SetPoint("TOPLEFT", "ActionButton12", "BOTTOMLEFT", -8, 4)
+ ActionBarDownButton:ClearAllPoints()
+ ActionBarDownButton:SetPoint("TOPRIGHT", "ActionButton12", "BOTTOMRIGHT", 8, 4)
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b, pb
+ ActionButton1:ClearAllPoints()
+ ActionButton1:SetPoint("BOTTOMLEFT", "MainMenuBarArtFrame", "BOTTOMLEFT", 8, 4)
+ ActionBarUpButton:ClearAllPoints()
+ ActionBarUpButton:SetPoint("CENTER", "MainMenuBarArtFrame", "TOPLEFT", 522, -22)
+ ActionBarDownButton:ClearAllPoints()
+ ActionBarDownButton:SetPoint("CENTER", "MainMenuBarArtFrame", "TOPLEFT", 522, -42)
+ for i = 1, 12, 1 do
+ b = _G[ "ActionButton"..i ]
+ b.MAParent = BasicActionButtonsMover
+ if i > 1 then
+ pb = _G[ "ActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", pb, "RIGHT", 6, 0)
+ end
+ _G[ "BonusActionButton"..i ]:ClearAllPoints()
+ _G[ "BonusActionButton"..i ]:SetPoint("CENTER", b, "CENTER")
+ end
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ for i = 1, 10 do
+ _G["PetActionButton"..i].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("PetActionButtonsVerticalMover") then
+ MovAny:ResetFrame("PetActionButtonsVerticalMover")
+ end
+ PetActionButton1:ClearAllPoints()
+ PetActionButton1:SetPoint("LEFT", self, "LEFT", 0, 0)
+ self.attachedChildren = {}
+ for i = 1, 10, 1 do
+ tinsert(self.attachedChildren, _G[ "PetActionButton"..i ])
+ b = _G[ "PetActionButton"..i ]
+ if i > 1 then
+ pb = _G[ "PetActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", pb, "RIGHT", 4, 0)
+ end
+ b.MAParent = self
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ PetActionButton1:ClearAllPoints()
+ PetActionButton1:SetPoint("BOTTOMLEFT", "PetActionBarFrame", "BOTTOMLEFT", 36, 1)
+ for i = 2, 10, 1 do
+ b = _G[ "PetActionButton"..i ]
+ pb = _G[ "PetActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", pb, "RIGHT", 8, 0)
+ end
+ self.attachedChildren = nil
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("PetActionButtonsMover") then
+ MovAny:ResetFrame("PetActionButtonsMover")
+ end
+ local b, pb
+ PetActionButton1:ClearAllPoints()
+ PetActionButton1:SetPoint("TOP", self, "TOP", 0, 0)
+ --self:SetFrameLevel(PetActionButton1:GetFrameLevel() + 1)
+ self.attachedChildren = {}
+ for i = 1, 10, 1 do
+ b = _G[ "PetActionButton"..i ]
+ tinsert(self.attachedChildren, b)
+ if i > 1 then
+ pb = _G[ "PetActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("TOP", pb, "BOTTOM", 0, -3)
+ end
+ b.MAParent = self
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b, pb
+ PetActionButton1:ClearAllPoints()
+ PetActionButton1:SetPoint("BOTTOMLEFT", "PetActionBarFrame", "BOTTOMLEFT", 36, 1)
+ for i = 2, 10, 1 do
+ b = _G[ "PetActionButton"..i ]
+ pb = _G[ "PetActionButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", pb, "RIGHT", 8, 0)
+ b.MAParent = PetActionButtonsMover
+ end
+ self.attachedChildren = nil
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ for i = 1, 10 do
+ _G["ShapeshiftButton"..i].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("ShapeshiftButtonsVerticalMover") then
+ MovAny:ResetFrame("ShapeshiftButtonsVerticalMover")
+ end
+
+ ShapeshiftBarFrame.MAParent = self
+ for i = 1, 10 do
+ _G["ShapeshiftButton"..i].MAParent = self
+ end
+ ShapeshiftBarFrame:DisableDrawLayer("BACKGROUND")
+ ShapeshiftBarFrame:DisableDrawLayer("BORDER")
+ self.attachedChildren = {ShapeshiftBarFrame}
+ self:Show()
+ end
+ self.OnMAPosition = function(self)
+ MovAny:UnlockPoint(ShapeshiftBarFrame)
+ ShapeshiftBarFrame:ClearAllPoints()
+ ShapeshiftBarFrame:SetPoint("LEFT", self, "LEFT", 0, 0)
+ MovAny:LockPoint(ShapeshiftBarFrame)
+ end
+ self.OnMAOnAttach = function(self, mover)
+ MovAny:UnlockPoint(ShapeshiftBarFrame)
+
+ --self:ClearAllPoints()
+ --self:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", ShapeshiftBarFrame:GetLeft(), ShapeshiftBarFrame:GetBottom())
+
+ ShapeshiftBarFrame:ClearAllPoints()
+ ShapeshiftBarFrame:SetPoint("LEFT", self, "LEFT", 0, 0)
+
+ MovAny:LockPoint(ShapeshiftBarFrame)
+ end
+
+ self.OnMAOnDetach = function(self)
+ end
+ self.OnMAPreReset = function(self)
+ MovAny:UnlockPoint(ShapeshiftBarFrame)
+ --ShapeshiftBarFrame:ClearAllPoints()
+ --MovAny:ResetPosition(ShapeshiftBarFrame, MovAny:GetFrameOptions("ShapeshiftButtonsMover"), true)
+ end
+ self.OnMAPostReset = function(self)
+ self.attachedChildren = nil
+ self:Hide()
+ ShapeshiftBarFrame:EnableDrawLayer("BACKGROUND")
+ ShapeshiftBarFrame:EnableDrawLayer("BORDER")
+ end
+ self.OnMAHide = function(self, hidden)
+ if hidden then
+ MovAny:LockVisibility(ShapeshiftBarFrame)
+ else
+ MovAny:UnlockVisibility(ShapeshiftBarFrame)
+ end
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("ShapeshiftButtonsMover") then
+ MovAny:ResetFrame("ShapeshiftButtonsMover")
+ end
+ ShapeshiftBarFrame:DisableDrawLayer("BACKGROUND")
+ ShapeshiftBarFrame:DisableDrawLayer("BORDER")
+ ShapeshiftBarFrame.MAParent = self
+ local b, pb
+ ShapeshiftButton1:ClearAllPoints()
+ ShapeshiftButton1:SetPoint("TOP", self, "TOP", 0, -7)
+ self.attachedChildren = {}
+ for i = 1, 10, 1 do
+ b = _G[ "ShapeshiftButton"..i ]
+ b.MAParent = self
+ if i > 1 then
+ b.MAParent = self
+ pb = _G[ "ShapeshiftButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("TOP", pb, "BOTTOM", 0, -7)
+ end
+ MovAny:LockPoint(b)
+ tinsert(self.attachedChildren, b)
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b, pb
+ ShapeshiftButton1:ClearAllPoints()
+ ShapeshiftButton1:SetPoint("BOTTOMLEFT", "ShapeshiftBarFrame", "BOTTOMLEFT", 11, 3)
+ for i = 2, 10, 1 do
+ b = _G[ "ShapeshiftButton"..i ]
+ pb = _G[ "ShapeshiftButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("LEFT", pb, "RIGHT", 7, 0)
+ b.MAParent = _G[ "ShapeshiftButtonsMover" ]
+ MovAny:UnlockPoint(b)
+ end
+ self.attachedChildren = nil
+ self:Hide()
+ ShapeshiftBarFrame:EnableDrawLayer("BACKGROUND")
+ ShapeshiftBarFrame:EnableDrawLayer("BORDER")
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("MultiBarRight") then
+ MovAny:ResetFrame("MultiBarRight")
+ end
+ local b, pb
+ self.attachedChildren = {}
+ for i = 1, 12, 1 do
+ b = _G[ "MultiBarRightButton"..i ]
+ tinsert(self.attachedChildren, b)
+ b:ClearAllPoints()
+ if i > 1 then
+ b:SetPoint("LEFT", pb, "RIGHT", 6, 0)
+ else
+ b:SetPoint("TOPLEFT", self)
+ end
+ pb = b
+ b.MAParent = self
+ end
+ self:Show()
+ end
+ self.OnMAPreReset = function (self)
+ if self.attachedChildren then
+ for i, v in pairs(self.attachedChildren) do
+ v.MAParent = nil
+ end
+ end
+ end
+ self.OnMAPostReset = function(self)
+ local b, pb
+ MultiBarRightButton1:ClearAllPoints()
+ MultiBarRightButton1:SetPoint("TOPRIGHT", "MultiBarRight")
+ for i = 2, 12, 1 do
+ b = _G[ "MultiBarRightButton"..i ]
+ pb = _G[ "MultiBarRightButton"..(i-1) ]
+ b:ClearAllPoints()
+ b:SetPoint("TOP", pb, "BOTTOM", 0, -6)
+ end
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.MAProtected = true
+ self.OnMAHook = function(self)
+ if MovAny:IsModified("MultiBarLeft") then
+ MovAny:ResetFrame("MultiBarLeft")
+ end
+ local b, pb
+ self.attachedChildren = {}
+ for i = 1, 12, 1 do
+ b = _G[ "MultiBarLeftButton"..i ]
+ tinsert(self.attachedChildren, b)
+ b:ClearAllPoints()
+ if i > 1 then
+ b:SetPoint("LEFT", pb, "RIGHT", 6, 0)
+ else
+ b:SetPoint("TOPLEFT", self)
+ end
+ pb = b
+ b.MAParent = self
+ end
+ self:Show()
+ end
+ self.OnMAPreReset = function (self)
+ if self.attachedChildren then
+ for i, v in pairs(self.attachedChildren) do
+ v.MAParent = nil
+ end
+ end
+ end
+ self.OnMAPostReset = function(self)
+ local b, pb
+ MultiBarLeftButton1:ClearAllPoints()
+ MultiBarLeftButton1:SetPoint("TOPRIGHT", "MultiBarLeft")
+ pb = MultiBarLeftButton1
+ for i = 2, 12, 1 do
+ b = _G[ "MultiBarLeftButton"..i ]
+ b:ClearAllPoints()
+ b:SetPoint("TOP", pb, "BOTTOM", 0, -6)
+ pb = b
+ end
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.id = 1
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ _G[ "PartyMemberFrame"..self.id.."Debuff"..i ].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["PartyMember"..self.id]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ b = _G[ "PartyMemberFrame"..self.id.."Debuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["PartyMemberFrame"..self.id.."Debuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", "PartyMemberFrame"..self.id, 48, -32)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.id = 2
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ _G[ "PartyMemberFrame"..self.id.."Debuff"..i ].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["PartyMember"..self.id]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ b = _G[ "PartyMemberFrame"..self.id.."Debuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["PartyMemberFrame"..self.id.."Debuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", "PartyMemberFrame"..self.id, 48, -32)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.id = 3
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ _G[ "PartyMemberFrame"..self.id.."Debuff"..i ].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["PartyMember"..self.id]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ b = _G[ "PartyMemberFrame"..self.id.."Debuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["PartyMemberFrame"..self.id.."Debuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", "PartyMemberFrame"..self.id, 48, -32)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.id = 4
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ _G[ "PartyMemberFrame"..self.id.."Debuff"..i ].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["PartyMember"..self.id]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, MAX_PARTY_DEBUFFS, 1 do
+ b = _G[ "PartyMemberFrame"..self.id.."Debuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["PartyMemberFrame"..self.id.."Debuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", "PartyMemberFrame"..self.id, 48, -32)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for i = 1, 4, 1 do
+ _G[ "PetFrameDebuff"..i ].MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["PetFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, 4, 1 do
+ b = _G[ "PetFrameDebuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["PetFrameDebuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", "PetFrame", 48, -42)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TargetFrame_UpdateAuras(TargetFrame)
+ for i = 1, MAX_TARGET_BUFFS, 1 do
+ local b = _G[ "TargetFrameBuff"..i ]
+ if not b then
+ b = CreateFrame("Button", "TargetFrameBuff"..i, TargetFrame, "TargetBuffFrameTemplate")
+ b.unit = TargetFrame.unit
+ end
+ b.MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["TargetFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ TargetFrame_UpdateAuras(TargetFrame)
+ for i = 1, MAX_TARGET_BUFFS, 1 do
+ b = _G[ "TargetFrameBuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ MovAny:UnlockPoint(TargetFrameBuff1)
+ TargetFrameBuff1:ClearAllPoints()
+ TargetFrameBuff1:SetPoint("TOPLEFT", TargetFrame, "BOTTOMLEFT", 5, 32)
+ self:Hide()
+ TargetFrame_UpdateAuras(TargetFrame)
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TargetFrame_UpdateAuras(TargetFrame)
+ for i = 1, MAX_TARGET_DEBUFFS, 1 do
+ local b = _G[ "TargetFrameDebuff"..i ]
+ if not b then
+ b = CreateFrame("Button", "TargetFrameDebuff"..i, TargetFrame, "TargetDebuffFrameTemplate")
+ b.unit = TargetFrame.unit
+ end
+ b.MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["TargetFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ TargetFrame_UpdateAuras(TargetFrame)
+ for i = 1, MAX_TARGET_DEBUFFS, 1 do
+ b = _G[ "TargetFrameDebuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = TargetFrameDebuff1
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", TargetFrame, "BOTTOMLEFT", 5, 35)
+ self:Hide()
+ TargetFrame_UpdateAuras(TargetFrame)
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TargetFrame_UpdateAuras(FocusFrame)
+ for i = 1, MAX_TARGET_BUFFS, 1 do
+ local b = _G[ "FocusFrameBuff"..i ]
+ if not b then
+ b = CreateFrame("Button", "FocusFrameBuff"..i, FocusFrame, "TargetBuffFrameTemplate")
+ b.unit = FocusFrame.unit
+ end
+ b.MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["FocusFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ TargetFrame_UpdateAuras(FocusFrame)
+ for i = 1, MAX_TARGET_DEBUFFS, 1 do
+ b = _G[ "FocusFrameBuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = FocusFrameBuff1
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", FocusFrame, "BOTTOMLEFT", 5, 35)
+ self:Hide()
+ TargetFrame_UpdateAuras(FocusFrame)
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TargetFrame_UpdateAuras(FocusFrame)
+ for i = 1, MAX_TARGET_DEBUFFS, 1 do
+ local b = _G[ "FocusFrameDebuff"..i ]
+ if not b then
+ b = CreateFrame("Button", "FocusFrameDebuff"..i, FocusFrame, "TargetDebuffFrameTemplate")
+ b.unit = FocusFrame.unit
+ end
+ b.MAParent = self
+ end
+ self.OnMAHook = function(self)
+ self:SetScale(_G["FocusFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ TargetFrame_UpdateAuras(FocusFrame)
+ for i = 1, MAX_TARGET_DEBUFFS, 1 do
+ b = _G[ "FocusFrameDebuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = FocusFrameDebuff1
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", FocusFrame, "BOTTOMLEFT", 4, 33)
+ self:Hide()
+ TargetFrame_UpdateAuras(FocusFrame)
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ for i = 1, 4, 1 do
+ local b = _G[ "TargetFrameToTDebuff"..i ]
+ b.MAParent = self
+ end
+ self.OnMAHook = function(self)
+ --self:SetPoint("TOPLEFT", TargetFrameToT, "TOPRIGHT", 4, -10)
+ self:SetScale(_G["TargetFrameToT"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, 4, 1 do
+ b = _G[ "TargetFrameToTDebuff"..i ]
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", self, "TOPLEFT", 1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["TargetFrameToTDebuff1"]
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPLEFT", TargetFrameToT, "TOPRIGHT", 4, -10)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ self.OnMAHook = function(self)
+ self.attachedChildren = {}
+ local b = _G["BuffFrame"]
+ b:SetPoint("TOPRIGHT", self, "TOPRIGHT", 0, 0)
+ MovAny:LockPoint(b)
+ tinsert(self.attachedChildren, b)
+ b = _G["ConsolidatedBuffs"]
+ b:SetPoint("TOPRIGHT", self, "TOPRIGHT", 0, 0)
+ MovAny:LockPoint(b)
+ tinsert(self.attachedChildren, b)
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G["BuffFrame"]
+ MovAny:UnlockPoint(b)
+ b:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -205, -13)
+ b = _G["ConsolidatedBuffs"]
+ MovAny:UnlockPoint(b)
+ b:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -180, -13)
+ self:Hide()
+ end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hooksecurefunc("BuffFrame_Update", function()
+ if MovAny:IsModified(self:GetName()) then
+ self.attachedChildren = {}
+ for i = 1, DEBUFF_MAX_DISPLAY, 1 do
+ local b = _G[ "DebuffButton"..i ]
+ if b then
+ b.MAParent = self
+ tinsert(self.attachedChildren, b)
+ end
+ end
+ MovAny:SyncFrame(self:GetName())
+ end
+ end)
+ self.OnMAHook = function(self)
+ self:SetScale(_G["BuffFrame"]:GetEffectiveScale() / UIParent:GetScale())
+ local b
+ self.attachedChildren = {}
+ for i = 1, DEBUFF_MAX_DISPLAY, 1 do
+ b = _G[ "DebuffButton"..i ]
+ if b then
+ tinsert(self.attachedChildren, b)
+ if i == 1 then
+ b:ClearAllPoints()
+ b:SetPoint("TOPRIGHT", self, "TOPRIGHT", -1, -1)
+ MovAny:LockPoint(b)
+ end
+ end
+ end
+ self:Show()
+ end
+ self.OnMAPostReset = function(self)
+ local b = _G[ "DebuffButton1"]
+ self.attachedChildren = nil
+ if b then
+ MovAny:UnlockPoint(b)
+ b:ClearAllPoints()
+ b:SetPoint("TOPRIGHT", ConsolidatedBuffs, "BOTTOMRIGHT", 0, -TempEnchant1:GetHeight()*3)
+ end
+ self:Hide()
+ BuffFrame_Update()
+ end
+
+
+
+
+
+
diff --git a/MoveAnything/localization.en.lua b/MoveAnything/localization.en.lua
new file mode 100644
index 0000000..5f996cd
--- /dev/null
+++ b/MoveAnything/localization.en.lua
@@ -0,0 +1,36 @@
+local addonname, modRef = ...
+
+_G["MOVANY"] = modRef
+MOVANY.RESET_FRAME_CONFIRM = "Reset %s? Press again within 5 seconds to confirm"
+MOVANY.RESETTING_FRAME = "Resetting %s"
+MOVANY.FRAME_PROTECTED_DURING_COMBAT = "Can't interact with %s during combat"
+MOVANY.DISABLED_DURING_COMBAT = "Disabled during combat"
+MOVANY.UNSUPPORTED_TYPE = "Unsupported type: %s"
+MOVANY.UNSUPPORTED_FRAME = "Unsupported frame: %s"
+MOVANY.FRAME_VISIBILITY_ONLY = "%s can only be hidden"
+MOVANY.ONLY_WHEN_VISIBLE = "%s can only be modified while it's shown on the screen"
+MOVANY.MAX_MOVERS = "You can only move %i frames at once"
+MOVANY.ELEMENT_NOT_FOUND = "UI element not found"
+MOVANY.ELEMENT_NOT_FOUND_NAMED = "UI element not found: %s"
+MOVANY.PROFILES_CANT_SWITCH_DURING_COMBAT = "Profiles can't be switched during combat"
+MOVANY.CMD_SYNTAX_UNMOVE = "Syntax: /unmove framename"
+MOVANY.CMD_SYNTAX_IMPORT = "Syntax: /moveimport ProfileName"
+MOVANY.CMD_SYNTAX_EXPORT = "Syntax: /moveexport ProfileName"
+MOVANY.CMD_SYNTAX_DELETE = "Syntax: /movedelete ProfileName"
+MOVANY.CMD_SYNTAX_HIDE = "Syntax: /hide ProfileName"
+MOVANY.RESET_ALL_CONFIRM = "MoveAnything: Reset MoveAnything to installation state?\n\nWarning: this will delete all frame settings and clear out the custom frame list."
+MOVANY.PROFILE_UNKNOWN = "Unknown profile: %s"
+MOVANY.PROFILE_IMPORTED = "Profile imported: %s"
+MOVANY.PROFILE_EXPORTED = "Profile exported: %s"
+MOVANY.PROFILE_DELETED = "Profile deleted: %s"
+MOVANY.PROFILE_RESET_CONFIRM = "MoveAnything: Reset all frames in the current profile?"
+MOVANY.PROFILE_CANT_DELETE_CURRENT_IN_COMBAT = "Can't delete current profile during combat"
+MOVANY.PROFILES = "Profiles"
+MOVANY.PROFILE_CURRENT = "Current"
+MOVANY.FRAME_UNPOSITIONED = "%s is currently unpositioned and can't be moved till it is"
+MOVANY.NO_NAMED_FRAMES_FOUND = "No named elements found"
+MOVANY.SEARCH_TEXT = "Search "
+MOVANY.LIST_HEADING_CATEGORY_AND_FRAMES = "Categories and Frames"
+MOVANY.LIST_HEADING_SEARCH_RESULTS = "Search results: %i"
+MOVANY.LIST_HEADING_HIDE = "Hide"
+MOVANY.LIST_HEADING_MOVER = "Mover"
\ No newline at end of file
diff --git a/README.md b/README.md
index 226db33..bed9669 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
-# Addon Name
+# Move Anything
-This is the repository for . Modified for Ascension.gg.
\ No newline at end of file
+This is the repository for MoveAnything. Modified for Ascension.gg.
\ No newline at end of file