UI Class Reference

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

UI Class Reference

Post by Cybernetic pig »

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.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: UI Class Reference

Post by Hanfling »

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.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: UI Class Reference

Post by Cybernetic pig »

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.

Code: Select all

local PersonaScreenSkills skillScreen;

skillScreen = ? 

skillScreen.updateTheFuckingSkillCounter();
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.
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: UI Class Reference

Post by Hanfling »

Probably a better approach is to just force the whole PersonaScreenSkills window to update.

Code: Select all

local DeusExBaseWindow TopWin = DeusExRootWindow(GetRootWindow()).GetTopWindow();
if ( TopWin!=None )
  TopWin.RefreshWindow( 0.0 );
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).
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Cybernetic pig
Illuminati
Posts: 2284
Joined: Thu Mar 08, 2012 3:21 am

Re: UI Class Reference

Post by Cybernetic pig »

Your first suggestion worked beautifully, thanks! Strange that the options are so limited...
Hanfling
MJ12
Posts: 406
Joined: Sun Oct 04, 2009 6:54 pm

Re: UI Class Reference

Post by Hanfling »

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.
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.
Post Reply