Page 1 of 1

HUD Subclassing

PostPosted: Mon Dec 05, 11 8:00 am
by EXetoC
Has anyone been able to do it? I think that this approach is better than modifying the class directly. The problem is that DeusExRootWindow for example seems to be created in native code, thus making it impossible to change the type. I am modifying 2027, whose source code consist almost entirely of subclasses in a separate directory, and i'd like to adhere to that convention.

PostPosted: Mon Dec 05, 11 1:05 pm
by ~DJ~
If I'm getting this right.. yeah? It's pretty simple.. your HUD extending DeusExHUD.. you'll need a playerclass along with it though. If that's not what you're talking about then NEEVEMIND :oops:

PostPosted: Mon Dec 05, 11 9:12 pm
by EXetoC
Yes i realized that, although it might not be a good idea to create a subclass after all. The question then is, do i move my variables from TruePlayer (which is a subclass of DeusExPlayer), to DeusExPlayer, or do i just add a few references to TruePlayer (alternatively replacing all the references to TruePlayer, thus making the code a little less messy)? The former is rather ugly from an object oriented perspective, i think. Either way, i'm under version control so a little experimentation isn't going to do much harm.

Was this at all confusing? :)

PostPosted: Tue Dec 06, 11 12:04 am
by EXetoC
Actually 2027 seems to modify the original classes (even some that are also subclassed), and it can save quite a lot of headaches i suppose.