Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
Expansions.Missions.Editor.MEGUINode Class Reference
Inheritance diagram for Expansions.Missions.Editor.MEGUINode:
Expansions.Missions.Editor.IMEHistoryTarget

Public Member Functions

void AddNewLine (MEGUIConnector line, MENodeConnectionType type)
 
bool CanDock ()
 Checks whether this node can dock to others. More...
 
void CheckDockStatus ()
 Check the current status of the node and evalute if a dock status change is needed More...
 
void CheckNodeDockingPosition (Vector3 nodePositionCheckOverride)
 Checks whether this node should be docked to another and handles docking and undocking. More...
 
void CleanNodeBodyParameters ()
 Clean the node More...
 
void CleanUp ()
 
void ClearHighlighter ()
 Turn off the highlighter More...
 
void ClearValidityIndicators ()
 Clear any gui indicators More...
 
void Deselect ()
 Deselect this node More...
 
void Destroy ()
 Disable this node and remove all it's references with the editor and other nodes More...
 
void DisplayNodeBodyParameters ()
 Displays the node body parameters More...
 
void DockNode (MEGUINode parentNode)
 Dock myself to a new node. More...
 
void DockNode (MEGUINode parentNode, int dockIndex, bool fromHistory)
 Overload 1, Dock myself to a node recovered by history "undo" or a new one with a specific index More...
 
bool DoesConnectionExist (MEGUINode otherNode, MENodeConnectionType otherNodeConnectionType)
 Returns true if this node is already linked through a connector to the other node, false if it isn't connected. More...
 
float GetDepthOfDockedNode (MEGUINode dockedNode)
 Gets the depth of a docked node inside the stack that it's in. More...
 
Color GetHighlighterColor ()
 Get the current Highlighter Color. More...
 
Vector2 GetInputButtonPosition ()
 
Vector2 GetOutputButtonPosition ()
 
ConfigNode GetState ()
 Gets the current node state More...
 
bool HasInputConnections ()
 
bool HasOutputConnections ()
 
void OnPointerClick (PointerEventData eventData)
 Implements the IPointerClickHandler event. More...
 
void PlaceNodeAtCanvas (Vector3 position)
 Place the node at a canvas world relative position More...
 
void PlaceNodeAtCanvas (Vector3 position, MEGUINodeIcon baseNodeIcon)
 Place the node at a canvas world relative position More...
 
void PushUndoActionOnPasteNode ()
 Add the paste nodes to the undo action history More...
 
void RemoveAllConnections ()
 Delete and un link all the connectors for this node More...
 
void RemoveLine (MEGUIConnector line, MENodeConnectionType type)
 Removes a line from the lines connections list More...
 
void Select (bool deselectOtherNodes=false, bool bypassNodeSelection=false)
 Select this node More...
 
void SetEndNode (bool setNode, bool initialize=false)
 Set the Nodes End visuals More...
 
void SetHighlighter (Color color)
 Turn on the highlighter with the specifed color More...
 
void SetNode (MENode node)
 Set the logic node that is used in this GUINode More...
 
void SetNodeColor ()
 Updates the node color and associated bits using the current color More...
 
void SetNodeColor (Color color)
 Set/changes the node header color and associated items More...
 
void SetTitleText (string title)
 Set/changes the node title string More...
 
void SetupDockingData ()
 Initialise all the information pertaining to docking for this node. More...
 
void SetValidityIndicators (MissionValidationTestResult result)
 Turn on the Validity Indicators More...
 
void ToggleHighlighter ()
 Toggle the Highlighter to other state More...
 
void ToggleHighlighter (bool state)
 Toggle the highlighter visibility to that passed in More...
 
void ToggleInputHolderHighlighter (bool state)
 
void ToggleOutputHolderHighlighter (bool state)
 
void ToggleParametersButtonClicked ()
 
void UndockNode ()
 Undock myself from a node. More...
 
void UpdateConnectors ()
 
void UpdateDockedIndex ()
 Checks and updates the dock index of this node More...
 
void UpdateInputConnectorImage ()
 Update the input connector image depending on the current state. More...
 
void UpdateOutputConnectorImage ()
 Update the input connector image depending on the current state. More...
 

