Exemplo n.º 1
0
 public void CompleteLoadProcess()
 {
     Ref.SceneType currentScene = Ref.currentScene;
     if (currentScene != Ref.SceneType.Build)
     {
         if (currentScene == Ref.SceneType.Game)
         {
             GameSaving.Quicksaves quicksaves = GameSaving.Quicksaves.LoadQuicksaves();
             if (this.selectedSaveId != -1 && this.selectedSaveId < quicksaves.QuicksavesCount)
             {
                 GameSaving.LoadGame(quicksaves.quicksaves[this.selectedSaveId]);
                 MsgController.ShowMsg("Game Loaded");
                 this.CloseMenus();
             }
         }
     }
     else
     {
         Build.BuildQuicksaves buildQuicksaves = Build.BuildQuicksaves.LoadBuildQuicksaves();
         if (this.selectedSaveId != -1 && this.selectedSaveId < buildQuicksaves.QuicksavesCount)
         {
             Build.main.LoadSave(buildQuicksaves.buildSaves[this.selectedSaveId]);
             this.CloseMenus();
         }
     }
 }
Exemplo n.º 2
0
    private void IniciateGameScene()
    {
        this.updatedPersistantTime = Time.time + 10f;
        CelestialBodyData planetByName = Ref.GetPlanetByName(this.startAdress);
        Double3           @double      = new Double3(-450.0, planetByName.radius + 30.0);

        Ref.map.InitializeMap();
        this.cheatEnabledText.text = ((!Ref.infiniteFuel) ? string.Empty : "\n Infinite Fuel: On") + ((!Ref.noDrag) ? string.Empty : "\n No Drag: On") + ((!Ref.unbreakableParts) ? string.Empty : "\n Unbreakable Parts: On") + ((!Ref.noGravity) ? string.Empty : "\n No Gravity: On");
        GameSaving.GameSave gameSave = GameSaving.GameSave.LoadPersistant();
        if (Ref.lastScene == Ref.SceneType.Build)
        {
            if (gameSave != null && gameSave.vessels.Count > 0)
            {
                gameSave.velocityOffset   = Double3.zero;
                gameSave.selectedVesselId = -1;
                GameSaving.LoadForLaunch(gameSave, @double);
                MonoBehaviour.print("There is a Persistant-Save, and a Rocket To Create");
            }
            else
            {
                MonoBehaviour.print("There is No Persistant-Save, created rocket into new scene empty scene");
                Ref.planetManager.SwitchLocation(planetByName, @double, false, true, 0.0);
                Ref.map.following = new OrbitLines.Target(planetByName);
                Ref.map.UpdateMapPosition(new Double3(0.0, @double.y / 10000.0));
                Ref.map.UpdateMapZoom(@double.y / 10000.0 / 20.0);
            }
            this.CreatePartsFromBuild(@double);
            Ref.mainVessel.SetThrottle(new Vessel.Throttle(false, 0.65f));
            Ref.mapView = false;
            Ref.controller.SetCameraDistance(23f);
        }
        else if (gameSave != null)
        {
            GameSaving.LoadGame(gameSave);
            MonoBehaviour.print("No rocket to create, loaded persistant");
        }
    }