KSP API
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
ApplicationLauncher Class Reference

The application launcher is the set of buttons that appear in the upper right, including for example the resource tab. You can add your own buttons to this toolbar. More...

Inheritance diagram for ApplicationLauncher:

Public Types

enum  AppScenes {
  AppScenes.NEVER = 0, AppScenes.SPACECENTER = 1, AppScenes.FLIGHT = 2, AppScenes.MAPVIEW = 4,
  AppScenes.VAB = 8, AppScenes.SPH = 16, AppScenes.ALWAYS = 31
}
 Or together these flags and pass them to AddModApplication to specify when your button should appear on the application launcher toolbar. More...
 

Public Member Functions

 ApplicationLauncher ()
 
ApplicationLauncherButton AddApplication (RUIToggleButton.OnTrue onTrue, RUIToggleButton.OnFalse onFalse, RUIToggleButton.OnHover onHover, RUIToggleButton.OnHoverOut onHoverOut, RUIToggleButton.OnEnable onEnable, RUIToggleButton.OnDisable onDisable, PackedSprite sprite)
 
ApplicationLauncherButton AddApplication (RUIToggleButton.OnTrue onTrue, RUIToggleButton.OnFalse onFalse, RUIToggleButton.OnHover onHover, RUIToggleButton.OnHoverOut onHoverOut, RUIToggleButton.OnEnable onEnable, RUIToggleButton.OnDisable onDisable, Texture texture)
 
ApplicationLauncherButton AddModApplication (RUIToggleButton.OnTrue onTrue, RUIToggleButton.OnFalse onFalse, RUIToggleButton.OnHover onHover, RUIToggleButton.OnHoverOut onHoverOut, RUIToggleButton.OnEnable onEnable, RUIToggleButton.OnDisable onDisable, ApplicationLauncher.AppScenes visibleInScenes, PackedSprite sprite)
 Add a MOD(3rd party) application to the Application Launcher. Use ApplicationLauncherButton.VisibleInScenes to set where the button should be displayed. More...
 
ApplicationLauncherButton AddModApplication (RUIToggleButton.OnTrue onTrue, RUIToggleButton.OnFalse onFalse, RUIToggleButton.OnHover onHover, RUIToggleButton.OnHoverOut onHoverOut, RUIToggleButton.OnEnable onEnable, RUIToggleButton.OnDisable onDisable, ApplicationLauncher.AppScenes visibleInScenes, Texture texture)
 Add a MOD(3rd party) application to the Application Launcher. Use ApplicationLauncherButton.VisibleInScenes to set where the button should be displayed. More...
 
void AddOnHideCallback (ApplicationLauncher.OnHide del)
 Register a method that will be called when the ApplicationLauncher GUI hides itself. More...
 
void AddOnRepositionCallback (ApplicationLauncher.OnReposition del)
 Register a method that will be called when the ApplicationLauncher moves from the top right to the bottom right, or vice versa. More...
 
void AddOnShowCallback (ApplicationLauncher.OnShow del)
 Register a method that will be called when the ApplicationLauncher GUI shows itself. More...
 
bool Contains (ApplicationLauncherButton button, out bool hidden)
 
bool DetermineVisibility (ApplicationLauncherButton button)
 
void DisableMutuallyExclusive (ApplicationLauncherButton launcherButton)
 Reverses the effect of EnableMutuallyExclusive() More...
 
void EnableMutuallyExclusive (ApplicationLauncherButton launcherButton)
 Makes your application hide the stock applications when opened, and makes stock applications hide your appliction when opened. More...
 
void Hide ()
 
void RemoveApplication (ApplicationLauncherButton button)
 
void RemoveModApplication (ApplicationLauncherButton button)
 Removes your button from the application launcher toolbar. More...
 
void RemoveOnHideCallback (ApplicationLauncher.OnHide del)
 Un-register a method that will be called when the ApplicationLauncher GUI hides itself. More...
 
void RemoveOnRepositionCallback (ApplicationLauncher.OnReposition del)
 Un-register a method that will be called when the ApplicationLauncher moves from the top right to the bottom right, or vice versa. More...
 
void RemoveOnShowCallback (ApplicationLauncher.OnShow del)
 Un-register a method that will be called when the ApplicationLauncher GUI shows itself. More...
 
bool ShouldBeVisible (ApplicationLauncherButton button)
 
void Show ()
 
delegate void OnHide ()
 
