/// <summary> /// Wrapper to draw editors /// </summary> /// <param name="mapDecalInstance"></param> public void DrawEditor(MapDecalInstance mapDecalInstance) { if (!guiInitialized) { InitializeLayout(); guiInitialized = true; } if (mapDecalInstance == null) { return; } if (selectedDecal != selectedDecalPrevious) { UpdateSelection(selectedDecal); selectedDecalPrevious = selectedDecal; position = selectedDecal.gameObject.transform.position; Planetarium.fetch.CurrentMainBody.GetLatLonAlt(position, out latitude, out longitude, out altitude); SetupVectors(); EditorGizmo.SetupMoveGizmo(selectedDecal.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack); if (!KerbalKonstructs.camControl.active) { KerbalKonstructs.camControl.enable(selectedDecal.gameObject); } } toolRect = GUI.Window(0xB00B1E3, toolRect, MapDecalEditorWindow, "", KKWindows); //if (editingLaunchSite) //{ // siteEditorRect = GUI.Window(0xB00B1E4, siteEditorRect, drawLaunchSiteEditorWindow, "", KKWindows); //} }
/// <summary> /// Wrapper to draw editors /// </summary> /// <param name="mapDecalInstance"></param> public void DrawEditor(MapDecalInstance mapDecalInstance) { if (!guiInitialized) { InitializeLayout(); guiInitialized = true; } if (mapDecalInstance == null) { return; } if (selectedDecal != selectedDecalPrevious) { UpdateSelection(selectedDecal); selectedDecalPrevious = selectedDecal; position = selectedDecal.gameObject.transform.position; Planetarium.fetch.CurrentMainBody.GetLatLonAlt(position, out latitude, out longitude, out altitude); SetupVectors(); } toolRect = GUI.Window(0xB00B1E3, toolRect, MapDecalEditorWindow, "", KKWindows); //if (editingLaunchSite) //{ // siteEditorRect = GUI.Window(0xB00B1E4, siteEditorRect, drawLaunchSiteEditorWindow, "", KKWindows); //} }
public void Close() { if (KerbalKonstructs.camControl.active) { KerbalKonstructs.camControl.disable(); } EditorGizmo.CloseGizmo(); selectedDecal = null; SetActive(false); }
public override void Close() { if (KerbalKonstructs.camControl.active) { KerbalKonstructs.camControl.disable(); } CloseVectors(); EditorGizmo.CloseGizmo(); base.Close(); selectedDecal = null; }
/// <summary> /// Deletes an selected MapDecalInstance /// </summary> internal void DeleteInstance() { if (selectedDecalPrevious == selectedDecal) { selectedDecalPrevious = null; } selectedDecal.gameObject.transform.parent = null; selectedDecal.mapDecal.transform.parent = null; selectedDecal.gameObject.DestroyGameObject(); selectedDecal.CelestialBody.pqsController.RebuildSphere(); DecalsDatabase.DeleteMapDecalInstance(selectedDecal); this.Close(); }
public override void Close() { CloseVectors(); selectedDecal = null; base.Close(); }
/// <summary> /// Updates the Window Strings to the new settings /// </summary> /// <param name="instance"></param> public static void UpdateSelection(MapDecalInstance instance) { selectedDecal = instance; }
public MapDecalItem(MapDecalInstance decal) { this.decal = decal; }