Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
KSP.UI.Screens.StageManager Class Reference

Staging "rules": StageIcons are only created when a part becomes active. StageIcons are only destroyed when a part dies. More...

Inheritance diagram for KSP.UI.Screens.StageManager:

Classes

class  DVUsageStats
 Counts of number of times events occur
 

Public Member Functions

void AddStageAt (int index)
 
bool CheckNullrefsInStageIconList ()
 Use to check for nullrefs in StageGroups.Icons after every operation. Might need to set icons to DestroyImmediate where applicable for immediate effect. More...
 
void DecrementCurrentStage ()
 Decrements CurrentStage by 1, call at your own peril. More...
 
void DeleteEmptyStages ()
 Deletes empty stages in the stack More...
 
void DeleteEmptyStages (bool deleteManualStages)
 Deletes empty stages in the stack More...
 
void DeleteStage (StageGroup stageToDelete, bool tweenOut=false)
 
void DisableDeltaVHeadings ()
 Disable the Delta-v Heading in the stage groups More...
 
void DisableDeltaVTotal ()
 Disable the Delta-v Total in the stage manager More...
 
void DisableInfoPanels ()
 Disable the Info Panel in the stage groups More...
 
void EnableDeltaVHeadings ()
 Enable the Delta-v Heading in the stage groups More...
 
void EnableDeltaVHeadings (bool enable)
 Set the Enabled state of the Delta-v Heading in the stage groups More...
 
void EnableDeltaVTotal ()
 Enable the Delta-v Total in the stage manager More...
 
void EnableDeltaVTotal (bool enable)
 Set the Enabled state of the Delta-v Total in the stage manager More...
 
void EnableInfoPanels ()
 Enable the Info Panel in the stage groups More...
 
void EnableInfoPanels (bool enable)
 Set the Enabled state of the Info Panel in the stage groups More...
 
int GetStageGroupInsertionIndex (PointerEventData eventData, out int modifiedSiblingIndex, bool freshEventData=true)
 Gets the insertion point in the stage group list where the mouse pointer is over. for dragging purposes. (Note: refactored from an older version where all components in the list were included, so this implementation is sound albeit a bit cumbersome) More...
 
int GetStageGroupUnderCursor (PointerEventData eventData, out StageGroup stageGroup, bool freshEventData=true)
 Finds the stagegroup under the cursor specified in PointerEventData. (Note: refactored from an older version where all components in the list were included, so this implementation is sound albeit a bit cumbersome) More...
 
void HoldIcon (StageIcon stageIcon, bool removeIcon=true, bool alertStagingSequencer=true)
 
void IncrementCurrentStage ()
 Increments CurrentStage by 1, call at your own peril. More...
 
void InsertStageAt (StageGroup stageGroup, int index, int forcedSiblingIndex=-1)
 Inserts a stage at a stageindex indexes are probably wrong before it is inserted due to drag drop etc. More...
 
void RemoveStage (StageGroup stageGroup)
 removes a stagegroup from the list without deleting it More...
 
virtual void SetDeltaVTotal_OnDeltaVCalcsCompleted ()
 The code thats called when DeltaVCalcsCompleted Fires to update the text/display of the DVTotal Button More...
 
virtual void SetDeltaVTotal_OnUpdate ()
 The code thats called during Update to set the text/display of the DVTotal Button More...
 
void SetManualStageOffset (int startIndex)
 set the star on icons More...
 
void SortIcons (bool instant)
 Recalculates staging sequence. More...
 
void SortIcons (bool instant, bool deleteManualStages)
 Recalculates staging sequence. More...
 
void ToggleInfoPanels (bool showPanels)
 Slide the InfoPanels in/out More...
 
void UnHoldIcon (StageIcon stageIcon, bool changeParents=false)
 
void UpdateStageGroups (bool seqOverride=true)
 

Static Public Member Functions

static void ActivateNextStage ()
 Activate the next stage This is the method called when you press "space" to activate the next stage More...
 
static void ActivateStage (int stage)
 
static void BeginFlight ()
 
static StageIcon CreateIcon (ProtoStageIcon protoIcon, bool alertStagingSequencer=true)
 
static void DisableIcon (StageIcon iconToDisable)
 
static List< PartFindPartsWithModuleSeparatingBeforeOtherPartsWithModule< Before, After > (List< Part > parts)
 
static void FindStageIndices (Part part, int thisStage, int carriedInverseStage)
 
static void GenerateStagingSequence (Part root)
 
static int GetStageCount (List< Part > parts)
 
static int RecalculateVesselStaging (Vessel v)
 
static void RemoveIcon (StageIcon stageIcon, bool destroyIcon=true, bool removeSelection=true, bool alertStagingSequencer=true)
 
static void ResumeFlight (int currStage)
 
static void SetSeparationIndices ()
 