delegate void OnReposition ()
 
delegate void OnShow ()
 

Public Attributes

GameObject anchor
 
GameObject listItemPrefab
 
ScrollListResizer listResizer
 
UIButton modListBtnLeft
 
UIButton modListBtnRight
 
UIButton modListDivider
 
ScrollListResizer modListResizer
 

Static Public Attributes

static bool Ready
 Don't try to add buttons before ApplicationLauncher.Ready is true. If it's currently false, you can register for the GameEvents.onGUIApplicationLauncherReady event which will fire when the application launcher becomes ready to have buttons added to it. More...
 

Properties

static ApplicationLauncher Instance [get]
 The single instance of ApplicationLauncher; call all the methods of this class using this instance. More...
 
bool IsPositionedAtTop [get]
 Whether the application launcher toolbar is positioned in the top right or in the bottom right (it's in the bottom right in the editor). More...
 

Detailed Description

The application launcher is the set of buttons that appear in the upper right, including for example the resource tab. You can add your own buttons to this toolbar.

See http://forum.kerbalspaceprogram.com/threads/86682-Appilcation-Launcher-and-Mods?p=1303921#post1303921

Member Enumeration Documentation

Or together these flags and pass them to AddModApplication to specify when your button should appear on the application launcher toolbar.

Enumerator
NEVER 
SPACECENTER 
FLIGHT 
MAPVIEW 
VAB 
SPH 
ALWAYS 

Constructor & Destructor Documentation

ApplicationLauncher.ApplicationLauncher ( )

Member Function Documentation

ApplicationLauncherButton ApplicationLauncher.AddApplication ( RUIToggleButton.OnTrue  onTrue,
RUIToggleButton.OnFalse  onFalse,
RUIToggleButton.OnHover  onHover,
RUIToggleButton.OnHoverOut  onHoverOut,
RUIToggleButton.OnEnable  onEnable,
RUIToggleButton.OnDisable  onDisable,
PackedSprite  sprite 
)
ApplicationLauncherButton ApplicationLauncher.AddApplication ( RUIToggleButton.OnTrue  onTrue,
RUIToggleButton.OnFalse  onFalse,
RUIToggleButton.OnHover  onHover,
RUIToggleButton.OnHoverOut  onHoverOut,
RUIToggleButton.OnEnable  onEnable,
RUIToggleButton.OnDisable  onDisable,
Texture  texture 
)
ApplicationLauncherButton ApplicationLauncher.AddModApplication ( RUIToggleButton.OnTrue  onTrue,
RUIToggleButton.OnFalse  onFalse,
RUIToggleButton.OnHover  onHover,
RUIToggleButton.OnHoverOut  onHoverOut,
RUIToggleButton.OnEnable  onEnable,
RUIToggleButton.OnDisable  onDisable,
ApplicationLauncher.AppScenes  visibleInScenes,
PackedSprite  sprite 
)

Add a MOD(3rd party) application to the Application Launcher. Use ApplicationLauncherButton.VisibleInScenes to set where the button should be displayed.

Note that the application launcher is destroyed when the player exits to the main menu. If the player then loads up a new save the application launcher will be recreated and you will have to re-add your button. Register for GameEvents.onGUIApplicationLauncherDestroyed and GameEvents.onGUIApplicationLauncherReady to detect when the application launcher has been destroyed and when it has been re-created.

Parameters
onTrueCallback for when the button is toggeled on
onFalseCallback for when the button is toggeled off
onHoverCallback for when the mouse is hovering over the button
onHoverOutCallback for when the mouse hoveris off the button
onEnableCallback for when the button is shown or enabled by the application launcher
onDisableCallback for when the button is hidden or disabled by the application launcher
visibleInScenesThe "scenes" this button will be visible in. For example VisibleInScenes = ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW;
spriteThe 38x38 PackedSprite animation to use for the button icon. Use ApplicationLauncherButton.PlayAnim() to play the animation.
Returns
ApplicationLauncherButton ApplicationLauncher.AddModApplication ( RUIToggleButton.OnTrue  onTrue,
RUIToggleButton.OnFalse  onFalse,
RUIToggleButton.OnHover  onHover,
RUIToggleButton.OnHoverOut  onHoverOut,
RUIToggleButton.OnEnable  onEnable,
RUIToggleButton.OnDisable  onDisable,
ApplicationLauncher.AppScenes  visibleInScenes,
Texture  texture 
)

Add a MOD(3rd party) application to the Application Launcher. Use ApplicationLauncherButton.VisibleInScenes to set where the button should be displayed.

Note that the application launcher is destroyed when the player exits to the main menu. If the player then loads up a new save the application launcher will be recreated and you will have to re-add your button. Register for GameEvents.onGUIApplicationLauncherDestroyed and GameEvents.onGUIApplicationLauncherReady to detect when the application launcher has been destroyed and when it has been re-created.

Parameters
onTrueCallback for when the button is toggeled on
onFalseCallback for when the button is toggeled off
onHoverCallback for when the mouse is hovering over the button
onHoverOutCallback for when the mouse hoveris off the button
onEnableCallback for when the button is shown or enabled by the application launcher
onDisableCallback for when the button is hidden or disabled by the application launcher
visibleInScenesThe "scenes" this button will be visible in. For example VisibleInScenes = ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW;
textureThe 38x38 Texture to use for the button icon.
Returns
void ApplicationLauncher.AddOnHideCallback ( ApplicationLauncher.OnHide  del)

Register a method that will be called when the ApplicationLauncher GUI hides itself.

Parameters
del
void ApplicationLauncher.AddOnRepositionCallback ( ApplicationLauncher.OnReposition  del)

Register a method that will be called when the ApplicationLauncher moves from the top right to the bottom right, or vice versa.

Parameters
del
void ApplicationLauncher.AddOnShowCallback ( ApplicationLauncher.OnShow  del)

Register a method that will be called when the ApplicationLauncher GUI shows itself.

Parameters
del
bool ApplicationLauncher.Contains ( ApplicationLauncherButton  button,
out bool  hidden 
)
bool ApplicationLauncher.DetermineVisibility ( ApplicationLauncherButton  button)
void ApplicationLauncher.DisableMutuallyExclusive ( ApplicationLauncherButton  launcherButton)

Reverses the effect of EnableMutuallyExclusive()

Parameters
launcherButton
void ApplicationLauncher.EnableMutuallyExclusive ( ApplicationLauncherButton  launcherButton)

Makes your application hide the stock applications when opened, and makes stock applications hide your appliction when opened.

Parameters
launcherButton
void ApplicationLauncher.Hide ( )
delegate void ApplicationLauncher.OnHide ( )
delegate void ApplicationLauncher.OnReposition ( )
delegate void ApplicationLauncher.OnShow ( )
void ApplicationLauncher.RemoveApplication ( ApplicationLauncherButton  button)
void ApplicationLauncher.RemoveModApplication ( ApplicationLauncherButton  button)

Removes your button from the application launcher toolbar.

Parameters
button
void ApplicationLauncher.RemoveOnHideCallback ( ApplicationLauncher.OnHide  del)

Un-register a method that will be called when the ApplicationLauncher GUI hides itself.

Parameters
del
void ApplicationLauncher.RemoveOnRepositionCallback ( ApplicationLauncher.OnReposition  del)

Un-register a method that will be called when the ApplicationLauncher moves from the top right to the bottom right, or vice versa.

Parameters
del
void ApplicationLauncher.RemoveOnShowCallback ( ApplicationLauncher.OnShow  del)

Un-register a method that will be called when the ApplicationLauncher GUI shows itself.

Parameters
del
bool ApplicationLauncher.ShouldBeVisible ( ApplicationLauncherButton  button)
void ApplicationLauncher.Show ( )

Member Data Documentation

GameObject ApplicationLauncher.anchor
GameObject ApplicationLauncher.listItemPrefab
ScrollListResizer ApplicationLauncher.listResizer
UIButton ApplicationLauncher.modListBtnLeft
UIButton ApplicationLauncher.modListBtnRight
UIButton ApplicationLauncher.modListDivider
ScrollListResizer ApplicationLauncher.modListResizer
bool ApplicationLauncher.Ready
static

Don't try to add buttons before ApplicationLauncher.Ready is true. If it's currently false, you can register for the GameEvents.onGUIApplicationLauncherReady event which will fire when the application launcher becomes ready to have buttons added to it.

Property Documentation

ApplicationLauncher ApplicationLauncher.Instance
staticget

The single instance of ApplicationLauncher; call all the methods of this class using this instance.

bool ApplicationLauncher.IsPositionedAtTop
get

Whether the application launcher toolbar is positioned in the top right or in the bottom right (it's in the bottom right in the editor).


The documentation for this class was generated from the following file: