Difference between revisions of "API:Staging"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (N3X15 moved page Staging to API:Staging)
m (Public Static Functions)
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
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.
 
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.
  
== Useful members ==
+
== Class Documentation ==
  
Note: this is not a complete listing of the class's members. It includes only the members that someone has figured out how to use and written an explanation for. If you figure out what the other members that aren't listed here do, you should add them to the list!
+
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 ===
 +
 
 +
<table border="1">
 +
<tr>
 +
<td><code>bool AdvancedStagingControls { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>int CurrentStage { get; }</code></td>
 +
<td>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.</td>
 +
</tr>
 +
<tr>
 +
<td><code>Texture2D DefaultIconMapTexture { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>Vector3 IconOffset { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>float IconSpacing { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>int lastStage { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>List<StackIcon> Selection { get; }</code></td>
 +
<td>Returns a List of the selected staging icons.</td>
 +
</tr>
 +
<tr>
 +
<td><code>bool separate_ready { get; }</code></td>
 +
<td>Returns true if the next stage is ready to activate, false otherwise.</td>
 +
</tr>
 +
<tr>
 +
<td><code>Transform StackTransform { get; }</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>int StageCount { get; }</code></td>
 +
<td>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)</td>
 +
</tr>
 +
</table>
 +
 
 +
=== Public Static Functions ===
  
 
<table border="1">
 
<table border="1">
 
<tr>
 
<tr>
<td><code>static void ActivateNextStage()</code></td>
+
<td><code>void ActivateNextStage();</code></td>
 
<td>Activates the next stage of the rocket just as if the user had pressed space.</td>
 
<td>Activates the next stage of the rocket just as if the user had pressed space.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><code>static void ActivateStage(int stage)</code></td>
+
<td><code>void ActivateStage(int stage);</code></td>
 
<td>Activates the given stage, even if it's not the next stage.</td>
 
<td>Activates the given stage, even if it's not the next stage.</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><code>static int StageCount { get; }</code></td>
+
<td><code>void AddStageAt(int index);</code></td>
<td>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)</td>
+
<td>Inserts a new empty stage at the given index.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void AddToSelection(StackIcon icon, bool multipleSelect = false);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void beginFlight();</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>StackIcon CreateIcon(Part caller);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void DeleteStage(StageGroup stageToDelete);</code></td>
 +
<td>Deletes the given stage.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void deselect(StackIcon icon);</code></td>
 +
<td>Deselects the given staging icon in the stage stack.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void DisableIcon(StackIcon iconToDisable);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>StackIcon FindIcon(Part part);</code></td>
 +
<td>Returns the staging icon of the given part.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void findStageIndices(Part part, int thisStage);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void GenerateStagingSequence();</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void GenerateStagingSequence(Part root);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>int GetStageCount(List<Part> ship);</code></td>
 +
<td>Returns the number of current stages.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnIconDrag(StackIcon icon);</code></td>
 +
<td>Called when a staging icon is being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnIconDragEnd(StackIcon icon);</code></td>
 +
<td>Called when a staging icon has finished being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnIconDragStart(StackIcon icon);</code></td>
 +
<td>Called when a staging icon has begun being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnStageDrag(StageGroup stage);</code></td>
 +
<td>Called when a stage is being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnStageDragEnd(StageGroup stage);</code></td>
 +
<td>Called when a stage has finished being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void OnStageDragStart(StageGroup stage);</code></td>
 +
<td>Called when a stage has begun being dragged.</td>
 +
</tr>
 +
<tr>
 +
<td><code>int RecalculateVesselStaging(Vessel v);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void RemoveIcon(StackIcon iconToRemove);</code></td>
 +
<td>Removes the given staging icon from the staging stack.</td>
 +
</tr>
 +
<tr>
 +
<td><code>void ResumeFlight(int currStage);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void ScheduleSort();</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void ScrollToIcon(StackIcon icon);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void ScrollToStage(int stageNumber);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void SetStageCount(int lastStg);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void SetStageCount(List<GameObject> ship);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void SetStageCount(List<Part> ship);</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void SortIcons();</code></td>
 +
<td>(Usage unknown.)</td>
 +
</tr>
 +
<tr>
 +
<td><code>void SortNow();</code></td>
 +
<td>(Usage unknown.)</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td><code>int CurrentStage { get; }</code></td>
+
<td><code>void StepBackCurrentStage();</code></td>
<td>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.</td>
+
<td>(Usage unknown.)</td>
</tr></table>
+
</tr>
 +
</table>
  
 
[[Category:Community API Documentation]]
 
[[Category:Community API Documentation]]

Latest revision as of 22:03, 11 January 2014

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; } Returns a List of the selected staging icons.
bool separate_ready { get; } Returns true if the next stage is ready to activate, false otherwise.
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); Deletes the given stage.
void deselect(StackIcon icon); Deselects the given staging icon in the stage stack.
void DisableIcon(StackIcon iconToDisable); (Usage unknown.)
StackIcon FindIcon(Part part); Returns the staging icon of the given part.
void findStageIndices(Part part, int thisStage); (Usage unknown.)
void GenerateStagingSequence(); (Usage unknown.)
void GenerateStagingSequence(Part root); (Usage unknown.)
int GetStageCount(List<Part> ship); Returns the number of current stages.
void OnIconDrag(StackIcon icon); Called when a staging icon is being dragged.
void OnIconDragEnd(StackIcon icon); Called when a staging icon has finished being dragged.
void OnIconDragStart(StackIcon icon); Called when a staging icon has begun being dragged.
void OnStageDrag(StageGroup stage); Called when a stage is being dragged.
void OnStageDragEnd(StageGroup stage); Called when a stage has finished being dragged.
void OnStageDragStart(StageGroup stage); Called when a stage has begun being dragged.
int RecalculateVesselStaging(Vessel v); (Usage unknown.)
void RemoveIcon(StackIcon iconToRemove); Removes the given staging icon from the staging stack.
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.)