static void SetSeparationIndices (Part p, int sepIndex)
 
static void SetStageCount (List< Part > ship)
 Set the stage count for the ship, based on it's parts More...
 
static void ShowHideStageStack (bool state)
 Shows or hides the visibility state of the stage stack UI More...
 
static void StepBackCurrentStage ()
 
static void ToggleStageStack ()
 Flips the stage stack UI More...
 

Public Attributes

AudioClip cannotSeparateClip
 
Button deltaVTotalButton
 
LayoutElement deltaVTotalSection
 
TMPro.TextMeshProUGUI deltaVTotalText
 
RectTransform frozenGroup
 
RectTransform heldGroup
 
PointerEnterExitHandler hoverHandlerPlusMinus
 
RectTransform iconCacheGroup
 
RectTransform layoutGroup
 
RectTransform malarkyGroup
 
AudioClip nextStageClip
 
const int radioGroupCollapsed = 99999
 
const int radioGroupExpanded = 0
 
Button resetButton
 
ScrollRect scrollRect
 
StageGroup stageGroupPrefab
 
Color stageIconNumberColor_lead = XKCDColors.KSPBadassGreen
 
Color stageIconNumberColor_symmetry = XKCDColors.KSPNotSoGoodOrange
 
StageIcon stageIconPrefab
 
const float tweeningSpeed = 0.15f
 1f; 0.2f; More...
 

Static Public Attributes

static bool EnableDeleteEmptyStages = true
 

Protected Member Functions

void OnPartUpdateStageability (Part data)
 

Protected Attributes

List< StageGroupstages = new List<StageGroup>()
 

Properties

static bool CanSeparate [get]
 
static int CurrentStage [get]
 
bool DeltaVHeadingsEnabled [get]
 Are the Delta-v headings for all stage groups enabled More...
 
bool DeltaVTotalEnabled [get]
 Is the Delta-v Total at the bottom of the stage manager enabled More...
 
bool InfoPanelsEnabled [get]
 Are the stagegroup InfopPanels for all stage groups enabled More...
 
static StageManager Instance [get, set]
 
static int LastStage [get]
 
static List< StageIconSelection [get]
 
static int StageCount [get]
 
List< StageGroupStages [get]
 
bool Visible [get, set]
 

Detailed Description

Staging "rules": StageIcons are only created when a part becomes active. StageIcons are only destroyed when a part dies.

Symmetry StageIcons: Symmetry StageIcons always has a random 'groupLead' (the icon you click to expand the group) All symmetry StageIcons has a groupLead, the groupLead has a ref to itself A single groupable part doesn't have a groupLead Collapsing/expanding symmetry groups hides/activates the symmetry counterpart icons (no icons should be removed or added during this process)

State: StageManager.stages has the list of StageGroups. In the UI they are children of StageManager.layoutGroup StageGroup.icons has the list of StageIcons for that group. In the UI they are children of StageGroup.iconsUiList StageIcon.groupedIcons has the list of symmetry Stageicons. In the UI they are placed as !activeSelf directly under the groupLead

Member Function Documentation

static void KSP.UI.Screens.StageManager.ActivateNextStage ( )
inlinestatic

Activate the next stage This is the method called when you press "space" to activate the next stage

static void KSP.UI.Screens.StageManager.ActivateStage ( int  stage)
inlinestatic

< deny activating if separation hasn't cooled down, or if at last stage

void KSP.UI.Screens.StageManager.AddStageAt ( int  index)
inline
static void KSP.UI.Screens.StageManager.BeginFlight ( )
inlinestatic
bool KSP.UI.Screens.StageManager.CheckNullrefsInStageIconList ( )
inline

Use to check for nullrefs in StageGroups.Icons after every operation. Might need to set icons to DestroyImmediate where applicable for immediate effect.

Returns
static StageIcon KSP.UI.Screens.StageManager.CreateIcon ( ProtoStageIcon  protoIcon,
bool  alertStagingSequencer = true 
)
inlinestatic
void KSP.UI.Screens.StageManager.DecrementCurrentStage ( )
inline

Decrements CurrentStage by 1, call at your own peril.

void KSP.UI.Screens.StageManager.DeleteEmptyStages ( )
inline

Deletes empty stages in the stack

void KSP.UI.Screens.StageManager.DeleteEmptyStages ( bool  deleteManualStages)
inline

Deletes empty stages in the stack

Parameters
deleteManualStagesshould empty manual stages be deleted (the ones added manually by the user)
void KSP.UI.Screens.StageManager.DeleteStage ( StageGroup  stageToDelete,
bool  tweenOut = false 
)
inline
void KSP.UI.Screens.StageManager.DisableDeltaVHeadings ( )
inline

Disable the Delta-v Heading in the stage groups

void KSP.UI.Screens.StageManager.DisableDeltaVTotal ( )
inline

