Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Properties | List of all members
ModuleInventoryPart Class Reference
Inheritance diagram for ModuleInventoryPart:
PartModule IPartMassModifier IPartCostModifier

Public Member Functions

void CancelPartPlacementMode ()
 
bool CanStackInSlot (AvailablePart part, string partVariantName, int slotIndex)
 Checks if the held part can stack into the slot. Checks name of parts matches, checks any part variant selected matches. Checks there is room still for stacking. More...
 
bool CheckPartStorage (string partName, int index=-1)
 Checks if the part can be stored Without actually storing it. More...
 
bool ClearPartAtSlot (int slotIndex)
 Empty this slot in the inventory More...
 
bool ContainsPart (string partName)
 Search the Inventory for a part name and return true if one is found. More...
 
Part CreatePartForInventoryUse (AvailablePart partInfo)
 Creates a part that will then be turned into a part icon by the inventory. More...
 
virtual void DeployInventoryItem (int index)
 Deploy a Ground Deployable Part (has ModuleGroundPart). More...
 
int FirstEmptySlot ()
 Get the first available Inventory slot index. More...
 
int FirstFullSlot ()
 Get the first full Inventory slot index. More...
 
override string GetInfo ()
 Returns formatted string of additional data for use in the VAB and SPH More...
 
float GetModuleCost (float defaultCost, ModifierStagingSituation sit)
 Return the amount to modify the original part's dry cost by. Returned values are added to the base cost. (0 means no effect) More...
 
ModifierChangeWhen GetModuleCostChangeWhen ()
 Return under which circumstances the modulecost changes More...
 
override string GetModuleDisplayName ()
 Override this to provide a Localized version of the PartModules Name for UI components More...
 
float GetModuleMass (float defaultMass, ModifierStagingSituation sit)
 Return the amount to modify the original part's dry mass by. Returned values are added to the base mass. (0 means no effect) More...
 
ModifierChangeWhen GetModuleMassChangeWhen ()
 Return under which circumstances the modulemass changes More...
 
float GetPartMass (Part part)
 
int GetStackAmountAtSlot (int slotIndex)
 Get stack amount at index slot More...
 
int GetStackCapacityAtSlot (int slotIndex)
 Get stack amount at index slot More...
 
string GetVariantNameForSlot (int slotIndex)
 Get variant name at index slot More...
 
bool HasCapacity (Part newPart)
 Checks if this inventory has capacity for a new part. This method only checks for mass and volume limits. More...
 
bool HasStackingSpace (int slotIndex)
 Get variant name at index slot More...
 
virtual bool InventoryItemCanBeDeployed (int index)
 Can the Inventory Item at index position in InventoryPartsList be deployed? More...
 
bool IsSlotEmpty (int slotIndex)
 Is there anything in this slot More...
 
bool IsStackable (int slotIndex)
 
override void OnCopy (PartModule fromModule)
 Copies the original part's inventory. More...
 
void OnDestroy ()
 
override void OnLoad (ConfigNode node)
 Use OnLoad to load any additional data from the ConfigNode provided More...
 
override void OnSave (ConfigNode node)
 Use OnSave to serialize additional module information into the ConfigNode provided More...
 
override void OnStart (PartModule.StartState state)
 
override void OnUpdate ()
 Called every frame that the part is active More...
 
bool RemoveNPartsFromInventory (string requestedPartName, int n, bool playSound=false)
 Searches the stored parts for all the slots that contain the requested part and removes the requested amount, setting slots to empty as necessary. More...
 
void RequestUpdateEngineerReport ()
 
void ResetInventoryCacheVars ()
 Resets cache variables; More...
 
void RestoreLimitsDisplay ()
 
void SaveDefault (ConfigNode node)
 Will set the Inventory to the Default loadout and then save it to the passed in ConfigNode. Doing this in flight scene is cheating, but not restricted. More...
 
void SetInventoryDefaults ()
 Sets the Inventory to the default loadout. Note: doing this in flight is cheating but not restricted. More...
 
void SlotClickedFirst (int index)
 save the fromSlot so we have a reference when transfering parts between slots More...
 
void SlotClickedSetParts (AvailablePart ap, int index)
 Receive which part was clicked and which inventory slot index More...
 
bool StoreCargoPartAtSlot (string partName, bool updatePAW=true, int index=-1)
 Stores a Cargo part into the module. If no index is specified, will find and use the first available slot. If a specific index is specified, will store in that index (will not check if that index slot is full or not). Also triggers GameEvents.onModuleInventoryChanged to fire and will automaticaly update the PAW UI items and Engineers Report (mass). More...
 
bool StoreCargoPartAtSlot (string partName, int slotIndex)
 
bool StoreCargoPartAtSlot (Part sPart, int slotIndex)
 
bool StoreCargoPartAtSlot (ProtoPartSnapshot pPart, int slotIndex)
 
int TotalAmountOfPartStored (string requestedPartName)
 Searches the stored parts for all the slots that contain the requested part and returns the total amount of parts stored, if at all. More...
 
int TotalEmptySlots ()
 Get how many inventory slots are empty. More...
 
bool UpdateStackAmountAtSlot (int slotIndex, int howMany, string variantName="")
 Update stack amount at index slot More...
 
- Public Member Functions inherited from PartModule
void AddPartModuleAdjuster (AdjusterPartModuleBase newAdjuster)
 Call this to add an adjuster to this part module. More...
 
void AddPartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Applies the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
bool AppliedUpgrades ()
 Returns true if upgrades are applied More...
 
void ApplyAdjustersOnStart ()
 Called when a part module is loaded and applies all of the currently loaded adjusters. More...
 
virtual void ApplyUpgradeNode (List< string > appliedUps, ConfigNode node, bool doLoad)
 Applies the upgrades to a confignode. Will either copy the upgrades back to the node or (if doLoad) calls load/onload on it. More...
 
virtual bool ApplyUpgrades (StartState state)
 Will find and apply upgrades. Called during Part's ModulesOnStart, before a module's OnStart. More...
 
void Awake ()
 
delegate bool boolPMApplyUpgrades (PartModule pm, StartState state)
 
delegate bool boolPMBoolDelegate (PartModule pm, bool apply)
 
void ClearPersistentId ()
 Clear the modules persistentId More...
 
void Copy (PartModule fromModule)
 
virtual void DemoteToPhysicslessPart ()
 This method will be called from Part class DemoteToPhysicslessPart when the part is being converted from physical to physicsless part. It is called before the joints and rigidbodies are destroyed. More...
 
virtual bool FindUpgrades (bool fillApplied, ConfigNode node=null)
 Find applicable upgrades to the partmodule (isunlocked and isenabled) and add to the upgradesApplied list. Pass true if you want to add the upgrades to upgradesApplied, false if you just want to know if at least one upgrade is applicable (unlocked rather than enabled) More...
 
virtual Color GetCurrentColor ()
 Returns the current part module color. More...
 
virtual Color GetCurrentColor (string fieldName)
 Returns the current part module color for a field where usespe. More...
 
uint GetPersistenActiontId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
uint GetPersistentId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
virtual string GetStagingDisableText ()
 
virtual string GetStagingEnableText ()
 
virtual string GetUpgradeInfo ()
 Called by Upgrade Stats dialog More...
 
bool HasUpgrades ()
 Returns true if upgrades exist for the partmodule More...
 
virtual bool IsStageable ()
 Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive() More...
 
bool IsValidContractObjective (string objectiveType)
 Returns if, for example, an antenna part module qualifies as an antenna for contracts. More...
 
void Load (ConfigNode node)
 
virtual void LoadUpgrades (ConfigNode node)
 Loads module-relevant upgrades from the partmodule confignode More...
 
uint NewPersistentId ()
 Reset the modules persistentId to a new number More...
 
virtual void OnActive ()
 Called when the part is set active (after unpacking etc) More...
 
virtual void OnAwake ()
 Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point More...
 
