Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
PartLoader Class Reference

Singleton class which contains compiles various game objects. More...

Inheritance diagram for PartLoader:
LoadingSystem

Public Member Functions

void AddPartReplacement (string oldName, string newName)
 Adds a part replacement entry, relating the old part and the new part names More...
 
List< AvailablePartGetAvailableAndPurchaseableCargoParts ()
 Returns a list of the currently available (unlocked, not purchased) Cargo Parts. More...
 
List< string > GetAvailableCargoInventoryPartNames ()
 Returns a list of the currently available (unlocked, purchased) Cargo Parts Names. More...
 
List< AvailablePartGetAvailableCargoInventoryParts ()
 Returns a list of the currently available (unlocked, purchased) Cargo Parts. More...
 
List< string > GetAvailableCargoPartNames ()
 Returns a list of the currently available (unlocked, purchased) Cargo Parts Names. More...
 
List< AvailablePartGetAvailableCargoParts ()
 Returns a list of the currently available (unlocked, purchased) Cargo Parts. More...
 
List< AvailablePartGetAvailableDeployedScienceExpParts ()
 Returns a list of the currently available (unlocked, purchased) Deployed Science Experiment Parts. More...
 
List< AvailablePartGetAvailableRobotArmScannerParts ()
 Returns a list of the currently available (unlocked, purchased) robot arm scanner Parts. More...
 
ConfigNode GetDatabaseConfig (Part p)
 Finds a config in the part database for the given part More...
 
ConfigNode GetDatabaseConfig (Part p, string nodeName)
 Finds a config in the part database for the given part with a given subnode name More...
 
override bool IsReady ()
 
override float ProgressFraction ()
 
override string ProgressTitle ()
 
void SetDatabaseConfig (Part p, ConfigNode newNode)
 Sets a config node for the given part. If the part's database entry already contains a node of that name it will get replaced. More...
 
override void StartLoad ()
 
- Public Member Functions inherited from LoadingSystem
virtual float LoadWeight ()
 

Static Public Member Functions

static bool ApplyPartValue (Part part, ConfigNode.Value nodeValue)
 
static bool DoesPartExist (string name)
 Search for an part reference by part name to see if it exists More...
 
static bool DoesPartHaveReplacement (string name)
 Search for a part replacement for the given part More...
 
static InternalModel GetInternalPart (string name)
 Returns an InternalModel by name, null if not found More...
 
static InternalProp GetInternalProp (string name)
 Returns an InternalProp by name, null if not found More...
 
static AvailablePart getPartInfoByIconPrefab (GameObject iconPrefab)
 Search for an AvailablePart reference by icon prefab More...
 
static AvailablePart getPartInfoByName (string name)
 Search for an AvailablePart reference by part name More...
 
static AvailablePart getPartInfoByPartPrefab (GameObject partPrefab)
 Search for an AvailablePart reference by part prefab More...
 
static string GetPartReplacementName (string oldName)
 Returns the new part name for a replaced part More...
 
static AvailableVariantTheme GetVariantInfoByName (string variantName)
 
static void StripComponent< T > (GameObject part)
 
static void StripComponent< T > (GameObject part, string tag, bool parseChildren=false)
 
static void StripGameObject< T > (GameObject part, string name)
 
static void StripTaggedTransforms (Transform root, string tag)
 

Public Attributes

List< InternalModelinternalParts
 List of loaded internal models More...
 
List< InternalPropinternalProps = new List<InternalProp>()
 List of loaded internal props More...
 
List< AvailablePartloadedParts
 The list of loaded parts More...
 
List< AvailableVariantThemeloadedVariantThemes
 The list of possible variants - keyed by name More...
 
List< AvailablePartparts
 

Properties

bool CargoPartsLoaded [get]
 True if at least one cargo part was loaded and is present in the game session. Which will affect the default Cargo tab display in editor and Kerbal Inventories display in the PAW. More...
 
static PartLoader Instance [get, set]
 Singleton instance More...
 
static List< AvailablePartLoadedPartsList [get]
 
static List
< AvailableVariantTheme
LoadedVariantThemesList [get]
 The list of variant themse loaded from CFGs More...
 
bool Recompile [get, set]
 

Detailed Description

Singleton class which contains compiles various game objects.

Member Function Documentation

void PartLoader.AddPartReplacement ( string  oldName,
string  newName 
)
inline

Adds a part replacement entry, relating the old part and the new part names

static bool PartLoader.ApplyPartValue ( Part  part,
ConfigNode.Value  nodeValue 
)
inlinestatic

< parse everything else

< parse fx node definitions

< apply sound effects on fx groups

< apply type-parseable parameters

static bool PartLoader.DoesPartExist ( string  name)
inlinestatic

Search for an part reference by part name to see if it exists

Parameters
namethe name of the part you're looking for
Returns
true if the parts exists in the database, false if none found
static bool PartLoader.DoesPartHaveReplacement ( string  name)
inlinestatic

Search for a part replacement for the given part

