I need a reference/pointer to a UI class from another UI class with no familial ties. Looking around the sparse information on the net and at existing code the methods to do so seem few and far between (I can't find any, but there must be some way).
I just need to update some damn text in UI class A when a button is pressed in UI class B...
Edit: I should note that both these windows/UI elements are open at the same time too.
UI Class Reference
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: UI Class Reference
I'm afraid your description is a bit to abstract. Maybe you should write what you plan to do in detail and which classes are involved.
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: UI Class Reference
http://i1309.photobucket.com/albums/s64 ... 6lxhnu.jpg WIP (obviously).
When purchasing a perk using a button in the window on the right (PersonaInfoWindow.uc) I need to update the skill points counter (# of skill points player has) which is a NewChild of the window on the left (PersonaScreenSkills.uc).
To do so I need a reference/pointer to PersonaScreenSkills from PersonaInfoWindow.
It should be simple but UI/window coding is a little different to actor coding and I haven't done too much of it beyond making an options menu and minor (yet significant) tweaks. I've looked through the code for methods on how to do this but I've not found anything.
When purchasing a perk using a button in the window on the right (PersonaInfoWindow.uc) I need to update the skill points counter (# of skill points player has) which is a NewChild of the window on the left (PersonaScreenSkills.uc).
To do so I need a reference/pointer to PersonaScreenSkills from PersonaInfoWindow.
Code: Select all
local PersonaScreenSkills skillScreen;
skillScreen = ?
skillScreen.updateTheFuckingSkillCounter();
Re: UI Class Reference
Probably a better approach is to just force the whole PersonaScreenSkills window to update.
Or maybe even update the button text for the Skillpoints available box every frame before drawing (Doing stuff that way is where I'm heading in case of HX).
Code: Select all
local DeusExBaseWindow TopWin = DeusExRootWindow(GetRootWindow()).GetTopWindow();
if ( TopWin!=None )
TopWin.RefreshWindow( 0.0 );
-
- Illuminati
- Posts: 2284
- Joined: Thu Mar 08, 2012 3:21 am
Re: UI Class Reference
Your first suggestion worked beautifully, thanks! Strange that the options are so limited...
Re: UI Class Reference
Well you could also cast the result of GetTopWindow() to PersonaScreenSkills and update just the remaining skill points. However this approach gets pretty awkward as you end up with a lot of code to update single elements spread thoughout your whole codebase.