View Single Post
05-20-10, 07:27 PM   #22
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
really when i tried to do function end it gave me an error about unable to do arithmetic on SetPoint.

Also is it possible to Add to a function? Not like the HookSecureFunc does but somehow add a few lines to another function? Or to make a function an event? If i could add to the bliz frame management function or turn it into an event i can have my own function respond to... might be easier then some of the things im noticing... doing the Setpoint = frame:setpoint deal works but it has to be done for everytime the frame position function is called by bliz and sometimes its not called by events, the On_Clicks for the options panel call the frame management stuff to. Had to make it look like this so when you open the options frame and click okay it would stop resetting the objectives frame, had to do it for cancel and a few others like the checkbox's in the actionbar options panel also caused the objectives frame to move again, im sure because its calling the frame management system again. So ya if i could some how adjust that frame management system without causing taint... i could turn the whole thing off and then just do setpoints with no funny business.

LUA Code:
  1. --
  2. -- Objevtives relocation
  3. -------------------------
  4.  
  5. local GUIObjectivesAnchor = CreateFrame('Frame', "GUIObjectivesAnchor", UIParent)
  6. GUIObjectivesAnchor:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 28, 0)
  7. GUIObjectivesAnchor:SetHeight(250)
  8. GUIObjectivesAnchor:SetWidth(250)
  9.  
  10. GUIObjectivesAnchor:RegisterEvent("PLAYER_ENTERING_WORLD")
  11. GUIObjectivesAnchor:RegisterEvent("QUEST_LOG_UPDATE")
  12. GUIObjectivesAnchor:RegisterEvent("CVAR_UPDATE")
  13.  
  14. InterfaceOptionsFrameOkay:HookScript("OnClick", function(self) --Hook script because we don't want to overwrite _onclick
  15.    
  16.     WatchFrame:ClearAllPoints()
  17.        
  18.     WatchFrame.SetPoint = WatchFrame:SetPoint("TOPLEFT", GUIObjectivesAnchor, "TOPLEFT", 0, 0)
  19.  
  20.    
  21. end)
  22.  
  23. InterfaceOptionsFrameCancel:HookScript("OnClick", function(self) --Hook script because we don't want to overwrite _onclick
  24.    
  25.     WatchFrame:ClearAllPoints()
  26.        
  27.     WatchFrame.SetPoint = WatchFrame:SetPoint("TOPLEFT", GUIObjectivesAnchor, "TOPLEFT", 0, 0)
  28.  
  29.    
  30. end)
  31.  
  32. GUIObjectivesAnchor:SetScript("OnEvent", function()
  33.    
  34.     WatchFrame:ClearAllPoints()
  35.        
  36.     WatchFrame.SetPoint = WatchFrame:SetPoint("TOPLEFT", GUIObjectivesAnchor, "TOPLEFT", 0, 0)
  37.    
  38.  
  39. end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote