Ejemplo n.º 1
0
    public void OnChangeControllerOption()
    {
        GreenHellGame.Instance.m_Settings.SaveSettings();
        GreenHellGame.Instance.m_Settings.ApplySettings(false);
        MainMenuManager mainMenuManager = MainMenuManager.Get();

        if (mainMenuManager != null)
        {
            mainMenuManager.SetupController();
        }
        MenuInGameManager menuInGameManager = MenuInGameManager.Get();

        if (menuInGameManager != null)
        {
            menuInGameManager.SetupController();
        }
        HUDManager hudmanager = HUDManager.Get();

        if (hudmanager != null)
        {
            hudmanager.SetuController();
        }
        if (MainMenuManager.Get())
        {
            if (GreenHellGame.IsPadControllerActive())
            {
                CursorManager.Get().ShowCursor(false, false);
                return;
            }
            if (GreenHellGame.IsPCControllerActive())
            {
                CursorManager.Get().ShowCursor(true, false);
            }
        }
    }
Ejemplo n.º 2
0
 public void OnYesFromDialog()
 {
     HUDDeath.YesNoQuestion yesNoQuestion = this.m_YesNoQuestion;
     if (yesNoQuestion != HUDDeath.YesNoQuestion.Quit)
     {
         if (yesNoQuestion != HUDDeath.YesNoQuestion.LoadGame)
         {
             if (yesNoQuestion == HUDDeath.YesNoQuestion.LoadLastSave)
             {
                 DeathController.Get().StartRespawn();
                 CursorManager.Get().SetCursor(CursorManager.TYPE.Normal);
             }
         }
         else
         {
             MenuInGameManager.Get().ShowScreen(typeof(MenuLoad));
         }
     }
     else
     {
         LoadingScreen.Get().Show(LoadingScreenState.ReturnToMainMenu);
         GreenHellGame.Instance.ReturnToMainMenu();
     }
     this.m_YesNoQuestion = HUDDeath.YesNoQuestion.None;
 }
Ejemplo n.º 3
0
 private void LateUpdate()
 {
     if (MenuInGameManager.Get().IsAnyScreenVisible() || !this.m_MainCamera.enabled)
     {
         return;
     }
     CameraManager.Mode mode = this.m_Mode;
     if (mode != CameraManager.Mode.Normal)
     {
         if (mode != CameraManager.Mode.Free)
         {
             if (mode == CameraManager.Mode.CutscenePlayer)
             {
                 this.UpdateCutscenePlayerMode();
             }
         }
         else
         {
             this.UpdateFreeMode();
         }
     }
     else
     {
         this.UpdateNormalMode();
     }
     if (Inventory3DManager.Get().gameObject.activeSelf)
     {
         Inventory3DManager.Get().CustomUpdate();
     }
     HUDManager.Get().UpdateAfterCamera();
 }
Ejemplo n.º 4
0
    public void StartSleeping(RestingPlace place = null, bool block_moves = true)
    {
        if (!Player.Get().CanSleep())
        {
            return;
        }
        this.m_RestingPlace = place;
        this.SetupSurroundingConstructions();
        if (block_moves)
        {
            this.m_Player.BlockMoves();
            this.m_Player.BlockRotation();
        }
        this.m_StartSleepingTime = Time.time;
        this.m_StartSleepHour    = this.m_Sky.Cycle.Hour;
        this.m_Progress          = 0f;
        this.m_PrevProgress      = 0f;
        this.m_HourProgress      = 0;
        HUDSleeping.Get().gameObject.SetActive(true);
        MenuInGameManager.Get().HideMenu();
        Item currentItem = this.m_Player.GetCurrentItem(Hand.Right);

        if (currentItem != null && currentItem.m_Info.IsHeavyObject())
        {
            this.m_Player.DropItem(currentItem);
        }
        Player.Get().StartController(PlayerControllerType.Sleep);
        PlayerAudioModule.Get().PlaySleepSound();
        GreenHellGame.Instance.SetSnapshot(AudioMixerSnapshotGame.Sleep, 0.5f);
        if (Inventory3DManager.Get().IsActive())
        {
            Inventory3DManager.Get().Deactivate();
        }
    }
