This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
forked from Mihara/RasterPropMonitor
-
Notifications
You must be signed in to change notification settings - Fork 1
Action handlers
Eugene Medvedev edited this page Jan 14, 2014
·
10 revisions
Action handlers are plugins for JSIActionGroupSwitch, allowing you to tie in-IVA animated switches provided by this module to foreign execution code. There isn't that much need for this feature externally, but internally RasterPropMonitor components use it to tie interface plugins into the framework.
The plugin mode is enabled by giving 'plugin' as the action name:
actionName = plugin
When this is present, the PLUGINACTION blocks in the module configuration are parsed:
PLUGINACTION
{
name = MechJebRPMButtons
actionMethod = ButtonRetrograde
stateMethod = ButtonRetrogradeState
}
- name -- is the name of the module to load.
- actionMethod -- The name of the method to call on the module when button state changes.
- stateMethod -- The name of the method to call on the module to determine which state the button is actually in. This parameter is optional, if it is not present, JSIActionGroupSwitch will track the button state itself.
To create your own action handler, you need to know these things:
- The handler must be an InternalModule. Only one copy will be created per prop if multiple instances of JSIActionGroupSwitch are present in it, and it must survive calls by multiple copies.
- The actionMethod is a method that takes one bool parameter -- true if the switch is to be turned on, and false if the switch is to be turned off.
- The stateMethod is a method that takes no parameters and returns a bool value -- true if the switch is currently in the 'on' state and false if it's in the off state. If this method is not provided, JSIActionGroupSwitch will keep track of the current state of the switch itself -- use it if the state of your action cannot change independently of the switch.
This module is part of MechJebRPM.dll and provides access to SmartASS functions with pairs of actionMethod/stateMethod:
- ButtonOff/ButtonOffState -- OFF
- ButtonNode/ButtonNodeState -- NODE
- ButtonKillRot/ButtonKillRotState -- KILL ROT
- ButtonPrograde/ButtonProgradeState -- PROGRADE
- ButtonRetrograde/ButtonRetrogradeState -- RETROGRADE
- ButtonNormalPlus/ButtonNormalPlusState -- NML+
- ButtonNormalMinus/ButtonNormalMinusState -- NML-
- ButtonRadialPlus/ButtonRadialPlusState -- RAD+
- ButtonRadialMinus/ButtonRadialMinusState -- RAD-
- ButtonTargetPlus/ButtonTargetPlusState -- TGT+
- ButtonTargetMinus/ButtonTargetMinusState -- TGT-
- ButtonRvelPlus/ButtonRvelPlusState -- RVEL+
- ButtonRvelMinus/ButtonRvelMinusState -- RVEL-
- ButtonParPlus/ButtonParPlusState -- PAR+
- ButtonParMinus/ButtonParMinusState -- PAR-
- ButtonNodeExecute/ButtonNodeExecuteState -- Node execution button. Pressing this button will execute the next maneuver node if one exists. The button is in the 'on' state while the node is being executed.