public void Save() { buildListPositionSaved = new GUIPosition("buildList", KCT_GUI.buildListWindowPosition.x, KCT_GUI.buildListWindowPosition.y, KCT_GameStates.showWindows[0]); editorPositionSaved = new GUIPosition("editor", KCT_GUI.editorWindowPosition.x, KCT_GUI.editorWindowPosition.y, KCT_GameStates.showWindows[1]); timeLimitPositionSaved = new GUIPosition("timeLimit", KCT_GUI.timeRemainingPosition.x, KCT_GUI.timeRemainingPosition.y, KCT_GUI.showTimeRemaining); ConfigNode cnTemp = ConfigNode.CreateConfigFromObject(this, new ConfigNode()); cnTemp.Save(filePath); }
public void Save() { // Only support persisting UI state for editor and space center scenes for now if (!HighLogic.LoadedSceneIsEditor && HighLogic.LoadedScene != GameScenes.SPACECENTER) { return; } try { buildListPositionSaved = new GUIPosition("buildList", KCT_GUI.BuildListWindowPosition.x, KCT_GUI.BuildListWindowPosition.y, KCTGameStates.ShowWindows[0]); editorPositionSaved = new GUIPosition("editor", KCT_GUI.EditorWindowPosition.x, KCT_GUI.EditorWindowPosition.y, KCTGameStates.ShowWindows[1]); editorBuildListPositionSaved = new GUIPosition("editorBuildList", KCT_GUI.EditorBuildListWindowPosition.x, KCT_GUI.EditorBuildListWindowPosition.y, false); ConfigNode cnTemp = ConfigNode.CreateConfigFromObject(this, new ConfigNode()); cnTemp.Save(filePath); } catch (Exception ex) { Debug.LogException(ex); } }