Ejemplo n.º 5
0
 public void OnStory()
 {
     MainLevel.Instance.m_GameMode     = GameMode.Story;
     GreenHellGame.Instance.m_GameMode = GameMode.Story;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
 }
Ejemplo n.º 6
0
 public void OnNoFromDialog()
 {
     if (MenuInGameManager.Get() && this.m_PadConstrollerInfoPause)
     {
         MenuInGameManager.Get().HideMenu();
     }
     this.m_PadConstrollerInfoPause = false;
 }
Ejemplo n.º 7
0
 public void OnSurvival()
 {
     ScenarioManager.Get().m_SkipTutorial = true;
     MainLevel.Instance.m_GameMode     = GameMode.Survival;
     GreenHellGame.Instance.m_GameMode = GameMode.Survival;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
 }
Ejemplo n.º 8
0
 public void OnDream(string variable)
 {
     ScenarioManager.Get().m_SkipTutorial = true;
     MainLevel.Instance.m_GameMode     = GameMode.Story;
     GreenHellGame.Instance.m_GameMode = GameMode.Story;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
     ScenarioManager.Get().SetBoolVariable(variable, true);
 }
Ejemplo n.º 9
0
 public void OnChallenge(string name)
 {
     ChallengesManager.Get().m_ChallengeToActivate = name;
     ScenarioManager.Get().m_SkipTutorial          = true;
     MainLevel.Instance.m_GameMode     = GameMode.Survival;
     GreenHellGame.Instance.m_GameMode = GameMode.Survival;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
 }
Ejemplo n.º 10
0
 private void UpdateController()
 {
     if (this.m_BlockControllerUpdate)
     {
         return;
     }
     this.m_PadControllerConnected = false;
     string[] joystickNames = Input.GetJoystickNames();
     if (joystickNames.Length != 0)
     {
         int i = 0;
         while (i < joystickNames.Length)
         {
             if (!string.IsNullOrEmpty(joystickNames[i]))
             {
                 this.m_PadControllerConnected = true;
                 if (joystickNames[i].Contains("Wireless") && !joystickNames[i].Contains("Xbox"))
                 {
                     InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Ps4;
                     break;
                 }
                 InputsManager.Get().m_PadControllerType = InputsManager.PadControllerType.Xbox;
                 break;
             }
             else
             {
                 i++;
             }
         }
     }
     if (GreenHellGame.IsPadControllerActive() && !this.m_PadControllerConnected)
     {
         GreenHellGame.Instance.m_Settings.m_ControllerType = ControllerType.PC;
         this.OnChangeControllerOption();
     }
     if (this.m_PadControllerConnected && GreenHellGame.IsPCControllerActive() && !this.m_WasPadConstrollerInfo)
     {
         if (MainLevel.Instance && !MainLevel.Instance.IsPause())
         {
             MenuInGameManager.Get().ShowScreen(typeof(MenuInGame));
             this.m_PadConstrollerInfoPause = true;
         }
         this.m_WasPadConstrollerInfo = true;
         GreenHellGame.GetYesNoDialog().Show(this, DialogWindowType.YesNo, GreenHellGame.Instance.GetLocalization().Get("YesNoDialog_Info", true), GreenHellGame.Instance.GetLocalization().Get("ControllerDetected_Info", true), false);
     }
     if (this.m_WasPadConstrollerInfo && !this.m_PadControllerConnected)
     {
         this.m_WasPadConstrollerInfo = false;
         return;
     }
     if (this.m_PadControllerConnected && GreenHellGame.IsPadControllerActive())
     {
         this.m_WasPadConstrollerInfo = true;
     }
 }
