Thread Tools Display Modes
05-20-10, 07:02 PM   #21
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Hmm, cool idea, I've been using the setpoint = function end system with no problems for the watchframe but your idea may well be better in the long run.
__________________
  Reply With Quote
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
05-20-10, 10:05 PM   #23
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
The reason you get the nil error is due to the getbottom and gettop etc functions returning a nil value due to the frame not being positioned in time or being reparented or the clearallpoints function is called. I worked past this so that I don't get that problem now.

Seerah worked past it by delaying the reparenting to allow blizz to do their stuff if I remember right.

I use the hooksecurefuncs to change what they do to what I want or if that doesn't work like the new WatchFrame_SetWidth function I just nullify it with the function end setting.

This is the parenting code I do during the ADDON_LOADED event
Code:
self:SetParent(nil);
self:SetParent(parent);
self:SetClampedToScreen( false );
I then resize and reposition during the VARIABLES_LOADED event to overrirde their automatic position and size settings.
First the Sizing
Code:
self:SetWidth( self:GetParent():GetWidth() - 30 );
self:SetHeight(self:GetParent():GetHeight() - 10 );
WATCHFRAME_MAXLINEWIDTH = self:GetWidth() - 10;
WATCHFRAME_EXPANDEDWIDTH = self:GetWidth();
WATCHFRAME_COLLAPSEDWIDTH = WatchFrameTitle:GetWidth() + 70;
Then the positioning. I have my watch frame reparented to a scroll frame so the setpoint here is relevant to that. But if I didn't I would set this to my chosen position. Because I call it after blizz does their positioning the user won't notice the difference.
Code:
self:SetAllPoints();
self:SetPoint( "TOPLEFT", 35, -5 );
self:SetPoint( "BOTTOMRIGHT", -5, 5 );
self.ClearAllPoints = function() end;
self.SetPoint = function() end;
self.SetAllPoints = function() end;
And then in PLAYER_LOGIN I show the frame.

And because my addon is an nUI friendly addon it disables nUI's control prior to any changes whatsoever.

This code though is still a work in progress and is only a part of my overrall code but it works pretty much as expected barring a couple of settings. I don't get any errors. Feel free to take a look at my last uploaded version.
__________________

Last edited by Xrystal : 05-20-10 at 10:18 PM.
  Reply With Quote
05-20-10, 11:36 PM   #24
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
are you func ending the WatchFrame_SetWidth because of the bliz option to make the objectives frame wider? If so why? the method i used seems to allow that bliz function to still function properly. So far... lol.

Let me just explain what i mean a little more... The method i came up with sets the objectives frame where i want and i can still use the bliz option for wider objective frame and it works as bliz intended while still maintaining my setpoint. Im guessing you func ended that because when you used that option in the options panel it would foul up your frame placement?

Been busy with other stuff today so i have not had a chance to try my method with the rest of the frames i have problems with. If this works for moving the vehicle bar ill be a happy camper. Although after you mentioned the idea of a delay to let bliz do its thing even if my way does not work i think Your or Seerah's way will.

If all else fails ill send Maul a msg and see if he can point me the right direction on action bars since i know for sure Macaroon has a full functioning movable vehic bar. Glancing at his code though looks like he may have rewritten it all together and ditched the bliz stuff entirely.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-21-10 at 12:31 AM.
  Reply With Quote
05-21-10, 04:51 AM   #25
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Ah no in my case I wanted to remove the option for wider objectives as I give the user full control over width and height of the objectives frame and with nUI itself it has a docking option which means it is a fixed size. Just scrollable in height.

Here's a couple of screenshots. I did try using the wider objectives option but it hard codes the width between 2 specific values and does some other coding which then messes up the rest of my addon.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_052110_043548.jpg
Views:	695
Size:	386.9 KB
ID:	4280  Click image for larger version

Name:	UnDocked with BlackBackGround.jpg
Views:	690
Size:	261.7 KB
ID:	4281  
__________________
  Reply With Quote
05-21-10, 05:05 AM   #26
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Also, it looks like nUI doesn't do anything fancy with the vehicle bar but lets blizz deal with it. As far as I know blizz simply replaces the main action bar with the vehicle bar and then back again. Where nUI doesn't do anything except reposition and reparent the main action bars it doesn't seem to break this part of the process.
__________________
  Reply With Quote
05-21-10, 08:17 AM   #27
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
When using nUI does the vehic bar show up dead center at the bottom? with all its art intact?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
05-21-10, 08:23 AM   #28
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Not at the bottom but where nUI has the main action bar placed. I'll grab you screenshot.

Aha, knew I had one around. Its a whiles old but shows that the bars are interchanged as per blizz settings. ah, but not with their art. With the nUI art.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_091109_181800.jpg
Views:	693
Size:	420.2 KB
ID:	4284  Click image for larger version

Name:	WoWScrnShot_091109_181615.jpg
Views:	694
Size:	282.7 KB
ID:	4285  
__________________
  Reply With Quote
05-21-10, 09:40 AM   #29
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
okay, seeing that... i think that what was done here is exactly what maul did with macaroons. I think how they do this is they hide all the graphix and the Vehic frame itself and re-parent the buttons to a new frame that then has secure state driver code to respond to getting in and out of vehicles.

Oh just a side note... i did get ride of most of the vehic bar art with no problems. infact no art at all would be just fine as long as the buttons poped up where they should all the time.

When your using nUI and you get into or out of a vehicle do any of your other button bars change up? or does it just appear to cover up your normal action bar?

Im not sure but thinking about it more and the way its done in nUI and macaroons is that all action bars are re-parented to frames that have secure code to handle events that deal with hiding and showing bars according to vehicles/stances/shapes so on and so forth or at lest so i think and it would appear. Maybe this is the only way to fully do it without having any funny bliz frame management issues or taint?

and you may be wondering why i dont just do that... lol... well... i dont understand either the nUI or Macaroon code enough or the secure code in general. lol but im trying


one last note it also appears that with the vehicle bar unlike the other bars you have to re parent each button rather then a frame. maybe true for all action buttons not sure yet.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 05-21-10 at 04:06 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to nuke bliz function

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off