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 | Protected Member Functions | Properties | List of all members
KSP.UI.Screens.EditorPartIcon Class Reference
Inheritance diagram for KSP.UI.Screens.EditorPartIcon:
Expansions.Missions.Editor.MEPartSelectorEntry KSP.UI.Screens.RDPartListItem

Public Member Functions

void Create (EditorPartList partList, AvailablePart part, float iconSize, float iconOverScale, float iconOverSpin)
 Creates a part icon with the specified parameters More...
 
void Create (EditorPartList partList, AvailablePart part, float iconSize, float iconOverScale, float iconOverSpin, Callback< EditorPartIcon > placePartCallback, bool btnPlacePartActive)
 Creates a part icon with the specified parameters More...
 
void Create (EditorPartList partList, AvailablePart part, StoredPart sPart, float iconSize, float iconOverScale, float iconOverSpin, Callback< EditorPartIcon > placePartCallback, bool btnPlacePartActive, bool skipVariants, PartVariant variant, bool useImageThumbnail, bool inInventory)
 Creates a part icon with the specified parameters More...
 
void DisableAddButton ()
 
void DisableDeleteButton ()
 
void EnableAddButton ()
 
void EnableDeleteButton ()
 
PartVariant GetCurrentVariant ()
 Return the current variant that is applied to the availablePart. More...
 
void Highlight ()
 
void MouseInput_PointerEnter (PointerEventData data)
 
void MouseInput_PointerExit (PointerEventData data)
 
void MouseInput_SpawnPart ()
 
void SetEmptySlot ()
 Sets this as an empty slot when there is no part icon to show. More...
 
void SetGrey (string why)
 
void ToggleVariant ()
 Will toggle More...
 
void Unhighlight ()
 
void UnsetGrey ()
 
bool VariantsAvailable ()
 Will return true if the availablePart has Variants More...
 

Static Public Member Functions

static void CleanUpMaterials (GameObject gameObject)
 
static Material[] CreateMaterialArray (GameObject gameObject)
 
static Material[] CreateMaterialArray (GameObject gameObject, bool includeInactiveRenderers)
 
static void SetPartColor (GameObject partIcon, Color color, AvailablePart part=null)
 Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1. More...
 
static void SetPartColor (GameObject partIcon, Color color, bool isFlag, AvailablePart part=null)
 Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1. More...
 
static void SetPartColor (GameObject partIcon, Color color, bool processUnlit, bool isFlag, AvailablePart part=null)
 Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1. More...
 

Public Attributes

Button btnAdd
 
Button btnPlacePart
 
Button btnRemove
 
Button btnSpawnPart
 
Button btnSwapTexture
 
Color experimentalPartColor = new Color32(128, 128, 255, 255)
 
FlagDecalBackground flagDecalBackground
 The flag Part module reference, assigned when this is created and the part has the module. More...
 
Image highlightImage
 
float iconOverScale
 
float iconOverSpin
 
float iconSize
 
bool inInventory
 This is true if this icon is inside a ModuleInventoryPart grid. More...
 
RawImage inventoryItemThumbnail
 
bool isEmptySlot = false
 Indicates if this PartIcon is an Empty Slot in the Inventory Grid in the PAW. Is not relevant if this instance is not part of an Inventory Grid in a PAW UI. More...
 
bool isFlag
 True if this EditorPartIcon is a flag part. More...
 
bool isPart = true
 
Material[] materials
 
Color missionRequiredPartColor = new Color32(128, 128, 255, 255)
 
PartIcon partIcon
 Reference to the Part Icon object - which contains a reference to the Icon GameObject and cached Renderers. More...
 
Callback< EditorPartIconPlacePartCallback
 
TMPro.TextMeshProUGUI stackAmountText
 
Slider stackSlider
 The slider that shows how many items in a stack are filled More...
 
PartUpgradeHandler.Upgrade upgrade = null
 
int variantIndex
 

Protected Member Functions

void Start ()
 

Properties

AvailablePart AvailPart [get]
 Reference to the AvailablePart prefab More...
 
bool Focused [get]
 
string greyoutToolTipMessage [get, set]
 
bool HasIconOrThumbnail [get]
 Does the icon or thumbnail exist? More...
 
bool IsCargoPart [get]
 True if Part implements ModuleCargoPart More...
 
bool IsDeployablePart [get]
 
bool isGrey [get, set]
 
bool MouseOver [get]
 
Transform PartIcon [get]
 The Part Icon transform More...
 
AvailablePart partInfo [get]
 
bool StillFocused [get]
 