Ejemplo n.º 11
0
 public void OnYesFromDialog()
 {
     if (MenuInGameManager.Get())
     {
         MenuInGameManager.Get().ShowScreen(typeof(MainMenuOptionsControls));
     }
     else if (MainMenuManager.Get())
     {
         MainMenuManager.Get().SetActiveScreen(typeof(MainMenuOptionsControls), true);
     }
     this.m_PadConstrollerInfoPause = false;
 }
    private void HideCursor()
    {
        CursorManager.Get().ShowCursor(false, false);
        this.m_CursorVisible = false;
        MenuInGameManager menuInGameManager = MenuInGameManager.Get();

        if (menuInGameManager == null)
        {
            return;
        }
        menuInGameManager.SetCursorVisible(false);
    }
Ejemplo n.º 13
0
    private void SetCanvasActive(bool active)
    {
        CanvasGroup canvasGroup = null;

        if (MenuInGameManager.Get())
        {
            canvasGroup = MenuInGameManager.Get().m_CanvasGroup;
        }
        else if (MenuInGameManager.Get())
        {
            canvasGroup = MainMenuManager.Get().m_CanvasGroup;
        }
        if (canvasGroup != null)
        {
            canvasGroup.blocksRaycasts = active;
        }
    }
Ejemplo n.º 14
0
 public void OnDebug()
 {
     Player.Get().UnlockMap();
     Player.Get().UnlockNotepad();
     Player.Get().UnlockWatch();
     ItemsManager.Get().UnlockAllItemsInNotepad();
     PlayerDiseasesModule.Get().UnlockAllDiseasesInNotepad();
     PlayerDiseasesModule.Get().UnlockAllDiseasesTratmentInNotepad();
     PlayerDiseasesModule.Get().UnlockAllSymptomsInNotepad();
     PlayerDiseasesModule.Get().UnlockAllSymptomTreatmentsInNotepad();
     PlayerInjuryModule.Get().UnlockAllInjuryState();
     PlayerInjuryModule.Get().UnlockAllInjuryStateTreatment();
     MainLevel.Instance.m_GameMode     = GameMode.Debug;
     GreenHellGame.Instance.m_GameMode = GameMode.None;
     MainLevel.Instance.Initialize();
     MenuInGameManager.Get().HideMenu();
     this.StartRainforestAmbienceMultisample();
 }
Ejemplo n.º 15
0
    public void OnButtonSpawn(bool load_scene)
    {
        string selectedElementText = this.m_List.GetSelectedElementText();

        if (selectedElementText.Length == 0)
        {
            return;
        }
        DebugSpawner[] array = UnityEngine.Object.FindObjectsOfType <DebugSpawner>();
        for (int i = 0; i < array.Length; i++)
        {
            if (array[i].gameObject.name == selectedElementText)
            {
                Player.Get().Reposition(array[i].gameObject.transform.position, null);
                MenuInGameManager.Get().ShowPrevoiusScreen();
                return;
            }
        }
    }
Ejemplo n.º 16
0
    public void OnYesFromDialog()
    {
        switch (this.m_YesNoQuestion)
        {
        case HUDDeath.YesNoQuestion.LoadGame:
            MenuInGameManager.Get().ShowScreen(typeof(LoadGameMenu));
            break;

        case HUDDeath.YesNoQuestion.LoadLastSave:
            DeathController.Get().StartRespawn();
            CursorManager.Get().SetCursor(CursorManager.TYPE.Normal);
            break;

        case HUDDeath.YesNoQuestion.Quit:
            LoadingScreen.Get().Show(LoadingScreenState.ReturnToMainMenu);
            GreenHellGame.Instance.ReturnToMainMenu();
            break;
        }
        this.m_YesNoQuestion = HUDDeath.YesNoQuestion.None;
    }
