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

Public Member Functions

void CreateFlightTooltip (AvailablePart ap)
 Creates the part tooltip of the available part in the slot More...
 
Part CreatePartFromInventory (AvailablePart partInfo)
 Creates a part that will then be turned into a part icon by the inventory. More...
 
Part CreatePartFromInventory (ProtoPartSnapshot protoPartSnapshot)
 Creates a part that will then be turned into a part icon by the inventory. More...
 
void DestroyTooltip ()
 
bool IsKerbalWithinRange (ModuleInventoryPart inventoryPart)
 
void OnInventoryPartHover (uint partId, Part p)
 Called only whe the cursor is holding a cargo part over a ModuleInventoryPart, in order to open and close PAWs. More...
 
void PlayPartDroppedSFX ()
 Play the Part Dropped sfx with this class audioSource More...
 
void PlayPartSelectedSFX ()
 Play the Part Selected sfx with this class audioSource More...
 
void ResetInventoryCacheValues ()
 Reset the inventory cache variables More...
 
void ReturnHeldPart ()
 Returns current held part to current inventorySlotClicked. More...
 
void SetIconAsPart ()
 Sets the part that is currently treated as Icon, to be picked by the EditorLogic. More...
 
void SetPartAsIcon (Transform parent, Part part)
 Sets a part as an icon More...
 
void ToggleCargoPartsLight (int counter)
 Receives counters from the created and destroyed Inventory grids. If there are none, the light is turned off, if at least one counter remains, the light stays on. More...
 
void UpdateCurrentCargoPart ()
 Updates the Current held cargo part if it is not null. More...
 

Public Attributes

List< string > availableInventoryParts = new List<string>()
 List of all available cargo inventory parts. More...
 
EditorInventoryOnlyIcon CurrentInventoryOnlyIcon
 the current inventory only icon More...
 
bool currentPartIsAttachable
 Trie if the current held part implements ModuleCargoPart. More...
 
bool currentPartSnapping
 True if a selected part is being used for placement. More...
 
bool editorPartDroppedBlockSfx
 When true, blocks the Sfx from Editor Logic form playing while the logic calls "on_partDropped" event on the cargo part. More...
 
bool editorPartPickedBlockSfx
 When true, blocks the Sfx from Editor Logic form playing while the logic calls "st_place" event on the cargo part. More...
 
bool hoveredPartIsKerbal
 True if the cursor hovered part is a kerbal on eva. More...
 
float iconHeight = 58
 Part Icon Height - How many pixels should a part 1m x 1m x 1m More...
 
GameObject InventoryOnlyIconPrefab
 When inventory parts that can't be placed are held, they appear as 2D icons instead of 3D parts. When that happens this prefab here is used More...
 
GameObject inventoryTooltipPrefab
 Prefab for the right-click tooltip panel for inventory slots More...
 
bool IsCursorOverAnyPAWOrCargoPane
 True if the cursor is hovering any Part Action Window More...
 
bool isHeldPartOutOfActionWindows
 The current held part is outside of a Part Action Window More...
 
bool isSetAsPart
 True if the current selected part is set as an icon already More...
 
Shader noAmbientHue
 Used to make cargo parts set as icon in inventories to not be affected by the Ambient light hue. More...
 
Shader noAmbientHueBumped
 Used to make cargo parts set as icon in inventories to not be affected by the Ambient light hue. For use with Bumped shaders. More...
 
float partIconDepthDistance = 39
 PartIcon Depth Distance More...
 
bool referenceNextCreatedInventoryPAW = false
 The next created inventory paw should be cached as currentPawAutoOpened, then set to false so it works as a switch. More...
 
Sprite slot_partItem_current
 The sprite for the part item slot when greyed out, when a part has been picked up and we need a visual reference from which slot it comes from More...
 
Sprite slot_partItem_normal
 The sprite for the part item slot when normal More...
 

Static Public Attributes

static int amountToStore = 0
 
static bool heldPartIsStack = false
 Whether the part under the mouse is a stack of parts drawn from an inventory More...
 
static
UIPartActionControllerInventory 
Instance
 Singleton More...
 
static int stackSize = 0
 The amount of parts in the stack under the mouse More...
 

Protected Attributes

Part currentCargoPart
 
ModuleInventoryPart currentInventory
 
UIPartActionInventorySlot currentInventorySlotClicked
 
UIPartActionInventorySlot currentInventorySlotEmptied
 
