Originally Posted by
Rakkhin
Replace every occurrence... Snip...
Thanks.
So if i get this right then:
SetScript: Replace the original script and will only do what i tell it to do.
HookScript: Use the original script and only replace what i tell it to replace.
Am i right ?
Now the only problem i have is that sometime the GroupLootFrame "jump" back to its original place, then i tryed to make a frame and hook it to them, now that stay in place but now they sometime do this
This is how i have done that
Code:
local Hook_GLF_Frame = CreateFrame("Frame", Hook_GLF_Frame, UIParent)
-- The moving thing is just for testing
--[[
Hook_GLF_Frame:SetMovable(true)
Hook_GLF_Frame:EnableMouse(true)
Hook_GLF_Frame:RegisterForDrag("LeftButton")
Hook_GLF_Frame:SetScript("OnDragStart", frame.StartMoving)
Hook_GLF_Frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
]]
Hook_GLF_Frame:SetWidth(100);
Hook_GLF_Frame:SetHeight(100);
Hook_GLF_Frame:SetPoint("BOTTOM", -500, 600)
local GroupLootFrame_OnShow = function(self, ...)
self:ClearAllPoints();
self:SetParent(UIParent);
if (self == GroupLootFrame1) then
self:SetPoint("TOPLEFT", Hook_GLF_Frame, "BOTTOMLEFT", 0, 0);
elseif (self == GroupLootFrame2) then
self:SetPoint("TOPLEFT", GroupLootFrame1, "BOTTOMLEFT", 0, 0);
elseif (self == GroupLootFrame3) then
self:SetPoint("TOPLEFT", GroupLootFrame2, "BOTTOMLEFT", 0, 0);
elseif (self == GroupLootFrame4) then
self:SetPoint("TOPLEFT", GroupLootFrame3, "BOTTOMLEFT", 0, 0);
end
end
GroupLootFrame1:HookScript("OnShow", GroupLootFrame_OnShow)
GroupLootFrame2:HookScript("OnShow", GroupLootFrame_OnShow)
GroupLootFrame3:HookScript("OnShow", GroupLootFrame_OnShow)
GroupLootFrame4:HookScript("OnShow", GroupLootFrame_OnShow)
Any ide on how to fix that ?