Public Attributes

RectTransform dockedNodesParentTransform
 When logic nodes are docked to this node, they parent to this transform. More...
 
MEGUINode dockedParentNode
 This is the node that I am docked to. More...
 
Image headerImage
 Image used for the header. Used to change the colour of the header. More...
 
Button inputConnectorButton
 
RectTransform InputOutputGroup
 
bool isSelected
 Node has been selected in the mission editor More...
 
MEGUINodeBodyParameter nodeBodyParameterPrefab
 Prefab used to instantiate the node body parameters. More...
 
int numberOfParametersToDisplayWhenMinimised = 1
 Number of node body parameters to display when the minimise button is clicked More...
 
Button outputConnectorButton
 
Transform ParameterListTransform
 
TextMeshProUGUI title
 
Button toggleParametersButton
 

Protected Member Functions

IEnumerator DelayedUpdateConnectors ()
 
void DisplayModuleSection (IMENodeDisplay module, string parameterName, int parameterPosition)
 Displays the module parameter in the node body More...
 
void DisplayParameter (string displayString, int parameterPosition, bool allowEmpty)
 
void DisplayParameter (string displayString, int parameterPosition)
 
virtual void Setup ()
 

Protected Attributes

KSP.UI.UIDragPanel dragPanel
 

Properties

MEBasicNode BasicNode [get]
 This is a reference to the MEBasicNode that this MEGUINode is based from. More...
 
MEGUINode DockCandidate [get]
 
List< MEGUIConnectorInputConnectors [get, set]
 
MENode Node [get, set]
 The object that underpins this graphical representation More...
 
List< MEGUIConnectorOutputConnectors [get, set]
 
RectTransform rectTransform [get, set]
 

Events

System.Action< MEGUINodeDockStatusChange = (node) => { }
 Triggered when the dock status of this node changes More...
 

Member Function Documentation

void Expansions.Missions.Editor.MEGUINode.AddNewLine ( MEGUIConnector  line,
MENodeConnectionType  type 
)
inline
bool Expansions.Missions.Editor.MEGUINode.CanDock ( )
inline

Checks whether this node can dock to others.

Returns
Return true if this node can dock to others, false otherwise.
void Expansions.Missions.Editor.MEGUINode.CheckDockStatus ( )
inline

Check the current status of the node and evalute if a dock status change is needed

void Expansions.Missions.Editor.MEGUINode.CheckNodeDockingPosition ( Vector3  nodePositionCheckOverride)
inline

Checks whether this node should be docked to another and handles docking and undocking.

void Expansions.Missions.Editor.MEGUINode.CleanNodeBodyParameters ( )
inline

Clean the node

void Expansions.Missions.Editor.MEGUINode.CleanUp ( )
inline
void Expansions.Missions.Editor.MEGUINode.ClearHighlighter ( )
inline

Turn off the highlighter

void Expansions.Missions.Editor.MEGUINode.ClearValidityIndicators ( )
inline

Clear any gui indicators

Parameters
nodethe Node to work on
IEnumerator Expansions.Missions.Editor.MEGUINode.DelayedUpdateConnectors ( )
inlineprotected
void Expansions.Missions.Editor.MEGUINode.Deselect ( )
inline

Deselect this node

void Expansions.Missions.Editor.MEGUINode.Destroy ( )
inline

Disable this node and remove all it's references with the editor and other nodes

void Expansions.Missions.Editor.MEGUINode.DisplayModuleSection ( IMENodeDisplay  module,
string  parameterName,
int  parameterPosition 
)
inlineprotected

Displays the module parameter in the node body

Parameters
module
parameterName
parameterPosition
void Expansions.Missions.Editor.MEGUINode.DisplayNodeBodyParameters ( )
inline

Displays the node body parameters

Parameters
nodeNode to be displayed
void Expansions.Missions.Editor.MEGUINode.DisplayParameter ( string  displayString,
int  parameterPosition,
bool  allowEmpty 
)
inlineprotected
void Expansions.Missions.Editor.MEGUINode.DisplayParameter ( string  displayString,
int  parameterPosition 
)
inlineprotected
void Expansions.Missions.Editor.MEGUINode.DockNode ( MEGUINode  parentNode)
inline

