btysgtmajor Posted September 8, 2016 Share Posted September 8, 2016 I'm still fairly new to XCOM 2 modding, but, I was wondering if anyone knows if there are any events triggered or any way whatsoever to know when UITacticalHUD ends up calling RaiseTargetSystem() or LowerTargetSystem()? I've tried polling the class, but, so far I've only been able to do it via the Visualization Observer Interface (or whatever) but those events don't trigger when the targeting system goes up or down. This is the last sticking point for a mod of mine. Otherwise, I have to override UITacticalHUD and it creates all kinds of conflicts with other mods. Any thoughts/advice? Or am I missing something obvious? Thanks in advance! Link to comment Share on other sites More sharing options...
btysgtmajor Posted September 8, 2016 Author Share Posted September 8, 2016 FYI, Robojumper has suggested a mod called "NobodySawThat" might have a way to accomplish what I'm looking to do. I'm going to check that out when I get the chance, and hopefully report my findings here. Link to comment Share on other sites More sharing options...
btysgtmajor Posted September 9, 2016 Author Share Posted September 9, 2016 As promised, I'm sharing my results. Thanks to the mod referenced above, I found a snazzy way to be alerted to essentially ANY variable change! Take a look at the line below and I think you'll see how you can use it most anywhere: WorldInfo.MyWatchVariableMgr.RegisterWatchVariable( HUDScreen, 'm_isMenuRaised', self, ToggleTargetSystem); In the case above, we're registering the variable/property "m_isMenuRaised" against the "HUDScreen" class (in this case a UITacticalHUD), and telling it to notify "self" and, when doing so, call the "ToggleTargetSystem" method. Hope this helps someone else! Link to comment Share on other sites More sharing options...
robojumper Posted September 9, 2016 Share Posted September 9, 2016 That being said, RegisterWatchVariable should be considered a last resort for ONLY UI ELEMENTS. Often, these class variables contain data relevant to the internal state of the object. If there is anything that changes the GameState, you should not rely on it, and use the built-in `XEVENTMGR if possible. Link to comment Share on other sites More sharing options...
btysgtmajor Posted September 9, 2016 Author Share Posted September 9, 2016 An excellent point. @robojumper: Have you considered putting a guide/document together with all these great tidbits? I've found them most helpful so far. Link to comment Share on other sites More sharing options...
Recommended Posts