From b23665c382af52f80054ea0ad63a61deef4bcbfa Mon Sep 17 00:00:00 2001 From: Xruptor Date: Sat, 6 Oct 2012 09:41:16 -0400 Subject: [PATCH] -Fixed an issue with resetting frames. --- LootRollMover.lua | 46 +++++++++++++++------------------------------- LootRollMover.toc | 2 +- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/LootRollMover.lua b/LootRollMover.lua index b680af7..f205e73 100644 --- a/LootRollMover.lua +++ b/LootRollMover.lua @@ -74,44 +74,28 @@ local function RepositionLootFrames() if not _G["LootRollMoverAnchor_Frame"] then return end if not LRMDB then return end local frame + frame = _G["GroupLootContainer"] + if ( frame ) then + frame:ClearAllPoints() + frame:SetPoint("BOTTOMLEFT", _G["LootRollMoverAnchor_Frame"], "BOTTOMLEFT", 4, 2) + frame:SetParent(UIParent) + frame:SetScale(LRMDB.scale) + end for i=1, NUM_GROUP_LOOT_FRAMES do frame = _G["GroupLootFrame" .. i] - if i == 1 then - if ( frame:IsShown() ) then - frame:ClearAllPoints() - frame:SetPoint("BOTTOMLEFT", _G["LootRollMoverAnchor_Frame"], "BOTTOMLEFT", 4, 2) - frame:SetParent(UIParent) - frame:SetScale(LRMDB.scale) - end - elseif i > 1 then - if ( frame:IsShown() ) then - frame:ClearAllPoints() - frame:SetPoint("BOTTOM", "GroupLootFrame" .. (i-1), "TOP", 0, 3) - frame:SetParent(UIParent) - frame:SetScale(LRMDB.scale) - end + if ( frame ) then + frame:SetScale(LRMDB.scale) end end end -local old_GroupLootFrame_OnShow = GroupLootFrame_OnShow -GroupLootFrame_OnShow = function(self) - old_GroupLootFrame_OnShow(self) - RepositionLootFrames() -end +hooksecurefunc("GroupLootContainer_OnLoad", RepositionLootFrames) +hooksecurefunc("GroupLootContainer_RemoveFrame", RepositionLootFrames) +hooksecurefunc("GroupLootFrame_OnShow", RepositionLootFrames) +hooksecurefunc("GroupLootFrame_OpenNewFrame", RepositionLootFrames) +hooksecurefunc("GroupLootFrame_OnEvent", RepositionLootFrames) +hooksecurefunc("AlertFrame_FixAnchors", RepositionLootFrames) -local old_GroupLootFrame_OpenNewFrame = GroupLootFrame_OpenNewFrame -GroupLootFrame_OpenNewFrame = function(id, rollTime) - old_GroupLootFrame_OpenNewFrame(id, rollTime) - RepositionLootFrames() -end - -local old_GroupLootFrame_OnEvent = GroupLootFrame_OnEvent -GroupLootFrame_OnEvent = function(self, event, ...) - old_GroupLootFrame_OnEvent(self, event, ...) - RepositionLootFrames() -end - function f:DrawAnchor() local frame = CreateFrame("Frame", "LootRollMoverAnchor_Frame", UIParent) diff --git a/LootRollMover.toc b/LootRollMover.toc index 1489918..a98cbd3 100644 --- a/LootRollMover.toc +++ b/LootRollMover.toc @@ -1,7 +1,7 @@ ## Interface: 50001 ## Title: LootRollMover ## Author: Xruptor -## Version: 3.0 +## Version: 3.1 ## Notes: A simple mod to move the default Blizzard Group Loot Roll Windows ## SavedVariables: LRMDB -- 1.7.9.5