virtual void OnColorChanged (Color color)
 Meant to be overwritten by part modules implementing color changes. In this case, it doesn't matter which color picker changed specifically. More...
 
virtual void OnColorChanged (Color color, string pickerID="")
 Meant to be overwritten by part modules implementing color changes More...
 
virtual void OnConstructionModeFixedUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every FixedUpdate(). More...
 
virtual void OnConstructionModeUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every Update(). More...
 
virtual void OnFixedUpdate ()
 Called every physics/fixed frame that the part is active More...
 
virtual void OnIconCreate ()
 Method fires just before components are stripped from the gameobject to make it an icon. (The part is instantiated and then various components like Part, PartModule, EffectBehaviour, Colliders, Particles, etc are stripped and then it's set as the icon prefab. This lets PartModules do stuff to the model right before that happens. More...
 
virtual void OnInactive ()
 Called before the part goes inactive (after packing etc) More...
 
virtual void OnInitialize ()
 Called on all modules after all parts are loaded but before they give the ship to the game More...
 
virtual void OnInventoryModeDisable ()
 This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode. More...
 
virtual void OnInventoryModeEnable ()
 This method will be called when this modules part and itself is first enabled (when it is attached to a vessel) when created in Inventory/Construction mode. More...
 
void OnModuleAdjusterAddedWrapper (AdjusterPartModuleBase adjuster)
 Wrapper to check the mission expansion availability before performing processing specific to this part module when an adjuster is added. More...
 
virtual void OnModuleAdjusterRemoved (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is removed. By default this does nothing is up to each part module to implement it properly. More...
 
virtual void OnPartCreatedFomInventory (ModuleInventoryPart moduleInventoryPart)
 This method is called when a part is being taken out from a slot while being in EVAConstruction mode. More...
 
virtual void OnStart (StartState state)
 Called when the part starts. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStartBeforePartAttachJoint (StartState state)
 Called in flight scene in Part.Start just before the Part attachnode joints are created. More...
 
virtual void OnStartFinished (StartState state)
 Called when the part finishes starting. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStoredInInventory (ModuleInventoryPart moduleInventoryPart)
 Called when the part is stored in an inventory. More...
 
virtual void OnWasCopied (PartModule copyPartModule, bool asSymCounterpart)
 Called when the PartModule was copied, through Alt+Copy or symmetry More...
 
virtual void OnWillBeCopied (bool asSymCounterpart)
 Called when the PartModule is about to be copied, through Alt+Copy or symmetry More...
 
virtual bool OnWillBeMirrored (ref Quaternion rotation, AttachNode selPartNode, Part partParent)
 This is called in the Editor scene when a symmetry copy of a part is being positioned. Only called on the symmetry parts and only when symmetry mode is set to Mirror. It allows the mirror rotation to be changed and returned before being applied to the symmetry copy part.

Parameters
rotationThe current calculated rotation. Will be updated if method returns true.
selPartNodeThe attachnode.
partParentThe part that will become this part's parent.
Returns
True if the rotation was changed. Otherwise will return false.
More...
 
virtual List< Color > PresetColors ()
 Preset colors received for any part module. By default, returns only black, override to make your own selection. More...
 
virtual string PrintUpgrades ()
 
virtual void PromoteToPhysicalPart ()
 This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part. More...
 
void RemovePartModuleAdjuster (AdjusterPartModuleBase oldAdjuster)
 Call this to remove an adjuster from this part module. More...
 
void RemovePartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Removes the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
void Save (ConfigNode node)
 
virtual void SetStaging (bool newValue)
 Run by the part's staging toggle handler, sets staging on modules on symmetry counterparts. More...
 
void SetStagingState (bool newState)
 Set the staging enabled bool for this module. More...
 
virtual bool StagingEnabled ()
 Gets current staging status (is staging enabled for this module) Override me! More...
 
virtual bool StagingToggleEnabledEditor ()
 
virtual bool StagingToggleEnabledFlight ()
 
void ToggleStaging ()
 
virtual void UpdateStagingToggle ()
 Updates the staging toggle More...
 
delegate void voidPMApplyNodeDelegate (PartModule pm, List< string > appliedUps, ConfigNode node, bool doLoad)
 
delegate void voidPMDelegate (PartModule pm)
 
delegate void voidPMNodeDelegate (PartModule pm, ConfigNode node)
 

Public Attributes

float allowedKerbalEvaDistance = 5f
 The max distance a kerbal on EVA can interact with an inventory part. More...
 
UIPartActionInventory constructorModeInventory
 EVA Constructor Mode Inventory reference for this part module. More...
 
string Inventory
 Comma separated list of Inventory parts being held by this part. - NB: ONLY used for persistence when the part is loaded. More...
 
int InventorySlots = 9
 This is the number of inventory slots this part has. More...
 
ProtoCrewMember kerbalReference
 This is set to the ProtoCrewMember instance if this instance of this part module is in fact attached to a ProtoCrewMember instead of a Part. Use with Extreme Care. More...
 
float massCapacity = 0f
 The current capacity consumed in this container. More...
 
bool massCapacityReached
 Checks if the mass capacity has been reached. More...
 
float massLimit
 The mass capacity this container has. More...
 
float packedVolumeLimit
 The volume capacity this container has. More...
 
bool partBeingRetrieved
 
float placementGroundOffset = 0.1f
 The ground Offset to keep a part above the ground when in placement mode. More...
 
float placementGroundOffsetCap = 0.5f
 The maximum distance a part in placement mode can offset from the kerbal in the up and down directions. More...
 
FXGroup placementNotAllowedGroup
 
float placementOpacity = 0.4f
 The Opacity to set a part's shaders when in placement mode. More...
 
float placementRotateSpeed = 80f
 The speed a part will rotate when in placement mode More...
 
bool showPreview
 Triggers the preview update on pointer enter/exit while holding a part More...
 
DictionaryValueList< int,
StoredPart
storedParts
 The list of stored parts in this inventory module More...
 
int transferFromSlot = -1
 Used as a placeholder for the array index when transferring from another instance More...
 
int transferToSlot = -1
 Used as a placeholder for the array index to transfer a ground object to More...
 
float volumeCapacity = 0f
 The current capacity consumed in this container. More...
 
bool volumeCapacityReached
 Checks if the volume capacity has been reached. More...
 
- Public Attributes inherited from PartModule
bool isEnabled = true
 
bool moduleIsEnabled = true
 
string moduleName
 
bool overrideStagingIconIfBlank = true
 
ModuleResourceHandler resHandler = new ModuleResourceHandler()
 
bool showUpgradesInModuleInfo = false
 
ProtoPartModuleSnapshot snapshot
 
string stagingDisableText = ""
 
bool stagingEnabled = true
 
string stagingEnableText = ""
 
bool stagingToggleEnabledEditor = false
 
bool stagingToggleEnabledFlight = false
 
List< ConfigNodeupgrades
 
List< string > upgradesApplied = new List<string>()
 
bool upgradesApply = true
 
bool upgradesAsk = true
 

Properties

bool AbleToPlaceParts [get]
 Is the Module able to place parts currently? IE: is the vessel this module is a part of an EVA kerbal that is on the ground? More...
 
bool HasMassLimit [get]
 Does this inventory part have a massLimit defined More...
 
bool HasPackedVolumeLimit [get]
 Does this inventory part have a massLimit defined More...
 
bool InventoryIsEmpty [get]
 False if there is at least one non-null element in the stored parts list. True otherwise. More...
 
bool InventoryIsFull [get]
 False if there is at least one non-null element in the stored parts list. True otherwise. More...
 
int InventoryItemCount [get]
 The total number of Inventory Items in this Part. More...
 
List< string > InventoryPartsList [get]
 Returns a copy of the Currently Inventory Parts Names in a list. You cannot Alter this List - as it is not a reference. Use Methods in this class to alter the list. More...
 
bool IsKerbalOnEVA [get]
 Is the Module attached to a Kerbal on EVA? IE: is the vessel this module is a part of an EVA kerbal More...
 
bool kerbalMode [get]
 Will return True if this instance of the PartModule is not attached to a Part. But is attached ot a ProtoCrewMember. More...
 
bool PlacementAllowXRotation [get]
 Can the currently selected part be rotated in the X axis? More...
 
bool PlacementAllowYRotation [get]
 Can the currently selected part be rotated in the Y axis? More...
 
bool PlacementAllowZRotation [get]
 Can the currently selected part be rotated in the Z axis? More...
 
Part SelectedPart [get]
 
- Properties inherited from PartModule
BaseActionList Actions [get]
 
int ClassID [get]
 
string ClassName [get]
 
List< AdjusterPartModuleBaseCurrentModuleAdjusterList [get]
 List of all the module adjusters that are currently active on this part module. More...
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 
string GUIName [get]
 
bool HasAdjusters [get]
 Has this part module been adjusted? More...
 
ReflectedAttributes ModuleAttributes [get, set]
 
Part part [get, set]
 
uint PersistentActionsId [get, set]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
uint PersistentId [get]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
Vessel vessel [get]
 

Additional Inherited Members

- Public Types inherited from PartModule
enum  PartUpgradeState { PartUpgradeState.NONE, PartUpgradeState.LOCKED, PartUpgradeState.AVAILABLE }
 
enum  StartState {
  StartState.None = 0, StartState.Editor = 1, StartState.PreLaunch = 2, StartState.Landed = 4,
  StartState.Docked = 8, StartState.Flying = 16, StartState.Splashed = 32, StartState.SubOrbital = 64,
  StartState.Orbital = 128
}
 
- Static Public Member Functions inherited from PartModule
static ReflectedAttributes GetReflectedAttributes (Type partModuleType)
 
static PartUpgradeState UpgradesAvailable (Part part)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
static PartUpgradeState UpgradesAvailable (Part part, ConfigNode node)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
- Static Public Attributes inherited from PartModule
static voidPMApplyNodeDelegate ApplyUpgradeNodeDel
 
static boolPMApplyUpgrades ApplyUpgradesDel
 
static bool ApplyUpgradesEditorAuto = true
 
static boolPMBoolDelegate FindUpgradesDel
 
static voidPMNodeDelegate LoadExpansionNodes
 Hook for loading extra nodes common to all part modules. More...
 
static voidPMNodeDelegate LoadUpgradesDel
 
static voidPMNodeDelegate SaveExpansionNodes
 Hook for saving extra nodes common to all part modules. More...
 
static voidPMDelegate SetupExpansion
 Hook for performing extra setup common to all part modules. More...
 
static string UpgradesAvailableString = "#autoLOC_6002273"
 
static string UpgradesLockedString = "#autoLOC_6002274"
 
- Protected Member Functions inherited from PartModule
ConfigNode GetUpgrade (string name)
 
virtual void LoadUpgradesApplied (List< string > applieds, ConfigNode node)
 Load the applied upgrade names More...
 
virtual void OnModuleAdjusterAdded (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is added. By default this does nothing is up to each part module to implement it properly. More...
 
virtual void SaveUpgradesApplied (ConfigNode node)
 Save the applied upgrades. More...
 
IEnumerator UpgradeWaitForScenarioModules ()
 
- Static Protected Attributes inherited from PartModule
static Dictionary< string,
ConfigNode
exclusives = new Dictionary<string, ConfigNode>()
 
static Dictionary< Type,
ReflectedAttributes
reflectedAttributeCache = new Dictionary<Type, ReflectedAttributes>()
 

Member Function Documentation

void ModuleInventoryPart.CancelPartPlacementMode ( )
inline
bool ModuleInventoryPart.CanStackInSlot ( AvailablePart  part,
string  partVariantName,
int  slotIndex 
)
inline

Checks if the held part can stack into the slot. Checks name of parts matches, checks any part variant selected matches. Checks there is room still for stacking.

Parameters
partPart to test for can stack
partVariantNamename of the variant
Returns
True if there is space in this slot for this part
bool ModuleInventoryPart.CheckPartStorage ( string  partName,
int  index = -1 
)
inline

Checks if the part can be stored Without actually storing it.

Parameters
partNamePart name to be stored
indexPart index
Returns
bool ModuleInventoryPart.ClearPartAtSlot ( int  slotIndex)
inline

Empty this slot in the inventory

Parameters
slotIndex
Returns
True is it
bool ModuleInventoryPart.ContainsPart ( string  partName)
inline

Search the Inventory for a part name and return true if one is found.

Parameters
partName
Returns
Part ModuleInventoryPart.CreatePartForInventoryUse ( AvailablePart  partInfo)
inline

Creates a part that will then be turned into a part icon by the inventory.

Parameters
partInfoAvailable part as a reference for instancing the part.
Returns
virtual void ModuleInventoryPart.DeployInventoryItem ( int  index)
inlinevirtual

Deploy a Ground Deployable Part (has ModuleGroundPart).

Parameters
indexThe Index in InventoryPartsList
int ModuleInventoryPart.FirstEmptySlot ( )
inline

Get the first available Inventory slot index.

Returns
Returns the index of the first Inventory slot that is empty. Or -1 if none are empty.
int ModuleInventoryPart.FirstFullSlot ( )
inline

Get the first full Inventory slot index.

Returns
Returns the index of the first Inventory slot that is not empty. Or -1 if none are empty.
override string ModuleInventoryPart.GetInfo ( )
inlinevirtual

Returns formatted string of additional data for use in the VAB and SPH

Returns

Reimplemented from PartModule.

float ModuleInventoryPart.GetModuleCost ( float  defaultCost,
ModifierStagingSituation  sit 
)
inline

Return the amount to modify the original part's dry cost by. Returned values are added to the base cost. (0 means no effect)

Returns

Implements IPartCostModifier.

ModifierChangeWhen ModuleInventoryPart.GetModuleCostChangeWhen ( )
inline

Return under which circumstances the modulecost changes

Returns

Implements IPartCostModifier.

override string ModuleInventoryPart.GetModuleDisplayName ( )
inlinevirtual

Override this to provide a Localized version of the PartModules Name for UI components

Returns

Reimplemented from PartModule.

float ModuleInventoryPart.GetModuleMass ( float  defaultMass,
ModifierStagingSituation  sit 
)
inline

Return the amount to modify the original part's dry mass by. Returned values are added to the base mass. (0 means no effect)

Returns

Implements IPartMassModifier.

ModifierChangeWhen ModuleInventoryPart.GetModuleMassChangeWhen ( )
inline

Return under which circumstances the modulemass changes

Returns

Implements IPartMassModifier.

float ModuleInventoryPart.GetPartMass ( Part  part)
inline
int ModuleInventoryPart.GetStackAmountAtSlot ( int  slotIndex)
inline

Get stack amount at index slot

Parameters
slotIndex
int ModuleInventoryPart.GetStackCapacityAtSlot ( int  slotIndex)
inline

Get stack amount at index slot

Parameters
slotIndex
string ModuleInventoryPart.GetVariantNameForSlot ( int  slotIndex)
inline

Get variant name at index slot

Parameters
slotIndex
bool ModuleInventoryPart.HasCapacity ( Part  newPart)
inline

Checks if this inventory has capacity for a new part. This method only checks for mass and volume limits.

Parameters
newPartPart trying to get stored.
Returns
bool ModuleInventoryPart.HasStackingSpace ( int  slotIndex)
inline

Get variant name at index slot

Parameters
slotIndex
virtual bool ModuleInventoryPart.InventoryItemCanBeDeployed ( int  index)
inlinevirtual

Can the Inventory Item at index position in InventoryPartsList be deployed?

Parameters
index
Returns
bool ModuleInventoryPart.IsSlotEmpty ( int  slotIndex)
inline

Is there anything in this slot

Parameters
slotIndex
bool ModuleInventoryPart.IsStackable ( int  slotIndex)
inline
override void ModuleInventoryPart.OnCopy ( PartModule  fromModule)
inlinevirtual

Copies the original part's inventory.

Parameters
fromModuleOriginal part Part Module.

Reimplemented from PartModule.

void ModuleInventoryPart.OnDestroy ( )
inline
override void ModuleInventoryPart.OnLoad ( ConfigNode  node)
inlinevirtual

Use OnLoad to load any additional data from the ConfigNode provided

Parameters
node

Reimplemented from PartModule.

override void ModuleInventoryPart.OnSave ( ConfigNode  node)
inlinevirtual

Use OnSave to serialize additional module information into the ConfigNode provided

Parameters
node

Reimplemented from PartModule.

override void ModuleInventoryPart.OnStart ( PartModule.StartState  state)
inline
override void ModuleInventoryPart.OnUpdate ( )
inlinevirtual

Called every frame that the part is active

Reimplemented from PartModule.

bool ModuleInventoryPart.RemoveNPartsFromInventory ( string  requestedPartName,
int  n,
bool  playSound = false 
)
inline

Searches the stored parts for all the slots that contain the requested part and removes the requested amount, setting slots to empty as necessary.

Parameters
requestedPartNameThe part name to remove
nThe number of parts to remove
void ModuleInventoryPart.RequestUpdateEngineerReport ( )
inline
void ModuleInventoryPart.ResetInventoryCacheVars ( )
inline

Resets cache variables;

void ModuleInventoryPart.RestoreLimitsDisplay ( )
inline
void ModuleInventoryPart.SaveDefault ( ConfigNode  node)
inline

Will set the Inventory to the Default loadout and then save it to the passed in ConfigNode. Doing this in flight scene is cheating, but not restricted.

Parameters
node
void ModuleInventoryPart.SetInventoryDefaults ( )
inline

Sets the Inventory to the default loadout. Note: doing this in flight is cheating but not restricted.

void ModuleInventoryPart.SlotClickedFirst ( int  index)
inline

save the fromSlot so we have a reference when transfering parts between slots

Parameters
index
void ModuleInventoryPart.SlotClickedSetParts ( AvailablePart  ap,
int  index 
)
inline

Receive which part was clicked and which inventory slot index

Parameters
apPart from the PAW
indexInventory slot index
bool ModuleInventoryPart.StoreCargoPartAtSlot ( string  partName,
bool  updatePAW = true,
int  index = -1 
)
inline

Stores a Cargo part into the module. If no index is specified, will find and use the first available slot. If a specific index is specified, will store in that index (will not check if that index slot is full or not). Also triggers GameEvents.onModuleInventoryChanged to fire and will automaticaly update the PAW UI items and Engineers Report (mass).

Parameters
partNameThe Part Name. Can also be empty string (to clear a slot).
indexThe index to use. Or if -1 - will try to find the first available.
updatePAWIf true will update the PAW window icons if it is open.
Returns
True if successful. Otherwise false.
bool ModuleInventoryPart.StoreCargoPartAtSlot ( string  partName,
int  slotIndex 
)
inline
bool ModuleInventoryPart.StoreCargoPartAtSlot ( Part  sPart,
int  slotIndex 
)
inline
bool ModuleInventoryPart.StoreCargoPartAtSlot ( ProtoPartSnapshot  pPart,
int  slotIndex 
)
inline
int ModuleInventoryPart.TotalAmountOfPartStored ( string  requestedPartName)
inline

Searches the stored parts for all the slots that contain the requested part and returns the total amount of parts stored, if at all.

Parameters
requestedPartNameThe part name to check on
Returns
The total amount of the part if it is stored or -1 if it's not.
int ModuleInventoryPart.TotalEmptySlots ( )
inline

Get how many inventory slots are empty.

Returns
bool ModuleInventoryPart.UpdateStackAmountAtSlot ( int  slotIndex,
int  howMany,
string  variantName = "" 
)
inline

Update stack amount at index slot

Parameters
slotIndex

Member Data Documentation

float ModuleInventoryPart.allowedKerbalEvaDistance = 5f

The max distance a kerbal on EVA can interact with an inventory part.

UIPartActionInventory ModuleInventoryPart.constructorModeInventory

EVA Constructor Mode Inventory reference for this part module.

string ModuleInventoryPart.Inventory

Comma separated list of Inventory parts being held by this part. - NB: ONLY used for persistence when the part is loaded.

int ModuleInventoryPart.InventorySlots = 9

This is the number of inventory slots this part has.

ProtoCrewMember ModuleInventoryPart.kerbalReference

This is set to the ProtoCrewMember instance if this instance of this part module is in fact attached to a ProtoCrewMember instead of a Part. Use with Extreme Care.

float ModuleInventoryPart.massCapacity = 0f

The current capacity consumed in this container.

bool ModuleInventoryPart.massCapacityReached

Checks if the mass capacity has been reached.

float ModuleInventoryPart.massLimit

The mass capacity this container has.

float ModuleInventoryPart.packedVolumeLimit

The volume capacity this container has.

bool ModuleInventoryPart.partBeingRetrieved
float ModuleInventoryPart.placementGroundOffset = 0.1f

The ground Offset to keep a part above the ground when in placement mode.

float ModuleInventoryPart.placementGroundOffsetCap = 0.5f

The maximum distance a part in placement mode can offset from the kerbal in the up and down directions.

FXGroup ModuleInventoryPart.placementNotAllowedGroup
float ModuleInventoryPart.placementOpacity = 0.4f

The Opacity to set a part's shaders when in placement mode.

float ModuleInventoryPart.placementRotateSpeed = 80f

The speed a part will rotate when in placement mode

bool ModuleInventoryPart.showPreview

Triggers the preview update on pointer enter/exit while holding a part

DictionaryValueList<int, StoredPart> ModuleInventoryPart.storedParts

The list of stored parts in this inventory module

The INDEX is the slot number in the inventory - dont use this like an array or things WILL go wrong

int ModuleInventoryPart.transferFromSlot = -1

Used as a placeholder for the array index when transferring from another instance

int ModuleInventoryPart.transferToSlot = -1

Used as a placeholder for the array index to transfer a ground object to

float ModuleInventoryPart.volumeCapacity = 0f

The current capacity consumed in this container.

bool ModuleInventoryPart.volumeCapacityReached

Checks if the volume capacity has been reached.

Property Documentation

bool ModuleInventoryPart.AbleToPlaceParts
get

Is the Module able to place parts currently? IE: is the vessel this module is a part of an EVA kerbal that is on the ground?

bool ModuleInventoryPart.HasMassLimit
get

Does this inventory part have a massLimit defined

bool ModuleInventoryPart.HasPackedVolumeLimit
get

Does this inventory part have a massLimit defined

bool ModuleInventoryPart.InventoryIsEmpty
get

False if there is at least one non-null element in the stored parts list. True otherwise.

bool ModuleInventoryPart.InventoryIsFull
get

False if there is at least one non-null element in the stored parts list. True otherwise.

int ModuleInventoryPart.InventoryItemCount
get

The total number of Inventory Items in this Part.

List<string> ModuleInventoryPart.InventoryPartsList
get

Returns a copy of the Currently Inventory Parts Names in a list. You cannot Alter this List - as it is not a reference. Use Methods in this class to alter the list.

bool ModuleInventoryPart.IsKerbalOnEVA
get

Is the Module attached to a Kerbal on EVA? IE: is the vessel this module is a part of an EVA kerbal

bool ModuleInventoryPart.kerbalMode
get

Will return True if this instance of the PartModule is not attached to a Part. But is attached ot a ProtoCrewMember.

bool ModuleInventoryPart.PlacementAllowXRotation
get

Can the currently selected part be rotated in the X axis?

bool ModuleInventoryPart.PlacementAllowYRotation
get

Can the currently selected part be rotated in the Y axis?

bool ModuleInventoryPart.PlacementAllowZRotation
get

Can the currently selected part be rotated in the Z axis?

Part ModuleInventoryPart.SelectedPart
get

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