Member Function Documentation

static void KSP.UI.Screens.EditorPartIcon.CleanUpMaterials ( GameObject  gameObject)
inlinestatic
void KSP.UI.Screens.EditorPartIcon.Create ( EditorPartList  partList,
AvailablePart  part,
float  iconSize,
float  iconOverScale,
float  iconOverSpin 
)
inline

Creates a part icon with the specified parameters

///

Parameters
partListThe EditorPartList the icon belongs to.
partThe AvailablePart this icon represents.
iconSizeThe size of the icon.
iconOverScaleThe multiplier for the over state.
iconOverSpinThe part spin animation speed.
void KSP.UI.Screens.EditorPartIcon.Create ( EditorPartList  partList,
AvailablePart  part,
float  iconSize,
float  iconOverScale,
float  iconOverSpin,
Callback< EditorPartIcon placePartCallback,
bool  btnPlacePartActive 
)
inline

Creates a part icon with the specified parameters

///

Parameters
partListThe EditorPartList the icon belongs to.
partThe AvailablePart this icon represents.
iconSizeThe size of the icon.
iconOverScaleThe multiplier for the over state.
iconOverSpinThe part spin animation speed.
placePartCallbackCallback for part place event.
btnPlacePartActiveWhether this icon will have a deploy part icon visible.
void KSP.UI.Screens.EditorPartIcon.Create ( EditorPartList  partList,
AvailablePart  part,
StoredPart  sPart,
float  iconSize,
float  iconOverScale,
float  iconOverSpin,
Callback< EditorPartIcon placePartCallback,
bool  btnPlacePartActive,
bool  skipVariants,
PartVariant  variant,
bool  useImageThumbnail,
bool  inInventory 
)
inline

Creates a part icon with the specified parameters

///

Parameters
partListThe EditorPartList the icon belongs to.
partThe AvailablePart this icon represents.
iconSizeThe size of the icon.
iconOverScaleThe multiplier for the over state.
iconOverSpinThe part spin animation speed.
placePartCallbackCallback for part place event.
btnPlacePartActiveWhether this icon will have a deploy part icon visible.
skipVariantsWhether this icon will bypass a OnVariantChanged event.
useImageThumbnailSet true to use image thumbnail instead of 3d object for icon.
inInventorySet true if this icon is inside a ModuleInventoryPart
static Material [] KSP.UI.Screens.EditorPartIcon.CreateMaterialArray ( GameObject  gameObject)
inlinestatic
static Material [] KSP.UI.Screens.EditorPartIcon.CreateMaterialArray ( GameObject  gameObject,
bool  includeInactiveRenderers 
)
inlinestatic
void KSP.UI.Screens.EditorPartIcon.DisableAddButton ( )
inline
void KSP.UI.Screens.EditorPartIcon.DisableDeleteButton ( )
inline
void KSP.UI.Screens.EditorPartIcon.EnableAddButton ( )
inline
void KSP.UI.Screens.EditorPartIcon.EnableDeleteButton ( )
inline
PartVariant KSP.UI.Screens.EditorPartIcon.GetCurrentVariant ( )
inline

Return the current variant that is applied to the availablePart.

Returns
void KSP.UI.Screens.EditorPartIcon.Highlight ( )
inline
void KSP.UI.Screens.EditorPartIcon.MouseInput_PointerEnter ( PointerEventData  data)
inline
void KSP.UI.Screens.EditorPartIcon.MouseInput_PointerExit ( PointerEventData  data)
inline
void KSP.UI.Screens.EditorPartIcon.MouseInput_SpawnPart ( )
inline
void KSP.UI.Screens.EditorPartIcon.SetEmptySlot ( )
inline

Sets this as an empty slot when there is no part icon to show.

void KSP.UI.Screens.EditorPartIcon.SetGrey ( string  why)
inline
static void KSP.UI.Screens.EditorPartIcon.SetPartColor ( GameObject  partIcon,
Color  color,
AvailablePart  part = null 
)
inlinestatic

Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1.

Parameters
partIconThe game object.
colorThe color to set.
partthe available part (database) version that will be used to reset to default colors.
static void KSP.UI.Screens.EditorPartIcon.SetPartColor ( GameObject  partIcon,
Color  color,
bool  isFlag,
AvailablePart  part = null 
)
inlinestatic

Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1.

Parameters
partIconThe game object.
color>The color to set.
isFlagSet true if the game object is a Flag Part.
partthe available part (database) version that will be used to reset to default colors.
static void KSP.UI.Screens.EditorPartIcon.SetPartColor ( GameObject  partIcon,
Color  color,
bool  processUnlit,
bool  isFlag,
AvailablePart  part = null 
)
inlinestatic

