private void Start()
        {
            //setup system text
            if (CoreParams.IsDebug)
            {
                SystemText.text = CoreParams.GetShortSystemText();
            }
            else
            {
                SystemText.gameObject.SetActive(false);
            }

            //setup continue button
            if (CoreParams.AllowSaveLoad && SaveUtils.GetLastSave() != null)
            {
                ContinueButton.interactable = true;
                EventSystem.current.SetSelectedGameObject(ContinueButton.gameObject);
            }
            else
            {
                ContinueButton.interactable = false;
            }

            //call hooked scripts
            ScriptingModule.CallHooked(ScriptHook.AfterMainMenuCreate, this);
        }
Пример #2
0
        public void OnClickContinue()
        {
            var save = SaveUtils.GetLastSave();

            if (save != null)
            {
                SharedUtils.LoadGame(save, false);
            }
            else
            {
                Modal.PushMessageModal(Sub.Replace("ContinueNoSaveMessage", "IGUI_SAVE"), Sub.Replace("ContinueNoSaveHeading", "IGUI_SAVE"), null, null);
            }
        }
Пример #3
0
        public void HandleReloadButtonClicked()
        {
            string saveName = SaveUtils.GetLastSave();

            if (string.IsNullOrEmpty(saveName))
            {
                Modal.PushConfirmModal("There is no previous save to load", "Save Not Found", "Main Menu", "Close", null, (status, tag, result) => {
                    if (result)
                    {
                        SharedUtils.EndGame();
                    }
                });
            }
            else
            {
                SharedUtils.LoadGame(saveName, false);
            }
        }
Пример #4
0
        public override void Start()
        {
            base.Start();

            //execute hook
            ScriptingModule.CallHooked(ScriptHook.OnGameOver, this);

            //set buttons
            if (ReturnButton != null)
            {
                ReturnButton.gameObject.SetActive(ShowReturnButton);
            }
            if (ReloadButton != null)
            {
                if (ShowReloadButton)
                {
                    ReloadButton.gameObject.SetActive(true);
                    if (!string.IsNullOrEmpty(SaveUtils.GetLastSave()))
                    {
                        ReloadButton.interactable = true;
                    }
                    else
                    {
                        ReloadButton.interactable = false;
                    }
                }
                else
                {
                    ReloadButton.gameObject.SetActive(false);
                }
            }

            //set music
            if (!string.IsNullOrEmpty(Music))
            {
                AudioPlayer.Instance.SetMusic(Music, MusicSlot.Ambient, MusicVolume, LoopMusic, false);
                AudioPlayer.Instance.StartMusic(MusicSlot.Ambient);
            }

            //set background
            SetBackground();
        }
 public void OnClickContinue()
 {
     SharedUtils.LoadGame(SaveUtils.GetLastSave(), false);
 }