API:Staging

From Kerbal Space Program Wiki
Revision as of 04:25, 23 November 2013 by Jyrroe (talk | contribs) (Updated list to contain all public properties and functions of the class.)
Jump to: navigation, search

The Staging class provides some information about the staging of the rocket, and also provides a function that lets you activate the next stage from code as if the user had pressed the space bar.

This class also seems to handle user interaction with the staging icon list (dragging icons around).

Note that in KSP the stages count DOWN as you go through the stages in your rocket, so that the LAST stage is stage zero. The stage a part activates in is given by Part.inverseStage.

Class Documentation

This is a complete list of public properties and functions of the Staging class. However, only entries that have been investigated by other users have been filled in. If you discover the use of a property or function, you are encouraged to fill it in!

The functionality of some functions may be obvious from its name, but simply have not been tested yet.

Properties

bool AdvancedStagingControls { get; } (Usage unknown.)
int CurrentStage { get; } The stage number of the currently active stage of the rocket. This decrements by one every time a new stage is activated, until it reaches zero when the final stage is activated.
Texture2D DefaultIconMapTexture { get; } (Usage unknown.)
Vector3 IconOffset { get; } (Usage unknown.)
float IconSpacing { get; } (Usage unknown.)
int lastStage { get; } (Usage unknown.)
List<StackIcon> Selection { get; } (Usage unknown.)
bool separate_ready { get; } (Usage unknown.)
Transform StackTransform { get; } (Usage unknown.)
int StageCount { get; } The stage number of the initial stage of the rocket. You can test to see if the rocket is still on the pad by testing whether (Staging.CurrentStage == Staging.StageCount)

Public Static Functions

void ActivateNextStage(); Activates the next stage of the rocket just as if the user had pressed space.
void ActivateStage(int stage); Activates the given stage, even if it's not the next stage.
void AddStageAt(int index); Inserts a new empty stage at the given index.
void AddToSelection(StackIcon icon, bool multipleSelect = false); (Usage unknown.)
void beginFlight(); (Usage unknown.)
StackIcon CreateIcon(Part caller); (Usage unknown.)
void DeleteStage(StageGroup stageToDelete); (Usage unknown.)
void deselect(StackIcon icon); (Usage unknown.)
void DisableIcon(StackIcon iconToDisable); (Usage unknown.)
StackIcon FindIcon(Part part); (Usage unknown.)
void findStageIndices(Part part, int thisStage); (Usage unknown.)
void GenerateStagingSequence(); (Usage unknown.)
void GenerateStagingSequence(Part root); (Usage unknown.)
int GetStageCount(List<Part> ship); (Usage unknown.)
void OnIconDrag(StackIcon icon); (Usage unknown.)
void OnIconDragEnd(StackIcon icon); (Usage unknown.)
void OnIconDragStart(StackIcon icon); (Usage unknown.)
void OnStageDrag(StageGroup stage); (Usage unknown.)
void OnStageDragEnd(StageGroup stage); (Usage unknown.)
void OnStageDragStart(StageGroup stage); (Usage unknown.)
int RecalculateVesselStaging(Vessel v); (Usage unknown.)
void RemoveIcon(StackIcon iconToRemove); (Usage unknown.)
void ResumeFlight(int currStage); (Usage unknown.)
void ScheduleSort(); (Usage unknown.)
void ScrollToIcon(StackIcon icon); (Usage unknown.)
void ScrollToStage(int stageNumber); (Usage unknown.)
void SetStageCount(int lastStg); (Usage unknown.)
void SetStageCount(List<GameObject> ship); (Usage unknown.)
void SetStageCount(List<Part> ship); (Usage unknown.)
void SortIcons(); (Usage unknown.)
void SortNow(); (Usage unknown.)
void StepBackCurrentStage(); (Usage unknown.)