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

Public Types

enum  EditorModes { EditorModes.SIMPLE = 0, EditorModes.ADVANCED = 1 }
 

Public Member Functions

bool AnyTextFieldHasFocus ()
 Function to check if any textfield in the Editor (excluding DeltaVapp and RoboticControllerManager) is currently focused More...
 
bool AreAllPartsConnected ()
 Returns false if at least one part is not connected. More...
 
int CountAllSceneParts (bool includeSelected)
 Returns the number of scene parts More...
 
Part CreatePartForInventoryUse (AvailablePart partInfo)
 Creates a part that will then be turned into a part icon by the inventory. More...
 
void DestroySelectedPart ()
 
List< PartgetSortedShipList ()
 
void launchVessel ()
 Will launch the current vessel. (same as pressing the Launch button in the VAB/SPH). More...
 
void launchVessel (string siteName)
 Will launch the current vessel from the specified siteName. Will check the siteName is a valid siteName and if not, will use the default Launchsite for the current Editor (SPH/VAB). More...
 
void Lock (bool lockLoad, bool lockExit, bool lockSave, string lockID)
 
bool NameOrDescriptionFocused ()
 
void OnPartListBackgroundTap ()
 
void OnPartListIconTap (AvailablePart p)
 
void OnPartListIconTap (ShipTemplate st)
 
void OnPodSpawn (AvailablePart pod)
 
void OnSubassemblyDialogDismiss (Part p)
 
void ReleasePartToIcon ()
 Drops a part so it can be used to move over a PAW as an inventory item to be placed. More...
 
void ResetBackup ()
 Replaces the last undo state More...
 
void SelectPanelActions ()
 
void SelectPanelCargo ()
 
void SelectPanelCrew ()
 
void SelectPanelParts ()
 
void SelectPanelParts (bool isReset)
 
void SetBackup ()
 Creates a new undo state More...
 
void SetIconAsPart (Part part)
 Used to convert an existing part set as an icon, to a draggable Editor Part. More...
 
void snapButton (PointerEventData evtData=null)
 
void SpawnConstruct (ShipConstruct construct)
 
void SpawnPart (AvailablePart partInfo)
 
void SpawnTemplate (ShipTemplate st)
 
void SwitchEditor ()
 
void symButton (PointerEventData evtData=null)
 
void UndoRedoInputUpdate ()
 
void Unlock (string lockID)
 
void UpdateUI ()
 

Static Public Member Functions

static void DeletePart (Part part)
 
static Part FirstNonSymmetricalParentFrom (Part p)
 
static void LoadShipFromFile (string path)
 
- Static Public Member Functions inherited from EditorLogicBase
static List< PartFindPartsInChildren (Part part)
 Finds all parts in the child hierarchy of the given part, part included More...
 
static void FindPartsInChildren (ref List< Part > parts, Part part)
 Finds all parts in the child hierarchy of the given part, part included More...
 

Public Attributes

Button actionPanelBtn
 
bool allowNodeAttachment = true
 
bool allowSrfAttachment = true
 
UIOnClick angleSnapButton
 
UIStateImage angleSnapSprite
 
AudioClip attachClip
 
RectTransform cargoBtnOrigPos
 
Button cargoPanelBtn
 
Button coordSpaceBtn
 
TMPro.TextMeshProUGUI coordSpaceText
 
RectTransform crewBtnOrigPos
 
Button crewPanelBtn
 
bool disallowSave = false
 
float dragSharpness = 0.3f
 
RectTransform editorBtnOrigPos
 
UIStateToggleButton editorBtnStateToggle
 
EditorCamera editorCam
 
Camera editorCamera
 
Camera editorCargoCamera
 
Button exitBtn
 
FlagBrowserButton flagBrowserButton
 
Button launchBtn
 
string launchSiteName = "LaunchPad"
 This is the currently selected launchSite Name. More...
 
Button loadBtn
 
UIStateImage mirrorSprite
 
Collider[] modalAreas
 
Button newBtn
 
Button partPanelBtn
 
Button radialSymmetryBtn
 
TMPro.TextMeshProUGUI radialSymmetryText
 
Button saveBtn
 
int sceneToLoad
 
ShipConstruct ship
 
GUISkin shipBrowserSkin
 
TMPro.TMP_InputField shipDescriptionField
 
Texture2D shipFileImage
 
TMPro.TMP_InputField shipNameField
 
float srfAttachAngleSnap = 15f
 
float srfAttachAngleSnapFine = 5f
 
string startPodId = "mk1pod.v2"
 
Button steamBtn
 
Button switchEditorBtn
 
UIOnClick symmetryButton
 
SymmetryMethod symmetryMethod
 
int symmetryMode = 0
 
int symmetryModeTmp = 0
 
UIStateImage symmetrySprite
 
EditorToolsUI toolsUI
 
Quaternion vesselRotation = Quaternion.identity
 
- Public Attributes inherited from EditorLogicBase
EditorScreen editorScreen
 
Vector3 selPartGrabOffset
 

Static Public Attributes

static EditorLogic fetch
 
static string FlagURL = ""
 
static EditorPartIcon iconRequestedVariantChange = null
 This is the part icon where the variant switch button was actually clicked on More...
 
static EditorModes Mode = EditorModes.SIMPLE
 

Protected Member Functions

override void partRotationResetUpdate ()
 
bool ShipIsValid (ShipConstruct ship)
 Returns true if ship is not null and if ship contains at least 1 part. More...
 
- Protected Member Functions inherited from EditorLogicBase
void AssignAttachIcon (Part part, AttachNode node, bool stackNodes, bool srfNodes, bool dockNodes)
 
void CreateSelectedPartIcon ()
 Creates a part icon for the current selected part when it's not null and it's a cargo part. More...
 
void displayAttachNodeIcons (List< Part > parts, Part selectedPart, bool stackNodes, bool srfNodes, bool dockNodes)
 Displays all attachNodes currently available for attaching. (depending on rules) (false, false disables the node icons) More...
 
float FindPartSurface (Part p, Vector3 origin, Vector3 direction, Vector3 fromParent, RaycastHit hit, out Vector3 srfNormal)
 Find the surface of the part using its enabled colliders More...
 
float FindPartSurface (Part p, Vector3 origin, Vector3 direction, Vector3 fromParent, RaycastHit hit, out Vector3 srfNormal, int layerMask)
 Find the surface of the part using its enabled colliders More...
 
void handleAttachNodeIcons (Part part, bool stackNodes, bool srfNodes, bool dockNodes)
 
void handleChildNodeIcons (Part part)
 
bool PartInHierarchy (Part part, Part tgtPart)
 Detects whether the given part has the target part in it's child hierarchy. Used to detect and prevent parts connecting to their own childs and creating hierarchy loops. More...
 
void partRotationInputUpdate ()
 

Properties

static string autoShipName [get]
 
string currentStateName [get]
 
Bounds editorBounds [get]
 
ConstructionMode EditorConstructionMode [get]
 
bool FSMStarted [get]
 
Vector3 initialPodPosition [get]
 
string lastEventName [get]
 
static int LayerMask [get]
 
static Part RootPart [get]
 
static Part SelectedPart [get]
 The current selected part. Must be implementing ModuleCargoPart More...
 
static Texture2D ShipFileImage [get]
 
static List< PartSortedShipList [get]
 A depth-first ordered list of ship parts (matches the SFS ordering) More...
 
static Quaternion VesselRotation [get]
 
- Properties inherited from EditorLogicBase
bool IsCurrentPartFlag [get]
 Returns true if the current held part is a Flag, returns false if there is no current part flag or if it's not a Flag. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from EditorLogicBase
static void clearAttachNodes (Part part, Part otherPart)
 
- Protected Attributes inherited from EditorLogicBase
GameObject attachNodePrefab
 
bool checkInputLocks = true
 
KerbalFSM fsm = null
 
ScreenMessage interactMsg
 
bool isCurrentPartFlag
 
ScreenMessage modeMsg
 
bool partTweaked
 
CompoundPart selectedCompoundPart
 
Part selectedPart
 
Quaternion stackRotation
 
- Static Protected Attributes inherited from EditorLogicBase
static string cacheAutoLOC_125488
 
static string cacheAutoLOC_125583
 
static string cacheAutoLOC_125724
 
static string cacheAutoLOC_125784
 
