File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- # ShowKSP2Events
2- Shows events triggered by Kerbal Space Program 2 .
1+ # ShowKSP2Events - a Kerbal Space Program 2 plugin
2+ Shows events triggered by KSP2 .
33
44This is a mod to help modders mod.
55
6- < span style = " color : white ; " > White event</ span > - event that was just triggered (< 1 sec)
7- < span style = " color : yellow ; " > Yellow event</ span > - event that was recently triggered (< 20 sec)
8- < span style = " color : yellow ; " > Grey message</ span > - event that hasn't triggered for a while (< 60 sec)
6+ - ** White event** - event that was just triggered (< 1 sec)
7+ - ** Yellow event** - event that was recently triggered (< 20 sec)
8+ - ** Grey event ** - event that hasn't triggered for a while (< 60 sec)
99
1010![ screenshot] ( https://i.imgur.com/Z3zMOcJ.png )
1111
@@ -18,10 +18,13 @@ Mod folder will be placed in ..\Kerbal Space Program 2\BepInEx\plugins\
1818
1919- open the mod via app bar.
2020- see which event is being triggered by a certain user or game action
21- - to subscribe to the event use the following code in your mod :
21+ - to subscribe to the event use the following code:
2222
2323~~~~~~~~
24- GameManager.Instance.Game.Messages.Subscribe<NameOfTheEventYouWantToSubscribeTo>(new Action<MessageCenterMessage>(this.YourMethodThatWillHandleTheEvent));
24+ // Place somewhere inside of: public override void OnInitialized()
25+
26+ var messages = GameManager.Instance.Game.Messages;
27+ messages.Subscribe<NameOfTheEventYouWantToSubscribeTo>(new Action<MessageCenterMessage>(this.YourMethodThatWillHandleTheEvent));
2528
2629private void YourMethodThatWillHandleTheEvent(MessageCenterMessage obj)
2730{
You can’t perform that action at this time.
0 commit comments