diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index f838b59..78a206a 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -174,3 +174,6 @@ AmbientLPFParameter= bFMODAudioLinkEnabled=False Platforms=() +[/Script/Engine.AudioSettings] +DefaultBaseSoundMix=/Game/Audio/SM_Mixer.SM_Mixer + diff --git a/Content/Audio/Classes/SC_Master.uasset b/Content/Audio/Classes/SC_Master.uasset index fff913c..b3ddf55 100644 --- a/Content/Audio/Classes/SC_Master.uasset +++ b/Content/Audio/Classes/SC_Master.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3226bfe341f00c0746e63ba4f9d8c9bd366a5fbe48130db6bec43ddf7daa6955 -size 1613 +oid sha256:dde87583e8508f8246fce9608252dfa9a2fe5e601e0af7979b5fd0cdf9747ff4 +size 1913 diff --git a/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset b/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset index 91bd2fd..01a4af7 100644 --- a/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset +++ b/Content/Audio/Music/Level2/Minigames/SW_Minigame_RythmClick.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:137cd84114e2f87760b93055722cfe7235935c4a1612acd7ad52b7f819d47161 -size 7428527 +oid sha256:1bd6ee30f0355d0921fc0d75acbd09c95844ceb3e951b7e9d69a1bbc0f1c09bb +size 7428784 diff --git a/Content/Blueprints/Characters/BP_Player.uasset b/Content/Blueprints/Characters/BP_Player.uasset index 7625f59..df20519 100644 --- a/Content/Blueprints/Characters/BP_Player.uasset +++ b/Content/Blueprints/Characters/BP_Player.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a3160dfba8faf5a705405ff599a3d676e1bf49a1703f5749ed3c05a9e557b03c -size 481098 +oid sha256:dbb801ad73a6c2185db8942117e3b658a1f4f932d5f5f6da2b6b967a7585bf42 +size 490439 diff --git a/Content/Input/Actions/IA_OpenMenu.uasset b/Content/Input/Actions/IA_OpenMenu.uasset new file mode 100644 index 0000000..c15951f --- /dev/null +++ b/Content/Input/Actions/IA_OpenMenu.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e62ddef659249dac3bf1d141fd928687f741c357a867236ad0c2527e2546a306 +size 1756 diff --git a/Content/Input/IMC_Player.uasset b/Content/Input/IMC_Player.uasset index 7982723..a7a917f 100644 Binary files a/Content/Input/IMC_Player.uasset and b/Content/Input/IMC_Player.uasset differ diff --git a/Content/Levels/Level_1/Blueprints/BP_Level1Restart.uasset b/Content/Levels/Level_1/Blueprints/BP_Level1Restart.uasset index aeb62e3..0ee8c48 100644 Binary files a/Content/Levels/Level_1/Blueprints/BP_Level1Restart.uasset and b/Content/Levels/Level_1/Blueprints/BP_Level1Restart.uasset differ diff --git a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset index 5e121e6..a49681f 100644 Binary files a/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset and b/Content/Levels/Level_2/Blueprints/Minigames/RythmClick/UI/UI_Minigame_RythmClick_Canvas.uasset differ diff --git a/Content/Levels/Test/L_Test.umap b/Content/Levels/Test/L_Test.umap index 05e54fe..c102713 100644 --- a/Content/Levels/Test/L_Test.umap +++ b/Content/Levels/Test/L_Test.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3b6e8de6ac552ef9f76a4e6db04e044332de5959c0faeeb2a02e14264357283c +oid sha256:94e0ccda50b0109428a8364a0e201c8853ceda986185538fe2b3a44070717b99 size 2080437 diff --git a/Content/UI/BP_MainWidgetManager.uasset b/Content/UI/BP_MainWidgetManager.uasset index f592027..47d2a79 100644 Binary files a/Content/UI/BP_MainWidgetManager.uasset and b/Content/UI/BP_MainWidgetManager.uasset differ diff --git a/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset b/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset new file mode 100644 index 0000000..9ea5535 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:021461e6258a4618df85be661630be0dbc2b58e6abc28249aadc9ad668f82f2e +size 4406 diff --git a/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset b/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset new file mode 100644 index 0000000..5209d78 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:589258928e79bd65e1644c77670e24475b6e86269354c59d589af39d239736dd +size 2924 diff --git a/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset b/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset new file mode 100644 index 0000000..01d5f4a --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e2fc299854db5b21bb075818fa236ed02bdd8e0792706e4c0d213befa9a4036 +size 3551 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset new file mode 100644 index 0000000..4bf486e --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f318670de51ba318ca39b287f167d8b18c6d4bb6a0e09dc3ebe8e03c8ceb6481 +size 175855 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset new file mode 100644 index 0000000..8a8d883 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72746790a5d60702c242f1c3c3bf4808acf13253e46fae41ba541e018a927d63 +size 1056291 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset new file mode 100644 index 0000000..3510003 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:647b375075ad14af64932e5ef664da6e22b0a375c7867811f5f1c436f24808cc +size 62215 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset new file mode 100644 index 0000000..d7f116d --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e247836e085546324e4f68c3a5070b4d37992b60082ef5a525160e79ca9ea5f +size 95551 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset new file mode 100644 index 0000000..d8761b0 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:320802b0e498502805839fc87e239f5202054caf20946d925fcaf8117e1050a3 +size 1253928 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset new file mode 100644 index 0000000..d4214c8 --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa65c0fadfc7e8e5f7fb35aeeb1c7a093747ecb597f0edf10669a77bd1aca5b6 +size 395580 diff --git a/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset new file mode 100644 index 0000000..90fd38a --- /dev/null +++ b/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84710e5172a63da48574753562872e355c81272db56a3835a14803117c72cc48 +size 500294 diff --git a/Content/UI/Blueprints/UI_Fade.uasset b/Content/UI/Blueprints/UI_Fade.uasset new file mode 100644 index 0000000..218909c --- /dev/null +++ b/Content/UI/Blueprints/UI_Fade.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69b52df11b694f30bcf16b00a908ba45067d20a914c558a6e3070c6ba83847a6 +size 82081 diff --git a/Content/UI/Blueprints/UI_Journal.uasset b/Content/UI/Blueprints/UI_Journal.uasset index 98adeef..2aa8060 100644 Binary files a/Content/UI/Blueprints/UI_Journal.uasset and b/Content/UI/Blueprints/UI_Journal.uasset differ diff --git a/Content/UI/Blueprints/UI_Loading.uasset b/Content/UI/Blueprints/UI_Loading.uasset new file mode 100644 index 0000000..3ee67bf --- /dev/null +++ b/Content/UI/Blueprints/UI_Loading.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8c568f2ffffdbfd9b57e4c0214a77249acdbb587dfbd65d145d7b04281ecfca +size 65331 diff --git a/Content/UI/Components/Classes/UICC_Journal_Text.uasset b/Content/UI/Components/Classes/UICC_Journal_Text.uasset new file mode 100644 index 0000000..aa2a735 --- /dev/null +++ b/Content/UI/Components/Classes/UICC_Journal_Text.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f32864c6574481aeb9afb282df99dfb520774dfd87b2037bdd587db6081d227 +size 5648 diff --git a/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset new file mode 100644 index 0000000..175d3e9 --- /dev/null +++ b/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd2cb854bac32344c95a52bb2dbd96d1d71fb6c413c16b6e7bbeb3356bc813df +size 6659 diff --git a/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset b/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset new file mode 100644 index 0000000..21c35b9 --- /dev/null +++ b/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c18c5f3da0b42351af74d92bcd84e799b69039887f1a3e24bdbb9f8a8136329e +size 7247 diff --git a/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset b/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset new file mode 100644 index 0000000..5a2495d --- /dev/null +++ b/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7db291a28abb65d5b7fa53ac78c8cfa3cc1581a15704e0380b2a91f63bf4b6d7 +size 7395 diff --git a/Content/UI/Components/Classes/UICC_Slider.uasset b/Content/UI/Components/Classes/UICC_Slider.uasset new file mode 100644 index 0000000..18c3274 --- /dev/null +++ b/Content/UI/Components/Classes/UICC_Slider.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83577255a900af0fbdf3e0f67c3b1c62143b49d2236c80ec11f003c247af16e1 +size 6661 diff --git a/Content/UI/Components/UIC_JournalText.uasset b/Content/UI/Components/UIC_JournalText.uasset deleted file mode 100644 index 1516e62..0000000 Binary files a/Content/UI/Components/UIC_JournalText.uasset and /dev/null differ diff --git a/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset b/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset new file mode 100644 index 0000000..1010417 --- /dev/null +++ b/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efda0003854618cfa6670b36c03e1d23a00ff2c84f347b09917eeef868f73f50 +size 351135 diff --git a/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset b/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset new file mode 100644 index 0000000..adf1bab --- /dev/null +++ b/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4594941e75fed32cd4b50ea3df580518136aed7224163637be11deb5f61bf01a +size 38361 diff --git a/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset b/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset new file mode 100644 index 0000000..7b46733 --- /dev/null +++ b/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c1c95a5b3a08982a831a6705de104386432f70cf164cc7096dea665d56cfb95 +size 54259 diff --git a/Content/UI/Components/UIC_MainMenu_PageButton.uasset b/Content/UI/Components/UIC_MainMenu_PageButton.uasset new file mode 100644 index 0000000..6df4ce8 --- /dev/null +++ b/Content/UI/Components/UIC_MainMenu_PageButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ff3faaff96829b922419fb17de6065554c5526bfd57a650e75bf58a82ce96ab +size 358569 diff --git a/Content/UI/Components/UIC_MainMenu_Title.uasset b/Content/UI/Components/UIC_MainMenu_Title.uasset new file mode 100644 index 0000000..013f601 --- /dev/null +++ b/Content/UI/Components/UIC_MainMenu_Title.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7db1ca05958c37166cb7ece4ea2a7a2b6b8eb4445f055e4b3a00b5ea20c5d09 +size 448427 diff --git a/Content/UI/Components/UIC_OptionKeyselector.uasset b/Content/UI/Components/UIC_OptionKeyselector.uasset new file mode 100644 index 0000000..26be477 --- /dev/null +++ b/Content/UI/Components/UIC_OptionKeyselector.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73ae75a220cdff45b4f7d8661cac09edee64a996f4702774e716ff6676780d64 +size 173879 diff --git a/Content/UI/Components/UIC_Slider.uasset b/Content/UI/Components/UIC_Slider.uasset new file mode 100644 index 0000000..38918f0 --- /dev/null +++ b/Content/UI/Components/UIC_Slider.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5932ca564d4f73b9e5c0b3e22a096cf0ce974808343bbb40ced10fe79414de99 +size 86177 diff --git a/Content/UI/Materials/MM_IconBackpack.uasset b/Content/UI/Materials/MM_IconBackpack.uasset deleted file mode 100644 index 513832b..0000000 Binary files a/Content/UI/Materials/MM_IconBackpack.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconBook.uasset b/Content/UI/Materials/MM_IconBook.uasset deleted file mode 100644 index 2bf6275..0000000 Binary files a/Content/UI/Materials/MM_IconBook.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconCamera.uasset b/Content/UI/Materials/MM_IconCamera.uasset deleted file mode 100644 index 85af3f2..0000000 Binary files a/Content/UI/Materials/MM_IconCamera.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconHearth.uasset b/Content/UI/Materials/MM_IconHearth.uasset deleted file mode 100644 index 77aa131..0000000 Binary files a/Content/UI/Materials/MM_IconHearth.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconKnife.uasset b/Content/UI/Materials/MM_IconKnife.uasset deleted file mode 100644 index 7b50dff..0000000 Binary files a/Content/UI/Materials/MM_IconKnife.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconMovement.uasset b/Content/UI/Materials/MM_IconMovement.uasset deleted file mode 100644 index 40beb03..0000000 Binary files a/Content/UI/Materials/MM_IconMovement.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconPlus.uasset b/Content/UI/Materials/MM_IconPlus.uasset deleted file mode 100644 index 8ea60b7..0000000 Binary files a/Content/UI/Materials/MM_IconPlus.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconPoint.uasset b/Content/UI/Materials/MM_IconPoint.uasset deleted file mode 100644 index 187a33c..0000000 Binary files a/Content/UI/Materials/MM_IconPoint.uasset and /dev/null differ diff --git a/Content/UI/Materials/MM_IconSave.uasset b/Content/UI/Materials/MM_IconSave.uasset deleted file mode 100644 index e83e6d4..0000000 Binary files a/Content/UI/Materials/MM_IconSave.uasset and /dev/null differ diff --git a/Content/UI/Textures/T_Merge.uasset b/Content/UI/Textures/T_Merge.uasset deleted file mode 100644 index 5361636..0000000 --- a/Content/UI/Textures/T_Merge.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9988117d9a2b5dba910a8a917846e7f2b04f24909c10df8bdf841f61bc870c7a -size 4902 diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp index a042ab6..9c53d08 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.cpp @@ -7,6 +7,7 @@ #include "EnhancedInputSubsystems.h" #include "InputMappingContext.h" #include "Kismet/GameplayStatics.h" +#include "Kismet/KismetSystemLibrary.h" #include "CommonFunctions.h" #include "ContentLoader.h" @@ -141,3 +142,8 @@ void UCustomGameInstanceBase::LoadGame() UGameplayStatics::OpenLevel(this, saveData->level); } + +void UCustomGameInstanceBase::ExitGame() +{ + UKismetSystemLibrary::QuitGame(GetWorld(), nullptr, EQuitPreference::Quit, true); +} diff --git a/Source/Lost_Edge/Private/CustomGameInstanceBase.h b/Source/Lost_Edge/Private/CustomGameInstanceBase.h index f0a4b6d..1f7cbab 100644 --- a/Source/Lost_Edge/Private/CustomGameInstanceBase.h +++ b/Source/Lost_Edge/Private/CustomGameInstanceBase.h @@ -31,6 +31,8 @@ public: void SaveGame(FName checkpointName); UFUNCTION(BlueprintCallable, Category = Save) void LoadGame(); + UFUNCTION(BlueprintCallable) + void ExitGame(); static UCustomGameInstanceBase* instance; diff --git a/Source/Lost_Edge/Private/PlayerBase.cpp b/Source/Lost_Edge/Private/PlayerBase.cpp index 4686147..79780ed 100644 --- a/Source/Lost_Edge/Private/PlayerBase.cpp +++ b/Source/Lost_Edge/Private/PlayerBase.cpp @@ -353,10 +353,36 @@ void APlayerBase::ShowInventory() void APlayerBase::ShowJournal() { + if(GetWorld()->IsPaused()) + return; + if(auto WM = AMainGameModeBase::GetWidgetsManager()) WM->ShowJournal(); } +void APlayerBase::ShowMenu() +{ + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + if(GetWorld()->IsPaused()) + { + WM->HideMainMenu(); + playerController->SetShowMouseCursor(false); + playerController->SetInputMode(FInputModeGameOnly{}); + UnlockPlayer(FPlayerLock::All()); + UGameplayStatics::SetGamePaused(GetWorld(), false); + } + else + { + WM->ShowMainMenu(); + playerController->SetShowMouseCursor(true); + playerController->SetInputMode(FInputModeGameAndUI{}); + LockPlayer(FPlayerLock::All()); + UGameplayStatics::SetGamePaused(GetWorld(), true); + } + } +} + FPlayerLock FPlayerLock::All() { FPlayerLock lock; diff --git a/Source/Lost_Edge/Private/PlayerBase.h b/Source/Lost_Edge/Private/PlayerBase.h index 76880c8..69d7028 100644 --- a/Source/Lost_Edge/Private/PlayerBase.h +++ b/Source/Lost_Edge/Private/PlayerBase.h @@ -94,6 +94,8 @@ protected: UFUNCTION(BlueprintCallable, Category = Character) void ShowJournal(); + UFUNCTION(BlueprintCallable, Category = Character) + void ShowMenu(); class APlayerController* playerController; UPROPERTY(EditAnywhere) diff --git a/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.cpp b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.cpp new file mode 100644 index 0000000..b6ef69e --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.cpp @@ -0,0 +1,5 @@ +// Oleg Petruny proprietary. + + +#include "MainMenuButtonWidget.h" + diff --git a/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.h b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.h new file mode 100644 index 0000000..d439279 --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuButtonWidget.h @@ -0,0 +1,16 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Blueprint/UserWidget.h" + +#include "MainMenuButtonWidget.generated.h" + +UCLASS(Blueprintable, Abstract) +class UMainMenuButtonWidget : public UUserWidget +{ + GENERATED_BODY() + +public: + +}; diff --git a/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp new file mode 100644 index 0000000..9943ef7 --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp @@ -0,0 +1,61 @@ +// Oleg Petruny proprietary. + + +#include "MainMenuWidget.h" + +#include "Animation/WidgetAnimation.h" + +#include "CustomGameInstanceBase.h" +#include "MainGameModeBase.h" +#include "MainMenuButtonWidget.h" +#include "Widgets/WidgetsManager.h" + +bool UMainMenuWidget::Initialize() +{ + if(ButtonLoadLastSave) + { + if(auto GI = UCustomGameInstanceBase::GetGameInstance()) + { + if(GI->saveData) + { + ButtonLoadLastSave->SetIsEnabled(true); + ButtonLoadLastSave->SetRenderOpacity(1.0f); + } + } + } + + //FWidgetAnimationDynamicEvent closeFinished; + //closeFinished.BindDynamic(this, &UMainMenuWidget::Closed); + //BindToAnimationFinished(closeAnimation, closeFinished); + + return UUserWidget::Initialize(); +} + +void UMainMenuWidget::Show(bool fast) +{ + SetVisibility(ESlateVisibility::Visible); + //StopAnimation(closeAnimation); + // + //if(fast) + // PlayAnimation(showFastAnimation, 0, 1, EUMGSequencePlayMode::Forward, 1, false); + //else + // PlayAnimation(showFullAnimation, 0, 1, EUMGSequencePlayMode::Forward, 1, false); + // + //OnMainMenuOpeningDelegate.Broadcast(); +} + +void UMainMenuWidget::Hide() +{ + //StopAnimation(showFastAnimation); + //StopAnimation(showFullAnimation); + + //PlayAnimation(closeAnimation); + //OnMainMenuClosingDelegate.Broadcast(); + SetVisibility(ESlateVisibility::Hidden); +} + +void UMainMenuWidget::Closed() +{ + SetVisibility(ESlateVisibility::Hidden); + //OnMainMenuClosedDelegate.Broadcast(); +} diff --git a/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h new file mode 100644 index 0000000..a3678c5 --- /dev/null +++ b/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h @@ -0,0 +1,56 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Widgets/ResolutionResponsiveUserWidget.h" + +#include "MainMenuWidget.generated.h" + +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FMainMenuOpeningDelegate); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FMainMenuClosingDelegate); +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FMainMenuClosedDelegate); + +UCLASS(Blueprintable, Abstract) +class UMainMenuWidget : public UUserWidget +{ + GENERATED_BODY() + +public: + virtual bool Initialize() override; + + UFUNCTION(BlueprintCallable) + void Show(bool fast = true); + UFUNCTION(BlueprintCallable) + void Hide(); + + UPROPERTY(BlueprintAssignable) + FMainMenuOpeningDelegate OnMainMenuOpeningDelegate; + UPROPERTY(BlueprintAssignable) + FMainMenuClosedDelegate OnMainMenuClosingDelegate; + UPROPERTY(BlueprintAssignable) + FMainMenuClosedDelegate OnMainMenuClosedDelegate; + + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonContinue; + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonLoadLastSave; + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonNewGame; + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonOptions; + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonCredits; + UPROPERTY(meta = (BindWidget)) + class UMainMenuButtonWidget* ButtonExit; + + UPROPERTY(Transient, meta = (BindWidgetAnim)) + class UWidgetAnimation* showFullAnimation; + UPROPERTY(Transient, meta = (BindWidgetAnim)) + class UWidgetAnimation* showFastAnimation; + UPROPERTY(Transient, meta = (BindWidgetAnim)) + class UWidgetAnimation* closeAnimation; + +protected: + UFUNCTION() + void Closed(); +}; diff --git a/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp b/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp index 46310e2..095caaf 100644 --- a/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp +++ b/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp @@ -21,6 +21,7 @@ #include "Widgets/InteractableHintWidgetManager.h" #include "Widgets/InventoryWidget.h" #include "Widgets/JournalWidget.h" +#include "Widgets/MainMenu/MainMenuWidget.h" void UWidgetsManager::Init() { @@ -42,6 +43,12 @@ void UWidgetsManager::Init() instance->AddToViewport(); } } + if(auto instance = CreateWidget(PC, mainMenuWidgetClass)) + { + mainMenuWidget = instance; + mainMenuWidget->SetVisibility(ESlateVisibility::Hidden); + mainMenuWidget->AddToViewport(8); + } if(auto instance = CreateWidget(PC, interactableHintWidgetManagerClass)) { interactableHintWidgetManager = instance; @@ -130,6 +137,18 @@ void UWidgetsManager::UpdateWidgetsOwner() +void UWidgetsManager::ShowMainMenu(bool pause) +{ + mainMenuWidget->Show(pause); +} + +void UWidgetsManager::HideMainMenu() +{ + mainMenuWidget->Hide(); +} + + + void UWidgetsManager::ShowInteractionHints(const UInteractableModificator* modificator) { if(interactableHintWidgetManager) diff --git a/Source/Lost_Edge/Private/Widgets/WidgetsManager.h b/Source/Lost_Edge/Private/Widgets/WidgetsManager.h index 468de7a..e49fb2b 100644 --- a/Source/Lost_Edge/Private/Widgets/WidgetsManager.h +++ b/Source/Lost_Edge/Private/Widgets/WidgetsManager.h @@ -21,6 +21,9 @@ public: void HideWidgets(); void UpdateWidgetsOwner(); + void ShowMainMenu(bool pause = true); + void HideMainMenu(); + UFUNCTION(BlueprintCallable, Category = WidgetsManager) void ShowInteractionHints(const class UInteractableModificator* modificator = nullptr); UFUNCTION(BlueprintCallable, Category = WidgetsManager) @@ -53,6 +56,10 @@ protected: TSet> overlayWidgets; // hidden in pause, cutscene TArray overlayWidgetsInstances; + UPROPERTY(EditDefaultsOnly) + TSubclassOf mainMenuWidgetClass; + class UMainMenuWidget* mainMenuWidget = nullptr; + UPROPERTY(EditDefaultsOnly) TSubclassOf interactableHintWidgetManagerClass; // hidden in cutscene class UInteractableHintWidgetManager* interactableHintWidgetManager = nullptr;