Exemplo n.º 1
0
        private static void Rehost()
        {
            LongEventHandler.QueueLongEvent(() =>
            {
                Find.GameInfo.permadeathMode = false;
                // todo handle the other faction def too
                Multiplayer.DummyFaction.def = FactionDefOf.Ancients;

                OnMainThread.StopMultiplayer();

                var doc = SaveLoad.SaveGame();
                MemoryUtility.ClearAllMapsAndWorld();

                Current.Game                     = new Game();
                Current.Game.InitData            = new GameInitData();
                Current.Game.InitData.gameToLoad = "play";

                LoadPatch.gameToLoad = doc;

                LongEventHandler.ExecuteWhenFinished(() =>
                {
                    HostWindow window = new HostWindow(null, true);
                    window.forcePause = true;
                    window.absorbInputAroundWindow = true;
                    Find.WindowStack.Add(window);
                });
            }, "Play", "MpConverting", true, null);
        }
        public override void DoWindowContents(Rect inRect)
        {
            base.DoWindowContents(inRect);

            var entry = new Rect(0f, 95f, 120f, 30f);

            if (Multiplayer.LocalServer != null)
            {
                TooltipHandler.TipRegion(entry, "MpFullSaveDesc".Translate());
                HostWindow.CheckboxLabeled(entry, "MpFullSave".Translate(), ref fullSave, placeTextNearCheckbox: true);
            }
        }