Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | Static Public Attributes | Properties | List of all members
InputLockManager Class Reference

Static Public Member Functions

static void ClearControlLocks ()
 Removes all control locks More...
 
static ulong ControlLocks (int lower, int upper)
 
static void DebugLockStack ()
 
static ControlTypes GetControlLock (string lockID)
 Get a control lock by it's ID string More...
 
static bool IsAllLocked (ControlTypes mask)
 Check whether all controls in a mask are locked More...
 
static bool IsAnyUnlocked (ControlTypes mask)
 Check whether any controls in a mask are unlocked More...
 
static bool IsLocked (ControlTypes controlType)
 Check whether a given control type is locked or not, based on the current lock state. More...
 
static bool IsLocked (ControlTypes controlType, ControlTypes refMask)
 Check whether a given control type is locked or not, based on the current lock state compared to a reference lock mask. More...
 
static bool IsLocking (ControlTypes controlType, GameEvents.FromToAction< ControlTypes, ControlTypes > refMasks)
 Check whether a given control type is being locked on a locks modified event. Will only return true if the control wasn't previously locked already. More...
 
static bool IsUnlocked (ControlTypes controlType)
 Check whether a given control type is unlocked or not, based on the current lock state. More...
 
static bool IsUnlocked (ControlTypes controlType, ControlTypes refMask)
 Check whether a given control type is unlocked or not, based on the current lock state compared to a reference lock mask. More...
 
static bool IsUnlocking (ControlTypes controlType, GameEvents.FromToAction< ControlTypes, ControlTypes > refMasks)
 Check whether a given control type is being unlocked on a locks modified event. Will only return true if the control wasn't previously unlocked already. More...
 
static string PrintLockStack ()
 
static void RemoveControlLock (string lockID)
 Remove a control lock added earlier. More...
 
static ControlTypes SetControlLock (ControlTypes locks, string lockID)
 Set a lock on flight controls. The lock will be added if this is the first call by this caller, or edited if there was a previous lock More...
 
static ControlTypes SetControlLock (string lockID)
 Set a lock on all controls. More...
 

Static Public Attributes

static ulong lockMask = 0
 
static Dictionary< string, ulong > lockStack = new Dictionary<string, ulong>()
 

Properties

static ulong LockMask [get]
 Get the state of the input lock mask (read-only). More...
 

Member Function Documentation

static void InputLockManager.ClearControlLocks ( )
inlinestatic

Removes all control locks

static ulong InputLockManager.ControlLocks ( int  lower,
int  upper 
)
inlinestatic

< 7 - 3 + 1 = 5

< #00100000 - 1 = #000011111

< #00011111 << 3 = #011111000

static void InputLockManager.DebugLockStack ( )
inlinestatic
static ControlTypes InputLockManager.GetControlLock ( string  lockID)
inlinestatic

Get a control lock by it's ID string

Parameters
lockIDThe lock to find
Returns
The lock value, if one is found, or 0 if none found
static bool InputLockManager.IsAllLocked ( ControlTypes  mask)
inlinestatic

Check whether all controls in a mask are locked

static bool InputLockManager.IsAnyUnlocked ( ControlTypes  mask)
inlinestatic

Check whether any controls in a mask are unlocked

static bool InputLockManager.IsLocked ( ControlTypes  controlType)
inlinestatic

Check whether a given control type is locked or not, based on the current lock state.

static bool InputLockManager.IsLocked ( ControlTypes  controlType,
ControlTypes  refMask 
)
inlinestatic

Check whether a given control type is locked or not, based on the current lock state compared to a reference lock mask.

static bool InputLockManager.IsLocking ( ControlTypes  controlType,
GameEvents.FromToAction< ControlTypes, ControlTypes refMasks 
)
inlinestatic

Check whether a given control type is being locked on a locks modified event. Will only return true if the control wasn't previously locked already.

Parameters
controlType
refMasks
Returns
static bool InputLockManager.IsUnlocked ( ControlTypes  controlType)
inlinestatic

Check whether a given control type is unlocked or not, based on the current lock state.

static bool InputLockManager.IsUnlocked ( ControlTypes  controlType,
ControlTypes  refMask 
)
inlinestatic

Check whether a given control type is unlocked or not, based on the current lock state compared to a reference lock mask.

static bool InputLockManager.IsUnlocking ( ControlTypes  controlType,
GameEvents.FromToAction< ControlTypes, ControlTypes refMasks 
)
inlinestatic

Check whether a given control type is being unlocked on a locks modified event. Will only return true if the control wasn't previously unlocked already.

Parameters
controlType
refMasks
Returns
static string InputLockManager.PrintLockStack ( )
inlinestatic
static void InputLockManager.RemoveControlLock ( string  lockID)
inlinestatic

Remove a control lock added earlier.

Parameters
lockIDA reference to the script that added the lock (again, 'this')
static ControlTypes InputLockManager.SetControlLock ( ControlTypes  locks,
string  lockID 
)
inlinestatic

Set a lock on flight controls. The lock will be added if this is the first call by this caller, or edited if there was a previous lock

Parameters
locksThe locks to apply
lockIDA reference to the caller script (just pass 'this')
static ControlTypes InputLockManager.SetControlLock ( string  lockID)
inlinestatic

Set a lock on all controls.

Parameters
lockID

Member Data Documentation

ulong InputLockManager.lockMask = 0
static
Dictionary<string, ulong> InputLockManager.lockStack = new Dictionary<string, ulong>()
static

Property Documentation

ulong InputLockManager.LockMask
staticget

Get the state of the input lock mask (read-only).


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