UIPartActionInventorySlot currentInventorySlotHovered
 
UIPartActionWindow currentPawAutoOpened
 
Part exchangedCargoPart
 

Properties

Part CurrentCargoPart [get, set]
 Current selected cargo part. Either from a picked up part, or a recently created one. More...
 
uint CurrentHoveredInventoryPart [get]
 The Part.persistentId of the currently hovered inventory part (otherwise zero). More...
 
ModuleInventoryPart CurrentInventory [get, set]
 Cache for the Part's inventory More...
 
UIPartActionInventorySlot CurrentInventorySlotClicked [get, set]
 Cache for current inventory slot clicked. More...
 
UIPartActionInventorySlot CurrentInventorySlotEmptied [get, set]
 Cache for current inventory slot for which all stacked elements were pulled. More...
 
UIPartActionInventorySlot CurrentInventorySlotHovered [get, set]
 Cache for current inventory slot hovered. More...
 
ModuleInventoryPart CurrentInventorySlotHoveredModule [get]
 Cache for the inventory module of the slot being hovered More...
 
ModuleCargoPart CurrentModuleCargoPart [get]
 References the picked up part ModuleCargoPart More...
 
UIPartActionWindow CurrentPawAutoOpened [get, set]
 Cached Reference of the current PartActionWindow that opened automatically by hovering with a held cargo part. More...
 
Part ExchangedCargoPart [get, set]
 Current selected cargo part that will be exchanged to another. Part that comes from toolbox or dropped. More...
 

Member Function Documentation

void UIPartActionControllerInventory.CreateFlightTooltip ( AvailablePart  ap)
inline

Creates the part tooltip of the available part in the slot