Dock myself to a new node.

Parameters
parentNodeNode that we want to dock to.
void Expansions.Missions.Editor.MEGUINode.DockNode ( MEGUINode  parentNode,
int  dockIndex,
bool  fromHistory 
)
inline

Overload 1, Dock myself to a node recovered by history "undo" or a new one with a specific index

Parameters
parentNodeNode that we want to dock to.
dockIndexNode's index to insert.
fromHistoryWheter it's recovered from history Undo/Redo.
bool Expansions.Missions.Editor.MEGUINode.DoesConnectionExist ( MEGUINode  otherNode,
MENodeConnectionType  otherNodeConnectionType 
)
inline

Returns true if this node is already linked through a connector to the other node, false if it isn't connected.

float Expansions.Missions.Editor.MEGUINode.GetDepthOfDockedNode ( MEGUINode  dockedNode)
inline

Gets the depth of a docked node inside the stack that it's in.

Parameters
dockedNodeNode that we want to calculate the depth of.
Returns
Return difference in height between docked node and its parent transform in UI units.
Color Expansions.Missions.Editor.MEGUINode.GetHighlighterColor ( )
inline

Get the current Highlighter Color.

Returns
Vector2 Expansions.Missions.Editor.MEGUINode.GetInputButtonPosition ( )
inline
Vector2 Expansions.Missions.Editor.MEGUINode.GetOutputButtonPosition ( )
inline
ConfigNode Expansions.Missions.Editor.MEGUINode.GetState ( )
inline

Gets the current node state

Returns

Implements Expansions.Missions.Editor.IMEHistoryTarget.

bool Expansions.Missions.Editor.MEGUINode.HasInputConnections ( )
inline
bool Expansions.Missions.Editor.MEGUINode.HasOutputConnections ( )
inline
void Expansions.Missions.Editor.MEGUINode.OnPointerClick ( PointerEventData  eventData)
inline

Implements the IPointerClickHandler event.

Parameters
eventData
void Expansions.Missions.Editor.MEGUINode.PlaceNodeAtCanvas ( Vector3  position)
inline

Place the node at a canvas world relative position

Parameters
position
void Expansions.Missions.Editor.MEGUINode.PlaceNodeAtCanvas ( Vector3  position,
MEGUINodeIcon  baseNodeIcon 
)
inline

Place the node at a canvas world relative position

Parameters
position
baseNodeIconThe MEGUINodeIcon for this MEGUINode; or Null if there isn't one.
void Expansions.Missions.Editor.MEGUINode.PushUndoActionOnPasteNode ( )
inline

Add the paste nodes to the undo action history

void Expansions.Missions.Editor.MEGUINode.RemoveAllConnections ( )
inline

Delete and un link all the connectors for this node

void Expansions.Missions.Editor.MEGUINode.RemoveLine ( MEGUIConnector  line,
MENodeConnectionType  type 
)
inline

Removes a line from the lines connections list

Parameters
line
type
void Expansions.Missions.Editor.MEGUINode.Select ( bool  deselectOtherNodes = false,
bool  bypassNodeSelection = false 
)
inline

Select this node

Parameters
deselectOtherNodesset this to true to deselect any other selected nodes
bypassNodeSelectionset this to true to not fire the change of the currently selected node. Used for pasting multiple nodes and not generating SAP redraws primarliy
void Expansions.Missions.Editor.MEGUINode.SetEndNode ( bool  setNode,
bool  initialize = false 
)
inline

Set the Nodes End visuals

Parameters
setNode
initialize
void Expansions.Missions.Editor.MEGUINode.SetHighlighter ( Color  color)
inline

Turn on the highlighter with the specifed color

Parameters
colorColor to highlight in
void Expansions.Missions.Editor.MEGUINode.SetNode ( MENode  node)
inline

Set the logic node that is used in this GUINode

Parameters
node
void Expansions.Missions.Editor.MEGUINode.SetNodeColor ( )
inline

Updates the node color and associated bits using the current color

void Expansions.Missions.Editor.MEGUINode.SetNodeColor ( Color  color)
inline

