public void Notify_SwitchedMap()
        {
            designatorManager.Deselect();
            reverseDesignatorDatabase.Reinit();
            selector.ClearSelection();
            selector.dragBox.active = false;
            targeter.StopTargeting();
            MainButtonDef        openTab = Find.MainTabsRoot.OpenTab;
            List <MainButtonDef> allDefsListForReading = DefDatabase <MainButtonDef> .AllDefsListForReading;

            for (int i = 0; i < allDefsListForReading.Count; i++)
            {
                allDefsListForReading[i].Notify_SwitchedMap();
            }
            if (openTab != null && openTab != MainButtonDefOf.Inspect)
            {
                Find.MainTabsRoot.SetCurrentTab(openTab, playSound: false);
            }
            if (Find.CurrentMap != null)
            {
                RememberedCameraPos rememberedCameraPos = Find.CurrentMap.rememberedCameraPos;
                Find.CameraDriver.SetRootPosAndSize(rememberedCameraPos.rootPos, rememberedCameraPos.rootSize);
            }
        }
 public void ClearPosition()
 {
     savedPosition = null;
 }
 public void SavePosition()
 {
     savedPosition          = new RememberedCameraPos(Find.CurrentMap);
     savedPosition.rootPos  = map.rememberedCameraPos.rootPos;
     savedPosition.rootSize = map.rememberedCameraPos.rootSize;
 }