Disable the Delta-v Total in the stage manager

static void KSP.UI.Screens.StageManager.DisableIcon ( StageIcon  iconToDisable)
inlinestatic
void KSP.UI.Screens.StageManager.DisableInfoPanels ( )
inline

Disable the Info Panel in the stage groups

void KSP.UI.Screens.StageManager.EnableDeltaVHeadings ( )
inline

Enable the Delta-v Heading in the stage groups

void KSP.UI.Screens.StageManager.EnableDeltaVHeadings ( bool  enable)
inline

Set the Enabled state of the Delta-v Heading in the stage groups

Parameters
enableSet true to enable
void KSP.UI.Screens.StageManager.EnableDeltaVTotal ( )
inline

Enable the Delta-v Total in the stage manager

void KSP.UI.Screens.StageManager.EnableDeltaVTotal ( bool  enable)
inline

Set the Enabled state of the Delta-v Total in the stage manager

void KSP.UI.Screens.StageManager.EnableInfoPanels ( )
inline

Enable the Info Panel in the stage groups

void KSP.UI.Screens.StageManager.EnableInfoPanels ( bool  enable)
inline

Set the Enabled state of the Info Panel in the stage groups

Parameters
enableSet true to enable
static List<Part> KSP.UI.Screens.StageManager.FindPartsWithModuleSeparatingBeforeOtherPartsWithModule< Before, After > ( List< Part parts)
inlinestatic
Type Constraints
Before :PartModule 
After :PartModule 
static void KSP.UI.Screens.StageManager.FindStageIndices ( Part  part,
int  thisStage,
int  carriedInverseStage 
)
inlinestatic
static void KSP.UI.Screens.StageManager.GenerateStagingSequence ( Part  root)
inlinestatic
static int KSP.UI.Screens.StageManager.GetStageCount ( List< Part parts)
inlinestatic
int KSP.UI.Screens.StageManager.GetStageGroupInsertionIndex ( PointerEventData  eventData,
out int  modifiedSiblingIndex,
bool  freshEventData = true 
)
inline

Gets the insertion point in the stage group list where the mouse pointer is over. for dragging purposes. (Note: refactored from an older version where all components in the list were included, so this implementation is sound albeit a bit cumbersome)

Parameters
eventDataWe are really just interested in the pointer position of eventData.position
stageGroupThe stageGroup dropped on
modifiedSiblingIndexWith resizing list items in the list, the inverseStageIndex is not the same as the sibling index. This is the actual index you need to insert at
Returns
The Insertion point as inverseStageIndex
int KSP.UI.Screens.StageManager.GetStageGroupUnderCursor ( PointerEventData  eventData,
out StageGroup  stageGroup,
bool  freshEventData = true 
)
inline

Finds the stagegroup under the cursor specified in PointerEventData. (Note: refactored from an older version where all components in the list were included, so this implementation is sound albeit a bit cumbersome)

Parameters
eventData
stageGroup
freshEventData
Returns
void KSP.UI.Screens.StageManager.HoldIcon ( StageIcon  stageIcon,
bool  removeIcon = true,
bool  alertStagingSequencer = true 
)
inline
void KSP.UI.Screens.StageManager.IncrementCurrentStage ( )
inline

Increments CurrentStage by 1, call at your own peril.

void KSP.UI.Screens.StageManager.InsertStageAt ( StageGroup  stageGroup,
int  index,
int  forcedSiblingIndex = -1 
)
inline

Inserts a stage at a stageindex indexes are probably wrong before it is inserted due to drag drop etc.

Parameters
stageGroup
index
void KSP.UI.Screens.StageManager.OnPartUpdateStageability ( Part  data)
inlineprotected
static int KSP.UI.Screens.StageManager.RecalculateVesselStaging ( Vessel  v)
inlinestatic
static void KSP.UI.Screens.StageManager.RemoveIcon ( StageIcon  stageIcon,
bool  destroyIcon = true,
bool  removeSelection = true,
bool  alertStagingSequencer = true 
)
inlinestatic
void KSP.UI.Screens.StageManager.RemoveStage ( StageGroup  stageGroup)
inline

removes a stagegroup from the list without deleting it

Parameters
stageGroup
static void KSP.UI.Screens.StageManager.ResumeFlight ( int  currStage)
inlinestatic
virtual void KSP.UI.Screens.StageManager.SetDeltaVTotal_OnDeltaVCalcsCompleted ( )
inlinevirtual

The code thats called when DeltaVCalcsCompleted Fires to update the text/display of the DVTotal Button

Its called in update when the is true

In stock code this is what updates the total button on staging and building in the editor

virtual void KSP.UI.Screens.StageManager.SetDeltaVTotal_OnUpdate ( )
inlinevirtual

The code thats called during Update to set the text/display of the DVTotal Button

