C# Class SSTUTools.SSTUModularFuelTank

Inheritance: PartModule, IPartCostModifier, IPartMassModifier
Show file Open project: shadowmage45/SSTULabs

Protected Properties

Property Type Description
currentMainTankModule TankModelData
currentMountModule SSTUTools.SingleModelData
currentNoseModule SSTUTools.SingleModelData
initialized bool
mainTankModules SSTUTools.TankModelData[]
mountModules SSTUTools.SingleModelData[]
noseModules SSTUTools.SingleModelData[]

Public Methods

Method Description
GetInfo ( ) : string

Cleans up the 'default' assignments from the prefab part (put here due to lack of multi-pass loading). Also adds a quick blurb to the right-click menu regarding possible additional part functionality.

GetModuleCost ( float defaultCost, ModifierStagingSituation sit ) : float

Return the adjusted cost for the part based on current tank setup

GetModuleCostChangeWhen ( ) : ModifierChangeWhen
GetModuleMass ( float defaultMass, ModifierStagingSituation sit ) : float
GetModuleMassChangeWhen ( ) : ModifierChangeWhen
OnDestroy ( ) : void

Overriden/defined in order to remove the on-editor-ship-modified event from the game-event callback queue

OnLoad ( ConfigNode node ) : void
OnStart ( StartState state ) : void
Start ( ) : void
mountTypeUpdated ( BaseField field, object obj ) : void
noseTypeUpdated ( BaseField field, object obj ) : void
onEditorVesselModified ( ShipConstruct ship ) : void

Event callback for when vessel is modified in the editor. Used to know when the gui-fields for this module have been updated.

onMountTextureUpdated ( BaseField field, object obj ) : void
onNoseTextureUpdated ( BaseField field, object obj ) : void
onTankTextureUpdated ( BaseField field, object obj ) : void
tankDiameterUpdated ( BaseField field, object obj ) : void
tankHeightScaleUpdated ( BaseField field, object obj ) : void
tankSetUpdated ( BaseField field, object obj ) : void
tankTypeUpdated ( BaseField field, object obj ) : void

Protected Methods

Method Description
getMountRootTransform ( bool recreate ) : Transform
getNoseRootTransform ( bool recreate ) : Transform
getTankRootTransform ( bool recreate ) : Transform
initialize ( ) : void
setMainTankModuleFromEditor ( String newMainTank, bool updateSymmetry ) : void
setMountModuleFromEditor ( String newMountType, bool updateSymmetry ) : void
setNoseModuleFromEditor ( String newNoseType, bool updateSymmetry ) : void
setTankSetFromEditor ( String newTankSet, bool updateSymmetry ) : void
updateAttachNodes ( bool userInput ) : void

Private Methods

Method Description
loadConfigData ( ) : void

Restores ModelData instances from config node data, and populates the 'currentModule' instances with the currently enabled modules.

restoreEditorFields ( ) : void

Restores the editor-only diameter and height-adjustment values;

restoreModels ( ) : void

Loads or builds the models for the currently selected modules.

selectMountEvent ( ) : void
selectNoseEvent ( ) : void
setMountTextureFromEditor ( String newSet, bool updateSymmetry ) : void
setNoseTextureFromEditor ( String newSet, bool updateSymmetry ) : void
setTankDiameterFromEditor ( float newDiameter, bool updateSymmetry ) : void
setTankScaleFromEditor ( float editorScaleValue, bool updateSymmetry ) : void
setTankTextureFromEditor ( String newSet, bool updateSymmetry ) : void
updateAvailableVariants ( ) : void
updateContainerVolume ( ) : void
updateEditorStats ( bool userInput ) : void
updateGuiState ( ) : void
updateModels ( ) : void
updateModuleStats ( ) : void

Updates the internal cached values for the modules based on the current tank settings for scale/volume/position; done separately from updating the actual models so that the values can be used without the models even being present

updateTankStats ( ) : void
updateTextureSet ( bool updateSymmetry ) : void
updateUIScaleControls ( ) : void

Method Details

GetInfo() public method

