Jump to content

Application Launcher and Mods


Romfarer

Recommended Posts

It seems like in 1.0 the GameEvent.onGUIApplicationLauncherReady is not fired. This makes most mod's icons not appear on the stock app launcher.

Hi Ziw, That event fires in the transition from MainMenu to SpaceCenter now (the OP is updated), you can simply check the ApplicationLauncher.Ready value in Awake() to see if it is ready. I have the code working in new versios of my mods, and will upload the source tonight (8 hours or so) if you need to see an example

Link to comment
Share on other sites

It seems like in 1.0 the GameEvent.onGUIApplicationLauncherReady is not fired. This makes most mod's icons not appear on the stock app launcher.

I'm seeing (or not seeing) that as well. I get onGameSceneLoadRequestedForAppLauncher and onGUIApplicationLauncherUnreadifying, but never onGUIApplicationLauncherReady.

EDIT: Looks like I replied at the same time as TriggerAU

Edited by MOARdV
Ninja'd
Link to comment
Share on other sites

Hi Ziw, That event fires in the transition from MainMenu to SpaceCenter now (the OP is updated), you can simply check the ApplicationLauncher.Ready value in Awake() to see if it is ready. I have the code working in new versios of my mods, and will upload the source tonight (8 hours or so) if you need to see an example

Thanks! We've figured this out quite quickly and added some code in Start for both our mods as most other 1.0 mods did. I just wanted to post here, to save other people some time.

Link to comment
Share on other sites

  • 2 weeks later...

I want to add a button to the ApplicationLauncher which is visible from within the two editors (VAB and SPH).

Up to now I have my addon always active with [KSPAddon(KSPAddon.Startup.SpaceCentre, true)] and add the button as soon as the application launcher is ready with (ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB)

This all works fine, but it also means that my addon is loaded (and sitting on its memory) all the time, even in flight, where it can not even be accessed.

Should I rather be loading the addon explicitly in the editors with [KSPAddon(KSPAddon.Startup.EditorAny, false)] and add/remove the buttons on Start/Destroy of my addon?

I guess this is just a matter of style as my addon is an absolute lightweight memory-wise, but maybe there are other reasons which I didn't think of.

Link to comment
Share on other sites

This all works fine, but it also means that my addon is loaded (and sitting on its memory) all the time, even in flight, where it can not even be accessed.

It doesn't really matter because the assembly had to be loaded anyway. Just make sure you don't use any resources, and you should be good to go.

Link to comment
Share on other sites

  • 4 months later...
How can I tell, when using the stock toolbar, if a player clicked a button with the right mouse button instead of the left mouse button?

If anyone is interested, this was answered in another thread:

http://forum.kerbalspaceprogram.com/threads/134730-How-can-I-detect-a-right-click-vs-a-left-click-on-the-stock-toolbar

Link to comment
Share on other sites

  • 4 months later...

I don't know if anyone else has mentioned this, and I don't really like to be 'that guy', but I just thought that I'd mention the fact that the word "Application" is misspelled in the thread title.  Sorry to be the bearer of (slightly) bad news.  :blush:

Update, a month later:  ...aaaaaaaannnnd nobody cares.

Edited by Neutrinovore
Link to comment
Share on other sites

  • 1 month later...

Okay, I'm not normally this OCD, but could the moderators just fix the spelling in the title of the thread, please?  It's not that big a deal, I guess, but I see that damn word every time I come to this forum, and poor spelling just makes my teeth itch!!  :0.0:

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

So I've referenced the firstpass assembly from c#, yet my references for the Applauncher are still out of context, could i get some help?

 

Edit: Solution!

ksp.ui.screens.ApplicationLauncher was the proper way of calling the class!

instead of just ApllicationLauncher.xxxxxxx

Edited by GGumby
Link to comment
Share on other sites

  • 4 months later...

I'm having trouble setting up a couple of toolbar buttons for a partless mod. They do not seem to be completely following the settings for which scenes they should appear in.
I have two buttons, one which sets visibleInScenes for both VAB and SPH and the other for just the space centre. 
The buttons appear in the scenes they are supposed to and work, however they also are appearing in other scenes.  The SPH/VAB button appears in the space centre scene and the one which should just be in the space centre also appears in flight (and then after reverting from flight to the editors, it then also appears in the SPH/VAB).  Also when quitting back to the main menu the SPH/VAB button appears on the main menu! 
I've made a stripped down version of my code for adding the buttons which produces this issue https://gist.github.com/Sujimichi/23cf077d89bc15acdc3c889cd39ac638
If someone could please have a look at it and tell me what I'm doing wrong I'd really appreciate it! 
Thanks!

Link to comment
Share on other sites

  • 8 months later...

@katateochi Use the Unreadifying event to unload the AppLauncher.

Example:

https://github.com/Alshain01/KSP-AdvancedTweakablesButton/blob/master/AdvancedTweakablesButton/AppLauncher.cs

As for the other problem, I'm not sure.  None of my mods load as early as the Space Center.

EDIT: I just realized how old that post was, for some reason the forum was showing me the thread had new replies.  Ah well, I'll leave it there in case anyone needs it.

Edited by Alshain
Link to comment
Share on other sites

18 hours ago, Alshain said:

@katateochi Use the Unreadifying event to unload the AppLauncher.

Example:

https://github.com/Alshain01/KSP-AdvancedTweakablesButton/blob/master/AdvancedTweakablesButton/AppLauncher.cs

As for the other problem, I'm not sure.  None of my mods load as early as the Space Center.

EDIT: I just realized how old that post was, for some reason the forum was showing me the thread had new replies.  Ah well, I'll leave it there in case anyone needs it.

This was a while ago! but thanks for the answer anyway. I'm pretty sure I solved it, but I can't remember how of the top of my head.  I'll check and see if the solution I found was the Unreadifying event or if I used some bat-guano mental approach (and if so replace with the Unreadifying method)!

Link to comment
Share on other sites

2 minutes ago, katateochi said:

This was a while ago! but thanks for the answer anyway. I'm pretty sure I solved it, but I can't remember how of the top of my head.  I'll check and see if the solution I found was the Unreadifying event or if I used some bat-guano mental approach (and if so replace with the Unreadifying method)!

Yeah sorry, the forum showed it in bold and with the little blue dot and I just assumed the last post was new.  I don't know why the forum decided it had unread posts, I know I've read this thread in the last few months.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...