public override void OnAwake() { RSTLogWriter.Log("OnAwake in " + HighLogic.LoadedScene); base.OnAwake(); GameEvents.onGameSceneLoadRequested.Add(OnGameSceneLoadRequested); if (HighLogic.LoadedScene == GameScenes.SPACECENTER) { RSTLogWriter.Log("Adding SpaceCenterManager"); var RBC = gameObject.AddComponent <ResearchBodiesController>(); children.Add(RBC); } else if (HighLogic.LoadedScene == GameScenes.FLIGHT) { RSTLogWriter.Log("Adding FlightManager"); var RBC = gameObject.AddComponent <ResearchBodiesController>(); children.Add(RBC); } else if (HighLogic.LoadedScene == GameScenes.EDITOR) { RSTLogWriter.Log("Adding EditorController"); var RBC = gameObject.AddComponent <ResearchBodiesController>(); children.Add(RBC); } else if (HighLogic.LoadedScene == GameScenes.TRACKSTATION) { RSTLogWriter.Log("Adding TrackingStationController"); var RBC = gameObject.AddComponent <ResearchBodiesController>(); children.Add(RBC); } }
public void OnDestroy() { RSTLogWriter.Log("OnDestroy"); GameEvents.onGameStatePostLoad.Remove(onGameStatePostLoad); GameEvents.OnGameSettingsApplied.Remove(ApplySettings); //GameEvents.onGameStateLoad.Remove(ApplySettings); }
public void ApplySettings() { RSTLogWriter.Log("Database ApplySettings"); if (HighLogic.CurrentGame != null) { //if (RB_SettingsParms == null) RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>(); if (ResearchBodies.Instance != null) { ResearchBodies.Enabled = RB_SettingsParms.RBEnabled; } chances = RB_SettingsParms.DiscoverySeed; allowTSlevel1 = RB_SettingsParms.Enabledtslvl1; if (RB_SettingsParms.french) { if (Locales.currentLocale.LocaleFull != "Français") { Locales.setLocale("Français"); if (ResearchBodiesController.instance != null) { ResearchBodiesController.instance.French = true; } } } else { Locales.setLocale(""); } RSTLogWriter.debuggingOn = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().DebugLogging; } else { RSTLogWriter.Log("Database Failed to apply settings - Fatal Error"); } }
public override void OnLoad(ConfigNode gameNode) { base.OnLoad(gameNode); RBgameSettings.Load(gameNode); // Load the global settings //if (File.Exists(globalConfigFilename)) //{ // globalNode = ConfigNode.Load(globalConfigFilename); // foreach (Savable s in children.Where(c => c is Savable)) // { // s.Load(globalNode); // } //} RSTLogWriter.debuggingOn = RBgameSettings.DebugLogging; if (HighLogic.CurrentGame.Mode == Game.Modes.SANDBOX && !Database.instance.enableInSandbox) { RBgameSettings.Enabled = false; } enabled = RBgameSettings.Enabled; APIReady = true; if (RSTLogWriter.debuggingOn) { RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnLoad: \n "); } // RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnLoad: \n " + gameNode + "\n" + globalNode); else { RSTLogWriter.Log("ResearchBodies Scenario Onload Completed."); } }
public void onGameStatePostLoad(ConfigNode node) { RSTLogWriter.Log("onGameStatePostLoad"); if (HighLogic.CurrentGame != null) { RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>(); ApplySettings(); foreach (KeyValuePair <CelestialBody, CelestialBodyInfo> CB in CelestialBodies) { CB.Value.ignore = CB.Value.IgnoreData.GetLevel(HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().difficulty); if (CB.Value.ignore) { CB.Value.isResearched = true; CB.Value.researchState = 100; } //else //{ // CB.Value.isResearched = false; // CB.Value.researchState = 0; //} } } else { RSTLogWriter.Log("Highlogic.CurrentGame is NULL cannot set Settings!!"); } }
public void Save(ConfigNode node) { ConfigNode settingsNode; if (node.HasNode(configNodeName)) { settingsNode = node.GetNode(configNodeName); settingsNode.ClearData(); } else { settingsNode = node.AddNode(configNodeName); } settingsNode.AddValue("Enabled", Enabled); settingsNode.AddValue("Difficulty", Difficulty); settingsNode.AddValue("ResearchCost", ResearchCost); settingsNode.AddValue("ProgressResearchCost", ProgressResearchCost); settingsNode.AddValue("ScienceReward", ScienceReward); settingsNode.AddValue("UseAppLauncher", UseAppLauncher); settingsNode.AddValue("DebugLogging", DebugLogging); settingsNode.AddValue("chances", chances); settingsNode.AddValue("enableInSandbox", enableInSandbox); settingsNode.AddValue("allowTSlevel1", allowTSlevel1); foreach (var entry in Database.instance.CelestialBodies) { ConfigNode CBNode = entry.Value.Save(settingsNode); RSTUtils.Utilities.Log_Debug("RBGameSettings Saving Entry = {0}", entry.Key.GetName()); //CBNode.AddValue("body", entry.Key.GetName()); } RSTLogWriter.Log("RBGameSettings Saving Complete"); }
public static void LaunchResearchPlan(CelestialBody cb) { if (Database.instance.CelestialBodies[cb].researchState == 0) { if (Funding.Instance != null) { if (Funding.Instance.Funds >= ResearchBodies.Instance.RBgameSettings.ResearchCost) { Funding.Instance.AddFunds(-ResearchBodies.Instance.RBgameSettings.ResearchCost, TransactionReasons.None); Research(cb, 10); } else { ScreenMessages.PostScreenMessage( string.Format(Locales.currentLocale.Values["launchPlan_notEnoughScience"], cb.GetName()), 3.0f, ScreenMessageStyle.UPPER_CENTER); } } else { if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER) { Research(cb, 10); } } } else { RSTLogWriter.Log(string.Format(Locales.currentLocale.Values["launchPlan_alreadyStarted"], cb.GetName())); } }
public static void LaunchResearchPlan(CelestialBody cb) { CelestialBody cbKey = Database.instance.ContainsBodiesKey(cb.bodyName); if (cbKey != null && Database.instance.CelestialBodies[cbKey].researchState == 0) { if (Funding.Instance != null) { //if (Funding.Instance.Funds >= Database.Instance.RB_SettingsParms.ResearchCost) if (Funding.Instance.Funds >= Database.instance.RB_SettingsParms.ResearchCost) { //Funding.Instance.AddFunds(-Database.Instance.RB_SettingsParms.ResearchCost, TransactionReasons.None); Funding.Instance.AddFunds(-Database.instance.RB_SettingsParms.ResearchCost, TransactionReasons.Progression); Research(cbKey, 10); } else { ScreenMessages.PostScreenMessage(Localizer.Format("#autoLOC_RBodies_00014", cbKey.displayName), 3.0f, ScreenMessageStyle.UPPER_CENTER); } } else { if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER) { Research(cbKey, 10); } } } else { RSTLogWriter.Log(Localizer.Format("#autoLOC_RBodies_00015", cb.displayName)); } }
public void Start() { ConfigNode[] cfgs = GameDatabase.Instance.GetConfigNodes("RESEARCHBODIES"); foreach (ConfigNode node in cfgs) { if (node.GetValue("loadAs") == "locale") { Locale l = new Locale(node); locales.Add(l); RSTLogWriter.Log("Added locale \"{0}\"", l.LocaleId); } } if (locales.Count == 0) { RSTLogWriter.Log("No locale added !"); } else { RSTLogWriter.Log("Added {0} locales", locales.Count); } RSTLogWriter.Flush(); Locales.setLocale(""); Available = true; }
public ResearchBodies() { RSTLogWriter.Log("ResearchBodies Constructor"); Instance = this; APIReady = false; RBgameSettings = new RBGameSettings(); //globalConfigFilename = Path.Combine(RSTLogWriter.AssemblyFolder, "PluginData/Config.cfg").Replace("\\", "/"); //RSTLogWriter.Log("globalConfigFilename = " + globalConfigFilename); }
/// <summary> /// Call this to signal that you have found a celestial body. /// It will set the celestial body to discovered. /// </summary> /// <param name="scienceReward">The scienceReward additional amount that is added to the base scienceReward for finding a body</param> /// <param name="bodyFound">The Celestial Body found</param> /// <param name="withParent">Will return true if the Parent Body has also been found</param> /// <param name="parentBody">The parent body that was discovered as well if withParent is true</param> /// <returns></returns> public static bool FoundBody(int scienceReward, CelestialBody bodyFound, out bool withParent, out CelestialBody parentBody) { withParent = false; parentBody = null; if (HighLogic.CurrentGame.Mode != Game.Modes.SANDBOX) //If not sandbox add the Science Points reward! { //var sciencePtsReward = scienceReward + Database.Instance.RB_SettingsParms.ScienceReward; var sciencePtsReward = scienceReward + Database.instance.RB_SettingsParms.ScienceReward; ResearchAndDevelopment.Instance.AddScience(sciencePtsReward, TransactionReasons.None); ScreenMessages.PostScreenMessage("Added " + sciencePtsReward + " science points !", 5f); } //Check if the referencebody is also not known. If so, we discover both the body and it's referencebody (parent). if (bodyFound.referenceBody != null && bodyFound != bodyFound.referenceBody && bodyFound.referenceBody.DiscoveryInfo.Level == DiscoveryLevels.Presence) { CelestialBody cbKey = Database.instance.ContainsBodiesKey(bodyFound.referenceBody.bodyName); if (cbKey != null) { Database.instance.CelestialBodies[cbKey].isResearched = true; } cbKey = Database.instance.ContainsBodiesKey(bodyFound.bodyName); if (cbKey != null) { Database.instance.CelestialBodies[cbKey].isResearched = true; var tempEntry = new KeyValuePair <CelestialBody, CelestialBodyInfo>(bodyFound, Database.instance.CelestialBodies[bodyFound]); setCBContractWeight(tempEntry, false); } withParent = true; parentBody = bodyFound.referenceBody; //check for Barycenter as well. if (bodyFound.referenceBody.referenceBody != null) { if ((bodyFound.referenceBody.referenceBody.DiscoveryInfo.Level == DiscoveryLevels.Appearance || bodyFound.referenceBody.referenceBody.DiscoveryInfo.Level == DiscoveryLevels.Presence) && Database.instance.CelestialBodies.ContainsKey(bodyFound.referenceBody.referenceBody)) { Database.instance.CelestialBodies[bodyFound.referenceBody.referenceBody].isResearched = true; var tempEntry = new KeyValuePair <CelestialBody, CelestialBodyInfo>(bodyFound.referenceBody.referenceBody, Database.instance.CelestialBodies[bodyFound.referenceBody.referenceBody]); setCBContractWeight(tempEntry, false); } } RSTLogWriter.Log("Found body {0} orbiting around {1} !", bodyFound.GetName(), bodyFound.referenceBody.GetName()); } else //No parent or parent is already discovered. So we just found this body. { CelestialBody cbKey = Database.instance.ContainsBodiesKey(bodyFound.bodyName); if (cbKey != null) { Database.instance.CelestialBodies[cbKey].isResearched = true; var tempEntry = new KeyValuePair <CelestialBody, CelestialBodyInfo>(cbKey, Database.instance.CelestialBodies[cbKey]); setCBContractWeight(tempEntry, false); } withParent = false; RSTLogWriter.Log("Found body {0} !", bodyFound.GetName()); } RSTLogWriter.Flush(); return(true); }
public void Awake() { if (instance != null) { RSTLogWriter.Log("Singleton instance of Databse already exists. Destroying this one"); Destroy(this); } instance = this; DontDestroyOnLoad(this); difficultyStrings = new string[] { Locales.currentLocale.Values["start_easy"], Locales.currentLocale.Values["start_normal"], Locales.currentLocale.Values["start_medium"], Locales.currentLocale.Values["start_hard"] }; }
public void OnGUI() { if (!enable) { instructor_Werner.Instructor.enabled = false; instructor_Linus.Instructor.enabled = false; return; } instructor_Werner.Instructor.enabled = true; instructor_Linus.Instructor.enabled = true; try { if (!Textures.StylesSet) { Textures.SetupStyles(); } } catch (Exception ex) { RSTLogWriter.Log("Unable to set GUI Styles to draw the GUI"); RSTLogWriter.Log("Exception: {0}", ex); } GUI.skin = Textures.ObsSkin; #if DEBUGFACILITY if (showObsdebugUI) { observRect = GUILayout.Window(_RBwindowId + 1, observRect, DrawObservDebug, "Research Bodies"); } #endif if (!showGUI) { return; } if (PSystemSetup.Instance.GetSpaceCenterFacility("TrackingStation").GetFacilityDamage() > 0) { ScreenMessages.PostScreenMessage(Locales.FmtLocaleString("#autoLOC_RBodies_00018"), 3.0f, ScreenMessageStyle.UPPER_CENTER); return; } try { windowRect.ClampInsideScreen(); windowRect = GUILayout.Window(_RBwindowId, windowRect, DrawWindow, "Research Bodies"); Utilities.DrawToolTip(); } catch (Exception ex) { RSTLogWriter.Log("Unable to draw GUI"); RSTLogWriter.Log("Exception: {0}", ex); } }
private void TryWithDrawContract(Contract c) { try { RSTLogWriter.Log("WithDrew contract \"{0}\"", c.Title); c.Withdraw(); //Changed to Withdraw - this will not penalize reputation. } catch (Exception e) { RSTLogWriter.Log("Unable to Withraw contract ! {0}", e); } }
public ResearchBodies() { RSTLogWriter.Log("ResearchBodies Constructor"); if (Instance != null) { RSTLogWriter.Log("Instance exists, destroying Usurper"); Destroy(this); } Instance = this; APIReady = false; RBgameSettings = new RBGameSettings(); }
protected void OnDestroy() { RSTLogWriter.Log("OnDestroy"); Instance = null; APIReady = false; foreach (Component child in children) { RSTLogWriter.Log("ResearchBodies Child Destroy for " + child.name); Destroy(child); } children.Clear(); GameEvents.onGameSceneLoadRequested.Remove(OnGameSceneLoadRequested); }
public void Awake() { RSTLogWriter.Log("Awake"); if (instance != null) { RSTLogWriter.Log("Singleton instance of Database already exists. Destroying this one"); Destroy(this); } instance = this; DontDestroyOnLoad(this); GameEvents.onGameStatePostLoad.Add(onGameStatePostLoad); GameEvents.OnGameSettingsApplied.Add(ApplySettings); //GameEvents.onGameStateLoad.Add(ApplySettings); }
public void Awake() { RSTLogWriter.Log("Awake"); if (instance != null) { RSTLogWriter.Log("Singleton instance of Database already exists. Destroying this one"); Destroy(this); } instance = this; DontDestroyOnLoad(this); GameEvents.onGameStatePostLoad.Add(onGameStatePostLoad); GameEvents.OnGameSettingsApplied.Add(ApplySettings); //GameEvents.onGameStateLoad.Add(ApplySettings); BodyList = new List <CelestialBody>(); VesselsInSOI = new Dictionary <string, CBVesselSOIInfo>(); }
internal static void LoadIconAssets() { try { LoadImageFromFile(ref ApplauncherIcon, "RBAppLaunchericon.png", PathIconsPath); LoadImageFromFile(ref ToolbarIcon, "RBToolBaricon.png", PathIconsPath); LoadImageFromFile(ref TooltipBox, "RBToolTipBox.png", PathIconsPath); LoadImageFromFile(ref BtnRedCross, "RBbtnRedCross.png", PathIconsPath); LoadImageFromFile(ref BtnResize, "RBbtnResize.png", PathIconsPath); LoadImageFromFile(ref BtnResizeHeight, "RBbtnResizeHeight.png", PathIconsPath); LoadImageFromFile(ref BtnResizeWidth, "RBbtnResizeWidth.png", PathIconsPath); } catch (Exception) { RSTLogWriter.Log("ResearchBodies Failed to Load Textures - are you missing a file?"); } }
internal static void LoadIconAssets() { try { LoadImageFromFile(ref TooltipBox, "RBToolTipBox.png", PathIconsPath); LoadImageFromFile(ref ObsWinBgnd, "RBObservBackGround.png", PathIconsPath); LoadImageFromFile(ref BtnRedCross, "RBbtnRedCross.png", PathIconsPath); LoadImageFromFile(ref BtnResize, "RBbtnResize.png", PathIconsPath); LoadImageFromFile(ref BtnResizeHeight, "RBbtnResizeHeight.png", PathIconsPath); LoadImageFromFile(ref BtnResizeWidth, "RBbtnResizeWidth.png", PathIconsPath); LoadImageFromFile(ref SpriteObservatory, "SpriteObservPicker.png", PathIconsPath); } catch (Exception) { RSTLogWriter.Log("ResearchBodies Failed to Load Textures - are you missing a file?"); } }
public static void StopResearchPlan(CelestialBody cb) { if (Database.instance.CelestialBodies[cb].researchState >= 10) { if (Funding.Instance != null) { Funding.Instance.AddFunds(ResearchBodies.Instance.RBgameSettings.ResearchCost, TransactionReasons.None); } Database.instance.CelestialBodies[cb].researchState = 0; KeyValuePair <CelestialBody, CelestialBodyInfo> cbd = new KeyValuePair <CelestialBody, CelestialBodyInfo>(cb, Database.instance.CelestialBodies[cb]); ResearchBodiesController.instance.SetIndividualBodyDiscoveryLevel(cbd); } else { RSTLogWriter.Log(string.Format(Locales.currentLocale.Values["stopPlan_hasntBeenStarted"], cb.GetName())); } }
public static void StopResearchPlan(CelestialBody cb) { CelestialBody cbKey = Database.instance.ContainsBodiesKey(cb.bodyName); if (cbKey != null && Database.instance.CelestialBodies[cbKey].researchState >= 10) { if (Funding.Instance != null) { Funding.Instance.AddFunds(Database.instance.RB_SettingsParms.ResearchCost, TransactionReasons.Progression); } Database.instance.CelestialBodies[cbKey].researchState = 0; KeyValuePair <CelestialBody, CelestialBodyInfo> cbd = new KeyValuePair <CelestialBody, CelestialBodyInfo>(cbKey, Database.instance.CelestialBodies[cbKey]); ResearchBodiesController.instance.SetIndividualBodyDiscoveryLevel(cbd); } else { RSTLogWriter.Log(Localizer.Format("#autoLOC_RBodies_00016", cb.displayName)); } }
public void ApplySettings() { RSTLogWriter.Log("Database ApplySettings"); if (HighLogic.CurrentGame != null) { //if (RB_SettingsParms == null) RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>(); if (ResearchBodies.Instance != null) { ResearchBodies.Enabled = RB_SettingsParms.RBEnabled; } chances = RB_SettingsParms.DiscoverySeed; allowTSlevel1 = RB_SettingsParms.Enabledtslvl1; RSTLogWriter.debuggingOn = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().DebugLogging; } else { RSTLogWriter.Log("Database Failed to apply settings - Fatal Error"); } }
public override void OnSave(ConfigNode gameNode) { //APIReady = false; base.OnSave(gameNode); RBgameSettings.Save(gameNode); //foreach (Savable s in children.Where(c => c is Savable)) //{ // s.Save(globalNode); //} //globalNode.Save(globalConfigFilename); if (RSTLogWriter.debuggingOn) { RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnSave: \n"); } // RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnSave: \n" + gameNode + "\n" + globalNode); else { RSTLogWriter.Log("ResearchBodies Scenario OnSave completed."); } }
public override void OnLoad(ConfigNode gameNode) { Database.instance.ResetBodiesforLoad(); base.OnLoad(gameNode); RBgameSettings.Load(gameNode); if (Database.instance.RB_SettingsParms != null) { RSTLogWriter.debuggingOn = Database.instance.RB_SettingsParms.DebugLogging; } APIReady = true; if (RSTLogWriter.debuggingOn) { RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnLoad: \n "); } // RSTLogWriter.Log_Debug("Scenario: " + HighLogic.LoadedScene + " OnLoad: \n " + gameNode + "\n" + globalNode); else { RSTLogWriter.Log("ResearchBodies Scenario Onload Completed."); } RSTLogWriter.Flush(); }
public override bool RequirementMet(ConfiguredContract contract) { if (contract == null) { return(false); } if (contract.ContractState == Contract.State.Active) { return(true); } for (int i = 0; i < PSystemSetup.Instance.SpaceCenterFacilities.Length; i++) { if (PSystemSetup.Instance.SpaceCenterFacilities[i].name == facility) { int level = Mathf.RoundToInt(ScenarioUpgradeableFacilities.GetFacilityLevel(facility) + 1); return(level >= minLevel); } } RSTLogWriter.Log("Observatory NOT found...."); return(false); }
public void Save(ConfigNode node) { ConfigNode settingsNode; if (node.HasNode(configNodeName)) { settingsNode = node.GetNode(configNodeName); settingsNode.ClearData(); } else { settingsNode = node.AddNode(configNodeName); } node.AddValue("lastTimeCheckedSOIs", lastTimeCheckedSOIs); foreach (var entry in Database.instance.CelestialBodies) { ConfigNode CBNode = entry.Value.Save(settingsNode); Utilities.Log_Debug("RBGameSettings Saving Entry = {0}", entry.Key.bodyName); } if (Database.instance.VesselsInSOI.Count > 0) { ConfigNode cbSOINode = settingsNode.AddNode("VESSELSINSOI"); var dictEnum = Database.instance.VesselsInSOI.GetEnumerator(); while (dictEnum.MoveNext()) { var entry = dictEnum.Current; ConfigNode vesselSOINode = entry.Value.Save(cbSOINode); Utilities.Log_Debug("RBGameSettings Saving Vessel in SOI Entry = {0}", entry.Key); } dictEnum.Dispose(); } RSTLogWriter.Log("RBGameSettings Saving Complete"); RSTLogWriter.Flush(); }
public void Save(ConfigNode node) { ConfigNode settingsNode; if (node.HasNode(configNodeName)) { settingsNode = node.GetNode(configNodeName); settingsNode.ClearData(); } else { settingsNode = node.AddNode(configNodeName); } foreach (var entry in Database.instance.CelestialBodies) { ConfigNode CBNode = entry.Value.Save(settingsNode); Utilities.Log_Debug("RBGameSettings Saving Entry = {0}", entry.Key.bodyName); } RSTLogWriter.Log("RBGameSettings Saving Complete"); RSTLogWriter.Flush(); }
public static Boolean LoadImageFromFile(ref Texture2D tex, String fileName, String folderPath = "") { Boolean blnReturn = false; try { if (folderPath == "") { folderPath = PathIconsPath; } //File Exists check if (System.IO.File.Exists(String.Format("{0}/{1}", folderPath, fileName))) { try { tex.LoadImage(System.IO.File.ReadAllBytes(String.Format("{0}/{1}", folderPath, fileName))); blnReturn = true; } catch (Exception ex) { RSTLogWriter.Log("ResearchBodies Failed to load the texture:" + folderPath + "(" + fileName + ")"); RSTLogWriter.Log(ex.Message); } } else { RSTLogWriter.Log("ResearchBodies Cannot find texture to load:" + folderPath + "(" + fileName + ")"); } } catch (Exception ex) { RSTLogWriter.Log("ResearchBodies Failed to load (are you missing a file):" + folderPath + "(" + fileName + ")"); RSTLogWriter.Log(ex.Message); } return(blnReturn); }
public void OnGUI() { if (HighLogic.LoadedSceneIsFlight && !sceneChangeRequested) { if (showGUI && ResearchBodies.Enabled) { try { if (!Textures.StylesSet) { Textures.SetupStyles(); } } catch (Exception ex) { RSTLogWriter.Log("Unable to set GUI Styles to draw the GUI"); RSTLogWriter.Log("Exception: {0}", ex); } GUI.skin = HighLogic.Skin; windowRect.ClampToScreen(); windowRect = GUILayout.Window(_partwindowID, windowRect, DrawWindow, Localizer.Format("#autoLOC_RBodies_00026")); } } }