static string cacheAutoLOC_125798
 
static string cacheAutoLOC_6001217
 
static string cacheAutoLOC_6001218
 
static string cacheAutoLOC_6001219
 
static string cacheAutoLOC_6001220
 
static string cacheAutoLOC_6001221
 
static string cacheAutoLOC_6001222
 
static string cacheAutoLOC_6001223
 
static string cacheAutoLOC_6001224
 
static string cacheAutoLOC_6001225
 
static string cacheAutoLOC_6001226
 
static string cacheAutoLOC_6004038
 
static string cacheAutoLOC_6006095
 

Member Enumeration Documentation

Enumerator
SIMPLE 
ADVANCED 

Member Function Documentation

bool EditorLogic.AnyTextFieldHasFocus ( )
inline

Function to check if any textfield in the Editor (excluding DeltaVapp and RoboticControllerManager) is currently focused

Returns
Returns True if any text field is focused (awaiting input)
bool EditorLogic.AreAllPartsConnected ( )
inline

Returns false if at least one part is not connected.

Parameters
ship
Returns
int EditorLogic.CountAllSceneParts ( bool  includeSelected)
inline

Returns the number of scene parts

Parameters
includeSelected
selectedPart
Returns
Part EditorLogic.CreatePartForInventoryUse ( AvailablePart  partInfo)
inline

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

Parameters
partInfoAvailable part as a referece for instancing the part.
Returns
static void EditorLogic.DeletePart ( Part  part)
inlinestatic
void EditorLogic.DestroySelectedPart ( )
inline
static Part EditorLogic.FirstNonSymmetricalParentFrom ( Part  p)
inlinestatic
List<Part> EditorLogic.getSortedShipList ( )
inline
void EditorLogic.launchVessel ( )
inline

Will launch the current vessel. (same as pressing the Launch button in the VAB/SPH).

void EditorLogic.launchVessel ( string  siteName)
inline

Will launch the current vessel from the specified siteName. Will check the siteName is a valid siteName and if not, will use the default Launchsite for the current Editor (SPH/VAB).

Parameters
siteNamethe siteName string

< clear out any on-screen messages

static void EditorLogic.LoadShipFromFile ( string  path)
inlinestatic
void EditorLogic.Lock ( bool  lockLoad,
bool  lockExit,
bool  lockSave,
string  lockID 
)
inline
bool EditorLogic.NameOrDescriptionFocused ( )
inline
void EditorLogic.OnPartListBackgroundTap ( )
inline
void EditorLogic.OnPartListIconTap ( AvailablePart  p)
inline
void EditorLogic.OnPartListIconTap ( ShipTemplate  st)
inline
void EditorLogic.OnPodSpawn ( AvailablePart  pod)
inline

< Added for Unity 4 support CJ 1-16-2012

void EditorLogic.OnSubassemblyDialogDismiss ( Part  p)
inline
override void EditorLogic.partRotationResetUpdate ( )
inlineprotectedvirtual

Reimplemented from EditorLogicBase.

void EditorLogic.ReleasePartToIcon ( )
inline

Drops a part so it can be used to move over a PAW as an inventory item to be placed.

void EditorLogic.ResetBackup ( )
inline

Replaces the last undo state

void EditorLogic.SelectPanelActions ( )
inline
void EditorLogic.SelectPanelCargo ( )
inline
void EditorLogic.SelectPanelCrew ( )
inline
void EditorLogic.SelectPanelParts ( )
inline
void EditorLogic.SelectPanelParts ( bool  isReset)
inline
void EditorLogic.SetBackup ( )
inline

Creates a new undo state

void EditorLogic.SetIconAsPart ( Part  part)
inline

Used to convert an existing part set as an icon, to a draggable Editor Part.

bool EditorLogic.ShipIsValid ( ShipConstruct  ship)
inlineprotected

Returns true if ship is not null and if ship contains at least 1 part.

Parameters
ship
Returns
void EditorLogic.snapButton ( PointerEventData  evtData = null)
inline
void EditorLogic.SpawnConstruct ( ShipConstruct  construct)
inline
void EditorLogic.SpawnPart ( AvailablePart  partInfo)
inline

< Added for Unity 4 support CJ 1-16-2012