Cleans up the 'default' assignments from the prefab part (put here due to lack of multi-pass loading). Also adds a quick blurb to the right-click menu regarding possible additional part functionality.
public GetInfo ( ) : string
return string

GetModuleCost() public method

Return the adjusted cost for the part based on current tank setup
public GetModuleCost ( float defaultCost, ModifierStagingSituation sit ) : float
defaultCost float
sit ModifierStagingSituation
return float

GetModuleCostChangeWhen() public method

public GetModuleCostChangeWhen ( ) : ModifierChangeWhen
return ModifierChangeWhen

GetModuleMass() public method

public GetModuleMass ( float defaultMass, ModifierStagingSituation sit ) : float
defaultMass float
sit ModifierStagingSituation
return float

GetModuleMassChangeWhen() public method

public GetModuleMassChangeWhen ( ) : ModifierChangeWhen
return ModifierChangeWhen

OnDestroy() public method

Overriden/defined in order to remove the on-editor-ship-modified event from the game-event callback queue
public OnDestroy ( ) : void
return void

OnLoad() public method

public OnLoad ( ConfigNode node ) : void
node System.ConfigNode
return void

OnStart() public method

public OnStart ( StartState state ) : void
state StartState
return void

Start() public method

public Start ( ) : void
return void

getMountRootTransform() protected method

protected getMountRootTransform ( bool recreate ) : Transform
recreate bool
return UnityEngine.Transform

getNoseRootTransform() protected method

protected getNoseRootTransform ( bool recreate ) : Transform
recreate bool
return UnityEngine.Transform

getTankRootTransform() protected method

protected getTankRootTransform ( bool recreate ) : Transform
recreate bool
return UnityEngine.Transform

initialize() protected method

protected initialize ( ) : void
return void

mountTypeUpdated() public method

public mountTypeUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

noseTypeUpdated() public method

public noseTypeUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

onEditorVesselModified() public method

Event callback for when vessel is modified in the editor. Used to know when the gui-fields for this module have been updated.
public onEditorVesselModified ( ShipConstruct ship ) : void
ship ShipConstruct
return void

onMountTextureUpdated() public method

public onMountTextureUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

onNoseTextureUpdated() public method

public onNoseTextureUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

onTankTextureUpdated() public method

public onTankTextureUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

setMainTankModuleFromEditor() protected method

protected setMainTankModuleFromEditor ( String newMainTank, bool updateSymmetry ) : void
newMainTank String
updateSymmetry bool
return void

setMountModuleFromEditor() protected method

protected setMountModuleFromEditor ( String newMountType, bool updateSymmetry ) : void
newMountType String
updateSymmetry bool
return void

setNoseModuleFromEditor() protected method

protected setNoseModuleFromEditor ( String newNoseType, bool updateSymmetry ) : void
newNoseType String
updateSymmetry bool
return void

setTankSetFromEditor() protected method

protected setTankSetFromEditor ( String newTankSet, bool updateSymmetry ) : void
newTankSet String
updateSymmetry bool
return void

tankDiameterUpdated() public method

public tankDiameterUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

tankHeightScaleUpdated() public method

public tankHeightScaleUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

tankSetUpdated() public method

public tankSetUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

tankTypeUpdated() public method

public tankTypeUpdated ( BaseField field, object obj ) : void
field BaseField
obj object
return void

updateAttachNodes() protected method

protected updateAttachNodes ( bool userInput ) : void
userInput bool
return void

Property Details

currentMainTankModule protected property

protected TankModelData,SSTUTools currentMainTankModule
return TankModelData

currentMountModule protected property

protected SingleModelData,SSTUTools currentMountModule
return SSTUTools.SingleModelData

currentNoseModule protected property

protected SingleModelData,SSTUTools currentNoseModule
return SSTUTools.SingleModelData

initialized protected property

protected bool initialized
return bool

mainTankModules protected property

protected TankModelData[],SSTUTools mainTankModules
return SSTUTools.TankModelData[]

mountModules protected property

protected SingleModelData[],SSTUTools mountModules
return SSTUTools.SingleModelData[]

noseModules protected property

protected SingleModelData[],SSTUTools noseModules
return SSTUTools.SingleModelData[]