public void WorldInterfaceUpdate() { if (WorldRendererUtility.WorldRenderedNow) { targeter.TargeterUpdate(); WorldSelectionDrawer.DrawSelectionOverlays(); Find.WorldDebugDrawer.WorldDebugDrawerUpdate(); } else { targeter.StopTargeting(); } routePlanner.WorldRoutePlannerUpdate(); }
public void WorldInterfaceOnGUI() { bool worldRenderedNow = WorldRendererUtility.WorldRenderedNow; Profiler.BeginSample("CheckOpenOrCloseInspectPane()"); this.CheckOpenOrCloseInspectPane(); Profiler.EndSample(); if (worldRenderedNow) { ScreenshotModeHandler screenshotMode = Find.UIRoot.screenshotMode; Profiler.BeginSample("ExpandableWorldObjectsOnGUI()"); ExpandableWorldObjectsUtility.ExpandableWorldObjectsOnGUI(); Profiler.EndSample(); Profiler.BeginSample("WorldSelectionDrawer.SelectionOverlaysOnGUI()"); WorldSelectionDrawer.SelectionOverlaysOnGUI(); Profiler.EndSample(); Profiler.BeginSample("WorldRoutePlannerOnGUI()"); this.routePlanner.WorldRoutePlannerOnGUI(); Profiler.EndSample(); if (!screenshotMode.FiltersCurrentEvent && Current.ProgramState == ProgramState.Playing) { Profiler.BeginSample("ColonistBarOnGUI()"); Find.ColonistBar.ColonistBarOnGUI(); Profiler.EndSample(); } Profiler.BeginSample("selector.dragBox.DragBoxOnGUI()"); this.selector.dragBox.DragBoxOnGUI(); Profiler.EndSample(); Profiler.BeginSample("TargeterOnGUI()"); this.targeter.TargeterOnGUI(); Profiler.EndSample(); if (!screenshotMode.FiltersCurrentEvent) { Profiler.BeginSample("globalControls.WorldGlobalControlsOnGUI()"); this.globalControls.WorldGlobalControlsOnGUI(); Profiler.EndSample(); } Profiler.BeginSample("WorldDebugDrawerOnGUI()"); Find.WorldDebugDrawer.WorldDebugDrawerOnGUI(); Profiler.EndSample(); } }
public static void ClearAllMapsAndWorld() { if (Current.Game != null && Current.Game.Maps != null) { List <Map> maps = Find.Maps; FieldInfo[] fields = typeof(Map).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); for (int i = 0; i < fields.Length; i++) { if (fields[i].FieldType.IsClass) { for (int j = 0; j < maps.Count; j++) { fields[i].SetValue(maps[j], null); } } } maps.Clear(); Current.Game.currentMapIndex = -1; } if (Find.World != null) { World world = Find.World; FieldInfo[] fields2 = typeof(World).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); for (int k = 0; k < fields2.Length; k++) { if (fields2[k].FieldType.IsClass) { fields2[k].SetValue(world, null); } } } BillUtility.Clipboard = null; RegionTraverser.RecreateWorkers(); SelectionDrawer.Clear(); WorldSelectionDrawer.Clear(); List <MainButtonDef> allDefsListForReading = DefDatabase <MainButtonDef> .AllDefsListForReading; for (int l = 0; l < allDefsListForReading.Count; l++) { allDefsListForReading[l].Notify_ClearingAllMapsMemory(); } }
public void WorldInterfaceUpdate() { bool worldRenderedNow = WorldRendererUtility.WorldRenderedNow; if (worldRenderedNow) { Profiler.BeginSample("TargeterUpdate()"); this.targeter.TargeterUpdate(); Profiler.EndSample(); Profiler.BeginSample("WorldSelectionDrawer.DrawSelectionOverlays()"); WorldSelectionDrawer.DrawSelectionOverlays(); Profiler.EndSample(); Profiler.BeginSample("WorldDebugDrawerUpdate()"); Find.WorldDebugDrawer.WorldDebugDrawerUpdate(); Profiler.EndSample(); } else { this.targeter.StopTargeting(); } Profiler.BeginSample("WorldRoutePlannerUpdate()"); this.routePlanner.WorldRoutePlannerUpdate(); Profiler.EndSample(); }
public static void ClearAllMapsAndWorld() { if (Current.Game != null && Current.Game.Maps != null) { List <Map> maps = Find.Maps; FieldInfo[] fields = typeof(Map).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); for (int i = 0; i < fields.Length; i++) { if (fields[i].FieldType.IsClass) { for (int j = 0; j < maps.Count; j++) { fields[i].SetValue(maps[j], null); } } } maps.Clear(); Current.Game.currentMapIndex = -1; } if (Find.World != null) { World world = Find.World; FieldInfo[] fields2 = typeof(World).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); for (int k = 0; k < fields2.Length; k++) { if (fields2[k].FieldType.IsClass) { fields2[k].SetValue(world, null); } } } BillUtility.Clipboard = null; RegionTraverser.RecreateWorkers(); SelectionDrawer.Clear(); WorldSelectionDrawer.Clear(); BreakRiskAlertUtility.Clear(); Region.ClearStaticData(); PawnsFinder.Clear(); List <MainButtonDef> allDefsListForReading = DefDatabase <MainButtonDef> .AllDefsListForReading; for (int l = 0; l < allDefsListForReading.Count; l++) { allDefsListForReading[l].Notify_ClearingAllMapsMemory(); } List <ThingDef> allDefsListForReading2 = DefDatabase <ThingDef> .AllDefsListForReading; for (int m = 0; m < allDefsListForReading2.Count; m++) { if (allDefsListForReading2[m].inspectorTabsResolved != null) { for (int n = 0; n < allDefsListForReading2[m].inspectorTabsResolved.Count; n++) { allDefsListForReading2[m].inspectorTabsResolved[n].Notify_ClearingAllMapsMemory(); } } } List <WorldObjectDef> allDefsListForReading3 = DefDatabase <WorldObjectDef> .AllDefsListForReading; for (int num = 0; num < allDefsListForReading3.Count; num++) { if (allDefsListForReading3[num].inspectorTabsResolved != null) { for (int num2 = 0; num2 < allDefsListForReading3[num].inspectorTabsResolved.Count; num2++) { allDefsListForReading3[num].inspectorTabsResolved[num2].Notify_ClearingAllMapsMemory(); } } } }