Its called in update when the is true

In stock code this is what updates the total button in flight

void KSP.UI.Screens.StageManager.SetManualStageOffset ( int  startIndex)
inline

set the star on icons

static void KSP.UI.Screens.StageManager.SetSeparationIndices ( )
inlinestatic
static void KSP.UI.Screens.StageManager.SetSeparationIndices ( Part  p,
int  sepIndex 
)
inlinestatic
static void KSP.UI.Screens.StageManager.SetStageCount ( List< Part ship)
inlinestatic

Set the stage count for the ship, based on it's parts

Parameters
shipThe list of objects that make up the ship
static void KSP.UI.Screens.StageManager.ShowHideStageStack ( bool  state)
inlinestatic

Shows or hides the visibility state of the stage stack UI

void KSP.UI.Screens.StageManager.SortIcons ( bool  instant)
inline

Recalculates staging sequence.

Parameters
instantShould it "sort" now or 2 frames later.
void KSP.UI.Screens.StageManager.SortIcons ( bool  instant,
bool  deleteManualStages 
)
inline

Recalculates staging sequence.

Parameters
instantShould it "sort" now or 2 frames later.
deleteManualStagesShould manual stages be deleted or not.
static void KSP.UI.Screens.StageManager.StepBackCurrentStage ( )
inlinestatic
void KSP.UI.Screens.StageManager.ToggleInfoPanels ( bool  showPanels)
inline

Slide the InfoPanels in/out

Parameters
showPanelWhether it Should end up shown or hidden
static void KSP.UI.Screens.StageManager.ToggleStageStack ( )
inlinestatic

Flips the stage stack UI

void KSP.UI.Screens.StageManager.UnHoldIcon ( StageIcon  stageIcon,
bool  changeParents = false 
)
inline
void KSP.UI.Screens.StageManager.UpdateStageGroups ( bool  seqOverride = true)
inline

Member Data Documentation

AudioClip KSP.UI.Screens.StageManager.cannotSeparateClip
Button KSP.UI.Screens.StageManager.deltaVTotalButton
LayoutElement KSP.UI.Screens.StageManager.deltaVTotalSection
TMPro.TextMeshProUGUI KSP.UI.Screens.StageManager.deltaVTotalText
bool KSP.UI.Screens.StageManager.EnableDeleteEmptyStages = true
static
RectTransform KSP.UI.Screens.StageManager.frozenGroup
RectTransform KSP.UI.Screens.StageManager.heldGroup
PointerEnterExitHandler KSP.UI.Screens.StageManager.hoverHandlerPlusMinus
RectTransform KSP.UI.Screens.StageManager.iconCacheGroup
RectTransform KSP.UI.Screens.StageManager.layoutGroup
RectTransform KSP.UI.Screens.StageManager.malarkyGroup
AudioClip KSP.UI.Screens.StageManager.nextStageClip
const int KSP.UI.Screens.StageManager.radioGroupCollapsed = 99999
const int KSP.UI.Screens.StageManager.radioGroupExpanded = 0
Button KSP.UI.Screens.StageManager.resetButton
ScrollRect KSP.UI.Screens.StageManager.scrollRect
StageGroup KSP.UI.Screens.StageManager.stageGroupPrefab
Color KSP.UI.Screens.StageManager.stageIconNumberColor_lead = XKCDColors.KSPBadassGreen
Color KSP.UI.Screens.StageManager.stageIconNumberColor_symmetry = XKCDColors.KSPNotSoGoodOrange
StageIcon KSP.UI.Screens.StageManager.stageIconPrefab
List<StageGroup> KSP.UI.Screens.StageManager.stages = new List<StageGroup>()
protected
const float KSP.UI.Screens.StageManager.tweeningSpeed = 0.15f

1f; 0.2f;

Property Documentation

bool KSP.UI.Screens.StageManager.CanSeparate
staticget
int KSP.UI.Screens.StageManager.CurrentStage
staticget
bool KSP.UI.Screens.StageManager.DeltaVHeadingsEnabled
get

Are the Delta-v headings for all stage groups enabled

bool KSP.UI.Screens.StageManager.DeltaVTotalEnabled
get

Is the Delta-v Total at the bottom of the stage manager enabled

bool KSP.UI.Screens.StageManager.InfoPanelsEnabled
get

Are the stagegroup InfopPanels for all stage groups enabled

StageManager KSP.UI.Screens.StageManager.Instance
staticgetset
int KSP.UI.Screens.StageManager.LastStage
staticget
List<StageIcon> KSP.UI.Screens.StageManager.Selection
staticget
int KSP.UI.Screens.StageManager.StageCount
staticget
List<StageGroup> KSP.UI.Screens.StageManager.Stages
get
bool KSP.UI.Screens.StageManager.Visible
getset

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