diff --git a/src/Visual novel/Assets/Project Files/Scripts/Infrastructure/ScenesManagers/Meta/Meta.cs b/src/Visual novel/Assets/Project Files/Scripts/Infrastructure/ScenesManagers/Meta/Meta.cs index 946ce2c..ebcbc1e 100644 --- a/src/Visual novel/Assets/Project Files/Scripts/Infrastructure/ScenesManagers/Meta/Meta.cs +++ b/src/Visual novel/Assets/Project Files/Scripts/Infrastructure/ScenesManagers/Meta/Meta.cs @@ -39,6 +39,10 @@ private void Start() _uiFactoryInfo.MainMenuUI.Buttons.OnStartNewGameButtonClicked = StartNewGame; _uiFactoryInfo.MainMenuUI.Buttons.OnContinueGameButtonClicked = ContinueGame; + var gameData = _saveLoadData.GetData(); + _uiFactoryInfo.MainMenuUI.Buttons.SetContinueGameButtonInteractable( + !string.IsNullOrEmpty(gameData.currentDialogue)); + _sounds.SetClip(ResourcesPath.SOUND_MAIN_MENU, true); _loadSceneAsync = SceneManager.LoadSceneAsync("3.Core"); @@ -85,11 +89,11 @@ private void LoadDataGame() ui.OnButtonClicked = () => { gameData.currentDialogue = data.idLastDialogue; - + _uiFactoryInfo.SaveLoadUI.SetActivePanel(false); - + _menu.ClosedMenu(); - + _loadSceneAsync.allowSceneActivation = true; }; } diff --git a/src/Visual novel/Assets/Project Files/Scripts/UI/MainMenu/ButtonsUI.cs b/src/Visual novel/Assets/Project Files/Scripts/UI/MainMenu/ButtonsUI.cs index a8b559c..793c2fe 100644 --- a/src/Visual novel/Assets/Project Files/Scripts/UI/MainMenu/ButtonsUI.cs +++ b/src/Visual novel/Assets/Project Files/Scripts/UI/MainMenu/ButtonsUI.cs @@ -40,6 +40,11 @@ private void Awake() #endif } + public void SetContinueGameButtonInteractable(bool value) + { + _continueGameButton.interactable = value; + } + public void SetLoadGameButton(string text) { _loadGameButtonText.text = text;