Parameters
apNull checks this parameter. Returns if null.
Part UIPartActionControllerInventory.CreatePartFromInventory ( 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
Part UIPartActionControllerInventory.CreatePartFromInventory ( ProtoPartSnapshot  protoPartSnapshot)
inline

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

Parameters
protoPartSnapshot
Returns
void UIPartActionControllerInventory.DestroyTooltip ( )
inline
bool UIPartActionControllerInventory.IsKerbalWithinRange ( ModuleInventoryPart  inventoryPart)
inline
void UIPartActionControllerInventory.OnInventoryPartHover ( uint  partId,
Part  p 
)
inline

Called only whe the cursor is holding a cargo part over a ModuleInventoryPart, in order to open and close PAWs.

Parameters
partIdInventory part persistent id.
pInventory Part.
void UIPartActionControllerInventory.PlayPartDroppedSFX ( )
inline

Play the Part Dropped sfx with this class audioSource

void UIPartActionControllerInventory.PlayPartSelectedSFX ( )
inline

Play the Part Selected sfx with this class audioSource

void UIPartActionControllerInventory.ResetInventoryCacheValues ( )
inline

Reset the inventory cache variables

void UIPartActionControllerInventory.ReturnHeldPart ( )
inline

Returns current held part to current inventorySlotClicked.

void UIPartActionControllerInventory.SetIconAsPart ( )
inline

Sets the part that is currently treated as Icon, to be picked by the EditorLogic.

Parameters
partPart reference for the Editor logic.
void UIPartActionControllerInventory.SetPartAsIcon ( Transform  parent,
Part  part 
)
inline

Sets a part as an icon

Parameters
parentSlot button transform.
partPart to become an icon.
void UIPartActionControllerInventory.ToggleCargoPartsLight ( int  counter)
inline

Receives counters from the created and destroyed Inventory grids. If there are none, the light is turned off, if at least one counter remains, the light stays on.

void UIPartActionControllerInventory.UpdateCurrentCargoPart ( )
inline

Updates the Current held cargo part if it is not null.

Member Data Documentation

int UIPartActionControllerInventory.amountToStore = 0
static
List<string> UIPartActionControllerInventory.availableInventoryParts = new List<string>()

List of all available cargo inventory parts.

Part UIPartActionControllerInventory.currentCargoPart
protected
ModuleInventoryPart UIPartActionControllerInventory.currentInventory
protected
EditorInventoryOnlyIcon UIPartActionControllerInventory.CurrentInventoryOnlyIcon

the current inventory only icon

UIPartActionInventorySlot UIPartActionControllerInventory.currentInventorySlotClicked
protected
UIPartActionInventorySlot UIPartActionControllerInventory.currentInventorySlotEmptied
protected
UIPartActionInventorySlot UIPartActionControllerInventory.currentInventorySlotHovered
protected
bool UIPartActionControllerInventory.currentPartIsAttachable

Trie if the current held part implements ModuleCargoPart.

bool UIPartActionControllerInventory.currentPartSnapping

True if a selected part is being used for placement.

UIPartActionWindow UIPartActionControllerInventory.currentPawAutoOpened
protected
bool UIPartActionControllerInventory.editorPartDroppedBlockSfx

When true, blocks the Sfx from Editor Logic form playing while the logic calls "on_partDropped" event on the cargo part.

bool UIPartActionControllerInventory.editorPartPickedBlockSfx

When true, blocks the Sfx from Editor Logic form playing while the logic calls "st_place" event on the cargo part.

Part UIPartActionControllerInventory.exchangedCargoPart
protected
bool UIPartActionControllerInventory.heldPartIsStack = false
static

Whether the part under the mouse is a stack of parts drawn from an inventory

bool UIPartActionControllerInventory.hoveredPartIsKerbal

True if the cursor hovered part is a kerbal on eva.

float UIPartActionControllerInventory.iconHeight = 58

Part Icon Height - How many pixels should a part 1m x 1m x 1m

UIPartActionControllerInventory UIPartActionControllerInventory.Instance
static

Singleton

GameObject UIPartActionControllerInventory.InventoryOnlyIconPrefab

When inventory parts that can't be placed are held, they appear as 2D icons instead of 3D parts. When that happens this prefab here is used

GameObject UIPartActionControllerInventory.inventoryTooltipPrefab

Prefab for the right-click tooltip panel for inventory slots

bool UIPartActionControllerInventory.IsCursorOverAnyPAWOrCargoPane

True if the cursor is hovering any Part Action Window

bool UIPartActionControllerInventory.isHeldPartOutOfActionWindows

The current held part is outside of a Part Action Window

bool UIPartActionControllerInventory.isSetAsPart

True if the current selected part is set as an icon already

Shader UIPartActionControllerInventory.noAmbientHue

Used to make cargo parts set as icon in inventories to not be affected by the Ambient light hue.

Shader UIPartActionControllerInventory.noAmbientHueBumped

Used to make cargo parts set as icon in inventories to not be affected by the Ambient light hue. For use with Bumped shaders.

float UIPartActionControllerInventory.partIconDepthDistance = 39

PartIcon Depth Distance

bool UIPartActionControllerInventory.referenceNextCreatedInventoryPAW = false

The next created inventory paw should be cached as currentPawAutoOpened, then set to false so it works as a switch.

Sprite UIPartActionControllerInventory.slot_partItem_current

The sprite for the part item slot when greyed out, when a part has been picked up and we need a visual reference from which slot it comes from

Sprite UIPartActionControllerInventory.slot_partItem_normal

The sprite for the part item slot when normal

int UIPartActionControllerInventory.stackSize = 0
static

The amount of parts in the stack under the mouse

Property Documentation

Part UIPartActionControllerInventory.CurrentCargoPart
getset

Current selected cargo part. Either from a picked up part, or a recently created one.

uint UIPartActionControllerInventory.CurrentHoveredInventoryPart
get

The Part.persistentId of the currently hovered inventory part (otherwise zero).

ModuleInventoryPart UIPartActionControllerInventory.CurrentInventory
getset

Cache for the Part's inventory

UIPartActionInventorySlot UIPartActionControllerInventory.CurrentInventorySlotClicked
getset

Cache for current inventory slot clicked.

UIPartActionInventorySlot UIPartActionControllerInventory.CurrentInventorySlotEmptied
getset

Cache for current inventory slot for which all stacked elements were pulled.

UIPartActionInventorySlot UIPartActionControllerInventory.CurrentInventorySlotHovered
getset

Cache for current inventory slot hovered.

ModuleInventoryPart UIPartActionControllerInventory.CurrentInventorySlotHoveredModule
get

Cache for the inventory module of the slot being hovered

ModuleCargoPart UIPartActionControllerInventory.CurrentModuleCargoPart
get

References the picked up part ModuleCargoPart

UIPartActionWindow UIPartActionControllerInventory.CurrentPawAutoOpened
getset

Cached Reference of the current PartActionWindow that opened automatically by hovering with a held cargo part.

Part UIPartActionControllerInventory.ExchangedCargoPart
getset

Current selected cargo part that will be exchanged to another. Part that comes from toolbox or dropped.


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