Set/changes the node header color and associated items

Parameters
color
void Expansions.Missions.Editor.MEGUINode.SetTitleText ( string  title)
inline

Set/changes the node title string

Parameters
title
virtual void Expansions.Missions.Editor.MEGUINode.Setup ( )
inlineprotectedvirtual
void Expansions.Missions.Editor.MEGUINode.SetupDockingData ( )
inline

Initialise all the information pertaining to docking for this node.

void Expansions.Missions.Editor.MEGUINode.SetValidityIndicators ( MissionValidationTestResult  result)
inline

Turn on the Validity Indicators

Parameters
nodeThe node to affect
messageThe message for the tooltip
void Expansions.Missions.Editor.MEGUINode.ToggleHighlighter ( )
inline

Toggle the Highlighter to other state

void Expansions.Missions.Editor.MEGUINode.ToggleHighlighter ( bool  state)
inline

Toggle the highlighter visibility to that passed in

Parameters
stateNew state
void Expansions.Missions.Editor.MEGUINode.ToggleInputHolderHighlighter ( bool  state)
inline
void Expansions.Missions.Editor.MEGUINode.ToggleOutputHolderHighlighter ( bool  state)
inline
void Expansions.Missions.Editor.MEGUINode.ToggleParametersButtonClicked ( )
inline
void Expansions.Missions.Editor.MEGUINode.UndockNode ( )
inline

Undock myself from a node.

void Expansions.Missions.Editor.MEGUINode.UpdateConnectors ( )
inline
void Expansions.Missions.Editor.MEGUINode.UpdateDockedIndex ( )
inline

Checks and updates the dock index of this node

void Expansions.Missions.Editor.MEGUINode.UpdateInputConnectorImage ( )
inline

Update the input connector image depending on the current state.

void Expansions.Missions.Editor.MEGUINode.UpdateOutputConnectorImage ( )
inline

Update the input connector image depending on the current state.

Member Data Documentation

RectTransform Expansions.Missions.Editor.MEGUINode.dockedNodesParentTransform

When logic nodes are docked to this node, they parent to this transform.

MEGUINode Expansions.Missions.Editor.MEGUINode.dockedParentNode

This is the node that I am docked to.

KSP.UI.UIDragPanel Expansions.Missions.Editor.MEGUINode.dragPanel
protected
Image Expansions.Missions.Editor.MEGUINode.headerImage

Image used for the header. Used to change the colour of the header.

Button Expansions.Missions.Editor.MEGUINode.inputConnectorButton
RectTransform Expansions.Missions.Editor.MEGUINode.InputOutputGroup
bool Expansions.Missions.Editor.MEGUINode.isSelected

Node has been selected in the mission editor

MEGUINodeBodyParameter Expansions.Missions.Editor.MEGUINode.nodeBodyParameterPrefab

Prefab used to instantiate the node body parameters.

int Expansions.Missions.Editor.MEGUINode.numberOfParametersToDisplayWhenMinimised = 1

Number of node body parameters to display when the minimise button is clicked

Button Expansions.Missions.Editor.MEGUINode.outputConnectorButton
Transform Expansions.Missions.Editor.MEGUINode.ParameterListTransform
TextMeshProUGUI Expansions.Missions.Editor.MEGUINode.title
Button Expansions.Missions.Editor.MEGUINode.toggleParametersButton

Property Documentation

MEBasicNode Expansions.Missions.Editor.MEGUINode.BasicNode
get

This is a reference to the MEBasicNode that this MEGUINode is based from.

MEGUINode Expansions.Missions.Editor.MEGUINode.DockCandidate
get
List<MEGUIConnector> Expansions.Missions.Editor.MEGUINode.InputConnectors
getset
MENode Expansions.Missions.Editor.MEGUINode.Node
getset

The object that underpins this graphical representation

List<MEGUIConnector> Expansions.Missions.Editor.MEGUINode.OutputConnectors
getset
RectTransform Expansions.Missions.Editor.MEGUINode.rectTransform
getset

Event Documentation

System.Action<MEGUINode> Expansions.Missions.Editor.MEGUINode.DockStatusChange = (node) => { }

Triggered when the dock status of this node changes


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