Ejemplo n.º 17
0
    private void LateUpdate()
    {
        if (MenuInGameManager.Get().IsAnyScreenVisible() || !this.m_MainCamera || !this.m_MainCamera.enabled)
        {
            return;
        }
        switch (this.m_Mode)
        {
        case CameraManager.Mode.Normal:
            this.UpdateNormalMode();
            break;

        case CameraManager.Mode.Free:
            this.UpdateFreeMode();
            break;

        case CameraManager.Mode.CutscenePlayer:
            this.UpdateCutscenePlayerMode();
            break;

        case CameraManager.Mode.Tpp:
            this.UpdateTppMode();
            break;
        }
        if (Inventory3DManager.Get().gameObject.activeSelf)
        {
            Inventory3DManager.Get().CustomUpdate();
        }
        HUDManager.Get().UpdateAfterCamera();
        if (this.m_OverrideFOV)
        {
            this.OverrideFOV();
        }
        if (this.m_AddRoll)
        {
            this.AddRoll();
        }
    }
Ejemplo n.º 18
0
 private void ShowModeMenu()
 {
     MenuInGameManager.Get().ShowScreen(typeof(MenuDebugSelectMode));
 }
Ejemplo n.º 19
0
 private void UpdateInputsDebug()
 {
     if (!GreenHellGame.DEBUG || MenuInGameManager.Get().IsAnyScreenVisible())
     {
         return;
     }
     if (Input.GetKeyDown(KeyCode.Numlock))
     {
         this.CycleTimeScaleSlowdown();
     }
     else if (Input.GetKeyDown(KeyCode.KeypadDivide))
     {
         this.CycleTimeScaleSpeedup();
     }
     else if (Input.GetKeyDown(KeyCode.KeypadPlus))
     {
         this.m_TODTime.AddHours(1f, true);
         ReflectionProbeUpdater[] array = UnityEngine.Object.FindObjectsOfType <ReflectionProbeUpdater>();
         for (int i = 0; i < array.Length; i++)
         {
             array[i].RenderProbe();
         }
     }
     else if (Input.GetKeyDown(KeyCode.KeypadMinus))
     {
         this.m_TODTime.AddHours(-1f, true);
         ReflectionProbeUpdater[] array2 = UnityEngine.Object.FindObjectsOfType <ReflectionProbeUpdater>();
         for (int j = 0; j < array2.Length; j++)
         {
             array2[j].RenderProbe();
         }
     }
     else if (Input.GetKeyDown(KeyCode.KeypadEnter))
     {
         this.m_TODTime.AddHours(10f, true);
         ReflectionProbeUpdater[] array3 = UnityEngine.Object.FindObjectsOfType <ReflectionProbeUpdater>();
         for (int k = 0; k < array3.Length; k++)
         {
             array3[k].RenderProbe();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Pause))
     {
         this.m_DebugPause = !this.m_DebugPause;
         CursorManager.Get().ShowCursor(this.m_DebugPause);
         this.Pause(this.m_DebugPause);
         if (this.m_DebugPause)
         {
             Player.Get().BlockMoves();
             Player.Get().BlockRotation();
         }
         else
         {
             Player.Get().UnblockMoves();
             Player.Get().UnblockRotation();
         }
     }
     else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.M))
     {
         Cheats.m_GodMode = !Cheats.m_GodMode;
     }
     else if (Input.GetKeyDown(KeyCode.KeypadPeriod))
     {
         this.m_TODTime.ProgressTime = !this.m_TODTime.ProgressTime;
     }
     else if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.BackQuote))
     {
         if (Input.GetKey(KeyCode.LeftShift))
         {
             Player.Get().TwentyFivePointsOfDamage();
         }
         else
         {
             Player.Get().Kill();
             Player.Get().UpdateDeath();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Equals))
     {
         if (Input.GetKey(KeyCode.LeftShift))
         {
             RainManager.Get().ToggleDebug();
         }
         else
         {
             RainManager.Get().ToggleRain();
         }
     }
     else if (Input.GetKeyDown(KeyCode.Semicolon))
     {
         this.PlayMovieWithFade("Tutorial_End");
     }
     else if (Input.GetKeyDown(KeyCode.Minus))
     {
         this.m_DebugShowCursor = !this.m_DebugShowCursor;
         CursorManager.Get().ShowCursor(this.m_DebugShowCursor);
         if (this.m_DebugShowCursor)
         {
             Vector2 zero = Vector2.zero;
             zero.Set((float)(Screen.width / 2), (float)(Screen.height / 2));
             CursorManager.Get().SetCursorPos(zero);
         }
     }
     else if (Input.GetKeyDown(KeyCode.U) && !Input.GetKey(KeyCode.LeftControl))
     {
         ParticleSystem[] array4 = Resources.FindObjectsOfTypeAll <ParticleSystem>();
         int num  = 0;
         int num2 = 0;
         for (int l = 0; l < array4.Length; l++)
         {
             bool activeInHierarchy = array4[l].gameObject.activeInHierarchy;
             Debug.Log("ParticleSystem " + array4[l].gameObject.name + ((!activeInHierarchy) ? " 0" : " 1"));
             if (activeInHierarchy)
             {
                 num++;
             }
             else
             {
                 num2++;
             }
         }
         Debug.Log("ParticleSystem num active " + num.ToString());
         Debug.Log("ParticleSystem num inactive " + num2.ToString());
     }
     else if (Input.GetKeyDown(KeyCode.LeftBracket) || Input.GetKeyDown(KeyCode.RightBracket))
     {
         if (this.m_CutscenePlayer == null)
         {
             GameObject original;
             if (Input.GetKeyDown(KeyCode.LeftBracket))
             {
                 original = (Resources.Load("Prefabs/TempPrefabs/CutscenePlayer/CutscenePlayer") as GameObject);
             }
             else
             {
                 original = (Resources.Load("Prefabs/TempPrefabs/CutscenePlayer/CutscenePlayer2") as GameObject);
             }
             this.m_CutscenePlayer = UnityEngine.Object.Instantiate <GameObject>(original);
             this.m_CutscenePlayer.transform.rotation = Player.Get().transform.rotation;
             this.m_CutscenePlayer.transform.position = Player.Get().transform.position;
             CameraManager.Get().SetTarget(this.m_CutscenePlayer.GetComponent <Being>());
             CameraManager.Get().SetMode(CameraManager.Mode.CutscenePlayer);
         }
         else
         {
             UnityEngine.Object.Destroy(this.m_CutscenePlayer);
             this.m_CutscenePlayer = null;
             CameraManager.Get().SetTarget(Player.Get());
             CameraManager.Get().SetMode(CameraManager.Mode.Normal);
         }
     }
     else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.F6))
     {
         Player.Get().StartController(PlayerControllerType.BodyInspectionMiniGame);
     }
     else if (Input.GetKeyDown(KeyCode.Keypad9))
     {
         SaveGame.Save();
     }
     if (Input.GetKey(KeyCode.LeftControl))
     {
         HUDCameraPosition.Get().m_Active = true;
     }
     else
     {
         HUDCameraPosition.Get().m_Active = false;
     }
 }
Ejemplo n.º 20
0
 private bool IsUnloadConvenient()
 {
     return((MenuInGameManager.Get() && MenuInGameManager.Get().IsAnyScreenVisible()) || (Inventory3DManager.Get() && Inventory3DManager.Get().IsActive()) || (CraftingManager.Get() && CraftingManager.Get().IsActive()) || (HUDWheel.Get() && HUDWheel.Get().enabled) || (Player.Get() && Player.Get().GetRotationBlocked()));
 }
Ejemplo n.º 21
0
 public override void OnExecute(TriggerAction.TYPE action)
 {
     MenuInGameManager.Get().ShowScreen(typeof(SaveGameMenu));
 }
Ejemplo n.º 22
0
 public void OnResume()
 {
     MenuInGameManager.Get().HideMenu();
 }
Ejemplo n.º 23
0
 public void OnLoadGame()
 {
     MenuInGameManager.Get().ShowScreen(typeof(MenuLoad));
 }