Parameters
namethe name of the part you're looking to replace
Returns
True if the replacement part is found, false otherwise
List<AvailablePart> PartLoader.GetAvailableAndPurchaseableCargoParts ( )
inline

Returns a list of the currently available (unlocked, not purchased) Cargo Parts.

List<string> PartLoader.GetAvailableCargoInventoryPartNames ( )
inline

Returns a list of the currently available (unlocked, purchased) Cargo Parts Names.

List<AvailablePart> PartLoader.GetAvailableCargoInventoryParts ( )
inline

Returns a list of the currently available (unlocked, purchased) Cargo Parts.

List<string> PartLoader.GetAvailableCargoPartNames ( )
inline

Returns a list of the currently available (unlocked, purchased) Cargo Parts Names.

List<AvailablePart> PartLoader.GetAvailableCargoParts ( )
inline

Returns a list of the currently available (unlocked, purchased) Cargo Parts.

List<AvailablePart> PartLoader.GetAvailableDeployedScienceExpParts ( )
inline

Returns a list of the currently available (unlocked, purchased) Deployed Science Experiment Parts.

Returns
List<AvailablePart> PartLoader.GetAvailableRobotArmScannerParts ( )
inline

Returns a list of the currently available (unlocked, purchased) robot arm scanner Parts.

ConfigNode PartLoader.GetDatabaseConfig ( Part  p)
inline

Finds a config in the part database for the given part

ConfigNode PartLoader.GetDatabaseConfig ( Part  p,
string  nodeName 
)
inline

Finds a config in the part database for the given part with a given subnode name

static InternalModel PartLoader.GetInternalPart ( string  name)
inlinestatic

Returns an InternalModel by name, null if not found

Parameters
name
Returns
static InternalProp PartLoader.GetInternalProp ( string  name)
inlinestatic

Returns an InternalProp by name, null if not found

static AvailablePart PartLoader.getPartInfoByIconPrefab ( GameObject  iconPrefab)
inlinestatic

Search for an AvailablePart reference by icon prefab

Parameters
iconPrefabthe icon prefab on your end
Returns
the availablePart object on our end, or null if none found
static AvailablePart PartLoader.getPartInfoByName ( string  name)
inlinestatic

Search for an AvailablePart reference by part name

Parameters
namethe name of the part you're looking for
Returns
the availablePart object with the given name, or null if none found
static AvailablePart PartLoader.getPartInfoByPartPrefab ( GameObject  partPrefab)
inlinestatic

Search for an AvailablePart reference by part prefab

Parameters
partPrefabthe part prefab on your end
Returns
the availablePart object on our end, or null if none found
static string PartLoader.GetPartReplacementName ( string  oldName)
inlinestatic

Returns the new part name for a replaced part

Parameters
oldNamethe name of the part you're looking to replace
Returns
the name of the replacement part, or an empty string if none found
static AvailableVariantTheme PartLoader.GetVariantInfoByName ( string  variantName)
inlinestatic
override bool PartLoader.IsReady ( )
inlinevirtual

Reimplemented from LoadingSystem.

override float PartLoader.ProgressFraction ( )
inlinevirtual

Reimplemented from LoadingSystem.

override string PartLoader.ProgressTitle ( )
inlinevirtual

Reimplemented from LoadingSystem.

void PartLoader.SetDatabaseConfig ( Part  p,
ConfigNode  newNode 
)
inline

Sets a config node for the given part. If the part's database entry already contains a node of that name it will get replaced.

override void PartLoader.StartLoad ( )
inlinevirtual

Reimplemented from LoadingSystem.

static void PartLoader.StripComponent< T > ( GameObject  part)
inlinestatic
Type Constraints
T :Component 
static void PartLoader.StripComponent< T > ( GameObject  part,
string  tag,
bool  parseChildren = false 
)
inlinestatic
Type Constraints
T :Component 
static void PartLoader.StripGameObject< T > ( GameObject  part,
string  name 
)
inlinestatic
Type Constraints
T :Component 
static void PartLoader.StripTaggedTransforms ( Transform  root,
string  tag 
)
inlinestatic

Member Data Documentation

List<InternalModel> PartLoader.internalParts

List of loaded internal models

List<InternalProp> PartLoader.internalProps = new List<InternalProp>()

List of loaded internal props

List<AvailablePart> PartLoader.loadedParts

The list of loaded parts

List<AvailableVariantTheme> PartLoader.loadedVariantThemes

The list of possible variants - keyed by name

List<AvailablePart> PartLoader.parts

Property Documentation

bool PartLoader.CargoPartsLoaded
get

True if at least one cargo part was loaded and is present in the game session. Which will affect the default Cargo tab display in editor and Kerbal Inventories display in the PAW.

PartLoader PartLoader.Instance
staticgetset

Singleton instance

List<AvailablePart> PartLoader.LoadedPartsList
staticget
List<AvailableVariantTheme> PartLoader.LoadedVariantThemesList
staticget

The list of variant themse loaded from CFGs

ThemeNames with no cfg data are recorded as the name of the theme with an unknown description

bool PartLoader.Recompile
getset

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