Sign in to follow this  
Followers 0
Romfarer

Application Launcher and Mods

39 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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:

1 person likes this

Share this post


Link to post
Share on other sites

YAY!!!  Thank you for fixing the spelling!  No more itchy teeth, lol!  :sticktongue:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0