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

A BaseAction object is the basic action object. There is one of these automatically created for each 'KSPAction' field in a partModule More...

Public Member Functions

 BaseAction (BaseActionList listParent, string name, BaseActionDelegate onEvent, KSPAction actionAttr)
 
static bool ContainsNonDefaultActions (Part p)
 
static List< BaseActionCreateActionList (List< Part > parts, KSPActionGroup group, bool include)
 
static List< BaseActionCreateActionList (Part p, KSPActionGroup group, bool include)
 
static List< bool > CreateGroupList (List< Part > parts)
 
static List< bool > CreateGroupList (Part p)
 
static void FireAction (List< Part > parts, KSPActionGroup group, KSPActionType type)
 
static int GetGroupIndex (KSPActionGroup group)
 
void Invoke (KSPActionParam param)
 Activate this action. Note that there is no toggle activation, you must check state yourself in code and activate or deactivate as appropriate More...
 
void OnLoad (ConfigNode node)
 
void OnSave (ConfigNode node)
 

Public Attributes

KSPActionGroup actionGroup
 Unconfirmed: The action groups this action is currently assigned to. More...
 
bool active
 Is this action available? Setting this false disables the action so it will not show in the available actions list. More...
 
KSPActionGroup defaultActionGroup
 Unconfirmed: Assign this action to action groups upon creation ('Gear' group for landing legs) More...
 
string guiName
 Name shown in editor action groups panel More...
 
BaseActionList listParent
 Information about what the action is attached to. listParent.module = partModule this action is a memeber of listParent.part = part this action is a member of More...
 
string name
 Name of the action group as seen in code where the KSPAction field exists More...
 

Properties

static int ActionGroupsLength [get]
 
BaseActionDelegate onEvent [get]
 

Detailed Description

A BaseAction object is the basic action object. There is one of these automatically created for each 'KSPAction' field in a partModule

Constructor & Destructor Documentation

BaseAction.BaseAction ( BaseActionList  listParent,
string  name,
BaseActionDelegate  onEvent,
KSPAction  actionAttr 
)

Member Function Documentation

static bool BaseAction.ContainsNonDefaultActions ( Part  p)
static List<BaseAction> BaseAction.CreateActionList ( List< Part parts,
KSPActionGroup  group,
bool  include 
)
static List<BaseAction> BaseAction.CreateActionList ( Part  p,
KSPActionGroup  group,
bool  include 
)
static List<bool> BaseAction.CreateGroupList ( List< Part parts)
static List<bool> BaseAction.CreateGroupList ( Part  p)
static void BaseAction.FireAction ( List< Part parts,
KSPActionGroup  group,
KSPActionType  type 
)
static int BaseAction.GetGroupIndex ( KSPActionGroup  group)
void BaseAction.Invoke ( KSPActionParam  param)

Activate this action. Note that there is no toggle activation, you must check state yourself in code and activate or deactivate as appropriate

Example code start to activate an action: KSP version 0.24.2

KSPActionParam actParam = new KSPActionParam(KSPActionGroup.None, KSPActionType.Activate); //okay to create this new just before invoking exampleAction.Invoke(actParam); //action defined as a KSPAction in a partModule

Example code start to deactivate an action: KSP version 0.24.2

KSPActionParam actParam = new KSPActionParam(KSPActionGroup.None, KSPActionType.Deactivate); //okay to create this new just before invoking exampleAction.Invoke(actParam); //action defined as a KSPAction in a partModule

void BaseAction.OnLoad ( ConfigNode  node)
void BaseAction.OnSave ( ConfigNode  node)

Member Data Documentation

KSPActionGroup BaseAction.actionGroup

Unconfirmed: The action groups this action is currently assigned to.

bool BaseAction.active

Is this action available? Setting this false disables the action so it will not show in the available actions list.

KSPActionGroup BaseAction.defaultActionGroup

Unconfirmed: Assign this action to action groups upon creation ('Gear' group for landing legs)

string BaseAction.guiName

Name shown in editor action groups panel

BaseActionList BaseAction.listParent

Information about what the action is attached to. listParent.module = partModule this action is a memeber of listParent.part = part this action is a member of

string BaseAction.name

Name of the action group as seen in code where the KSPAction field exists

Property Documentation

int BaseAction.ActionGroupsLength
get
BaseActionDelegate BaseAction.onEvent
getprotected

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