< Don't think it's necessary - RelinkPrefab(selectedPart, partInfo);

void EditorLogic.SpawnTemplate ( ShipTemplate  st)
inline
void EditorLogic.SwitchEditor ( )
inline
void EditorLogic.symButton ( PointerEventData  evtData = null)
inline
void EditorLogic.UndoRedoInputUpdate ( )
inline
void EditorLogic.Unlock ( string  lockID)
inline
void EditorLogic.UpdateUI ( )
inline

Member Data Documentation

Button EditorLogic.actionPanelBtn
bool EditorLogic.allowNodeAttachment = true
bool EditorLogic.allowSrfAttachment = true
UIOnClick EditorLogic.angleSnapButton
UIStateImage EditorLogic.angleSnapSprite
AudioClip EditorLogic.attachClip
RectTransform EditorLogic.cargoBtnOrigPos
Button EditorLogic.cargoPanelBtn
Button EditorLogic.coordSpaceBtn
TMPro.TextMeshProUGUI EditorLogic.coordSpaceText
RectTransform EditorLogic.crewBtnOrigPos
Button EditorLogic.crewPanelBtn
bool EditorLogic.disallowSave = false
float EditorLogic.dragSharpness = 0.3f
RectTransform EditorLogic.editorBtnOrigPos
UIStateToggleButton EditorLogic.editorBtnStateToggle
EditorCamera EditorLogic.editorCam
Camera EditorLogic.editorCamera
Camera EditorLogic.editorCargoCamera
Button EditorLogic.exitBtn
EditorLogic EditorLogic.fetch
static
FlagBrowserButton EditorLogic.flagBrowserButton
string EditorLogic.FlagURL = ""
static
EditorPartIcon EditorLogic.iconRequestedVariantChange = null
static

This is the part icon where the variant switch button was actually clicked on

Button EditorLogic.launchBtn
string EditorLogic.launchSiteName = "LaunchPad"

This is the currently selected launchSite Name.

Button EditorLogic.loadBtn
UIStateImage EditorLogic.mirrorSprite
Collider [] EditorLogic.modalAreas
EditorModes EditorLogic.Mode = EditorModes.SIMPLE
static
Button EditorLogic.newBtn
Button EditorLogic.partPanelBtn
Button EditorLogic.radialSymmetryBtn
TMPro.TextMeshProUGUI EditorLogic.radialSymmetryText
Button EditorLogic.saveBtn
int EditorLogic.sceneToLoad
ShipConstruct EditorLogic.ship
GUISkin EditorLogic.shipBrowserSkin
TMPro.TMP_InputField EditorLogic.shipDescriptionField
Texture2D EditorLogic.shipFileImage
TMPro.TMP_InputField EditorLogic.shipNameField
float EditorLogic.srfAttachAngleSnap = 15f
float EditorLogic.srfAttachAngleSnapFine = 5f
string EditorLogic.startPodId = "mk1pod.v2"
Button EditorLogic.steamBtn
Button EditorLogic.switchEditorBtn
UIOnClick EditorLogic.symmetryButton
SymmetryMethod EditorLogic.symmetryMethod
int EditorLogic.symmetryMode = 0
int EditorLogic.symmetryModeTmp = 0
UIStateImage EditorLogic.symmetrySprite
EditorToolsUI EditorLogic.toolsUI
Quaternion EditorLogic.vesselRotation = Quaternion.identity

Property Documentation

string EditorLogic.autoShipName
staticget
string EditorLogic.currentStateName
get
Bounds EditorLogic.editorBounds
get
ConstructionMode EditorLogic.EditorConstructionMode
get
bool EditorLogic.FSMStarted
get
Vector3 EditorLogic.initialPodPosition
get
string EditorLogic.lastEventName
get
int EditorLogic.LayerMask
staticget
Part EditorLogic.RootPart
staticget
Part EditorLogic.SelectedPart
staticget

The current selected part. Must be implementing ModuleCargoPart

Texture2D EditorLogic.ShipFileImage
staticget
List<Part> EditorLogic.SortedShipList
staticget

A depth-first ordered list of ship parts (matches the SFS ordering)

Quaternion EditorLogic.VesselRotation
staticget

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