Set material colors on object. Finds all materials on the object and sets it to the color passed in. Or will reset back to default colors from the passed in part if color is set to 1,1,1,1.

Parameters
partIconThe game object.
colorThe color to set.
processUnlitSet true to process unlit shaders.
isFlagSet true if the game object is a Flag Part.
partthe available part (database) version that will be used to reset to default colors.
void KSP.UI.Screens.EditorPartIcon.Start ( )
inlineprotected
void KSP.UI.Screens.EditorPartIcon.ToggleVariant ( )
inline

Will toggle

void KSP.UI.Screens.EditorPartIcon.Unhighlight ( )
inline
void KSP.UI.Screens.EditorPartIcon.UnsetGrey ( )
inline
bool KSP.UI.Screens.EditorPartIcon.VariantsAvailable ( )
inline

Will return true if the availablePart has Variants

Returns

Member Data Documentation

Button KSP.UI.Screens.EditorPartIcon.btnAdd
Button KSP.UI.Screens.EditorPartIcon.btnPlacePart
Button KSP.UI.Screens.EditorPartIcon.btnRemove
Button KSP.UI.Screens.EditorPartIcon.btnSpawnPart
Button KSP.UI.Screens.EditorPartIcon.btnSwapTexture
Color KSP.UI.Screens.EditorPartIcon.experimentalPartColor = new Color32(128, 128, 255, 255)
FlagDecalBackground KSP.UI.Screens.EditorPartIcon.flagDecalBackground

The flag Part module reference, assigned when this is created and the part has the module.

Image KSP.UI.Screens.EditorPartIcon.highlightImage
float KSP.UI.Screens.EditorPartIcon.iconOverScale
float KSP.UI.Screens.EditorPartIcon.iconOverSpin
float KSP.UI.Screens.EditorPartIcon.iconSize
bool KSP.UI.Screens.EditorPartIcon.inInventory

This is true if this icon is inside a ModuleInventoryPart grid.

RawImage KSP.UI.Screens.EditorPartIcon.inventoryItemThumbnail
bool KSP.UI.Screens.EditorPartIcon.isEmptySlot = false

Indicates if this PartIcon is an Empty Slot in the Inventory Grid in the PAW. Is not relevant if this instance is not part of an Inventory Grid in a PAW UI.

bool KSP.UI.Screens.EditorPartIcon.isFlag

True if this EditorPartIcon is a flag part.

bool KSP.UI.Screens.EditorPartIcon.isPart = true
Material [] KSP.UI.Screens.EditorPartIcon.materials
Color KSP.UI.Screens.EditorPartIcon.missionRequiredPartColor = new Color32(128, 128, 255, 255)
PartIcon KSP.UI.Screens.EditorPartIcon.partIcon

Reference to the Part Icon object - which contains a reference to the Icon GameObject and cached Renderers.

Callback<EditorPartIcon> KSP.UI.Screens.EditorPartIcon.PlacePartCallback
TMPro.TextMeshProUGUI KSP.UI.Screens.EditorPartIcon.stackAmountText
Slider KSP.UI.Screens.EditorPartIcon.stackSlider

The slider that shows how many items in a stack are filled

PartUpgradeHandler.Upgrade KSP.UI.Screens.EditorPartIcon.upgrade = null
int KSP.UI.Screens.EditorPartIcon.variantIndex

Property Documentation

AvailablePart KSP.UI.Screens.EditorPartIcon.AvailPart
get

Reference to the AvailablePart prefab

bool KSP.UI.Screens.EditorPartIcon.Focused
get
string KSP.UI.Screens.EditorPartIcon.greyoutToolTipMessage
getset
bool KSP.UI.Screens.EditorPartIcon.HasIconOrThumbnail
get

Does the icon or thumbnail exist?

bool KSP.UI.Screens.EditorPartIcon.IsCargoPart
get

True if Part implements ModuleCargoPart

bool KSP.UI.Screens.EditorPartIcon.IsDeployablePart
get
bool KSP.UI.Screens.EditorPartIcon.isGrey
getset
bool KSP.UI.Screens.EditorPartIcon.MouseOver
get
Transform KSP.UI.Screens.EditorPartIcon.PartIcon
get

The Part Icon transform

AvailablePart KSP.UI.Screens.EditorPartIcon.partInfo
get
bool KSP.UI.Screens.EditorPartIcon.StillFocused
get

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