Instalează Steam
conectare
|
limbă
简体中文 (chineză simplificată)
繁體中文 (chineză tradițională)
日本語 (japoneză)
한국어 (coreeană)
ไทย (thailandeză)
български (bulgară)
Čeština (cehă)
Dansk (daneză)
Deutsch (germană)
English (engleză)
Español - España (spaniolă - Spania)
Español - Latinoamérica (spaniolă - America Latină)
Ελληνικά (greacă)
Français (franceză)
Italiano (italiană)
Bahasa Indonesia (indoneziană)
Magyar (maghiară)
Nederlands (neerlandeză)
Norsk (norvegiană)
Polski (poloneză)
Português (portugheză - Portugalia)
Português - Brasil (portugheză - Brazilia)
Русский (rusă)
Suomi (finlandeză)
Svenska (suedeză)
Türkçe (turcă)
Tiếng Việt (vietnameză)
Українська (ucraineană)
Raportează o problemă de traducere
Thanks, I'll take a look.
I was actually talking about you guys incorporating my code, not the other way around.
However, I am attempting to make mine compatible with Toolbox by hooking into PostSquadSelectInit. How do I go about doing that? I'm trying to use XEVENTMGR.RegisterForEvent. Hopefully that is the correct way
Also, can I register for the event in the OnInit handler of the ScreenListner extension whose defualt properites sets ScreenClass=class'UISquadSelect'? Can I even use that technique given that Toolbox overrides the built in UISquadSelect class?
Aleternately, is the correct way to create a second class that extends UIScreenListerner without a ScreenClass assignment? And then it's in that class where the event listener is registered?
I just need help understanding how to hook into your event triggered in a class that overwrites a built in screen class.
Thanks.
Alex
One method is to set up your screen listener with a ScreenClass == none and then do filtering within OnInit, etc. The filter looks like if(UISquadSelect(Screen) != none). I've used this, and it will automatically detect UISquadSelect or any extension of it.
Another method is to use one of the new X2EventManager TriggerEvent methods that I've added in various places in Toolbox to improve interoperability. This method was used with the (updated) LeaderPack mod to make that compatible. LeaderPack had its own UIScreenListener on UISquadSelect for the leader-related UI bits, and I used the Triggered Events to implement the same functionality.
If you look through the LeaderPack code, inside the class UIStrategyScreenListener_LWOfficerPack is an example where I've set up 8 different RegisterForEvent methods to listen for events generated by Toolbox.
Note that LeaderPack was updated with these changes over a month ago, so a little while before Toolbox release! :). So that design functions fine with or without Toolbox. If Toolbox isn't present, the UISquadSelect listener kicks in and LeaderPack does its thing, and the RegisteredEvents never activate because they aren't triggered. If Toolbox IS present, then the UISquadSelect listener doesn't activate, but the functionality is handled through the Events.
Excellent. That is exactly what I needed.
Thanks,
Alex