From 498dc7ec8e4f9ecc5d7060e9f47f462a73e8d9ed Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Sat, 28 Dec 2024 15:27:11 +0100 Subject: [PATCH 1/9] Fix Main menu --- .../MainMenu/E_MainMenuButtonNames.uasset | 4 ++-- .../UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 ++-- .../Components/UIC_MainMenu_PageButton.uasset | 2 +- .../Content/UI/Components/UIC_Slider.uasset | 4 ++-- .../Lost_Edge/Private/CustomGameInstance.cpp | 24 ++++++++++++++++--- .../Lost_Edge/Private/CustomGameInstance.h | 4 +++- .../Widgets/MainMenu/MainMenuWidget.cpp | 10 -------- .../Private/Widgets/MainMenu/MainMenuWidget.h | 6 +---- 8 files changed, 32 insertions(+), 26 deletions(-) diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset index 38dd715..5fc0b85 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef4f7af31939d83d337b5e3664f3c6c3dda992897b3dc77895f1c98456083420 -size 4447 +oid sha256:116dc3eda9899a70ce02396ea2b15067238e5cf710ecec9d6738151c50a1f6dd +size 4059 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index 22d4b4f..5bba889 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ae4f8d697d46434366827562a388480f4b09f9fe022e12ba3b5f7aade8ffbc4 -size 174730 +oid sha256:c8e834d1b704d2cf4587441001e9f1022d12dcc607e19141e7abed76e2e47adf +size 192994 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset index 994ba3e..56e6256 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3ca9755fe19acf488007b1ed6ca99f8ef93f8bfce932d0939fab5502b136e55 +oid sha256:ec23b255a074720b88a6fde5b0a4fca89ea04488704494abefe09cd88f11241c size 358593 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset index 38918f0..eae415d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5932ca564d4f73b9e5c0b3e22a096cf0ce974808343bbb40ced10fe79414de99 -size 86177 +oid sha256:e9b29efef1b67fb199f51f19c9f9e44d47079aa0342840d5dc902ff7a944d70b +size 86429 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp index cfe6c93..b606fb4 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp @@ -10,6 +10,12 @@ #include "PlayerBase.h" #include "SaveData.h" +namespace +{ + constexpr auto saveName = TEXT("Save"); + constexpr int32 saveIndex = 0; +} + UCustomGameInstance* UCustomGameInstance::instance = nullptr; void UCustomGameInstance::Init() @@ -18,7 +24,11 @@ void UCustomGameInstance::Init() instance = this; contentLoader = NewObject(this); - saveData = Cast(UGameplayStatics::CreateSaveGameObject(USaveData::StaticClass())); + + if(auto save = UGameplayStatics::LoadGameFromSlot(saveName, saveIndex)) + saveData = Cast(save); + else + saveData = Cast(UGameplayStatics::CreateSaveGameObject(USaveData::StaticClass())); } UCustomGameInstance* UCustomGameInstance::Get() @@ -34,6 +44,14 @@ UContentLoader* UCustomGameInstance::GetContentLoader() return nullptr; } +bool UCustomGameInstance::IsGameSaved() +{ + if(auto GI = Get()) + return GI->saveData != nullptr; + + return false; +} + void UCustomGameInstance::SaveGame(FName checkpointName) { auto levelScript = ALevelBase::Get(); @@ -56,12 +74,12 @@ void UCustomGameInstance::SaveGame(FName checkpointName) else saveData->playerRightPocketItem = FName(TEXT("")); - UGameplayStatics::SaveGameToSlot(saveData, TEXT("Save"), 0); + UGameplayStatics::SaveGameToSlot(saveData, saveName, saveIndex); } void UCustomGameInstance::LoadGame() { - saveData = Cast(UGameplayStatics::LoadGameFromSlot(TEXT("Save"), 0)); + saveData = Cast(UGameplayStatics::LoadGameFromSlot(saveName, saveIndex)); if(!saveData) return; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h index a810e77..1d3b441 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h @@ -23,9 +23,11 @@ public: UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Custom Game Instance")) static UCustomGameInstance* Get(); - UFUNCTION(BlueprintPure) static class UContentLoader* GetContentLoader(); + /** Return true is save data are present and valid */ + UFUNCTION(BlueprintPure) + static bool IsGameSaved(); UFUNCTION(BlueprintCallable, Category = Save) void SaveGame(FName checkpointName); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp index f9c190c..acff3d2 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.cpp @@ -11,16 +11,6 @@ bool UMainMenuWidget::Initialize() { - if(ButtonLoadLastSave) - { - auto GI = UCustomGameInstance::Get(); - if(GI && GI->saveData) - { - ButtonLoadLastSave->SetIsEnabled(true); - ButtonLoadLastSave->SetRenderOpacity(1.0f); - } - } - //FWidgetAnimationDynamicEvent closeFinished; //closeFinished.BindDynamic(this, &UMainMenuWidget::Closed); //BindToAnimationFinished(closeAnimation, closeFinished); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h index a5bccff..2c97df6 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h @@ -30,13 +30,9 @@ public: UPROPERTY(BlueprintAssignable) FMainMenuClosedDelegate OnMainMenuClosedDelegate; - UPROPERTY(meta = (BindWidget)) + UPROPERTY(BlueprintReadWrite, 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; -- 2.45.2 From 3dd178833871117774360a62e130620d67b5b5e2 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Sat, 4 Jan 2025 13:35:00 +0100 Subject: [PATCH 2/9] Main, Options, Audio, Game menu and settings --- .../Config/DefaultGameUserSettings.ini | 5 + .../Blueprints/BP_CustomGameInstance.uasset | 4 +- .../Blueprints/Characters/BP_Player.uasset | 4 +- .../FunctionLibraries/BPFL_BPCast.uasset | 3 + .../Lost_Edge/Content/Levels/Test/L_Test.umap | 4 +- .../MainMenu/E_MainMenuButtonNames.uasset | 3 - .../E_MainMenuOptionsButtonName.uasset | 3 + .../E_MainMenuOptionsButtonNames.uasset | 3 - .../MainMenu/E_MainMenuPages.uasset | 3 - .../MainMenu/E_MainMenu_Button.uasset | 3 + .../MainMenu/E_MainMenu_Page.uasset | 3 + .../Pages/UI_MainMenu_Page_Credits.uasset | 3 + .../Pages/UI_MainMenu_Page_Home.uasset | 3 + .../Pages/UI_MainMenu_Page_Options.uasset | 3 + .../UI_MainMenu_Page_Options_Audio.uasset | 3 + .../UI_MainMenu_Page_Options_Game.uasset | 3 + .../UI_MainMenu_Page_Options_Graphics.uasset | 3 + .../MainMenu/ST_MainMenuCommonText.uasset | 3 - .../MainMenu/ST_MainMenu_CommonText.uasset | 3 + .../UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 +- .../MainMenu/UI_MainMenuOptions.uasset | 3 - .../MainMenu/UI_MainMenuOptionsAudio.uasset | 3 - .../UI_MainMenuOptionsControls.uasset | 4 +- .../MainMenu/UI_MainMenuOptionsGame.uasset | 3 - .../Classes/UICC_MainMenu_Page.uasset | 3 + .../UICC_MainMenu_PageButtonParticle.uasset | 4 +- .../Components/ST_CommonComboxValues.uasset | 3 + .../Content/UI/Components/UIC_ComboBox.uasset | 3 + .../UIC_MainMenu_OptionsButton.uasset | 4 +- .../UIC_MainMenu_OptionsComboBox.uasset | 4 +- .../UIC_MainMenu_OptionsComboBox_Bool.uasset | 3 + .../UIC_MainMenu_OptionsSlider.uasset | 4 +- .../UIC_MainMenu_OptionsSwitchButton.uasset | 3 - .../Components/UIC_MainMenu_PageButton.uasset | 4 +- .../UI/Components/UIC_MainMenu_Title.uasset | 4 +- .../Content/UI/Components/UIC_Slider.uasset | 4 +- .../Lost_Edge/Private/CommonFunctions.cpp | 10 ++ .../Lost_Edge/Private/CommonFunctions.h | 3 + .../Lost_Edge/Private/CustomGameInstance.cpp | 25 ++++ .../Lost_Edge/Private/CustomGameInstance.h | 10 +- .../Lost_Edge/Private/CustomGameSettings.cpp | 110 +++++++++++++++++- .../Lost_Edge/Private/CustomGameSettings.h | 83 +++++++++++-- .../Private/CustomPlayerController.cpp | 44 ++++--- .../Private/CustomPlayerController.h | 7 +- .../Source/Lost_Edge/Private/PlayerBase.cpp | 14 ++- .../Source/Lost_Edge/Private/PlayerBase.h | 1 - .../Private/Widgets/ComboBoxText.cpp | 20 ++++ .../Lost_Edge/Private/Widgets/ComboBoxText.h | 23 ++++ .../Private/Widgets/MainMenu/MainMenuWidget.h | 17 +-- 49 files changed, 390 insertions(+), 99 deletions(-) create mode 100644 UnrealProject/Lost_Edge/Content/Blueprints/FunctionLibraries/BPFL_BPCast.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Button.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Page.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenuCommonText.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenu_CommonText.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/ST_CommonComboxValues.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSwitchButton.uasset create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h diff --git a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini index 6c87b93..d9bc256 100644 --- a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini +++ b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini @@ -3,6 +3,11 @@ bUseMotionBlur=False bShowFps=False bMouseInverted=False fMouseSensetivity=1.000000 +fMasterVolume=0.500000 +fMusicVolume=1.000000 +fEffectsVolume=1.000000 +fVoicesVolume=1.000000 +fMenuVolume=1.000000 bUseVSync=False bUseDynamicResolution=False ResolutionSizeX=1920 diff --git a/UnrealProject/Lost_Edge/Content/Blueprints/BP_CustomGameInstance.uasset b/UnrealProject/Lost_Edge/Content/Blueprints/BP_CustomGameInstance.uasset index da2e0e6..9833752 100644 --- a/UnrealProject/Lost_Edge/Content/Blueprints/BP_CustomGameInstance.uasset +++ b/UnrealProject/Lost_Edge/Content/Blueprints/BP_CustomGameInstance.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:617aa7adcc34b939014b4d3e4e3442dacde726db2198f9943f13a9606a5dd12d -size 6156 +oid sha256:9c9c93e846c0b9f7c8ef0d79047da3cda2eb17550062c0bea1fcfa64a4688ecc +size 54469 diff --git a/UnrealProject/Lost_Edge/Content/Blueprints/Characters/BP_Player.uasset b/UnrealProject/Lost_Edge/Content/Blueprints/Characters/BP_Player.uasset index 1745f1d..941b408 100644 --- a/UnrealProject/Lost_Edge/Content/Blueprints/Characters/BP_Player.uasset +++ b/UnrealProject/Lost_Edge/Content/Blueprints/Characters/BP_Player.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65401d20c2bdd7a90f808492cb9fc7ffae46c67dc88e6eb46716c7a8dd1966da -size 491639 +oid sha256:58d6cbf633283a9746aaee650d1b09949761b2dc40b9e1c3fb5f1be043737f71 +size 493547 diff --git a/UnrealProject/Lost_Edge/Content/Blueprints/FunctionLibraries/BPFL_BPCast.uasset b/UnrealProject/Lost_Edge/Content/Blueprints/FunctionLibraries/BPFL_BPCast.uasset new file mode 100644 index 0000000..ed5419e --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/Blueprints/FunctionLibraries/BPFL_BPCast.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a91bc779986e469ebc95b0ff0a4375de966693318524c836388d40013b383627 +size 19136 diff --git a/UnrealProject/Lost_Edge/Content/Levels/Test/L_Test.umap b/UnrealProject/Lost_Edge/Content/Levels/Test/L_Test.umap index f37d0f1..c72b361 100644 --- a/UnrealProject/Lost_Edge/Content/Levels/Test/L_Test.umap +++ b/UnrealProject/Lost_Edge/Content/Levels/Test/L_Test.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:654c333de2b64ac0da0ff144917ff839fbf97858a564007816c2aec6cc5e678a -size 2266458 +oid sha256:e88d30729b1a3db9085efe74430a979ec8fa4eec486f2df5c102f09e6252b14f +size 2267466 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset deleted file mode 100644 index 5fc0b85..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:116dc3eda9899a70ce02396ea2b15067238e5cf710ecec9d6738151c50a1f6dd -size 4059 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset new file mode 100644 index 0000000..c36d271 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:804ce49b67d36ed546a85af9413fd7a243ca8953562359a9ad1b4f00b156a5c9 +size 2910 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset deleted file mode 100644 index 7d292ee..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonNames.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a1615c364bee71f147d2da29d321b73083e982347c676f9ae75bbf9a2253190 -size 2951 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset deleted file mode 100644 index a6b8f22..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuPages.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0632b9cfa1742906e319ba7cc1a013be2ced858bc9c89820a3a182a95a8c8a12 -size 3349 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Button.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Button.uasset new file mode 100644 index 0000000..321b75b --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Button.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e7ac2ae1d68094b707a2347df39144c696e7e52f79db6a61d801a7f22c36778 +size 3816 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Page.uasset new file mode 100644 index 0000000..8b8969f --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenu_Page.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:324785424810ad0ba200ab0aa14fe095ba00b8c5bfd1b367304b1a52ced73748 +size 2976 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset new file mode 100644 index 0000000..07c4166 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c54961497232b5b3bc1bc712b62c546377d267f9016cc2debca089a980fd308 +size 119987 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset new file mode 100644 index 0000000..5091ff3 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae76723653c9615604da1d4c6f0658f74c6a66f29a48e3ddbd09640b38ec372d +size 133071 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset new file mode 100644 index 0000000..86c3975 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79c137948d7e5184ca1230c9c461c6e23bf225ee44d657003d938b23d62ff3da +size 68002 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset new file mode 100644 index 0000000..e85345d --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:245a41b788f5cf2c392401225e701bee6ec493a9b5275686bb876dce3f4efbe6 +size 179621 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset new file mode 100644 index 0000000..8689e74 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7801f52458c5b085992c1ac5e956b72285699cec7ee4af24104d6397c48295bc +size 96533 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset new file mode 100644 index 0000000..ecbf921 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9aeaebec4e95c2f53bf51442efb796560e0fe8d65f5887d36591de7b0f682e21 +size 170790 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenuCommonText.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenuCommonText.uasset deleted file mode 100644 index b6f68eb..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenuCommonText.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6b94aa433be1147267908989331dff3f6af447d372cf8a82f2b25e81e3326598 -size 1878 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenu_CommonText.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenu_CommonText.uasset new file mode 100644 index 0000000..be5c588 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/ST_MainMenu_CommonText.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:646e788c2134f1742ac16b56e16254aa23ee16703e46a10d8d6b27e091aecfb4 +size 2581 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index 5bba889..7570a4d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8e834d1b704d2cf4587441001e9f1022d12dcc607e19141e7abed76e2e47adf -size 192994 +oid sha256:bee71e7ac3864119d6e7043a968424188b5c1a4160dd933b3ac76a67ffa2626e +size 198290 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset deleted file mode 100644 index 3510003..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptions.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:647b375075ad14af64932e5ef664da6e22b0a375c7867811f5f1c436f24808cc -size 62215 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset deleted file mode 100644 index d7f116d..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsAudio.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e247836e085546324e4f68c3a5070b4d37992b60082ef5a525160e79ca9ea5f -size 95551 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset index 828f58f..fea9005 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a1c5e7352b100ccabe043eee5ffd02b83fd1b2d5109144c28c687609841291b0 -size 130173 +oid sha256:c1b79c1fd758a592357c72366d989ba0185792c811f75601dee9a09784f57613 +size 129437 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset deleted file mode 100644 index 60b0c2c..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsGame.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:26321fde0b37a5dc8b876f8caee0d4c02eef2cb23264915a9aa181a53c133a93 -size 89011 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset new file mode 100644 index 0000000..de68f7c --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c3a942954cbba0c1406e32321f3f3f23985fcd9dd60e5cf02706d1c80cea900 +size 13492 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset index 175d3e9..113718e 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd2cb854bac32344c95a52bb2dbd96d1d71fb6c413c16b6e7bbeb3356bc813df -size 6659 +oid sha256:0d6dd492548c424e42aa44c6c37a2dfdd8492116cdafca0fce1b7ffd4250dac2 +size 6704 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/ST_CommonComboxValues.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/ST_CommonComboxValues.uasset new file mode 100644 index 0000000..dd8f8bb --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Components/ST_CommonComboxValues.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8693419363541fe78fdeb7af030428b90dce009da71fbd2d2168af808a5c259 +size 1809 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset new file mode 100644 index 0000000..bd8c7d1 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:070138fc6cfd92dd686cf311d8895f074c53de94a648cdcb33e0c5956caba9c3 +size 121172 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset index 44cd3ff..312746e 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8eb2ca474902a3180db5dafe6dc2ac2d9972a83384bb6a3a05c2ba51d58005e -size 341174 +oid sha256:ecd4075b374af4aebe1e63429ac0ce65b8882945c006f59f5f58d1d1af47510a +size 341123 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset index ea80e93..944688d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa41827ace0e485a32ad9ba233912f258ee5cfd0990ccdd117eaa007cb8379ae -size 39310 +oid sha256:c5aa1d53af63777f21fa4a01b11a049be775c448f17cd7db25fb52036f239c55 +size 61481 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset new file mode 100644 index 0000000..f51d24d --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71ae04b2ecc2b47966a4cd26a9052ac6c8646c1e171ae69b60df05257677078d +size 69115 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset index 89dcec6..2c62b55 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b22ad29cebdf628e50306fa7ec0eadfd98d8f817bd02cee0f1e7c0186070ee49 -size 55275 +oid sha256:51e0896d4bca4e3ccd43d1ec3fabe18ce55c452d07b21ffbfb335a72e9ffec18 +size 77285 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSwitchButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSwitchButton.uasset deleted file mode 100644 index 1fb0cc3..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSwitchButton.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ccdc4694adbbda575bd02ebfdc77f17e4020fce859243133ad4e999dacb14ff2 -size 39415 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset index 56e6256..c72bcc6 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec23b255a074720b88a6fde5b0a4fca89ea04488704494abefe09cd88f11241c -size 358593 +oid sha256:cf8fa9cdd55f24d905fa07e6ee18107c23442d41c8498cb9fad5b6015bbd7d3a +size 370639 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset index a73c9d5..8488cfc 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1643864c41e24f3b31d7cc2e7ae81d5a81662e040da7ed680094fc3035edcb02 -size 447458 +oid sha256:14ae36bb0e852e06a55126d54cbe6f2e77b66a48461c1789b9c232281919ced7 +size 453511 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset index eae415d..358e39e 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9b29efef1b67fb199f51f19c9f9e44d47079aa0342840d5dc902ff7a944d70b -size 86429 +oid sha256:1c871982aeb84a78a991eb8a18cd1232624cfa452894ecfcb14cb4fd09c935b4 +size 146802 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp index c45eec7..78f528f 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp @@ -29,6 +29,16 @@ FText UCommonFunctions::GetKeyDisplayName(FKey key) return key.GetDisplayName(false); } +int32 UCommonFunctions::StringIndexInTextArray(const TArray& array, const FString& value) +{ + FString v = value.ToLower(); + for(int32 i = 0; i < array.Num(); ++i) + if(FTextInspector::GetSourceString(array[i])->ToLower().Equals(v)) + return i; + + return -1; +} + void UCommonFunctions::DestroyActorRecursively(AActor* actor) { TArray childs; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h index 56d9dae..7e40538 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h @@ -25,6 +25,9 @@ public: UFUNCTION(BlueprintPure) static FText GetKeyDisplayName(struct FKey key); + UFUNCTION(BlueprintPure) + static int32 StringIndexInTextArray(const TArray& array, const FString& value); + /** Recursively destroy actor and all its childs (the default Destroy doesn't have consistent behavior) */ UFUNCTION(BlueprintCallable, Category = Actor) static void DestroyActorRecursively(class AActor* actor); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp index b606fb4..60769f0 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp @@ -6,6 +6,7 @@ #include "Kismet/KismetSystemLibrary.h" #include "ContentLoader.h" +#include "CustomGameSettings.h" #include "Levels/LevelBase.h" #include "PlayerBase.h" #include "SaveData.h" @@ -23,7 +24,15 @@ void UCustomGameInstance::Init() UGameInstance::Init(); instance = this; + contentLoader = NewObject(this); + for(auto& _class : globalInstancesClasses) + { + UObject* gi = NewObject(_class); + gi->AddToRoot(); + globalInstances.Add(_class.Get(), gi); + } + globalInstancesClasses.Empty(); if(auto save = UGameplayStatics::LoadGameFromSlot(saveName, saveIndex)) saveData = Cast(save); @@ -31,6 +40,14 @@ void UCustomGameInstance::Init() saveData = Cast(UGameplayStatics::CreateSaveGameObject(USaveData::StaticClass())); } +void UCustomGameInstance::Shutdown() +{ + if(auto settings = UCustomGameSettings::Get()) + settings->SaveSettings(); + + Super::Shutdown(); +} + UCustomGameInstance* UCustomGameInstance::Get() { return instance; @@ -44,6 +61,14 @@ UContentLoader* UCustomGameInstance::GetContentLoader() return nullptr; } +UObject* UCustomGameInstance::GetGlobalInstance(UClass* _class) +{ + if(auto GI = Get()) + return *(GI->globalInstances.Find(_class)); + + return nullptr; +} + bool UCustomGameInstance::IsGameSaved() { if(auto GI = Get()) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h index 1d3b441..d2cd197 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h @@ -20,19 +20,24 @@ class UCustomGameInstance : public UGameInstance public: /** Instantiates content loader, dummy save data and applies settings */ virtual void Init() override; + /** Saves settings */ + virtual void Shutdown() override; UFUNCTION(BlueprintPure, meta = (DisplayName = "Get Custom Game Instance")) static UCustomGameInstance* Get(); UFUNCTION(BlueprintPure) static class UContentLoader* GetContentLoader(); + UFUNCTION(BlueprintPure) + static UObject* GetGlobalInstance(UClass* _class); + /** Return true is save data are present and valid */ UFUNCTION(BlueprintPure) static bool IsGameSaved(); - UFUNCTION(BlueprintCallable, Category = Save) void SaveGame(FName checkpointName); UFUNCTION(BlueprintCallable, Category = Save) void LoadGame(); + UFUNCTION(BlueprintCallable) void ExitGame(); @@ -48,4 +53,7 @@ protected: UPROPERTY() class UContentLoader* contentLoader; + UPROPERTY(EditDefaultsOnly) + TSet> globalInstancesClasses; + TMap globalInstances; }; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp index 2c17640..b095e21 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp @@ -4,12 +4,35 @@ #include "Kismet/GameplayStatics.h" +namespace +{ + /** Game */ + constexpr float fDefaultMouseSensetivity = 0.5f; + constexpr bool bDefaultMouseInverted = false; + + /** Audio */ + constexpr float fDefaultMasterVolume = 0.4f; + constexpr float fDefaultMusicVolume = 1.0f; + constexpr float fDefaultEffectsVolume = 1.0f; + constexpr float fDefaultVoicesVolume = 1.0f; + constexpr float fDefaultMenuVolume = 1.0f; +} + UCustomGameSettings::UCustomGameSettings(const FObjectInitializer& ObjectInitializer) :Super(ObjectInitializer) { bUseMotionBlur = false; bShowFps = false; - bMouseInverted = false; - fMouseSensetivity = 1.0f; + + /** Game */ + fMouseSensetivity = GetDefaultMouseSensetivity(); + bMouseInverted = GetDefaultMouseInverted(); + + /** Audio */ + fMasterVolume = GetDefaultMasterVolume(); + fMusicVolume = GetDefaultMusicVolume(); + fEffectsVolume = GetDefaultEffectsVolume(); + fVoicesVolume = GetDefaultVoicesVolume(); + fMenuVolume = GetDefaultMenuVolume(); } UCustomGameSettings* UCustomGameSettings::Get() @@ -17,12 +40,89 @@ UCustomGameSettings* UCustomGameSettings::Get() return Cast(UGameUserSettings::GetGameUserSettings()); } + + +/** Game */ +float UCustomGameSettings::GetDefaultMouseSensetivity() const +{ + return fDefaultMouseSensetivity; +} +float UCustomGameSettings::GetMouseSensetivity() const +{ + return fMouseSensetivity; +} void UCustomGameSettings::SetMouseSensetivity(float value) { fMouseSensetivity = FMath::Clamp(value, 0.1f, 2.0f); } -float UCustomGameSettings::GetMouseSensetivity() const +bool UCustomGameSettings::GetDefaultMouseInverted() const { - return fMouseSensetivity; -} \ No newline at end of file + return bDefaultMouseInverted; +} + + + +/** Audio */ +float UCustomGameSettings::GetDefaultMasterVolume() const +{ + return fDefaultMasterVolume; +} +float UCustomGameSettings::GetDefaultMusicVolume() const +{ + return fDefaultMusicVolume; +} +float UCustomGameSettings::GetDefaultEffectsVolume() const +{ + return fDefaultEffectsVolume; +} +float UCustomGameSettings::GetDefaultVoicesVolume() const +{ + return fDefaultVoicesVolume; +} +float UCustomGameSettings::GetDefaultMenuVolume() const +{ + return fDefaultMenuVolume; +} + +float UCustomGameSettings::GetMasterVolume() const +{ + return fMasterVolume; +} +float UCustomGameSettings::GetMusicVolume() const +{ + return fMusicVolume; +} +float UCustomGameSettings::GetEffectsVolume() const +{ + return fEffectsVolume; +} +float UCustomGameSettings::GetVoicesVolume() const +{ + return fVoicesVolume; +} +float UCustomGameSettings::GetMenuVolume() const +{ + return fMenuVolume; +} + +void UCustomGameSettings::SetMasterVolume(float value) +{ + fMasterVolume = FMath::Clamp(value, 0.0f, 1.0f); +} +void UCustomGameSettings::SetMusicVolume(float value) +{ + fMusicVolume = FMath::Clamp(value, 0.0f, 1.0f); +} +void UCustomGameSettings::SetEffectsVolume(float value) +{ + fEffectsVolume = FMath::Clamp(value, 0.0f, 1.0f); +} +void UCustomGameSettings::SetVoicesVolume(float value) +{ + fVoicesVolume = FMath::Clamp(value, 0.0f, 1.0f); +} +void UCustomGameSettings::SetMenuVolume(float value) +{ + fMenuVolume = FMath::Clamp(value, 0.0f, 1.0f); +} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h index fbc5795..094d031 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h @@ -10,28 +10,19 @@ * Manages custom game settings. * Mouse sensetivity and inversion, motion blur usage, fps show. */ -UCLASS(Config = Game, defaultconfig) +UCLASS(defaultconfig) class UCustomGameSettings : public UGameUserSettings { - GENERATED_UCLASS_BODY() + GENERATED_BODY() public: // Is auto defined by UE but implementation is in cpp - //UCustomGameSettings(const FObjectInitializer& ObjectInitializer); + UCustomGameSettings(const FObjectInitializer& ObjectInitializer); UFUNCTION(BlueprintPure, Category = Settings, meta = (DisplayName = "Get Custom Game Settings")) static UCustomGameSettings* Get(); - /** - * Sets mouse sensetivity multiplier - * @param value [0.1 - 2.0] - */ - UFUNCTION(BlueprintCallable, Category = Settings) - void SetMouseSensetivity(float value); - /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ - UFUNCTION(BlueprintCallable, Category = Settings) - float GetMouseSensetivity() const; UPROPERTY(Config, BlueprintReadWrite) bool bUseMotionBlur; @@ -39,11 +30,79 @@ public: UPROPERTY(Config, BlueprintReadWrite) bool bShowFps; + + + /** Game */ + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultMouseSensetivity() const; + /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ + UFUNCTION(BlueprintPure, Category = Settings) + float GetMouseSensetivity() const; + /** + * Sets mouse sensetivity multiplier + * @param value [0.1 - 2.0] + */ + UFUNCTION(BlueprintCallable, Category = Settings) + void SetMouseSensetivity(float value); + + UFUNCTION(BlueprintPure, Category = Settings) + bool GetDefaultMouseInverted() const; UPROPERTY(Config, BlueprintReadWrite) bool bMouseInverted; + + + /** + * Audio + * All values are clamped in [0.0 - 1.0] + */ + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultMasterVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultMusicVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultEffectsVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultVoicesVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = Settings) + float GetDefaultMenuVolume() const; // UFUNCTION doesn't support constexpr functions + + UFUNCTION(BlueprintPure, Category = Settings) + float GetMasterVolume() const; + UFUNCTION(BlueprintPure, Category = Settings) + float GetMusicVolume() const; + UFUNCTION(BlueprintPure, Category = Settings) + float GetEffectsVolume() const; + UFUNCTION(BlueprintPure, Category = Settings) + float GetVoicesVolume() const; + UFUNCTION(BlueprintPure, Category = Settings) + float GetMenuVolume() const; + + UFUNCTION(BlueprintCallable, Category = Settings) + void SetMasterVolume(float value); + UFUNCTION(BlueprintCallable, Category = Settings) + void SetMusicVolume(float value); + UFUNCTION(BlueprintCallable, Category = Settings) + void SetEffectsVolume(float value); + UFUNCTION(BlueprintCallable, Category = Settings) + void SetVoicesVolume(float value); + UFUNCTION(BlueprintCallable, Category = Settings) + void SetMenuVolume(float value); + protected: UPROPERTY(Config) float fMouseSensetivity; + /** Audio */ + UPROPERTY(Config) + float fMasterVolume; + UPROPERTY(Config) + float fMusicVolume; + UPROPERTY(Config) + float fEffectsVolume; + UPROPERTY(Config) + float fVoicesVolume; + UPROPERTY(Config) + float fMenuVolume; + }; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.cpp index 386d1c6..cc00e34 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.cpp @@ -33,6 +33,13 @@ void ACustomPlayerController::AppendInputContext(TSoftObjectPtrAddMappingContext(context.LoadSynchronous(), 0); } +void ACustomPlayerController::ApplyMouseSettings() +{ + if(auto settings = UCustomGameSettings::Get()) + for(auto& context : contexts) + ApplyMouseSettings(context, settings); +} + void ACustomPlayerController::BeginPlay() { Super::BeginPlay(); @@ -71,15 +78,19 @@ void ACustomPlayerController::EndPlay(const EEndPlayReason::Type EndPlayReason) Super::EndPlay(EndPlayReason); } -void ACustomPlayerController::ApplyMouseSettings(TSoftObjectPtr& context) +void ACustomPlayerController::ApplyMouseSettings(TSoftObjectPtr& context, UCustomGameSettings* settings) { - auto gameSettings = UCustomGameSettings::Get(); - if(!gameSettings) - return; + if(!settings) + { + settings = UCustomGameSettings::Get(); + if(!settings) + return; + } if(!context.LoadSynchronous()) return; + bool contextChanged = false; for(auto& mapping : context.LoadSynchronous()->GetMappings()) { if(mapping.Key != EKeys::Mouse2D) @@ -87,20 +98,27 @@ void ACustomPlayerController::ApplyMouseSettings(TSoftObjectPtrbMouseInverted) + if(auto negate_modifier = Cast(modifier)) { - if(auto negate_modifier = Cast(modifier)) - { - negate_modifier->bY = !negate_modifier->bY; - continue; - } + negate_modifier->bY = !settings->bMouseInverted; + contextChanged = true; + } + else if(auto scalar_modifier = Cast(modifier)) + { + scalar_modifier->Scalar = FVector{ settings->GetMouseSensetivity() }; + contextChanged = true; } - if(auto scalar_modifier = Cast(modifier)) - scalar_modifier->Scalar = FVector{ gameSettings->GetMouseSensetivity() * 0.5 }; } } - UEnhancedInputLibrary::RequestRebuildControlMappingsUsingContext(context.LoadSynchronous()); + if(contextChanged) + { + if(subsystem) + { + FModifyContextOptions options; + subsystem->RequestRebuildControlMappings(options, EInputMappingRebuildType::RebuildWithFlush); + } + } } void ACustomPlayerController::OnAnyKeyPressed(FKey key) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.h index 191f83c..15efc94 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomPlayerController.h @@ -30,6 +30,10 @@ public: UFUNCTION(BlueprintCallable) static void AppendInputContext(TSoftObjectPtr context); + /** Applies mouse settings to all loaded contexts */ + UFUNCTION(BlueprintCallable) + static void ApplyMouseSettings(); + FPlayerAnyKeyPressedDelegate onAnyKeyPressed; FPlayerAnyKeyReleasedDelegate onAnyKeyReleased; @@ -38,7 +42,8 @@ protected: virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; private: - static void ApplyMouseSettings(TSoftObjectPtr& context); + /** Applies mouse settings to the specific context */ + static void ApplyMouseSettings(TSoftObjectPtr& context, class UCustomGameSettings* settings = nullptr); void OnAnyKeyPressed(FKey key); void OnAnyKeyReleased(FKey key); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp index 853d6ba..e841f08 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp @@ -371,16 +371,22 @@ void APlayerBase::ShowMenu() if(GetWorld()->IsPaused()) { WM->HideMainMenu(); - playerController->SetShowMouseCursor(false); - playerController->SetInputMode(FInputModeGameOnly{}); + if(auto PC = ACustomPlayerController::Get()) + { + PC->SetShowMouseCursor(false); + PC->SetInputMode(FInputModeGameOnly{}); + } UnlockPlayer(FPlayerLock::All()); UGameplayStatics::SetGamePaused(GetWorld(), false); } else { WM->ShowMainMenu(); - playerController->SetShowMouseCursor(true); - playerController->SetInputMode(FInputModeGameAndUI{}); + if(auto PC = ACustomPlayerController::Get()) + { + PC->SetShowMouseCursor(true); + PC->SetInputMode(FInputModeGameAndUI{}); + } LockPlayer(FPlayerLock::All()); UGameplayStatics::SetGamePaused(GetWorld(), true); } diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.h index 7d3c691..63aa4da 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.h @@ -113,7 +113,6 @@ protected: UFUNCTION(BlueprintCallable, Category = Character) void ShowMenu(); - class APlayerController* playerController; UPROPERTY(EditAnywhere) float moveSpeed = 200; UPROPERTY(EditAnywhere) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp new file mode 100644 index 0000000..dbd1fc0 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp @@ -0,0 +1,20 @@ +// Oleg Petruny proprietary. + +#include "ComboBoxText.h" + +void UComboBoxText::PostInitProperties() +{ + Super::PostInitProperties(); + + SetOptions(_DefaultOptions); + _DefaultOptions.Empty(); +} + +void UComboBoxText::SetOptions(const TArray& options) +{ + ClearSelection(); + Options.Empty(); + for(auto& o : options) + Options.Add(MakeShareable(new FString(o.ToString()))); + RefreshOptions(); +} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h new file mode 100644 index 0000000..82321b7 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h @@ -0,0 +1,23 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Components/ComboBoxString.h" + +#include "ComboBoxText.generated.h" + +UCLASS(Blueprintable, meta = (DisplayName = "ComboBox (Text)"), MinimalAPI) +class UComboBoxText : public UComboBoxString +{ + GENERATED_BODY() + +public: + virtual void PostInitProperties() override; + + UFUNCTION(BlueprintCallable) + void SetOptions(const TArray& options); + +protected: + UPROPERTY(EditAnywhere, Category = ComboBoxTextDefault) + TArray _DefaultOptions; +}; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h index 2c97df6..550bc7b 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/MainMenu/MainMenuWidget.h @@ -30,20 +30,9 @@ public: UPROPERTY(BlueprintAssignable) FMainMenuClosedDelegate OnMainMenuClosedDelegate; - UPROPERTY(BlueprintReadWrite, meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonContinue; - 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)) + UPROPERTY(BlueprintReadOnly, Transient, meta = (BindWidgetAnim)) + class UWidgetAnimation* extendAnimation; + UPROPERTY(BlueprintReadOnly, Transient, meta = (BindWidgetAnim)) class UWidgetAnimation* closeAnimation; protected: -- 2.45.2 From 2c055a850240dd699669d9ee8bbfb9c0486e823a Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Sat, 4 Jan 2025 15:35:36 +0100 Subject: [PATCH 3/9] Main menu animations --- .../Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 ++-- .../Classes/UICC_MainMenu_PageButtonParticle.uasset | 4 ++-- .../UI/Components/Classes/UICC_MenuMain_PageButton.uasset | 4 ++-- .../Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset | 3 +++ .../UI/Components/UIC_MainMenu_OptionsKeySelector.uasset | 4 ++-- .../Content/UI/Components/UIC_MainMenu_PageButton.uasset | 4 ++-- .../Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset | 4 ++-- .../Content/UI/Components/UIC_OptionKeyselector.uasset | 3 --- .../Lost_Edge/Content/UI/Components/UIC_Slider.uasset | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_OptionKeyselector.uasset diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index 7570a4d..daf1260 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bee71e7ac3864119d6e7043a968424188b5c1a4160dd933b3ac76a67ffa2626e -size 198290 +oid sha256:93f19c4b51065dc57743c25132032146f036249f0c374c592dab864f1c3862c5 +size 241855 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset index 113718e..c8fe0e8 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d6dd492548c424e42aa44c6c37a2dfdd8492116cdafca0fce1b7ffd4250dac2 -size 6704 +oid sha256:70b868f6cf2d8e23c1fa0239953d779f9cc1c923e4c987951bb5a94eea31b5c2 +size 6926 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset index 5a2495d..d8d598b 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7db291a28abb65d5b7fa53ac78c8cfa3cc1581a15704e0380b2a91f63bf4b6d7 -size 7395 +oid sha256:94f98024deddb686420b2546b1badf1691507fef0fd3f5952d3930368c1a9929 +size 7663 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset new file mode 100644 index 0000000..b2381af --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1a593a5828a817ac0e9083171901ec88bb601e00134da762ba33370e517f584 +size 172478 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset index b8c0590..c45657e 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e7383a2ca520d9cae3f262a2f4c2d858f9e27921bda642df800558977fc0b0a -size 39423 +oid sha256:34af8d5e81500e0cacc3761944ad9ac9397c95aed613d17e8879146667bc31dc +size 40854 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset index c72bcc6..bc13035 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf8fa9cdd55f24d905fa07e6ee18107c23442d41c8498cb9fad5b6015bbd7d3a -size 370639 +oid sha256:25557946f1a186a06e1286b0df1fe9d048de0e9ea562118aaca35a58bb47cc25 +size 367549 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset index 8488cfc..ad23a9d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14ae36bb0e852e06a55126d54cbe6f2e77b66a48461c1789b9c232281919ced7 -size 453511 +oid sha256:494897ebb21506071b1df404c10bf3898862afd29edfb2cb40170f4ee347ebdf +size 454837 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_OptionKeyselector.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_OptionKeyselector.uasset deleted file mode 100644 index 5f23726..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_OptionKeyselector.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c30481b55c1870ae72e33d513afc1acd98d11f33f3ac20ff83b5402f57bba180 -size 172580 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset index 358e39e..2d1795a 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c871982aeb84a78a991eb8a18cd1232624cfa452894ecfcb14cb4fd09c935b4 -size 146802 +oid sha256:680dbf5d16e01d2ccc7ade57130e4668601dc605370b0f4362dbb8db7855102f +size 147470 -- 2.45.2 From fbd5dddcc93790128f903895ede740cc5ba59370 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Mon, 6 Jan 2025 07:00:54 +0100 Subject: [PATCH 4/9] graphic settings wip --- .../Classes/UICC_MainMenu_Page.uasset | 3 ++ .../UICC_MainMenu_PageButtonParticle.uasset | 3 ++ .../Classes/UICC_MainMenu_SmallButton.uasset | 3 ++ .../Classes/UICC_MenuMain_PageButton.uasset | 3 ++ .../UIC_MainMenu_OptionsButton.uasset | 3 ++ .../UIC_MainMenu_OptionsCategory.uasset | 3 ++ .../UIC_MainMenu_OptionsComboBox.uasset | 3 ++ .../UIC_MainMenu_OptionsComboBox_Bool.uasset | 3 ++ .../UIC_MainMenu_OptionsKeySelector.uasset | 3 ++ .../UIC_MainMenu_OptionsSlider.uasset | 3 ++ .../Components/UIC_MainMenu_PageButton.uasset | 3 ++ .../Components/UIC_MainMenu_Title.uasset | 3 ++ .../Pages/UI_MainMenu_Page_Credits.uasset | 4 +- .../Pages/UI_MainMenu_Page_Home.uasset | 4 +- .../Pages/UI_MainMenu_Page_Options.uasset | 4 +- .../UI_MainMenu_Page_Options_Audio.uasset | 4 +- .../UI_MainMenu_Page_Options_Game.uasset | 4 +- .../UI_MainMenu_Page_Options_Graphics.uasset | 4 +- .../UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 +- .../MainMenu/UI_MainMenuCredits.uasset | 4 +- .../UI_MainMenuOptionsControls.uasset | 3 -- .../MainMenu/UI_MainMenuOptionsVideo.uasset | 3 -- .../Classes/UICC_MainMenu_Page.uasset | 3 -- .../UICC_MainMenu_PageButtonParticle.uasset | 3 -- .../Classes/UICC_MainMenu_SmallButton.uasset | 3 -- .../Classes/UICC_MenuMain_PageButton.uasset | 3 -- .../UI/Components/UIC_Keyselector.uasset | 4 +- .../UIC_MainMenu_OptionsButton.uasset | 3 -- .../UIC_MainMenu_OptionsCategory.uasset | 3 -- .../UIC_MainMenu_OptionsComboBox.uasset | 3 -- .../UIC_MainMenu_OptionsComboBox_Bool.uasset | 3 -- .../UIC_MainMenu_OptionsKeySelector.uasset | 3 -- .../UIC_MainMenu_OptionsSlider.uasset | 3 -- .../Components/UIC_MainMenu_PageButton.uasset | 3 -- .../UI/Components/UIC_MainMenu_Title.uasset | 3 -- .../Source/Lost_Edge/Lost_Edge.Build.cs | 8 ++-- .../Private/GraphicsSettingsHelper.cpp | 37 +++++++++++++++++++ .../Private/GraphicsSettingsHelper.h | 23 ++++++++++++ 38 files changed, 119 insertions(+), 63 deletions(-) create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_SmallButton.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MenuMain_PageButton.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsCategory.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsKeySelector.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_Title.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset new file mode 100644 index 0000000..d0f659d --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ef1817a6aa81c371c7edc45d33b8faeb2a19f22d52dc8c81e608be801904a84 +size 13552 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset new file mode 100644 index 0000000..0344799 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fe6c4fd42365952789dab56c8e6f45a8a19b5461f0e126b0bb394c6edb63821 +size 6986 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_SmallButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_SmallButton.uasset new file mode 100644 index 0000000..4e00ab3 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_SmallButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e7be9d963ac483ac56479a788b1d9e51957faf21ec389178b985ecc96a46f2a +size 7307 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MenuMain_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MenuMain_PageButton.uasset new file mode 100644 index 0000000..d5a1295 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MenuMain_PageButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f1ece54fbab7fc0239a9f019352d4cecbd0b8444e0c557b03bbbd25c5669d7 +size 7723 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset new file mode 100644 index 0000000..54b7f48 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad7f08dfb64fd3f4ac0fbc6bd9ec81a4c113bfd3e2dde318325d131c746b8e49 +size 341283 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsCategory.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsCategory.uasset new file mode 100644 index 0000000..db96232 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsCategory.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39fdb08e0221e246e54165c875b0b2bbd2845aa3a76266eeb8f53c7ea6b31369 +size 38269 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset new file mode 100644 index 0000000..1c20e64 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffbd972689ca6f97ab7b3d368e3e7cdbe26858359e0015a0ce77f685049fd10a +size 61581 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset new file mode 100644 index 0000000..8fc74de --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb1ffce3c78cb8cc620705fd93dcf9354029fa3bc67de504da673e19c2038569 +size 68949 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsKeySelector.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsKeySelector.uasset new file mode 100644 index 0000000..6f1279a --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsKeySelector.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac738c2d7807d81251495f1794b46c2d52a0a4b1fd668450da8985cc86036d1e +size 40954 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset new file mode 100644 index 0000000..557ab85 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8f62b2d0a9d81fd3585f9477b38acf9b8504847cf03df5a9441a19c22a61c10 +size 77333 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset new file mode 100644 index 0000000..15b3d50 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f848f6e7ae72d8d0c99fe4ff5f8295b539e3ad15b0150801a6aa63c2ec72ed53 +size 367684 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_Title.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_Title.uasset new file mode 100644 index 0000000..6581343 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_Title.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f31eddac3f08396c0b42f3fadd116036de20f2fadbcd851c3c8558449abc9c0b +size 448383 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset index 07c4166..223f22d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c54961497232b5b3bc1bc712b62c546377d267f9016cc2debca089a980fd308 -size 119987 +oid sha256:90a68584c3e325ad259b9ca90878ac34ac52c1bfb6d09c5236f80ac15733b6da +size 119873 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset index 5091ff3..ecaeb54 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Home.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae76723653c9615604da1d4c6f0658f74c6a66f29a48e3ddbd09640b38ec372d -size 133071 +oid sha256:0d1ab4322892e42ca4e2998d6887415a81d6ed99ad7a65ef4611e75a57a72001 +size 132734 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset index 86c3975..ebde59a 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79c137948d7e5184ca1230c9c461c6e23bf225ee44d657003d938b23d62ff3da -size 68002 +oid sha256:b0e781aa6d6836355b90fbd758ed2a1c628813e7492f62e982105f74f0580e0b +size 67822 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset index e85345d..20f4953 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Audio.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:245a41b788f5cf2c392401225e701bee6ec493a9b5275686bb876dce3f4efbe6 -size 179621 +oid sha256:7fb61162c5c7f096052b6b7a575bf3959b935ea13e94278ee8b3f11d9e30f9c6 +size 179055 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset index 8689e74..89640c2 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Game.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7801f52458c5b085992c1ac5e956b72285699cec7ee4af24104d6397c48295bc -size 96533 +oid sha256:7550073813e62fc6695d9241ff67ba456526a907227420c8fcf1de0f078338c1 +size 96918 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset index ecbf921..0e6aafd 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9aeaebec4e95c2f53bf51442efb796560e0fe8d65f5887d36591de7b0f682e21 -size 170790 +oid sha256:6eeeec30266e2e9460df51d739cd18b360dbe381fde52167e1af15b6fb939153 +size 117065 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index daf1260..6911cf6 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93f19c4b51065dc57743c25132032146f036249f0c374c592dab864f1c3862c5 -size 241855 +oid sha256:e19603b288905af80c6f53f14bdb6ce5b70af46c5f188a5b0a062e064d3545a8 +size 238305 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset index 76c474d..e039ee0 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa445eb438ecf53694584bda7e43c7746a2c61238d98b4e5b0665e3b98b4e87f -size 929306 +oid sha256:4c7e26391465b6d60a05d8fbd44b1108b13758332251eeb4b323011bf3272969 +size 929530 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset deleted file mode 100644 index fea9005..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsControls.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1b79c1fd758a592357c72366d989ba0185792c811f75601dee9a09784f57613 -size 129437 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset deleted file mode 100644 index 9405b9e..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuOptionsVideo.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43af47b809caafb6762158d0d3521fe80d7cbae5efc46b511c5126d6a7708043 -size 116192 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset deleted file mode 100644 index de68f7c..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_Page.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c3a942954cbba0c1406e32321f3f3f23985fcd9dd60e5cf02706d1c80cea900 -size 13492 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset deleted file mode 100644 index c8fe0e8..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70b868f6cf2d8e23c1fa0239953d779f9cc1c923e4c987951bb5a94eea31b5c2 -size 6926 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset deleted file mode 100644 index 21c35b9..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_SmallButton.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c18c5f3da0b42351af74d92bcd84e799b69039887f1a3e24bdbb9f8a8136329e -size 7247 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset deleted file mode 100644 index d8d598b..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MenuMain_PageButton.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:94f98024deddb686420b2546b1badf1691507fef0fd3f5952d3930368c1a9929 -size 7663 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset index b2381af..d6c2568 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Keyselector.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e1a593a5828a817ac0e9083171901ec88bb601e00134da762ba33370e517f584 -size 172478 +oid sha256:319898bbd889e2c5f897eed44e79a4ca27781c1ca69fa946ff0ea0fc24cd3db3 +size 172480 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset deleted file mode 100644 index 312746e..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsButton.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ecd4075b374af4aebe1e63429ac0ce65b8882945c006f59f5f58d1d1af47510a -size 341123 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset deleted file mode 100644 index 6e8eb9f..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsCategory.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:02463404f82d89ab8062a78728dc6a77e2246cb51522b5e47567d14649e8c12c -size 38169 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset deleted file mode 100644 index 944688d..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5aa1d53af63777f21fa4a01b11a049be775c448f17cd7db25fb52036f239c55 -size 61481 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset deleted file mode 100644 index f51d24d..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsComboBox_Bool.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:71ae04b2ecc2b47966a4cd26a9052ac6c8646c1e171ae69b60df05257677078d -size 69115 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset deleted file mode 100644 index c45657e..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsKeySelector.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:34af8d5e81500e0cacc3761944ad9ac9397c95aed613d17e8879146667bc31dc -size 40854 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset deleted file mode 100644 index 2c62b55..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_OptionsSlider.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:51e0896d4bca4e3ccd43d1ec3fabe18ce55c452d07b21ffbfb335a72e9ffec18 -size 77285 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset deleted file mode 100644 index bc13035..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_PageButton.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:25557946f1a186a06e1286b0df1fe9d048de0e9ea562118aaca35a58bb47cc25 -size 367549 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset deleted file mode 100644 index ad23a9d..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_MainMenu_Title.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:494897ebb21506071b1df404c10bf3898862afd29edfb2cb40170f4ee347ebdf -size 454837 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Lost_Edge.Build.cs b/UnrealProject/Lost_Edge/Source/Lost_Edge/Lost_Edge.Build.cs index a64361a..b5287de 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Lost_Edge.Build.cs +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Lost_Edge.Build.cs @@ -2,14 +2,16 @@ using UnrealBuildTool; -public class Lost_Edge : ModuleRules { - public Lost_Edge(ReadOnlyTargetRules Target) : base(Target) { +public class Lost_Edge : ModuleRules +{ + public Lost_Edge(ReadOnlyTargetRules Target) : base(Target) + { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OpenCV" }); PrivateDependencyModuleNames.AddRange(new string[] { "EnhancedInput", "UMG", "RHI", "RenderCore", "Lost_EdgeShaders", "PakFile", //"TextureCompressor", - "LevelSequence", "MovieScene", "HTTP", "Json" }); // "Slate", "SlateCore" + "LevelSequence", "MovieScene", "HTTP", "Json", "ApplicationCore" }); // "Slate", "SlateCore" // UE_LOG(LogTemp, Log, TEXT("capture: %s"), (capture ? TEXT("true") : TEXT("false"))); // GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("1")); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp new file mode 100644 index 0000000..da31d06 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -0,0 +1,37 @@ +// Oleg Petruny proprietary. + +#include "GraphicsSettingsHelper.h" + +#include "GenericPlatform/GenericApplication.h" + +int32 UGraphicsSettingsHelper::GetPrimaryMonitorId() +{ + FDisplayMetrics FDM; + FDisplayMetrics::GetMonitorsInfo(FDM); + TArray buffer; + for(const FMonitorInfo& i : FDM.MonitorInfo) + { + buffer.Add(FMonitorInfo(i.Name, i.ID, i.NativeWidth, i.NativeHeight, + FPlatformRectangle(i.DisplayRect.Left, i.DisplayRect.Top, i.DisplayRect.Right, i.DisplayRect.Bottom), + FPlatformRectangle(i.WorkArea.Left, i.WorkArea.Top, i.WorkArea.Right, i.WorkArea.Bottom), + i.bIsPrimary, i.DPI)); + } + monitors = buffer; + TArray monitors = GetAvailableMonitors(); + for(int i = 0; i < monitors.Num(); i++) + if(monitors[i].bIsPrimary) + return i; +} + +int32 UGraphicsSettingsHelper::GetCurrentMonitorId() +{ + return int32(); +} + +//TArray UGraphicsSettingsHelper::GetAvailableMonitors() +//{ +// return TArray(); +//} + +void UGraphicsSettingsHelper::SetMonitor(int32 id) +{} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h new file mode 100644 index 0000000..2c6f702 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h @@ -0,0 +1,23 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Kismet/BlueprintFunctionLibrary.h" + +#include "GraphicsSettingsHelper.generated.h" + +UCLASS() +class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) + static int32 GetPrimaryMonitorId(); + UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) + static int32 GetCurrentMonitorId(); + //UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) + //static TArray GetAvailableMonitors(); + UFUNCTION(BlueprintCallable, Category = GraphicsSettingsHelper) + static void SetMonitor(int32 id); +}; -- 2.45.2 From 07f34a7c6b72d0d0a41759c5969c912c7edcb057 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Thu, 9 Jan 2025 13:04:51 +0100 Subject: [PATCH 5/9] graphic settings wip 2 --- .../Lost_Edge/Private/CommonFunctions.cpp | 32 ++ .../Lost_Edge/Private/CommonFunctions.h | 12 + .../Lost_Edge/Private/CustomGameSettings.cpp | 58 ++-- .../Lost_Edge/Private/CustomGameSettings.h | 54 ++-- .../Private/GraphicsSettingsHelper.cpp | 302 ++++++++++++++++-- .../Private/GraphicsSettingsHelper.h | 104 +++++- 6 files changed, 478 insertions(+), 84 deletions(-) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp index 78f528f..c859f95 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp @@ -105,6 +105,38 @@ FWorldDilationChangedDelegate& UCommonFunctions::GetWorldDilationChangedDelegate return SlowMotion::worldDilationChangedDelegate; } +FString UCommonFunctions::IntPointToString(const FIntPoint& in) +{ + FString result = FString::Printf(TEXT("%sx%s"), *FString::FromInt(in.X), *FString::FromInt(in.Y)); + return MoveTemp(result); +} + +FIntPoint UCommonFunctions::StringToIntPoint(const FString& in) +{ + FIntPoint result; + + const FRegexPattern rgxP(FRegexPattern(TEXT("[0-9]+"))); + FRegexMatcher rgx = FRegexMatcher(rgxP, in); + if(rgx.FindNext()) + result.X = FCString::Atoi(*in.Mid(rgx.GetMatchBeginning(), rgx.GetMatchEnding() - rgx.GetMatchBeginning())); + if(rgx.FindNext()) + result.Y = FCString::Atoi(*in.Mid(rgx.GetMatchBeginning(), rgx.GetMatchEnding() - rgx.GetMatchBeginning())); + + return MoveTemp(result); +} + +int32 UCommonFunctions::GreatestCommonDivisor(int32 a, int32 b) +{ + int32 temp; + while(b != 0) + { + temp = b; + b = a % b; + a = temp; + } + return a; +} + void UCommonFunctions::SlowMotionTick() { const UWorld* world = UCustomGameInstance::Get()->GetWorld(); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h index 7e40538..d8539c8 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h @@ -44,6 +44,18 @@ public: + UFUNCTION(BlueprintPure, Category = TypeCasts) + static FString IntPointToString(const FIntPoint& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) + static FIntPoint StringToIntPoint(const FString& in); + + + + UFUNCTION(BlueprintPure, Category = Math) + static int32 GreatestCommonDivisor(int32 a, int32 b); + + + UFUNCTION(BlueprintPure) static TArray GetRandomIntArray(int32 size = 16, int32 min = 0, int32 max = 16); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp index b095e21..7584495 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp @@ -23,16 +23,16 @@ UCustomGameSettings::UCustomGameSettings(const FObjectInitializer& ObjectInitial bUseMotionBlur = false; bShowFps = false; - /** Game */ - fMouseSensetivity = GetDefaultMouseSensetivity(); - bMouseInverted = GetDefaultMouseInverted(); - /** Audio */ fMasterVolume = GetDefaultMasterVolume(); fMusicVolume = GetDefaultMusicVolume(); fEffectsVolume = GetDefaultEffectsVolume(); fVoicesVolume = GetDefaultVoicesVolume(); fMenuVolume = GetDefaultMenuVolume(); + + /** Game */ + fMouseSensetivity = GetDefaultMouseSensetivity(); + bMouseInverted = GetDefaultMouseInverted(); } UCustomGameSettings* UCustomGameSettings::Get() @@ -42,45 +42,24 @@ UCustomGameSettings* UCustomGameSettings::Get() -/** Game */ -float UCustomGameSettings::GetDefaultMouseSensetivity() const -{ - return fDefaultMouseSensetivity; -} -float UCustomGameSettings::GetMouseSensetivity() const -{ - return fMouseSensetivity; -} -void UCustomGameSettings::SetMouseSensetivity(float value) -{ - fMouseSensetivity = FMath::Clamp(value, 0.1f, 2.0f); -} - -bool UCustomGameSettings::GetDefaultMouseInverted() const -{ - return bDefaultMouseInverted; -} - - - /** Audio */ -float UCustomGameSettings::GetDefaultMasterVolume() const +inline float UCustomGameSettings::GetDefaultMasterVolume() const { return fDefaultMasterVolume; } -float UCustomGameSettings::GetDefaultMusicVolume() const +inline float UCustomGameSettings::GetDefaultMusicVolume() const { return fDefaultMusicVolume; } -float UCustomGameSettings::GetDefaultEffectsVolume() const +inline float UCustomGameSettings::GetDefaultEffectsVolume() const { return fDefaultEffectsVolume; } -float UCustomGameSettings::GetDefaultVoicesVolume() const +inline float UCustomGameSettings::GetDefaultVoicesVolume() const { return fDefaultVoicesVolume; } -float UCustomGameSettings::GetDefaultMenuVolume() const +inline float UCustomGameSettings::GetDefaultMenuVolume() const { return fDefaultMenuVolume; } @@ -126,3 +105,22 @@ void UCustomGameSettings::SetMenuVolume(float value) { fMenuVolume = FMath::Clamp(value, 0.0f, 1.0f); } + +/** Game */ +inline float UCustomGameSettings::GetDefaultMouseSensetivity() const +{ + return fDefaultMouseSensetivity; +} +float UCustomGameSettings::GetMouseSensetivity() const +{ + return fMouseSensetivity; +} +void UCustomGameSettings::SetMouseSensetivity(float value) +{ + fMouseSensetivity = FMath::Clamp(value, 0.1f, 2.0f); +} + +inline bool UCustomGameSettings::GetDefaultMouseInverted() const +{ + return bDefaultMouseInverted; +} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h index 094d031..239d687 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h @@ -23,7 +23,7 @@ public: static UCustomGameSettings* Get(); - + /** Graphics */ UPROPERTY(Config, BlueprintReadWrite) bool bUseMotionBlur; @@ -32,40 +32,20 @@ public: - /** Game */ - UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultMouseSensetivity() const; - /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ - UFUNCTION(BlueprintPure, Category = Settings) - float GetMouseSensetivity() const; - /** - * Sets mouse sensetivity multiplier - * @param value [0.1 - 2.0] - */ - UFUNCTION(BlueprintCallable, Category = Settings) - void SetMouseSensetivity(float value); - - UFUNCTION(BlueprintPure, Category = Settings) - bool GetDefaultMouseInverted() const; - UPROPERTY(Config, BlueprintReadWrite) - bool bMouseInverted; - - - /** * Audio * All values are clamped in [0.0 - 1.0] */ UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultMasterVolume() const; // UFUNCTION doesn't support constexpr functions + LOST_EDGE_API inline float GetDefaultMasterVolume() const; // UFUNCTION doesn't support constexpr functions UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultMusicVolume() const; // UFUNCTION doesn't support constexpr functions + LOST_EDGE_API inline float GetDefaultMusicVolume() const; // UFUNCTION doesn't support constexpr functions UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultEffectsVolume() const; // UFUNCTION doesn't support constexpr functions + LOST_EDGE_API inline float GetDefaultEffectsVolume() const; // UFUNCTION doesn't support constexpr functions UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultVoicesVolume() const; // UFUNCTION doesn't support constexpr functions + LOST_EDGE_API inline float GetDefaultVoicesVolume() const; // UFUNCTION doesn't support constexpr functions UFUNCTION(BlueprintPure, Category = Settings) - float GetDefaultMenuVolume() const; // UFUNCTION doesn't support constexpr functions + LOST_EDGE_API inline float GetDefaultMenuVolume() const; // UFUNCTION doesn't support constexpr functions UFUNCTION(BlueprintPure, Category = Settings) float GetMasterVolume() const; @@ -89,6 +69,28 @@ public: UFUNCTION(BlueprintCallable, Category = Settings) void SetMenuVolume(float value); + + + /** Game */ + UFUNCTION(BlueprintPure, Category = Settings) + LOST_EDGE_API inline float GetDefaultMouseSensetivity() const; + /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ + UFUNCTION(BlueprintPure, Category = Settings) + float GetMouseSensetivity() const; + /** + * Sets mouse sensetivity multiplier + * @param value [0.1 - 2.0] + */ + UFUNCTION(BlueprintCallable, Category = Settings) + void SetMouseSensetivity(float value); + + UFUNCTION(BlueprintPure, Category = Settings) + LOST_EDGE_API inline bool GetDefaultMouseInverted() const; + UPROPERTY(Config, BlueprintReadWrite) + bool bMouseInverted; + + + protected: UPROPERTY(Config) float fMouseSensetivity; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp index da31d06..7057683 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -4,34 +4,294 @@ #include "GenericPlatform/GenericApplication.h" +#include "CommonFunctions.h" +#include "CustomGameSettings.h" + +namespace +{ + const FIntPoint ipDefaultWindowPosition = { 0, 0 }; + constexpr int32 iDefaultMonitorId = 0; + const FIntPoint ipDefaultResolution = { 1920, 1080 }; + constexpr float fDefaultResolutionScale = 1.0f; + constexpr int32 iDefaultFrameRateLimit = 120; +} + +FIntPoint UGraphicsSettingsHelper::GetDefaultWindowPosition([[maybe_unused]] UCustomGameSettings* settings) +{ + return ipDefaultWindowPosition; +} + +FIntPoint UGraphicsSettingsHelper::GetWindowPosition([[maybe_unused]] UCustomGameSettings* settings) +{ + if(GEngine && GEngine->GameViewport) + { + if(auto window = GEngine->GameViewport->GetWindow()) + { + auto pos = window->GetPositionInScreen(); + return { (int32)pos.X, (int32)pos.Y }; + } + } + + return GetDefaultWindowPosition(settings); +} + +void UGraphicsSettingsHelper::SetWindowPosition([[maybe_unused]] UCustomGameSettings* settings, const FIntPoint& pos) +{ + if(settings && GEngine && GEngine->GameViewport) + { + if(auto window = GEngine->GameViewport->GetWindow()) + { + window->MoveWindowTo(pos); + settings->SetWindowPosition(pos.X, pos.Y); + } + } + + return; +} + +int32 UGraphicsSettingsHelper::GetDefaultMonitorId([[maybe_unused]] UCustomGameSettings* settings) +{ + return iDefaultMonitorId; +} + +int32 UGraphicsSettingsHelper::GetMonitorId([[maybe_unused]] UCustomGameSettings* settings) +{ + int32 currentWidth = 0; + if(GEngine && GEngine->GameViewport) + currentWidth = GEngine->GameViewport->GetWindow()->GetPositionInScreen().X; + + auto monitors = GetAvailableMonitors(); + + int32 i = 0; + for(; i < monitors.Num(); ++i) + { + if(currentWidth <= monitors[i].NativeWidth) + return i; + else + currentWidth -= monitors[i].NativeWidth; + } + + return GetDefaultMonitorId(settings); +} + int32 UGraphicsSettingsHelper::GetPrimaryMonitorId() { - FDisplayMetrics FDM; - FDisplayMetrics::GetMonitorsInfo(FDM); - TArray buffer; - for(const FMonitorInfo& i : FDM.MonitorInfo) - { - buffer.Add(FMonitorInfo(i.Name, i.ID, i.NativeWidth, i.NativeHeight, - FPlatformRectangle(i.DisplayRect.Left, i.DisplayRect.Top, i.DisplayRect.Right, i.DisplayRect.Bottom), - FPlatformRectangle(i.WorkArea.Left, i.WorkArea.Top, i.WorkArea.Right, i.WorkArea.Bottom), - i.bIsPrimary, i.DPI)); - } - monitors = buffer; - TArray monitors = GetAvailableMonitors(); - for(int i = 0; i < monitors.Num(); i++) + auto monitors = GetAvailableMonitors(); + for(int32 i = 0; i < monitors.Num(); i++) if(monitors[i].bIsPrimary) return i; + + return GetDefaultMonitorId(nullptr); } -int32 UGraphicsSettingsHelper::GetCurrentMonitorId() +TArray UGraphicsSettingsHelper::GetAvailableMonitorsNames() { - return int32(); + TArray names; + auto monitors = GetAvailableMonitors(); + for(auto& m : monitors) + names.Add(m.ID); + + return MoveTemp(names); } -//TArray UGraphicsSettingsHelper::GetAvailableMonitors() -//{ -// return TArray(); -//} +TArray UGraphicsSettingsHelper::GetAvailableMonitors() +{ + FDisplayMetrics FDM; + FDisplayMetrics::RebuildDisplayMetrics(FDM); + return MoveTemp(FDM.MonitorInfo); +} + +void UGraphicsSettingsHelper::SetMonitor(UCustomGameSettings* settings, const int32 id) +{ + auto monitors = GetAvailableMonitors(); + if(id >= monitors.Num()) + return; + + int32 windowNewX = 0.0f; + for(int32 i = 0; i < id; ++i) + windowNewX += monitors[i].NativeWidth; + + FIntPoint currentRes = GEngine->GameViewport->Viewport->GetSizeXY(); + FIntPoint nativeRes = FIntPoint{ monitors[id].NativeWidth, monitors[id].NativeHeight }; + + SetWindowPosition(settings, FIntPoint{ + (nativeRes.X - currentRes.X) / 2 + windowNewX, + (nativeRes.Y - currentRes.Y) / 2 + }); +} + +FIntPoint UGraphicsSettingsHelper::GetDefaultResolution([[maybe_unused]] UCustomGameSettings* settings) +{ + return ipDefaultResolution; +} + +FIntPoint UGraphicsSettingsHelper::GetResolution([[maybe_unused]] UCustomGameSettings* settings) +{ + if(GEngine + && GEngine->GameViewport + && GEngine->GameViewport->Viewport) + return GEngine->GameViewport->Viewport->GetSizeXY(); + + return GetNativeResolutionByMonitorId(GetMonitorId(settings)); +} + +FIntPoint UGraphicsSettingsHelper::GetNativeResolutionByMonitorId(const int32 id) +{ + auto monitors = GetAvailableMonitors(); + if(id < monitors.Num()) + return { monitors[id].NativeWidth, monitors[id].NativeHeight }; + + return GetDefaultResolution(nullptr); +} + +TArray UGraphicsSettingsHelper::GetAllAvailableResolutionsAndRefreshRates() +{ + TArray buffer; + if(!RHIGetAvailableResolutions(buffer, false) || buffer.Num() == 0) + return { {GetResolution(nullptr), {GetDefaultFrameRateLimit(nullptr)}} }; + + TArray result = {}; + int32 lastWidth = 0; + int32 lastHeight = 0; + for(auto& i : buffer) + { + if(lastWidth != i.Width || lastHeight != i.Height) + { + result.Add({ {static_cast(i.Width), static_cast(i.Height)}, {static_cast(i.RefreshRate)} }); + lastHeight = i.Height; + lastWidth = i.Width; + } + else + { + result[result.Num() - 1].refreshRates.Add(static_cast(i.RefreshRate)); + } + } + + return MoveTemp(result); +} + +TArray UGraphicsSettingsHelper::GetAllAvailableResolutions() +{ + TArray buffer; + if(!RHIGetAvailableResolutions(buffer, false) || buffer.Num() == 0) + return { {GetResolution(nullptr), {GetDefaultFrameRateLimit(nullptr)}} }; + + TArray result; + int32 lastWidth = 0; + int32 lastHeight = 0; + for(auto& i : buffer) + { + if(lastWidth != i.Width || lastHeight != i.Height) + { + result.Add({ static_cast(i.Width), static_cast(i.Height) }); + lastHeight = i.Height; + lastWidth = i.Width; + } + } + return MoveTemp(result); +} + +TArray UGraphicsSettingsHelper::GetAvailableResolutionsByMonitorId(const int32 id) +{ + TArray result; + + FIntPoint nativeRes = GetNativeResolutionByMonitorId(id); + for(auto& i : GetAllAvailableResolutions()) + { + if(i.X > nativeRes.X && i.Y > nativeRes.Y) + continue; + result.Add(i); + } + + return MoveTemp(result); +} + +TArray UGraphicsSettingsHelper::FilterResolutionsViaAspectRatio(const TArray& resolutions, const FIntPoint& aspectRatio) +{ + TArray result; + + for(FIntPoint i : resolutions) + if(i.X % aspectRatio.X == 0 && i.Y % aspectRatio.Y == 0) + result.Add(i); + + return MoveTemp(result); +} + +void UGraphicsSettingsHelper::SetResolution(UCustomGameSettings* settings, const FIntPoint& resolution) +{ + if(!settings) + return; + + settings->bUseDynamicResolution = true; + settings->SetScreenResolution(resolution); +} + +float UGraphicsSettingsHelper::GetDefaultResolutionScale([[maybe_unused]] UCustomGameSettings* settings) +{ + return fDefaultResolutionScale; +} + +float UGraphicsSettingsHelper::GetResolutionScale([[maybe_unused]] UCustomGameSettings* settings) +{ + if(auto settings = UCustomGameSettings::Get()) + return settings->GetResolutionScaleNormalized(); + + return 1.0f; +} + +void UGraphicsSettingsHelper::SetResolutionScale(UCustomGameSettings* settings, const float resolutionScale) +{ + if(!settings) + return; + + settings->SetResolutionScaleNormalized(resolutionScale); +} + +int32 UGraphicsSettingsHelper::GetDefaultFrameRateLimit([[maybe_unused]] UCustomGameSettings* settings) +{ + return iDefaultFrameRateLimit; +} + +TArray UGraphicsSettingsHelper::GetAvailableFrameRateLimitsForResolution(const FIntPoint& resolution) +{ + auto resAndRates = GetAllAvailableResolutionsAndRefreshRates(); + for(auto& i : resAndRates) + if(i.resolution == resolution) + return MoveTemp(i.refreshRates); + + return { GetDefaultFrameRateLimit(nullptr) }; +} + +FIntPoint UGraphicsSettingsHelper::GetDefaultAspectRatio([[maybe_unused]] UCustomGameSettings* settings) +{ + return GetAspectRatioFromResolution(GetDefaultResolution(settings)); +} + +FIntPoint UGraphicsSettingsHelper::GetAspectRatio([[maybe_unused]] UCustomGameSettings* settings) +{ + return GetAspectRatioFromResolution(GetResolution(settings)); +} + +FIntPoint UGraphicsSettingsHelper::GetAspectRatioFromResolution(const FIntPoint& resolution) +{ + int32 gcd = UCommonFunctions::GreatestCommonDivisor(resolution.X, resolution.Y); + return { resolution.X / gcd, resolution.Y / gcd }; +} + +FIntPoint UGraphicsSettingsHelper::GetAspectRatioOfMonitor(const int32 monitor) +{ + return GetAspectRatioFromResolution(GetNativeResolutionByMonitorId(monitor)); +} + +TArray UGraphicsSettingsHelper::GetAvailableAspectRatiousOfMonitor(const int32 monitor) +{ + TArray resolutions = GetAvailableResolutionsByMonitorId(monitor); + if(resolutions.Num() == 0) + return { GetAspectRatio(nullptr) }; + + TSet aspects; + for(auto& i : resolutions) + aspects.Add(GetAspectRatioFromResolution(i)); + return aspects.Array(); +} -void UGraphicsSettingsHelper::SetMonitor(int32 id) -{} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h index 2c6f702..f20185b 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h @@ -6,18 +6,108 @@ #include "GraphicsSettingsHelper.generated.h" +USTRUCT(BlueprintType, Category = "Settings|Graphics|Structs") +struct FResolutionAndRefreshRates +{ + GENERATED_BODY() + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FIntPoint resolution; + UPROPERTY(EditAnywhere, BlueprintReadWrite) + TArray refreshRates; +}; + +UENUM(BlueprintType, Category = "Settings|Graphics|Enums") +enum class EDisplayMode : uint8 +{ + Fullscreen = 0, + Borderless = 1, + Windowed = 2 +}; + +/** + * Helper for trivial and complex graphic settings. + * Most of functions work without settings pointer. It is there just for Blueprint call convinience. + * Helps with window position, monitor selection, resolution, resolution scale, frame rate limit, aspect ratio, + * display mode and gamma. + */ UCLASS() class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary { GENERATED_BODY() public: - UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Window") + static FIntPoint GetDefaultWindowPosition(class UCustomGameSettings* settings); // inline functions need API macro, but API macro with static inline function results in "no definition" + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Window") + static FIntPoint GetWindowPosition(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Window") + static void SetWindowPosition(class UCustomGameSettings* settings, const FIntPoint& pos); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") + static int32 GetDefaultMonitorId(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") + static int32 GetMonitorId(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") static int32 GetPrimaryMonitorId(); - UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) - static int32 GetCurrentMonitorId(); - //UFUNCTION(BlueprintPure, Category = GraphicsSettingsHelper) - //static TArray GetAvailableMonitors(); - UFUNCTION(BlueprintCallable, Category = GraphicsSettingsHelper) - static void SetMonitor(int32 id); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") + static TArray GetAvailableMonitorsNames(); + static TArray GetAvailableMonitors(); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Monitor") + static void SetMonitor(class UCustomGameSettings* settings, const int32 id); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static FIntPoint GetDefaultResolution(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static FIntPoint GetResolution(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static FIntPoint GetNativeResolutionByMonitorId(const int32 id); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics") + static TArray GetAllAvailableResolutionsAndRefreshRates(); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static TArray GetAllAvailableResolutions(); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static TArray GetAvailableResolutionsByMonitorId(const int32 id); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") + static TArray FilterResolutionsViaAspectRatio(const TArray& resolutions, const FIntPoint& aspectRatio); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Resolution") + static void SetResolution(class UCustomGameSettings* settings, const FIntPoint& resolution); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") + static float GetDefaultResolutionScale(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") + static float GetResolutionScale(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Resolution Scale") + static void SetResolutionScale(class UCustomGameSettings* settings, const float resolutionScale); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Frame Rate Limit") + static int32 GetDefaultFrameRateLimit(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Frame Rate Limit") + static TArray GetAvailableFrameRateLimitsForResolution(const FIntPoint& resolution); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") + static FIntPoint GetDefaultAspectRatio(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") + static FIntPoint GetAspectRatio(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") + static FIntPoint GetAspectRatioFromResolution(const FIntPoint& resolution); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") + static FIntPoint GetAspectRatioOfMonitor(const int32 monitor); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") + static TArray GetAvailableAspectRatiousOfMonitor(const int32 monitor); + + //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") + //static EDisplayMode StringToDisplayMode(FString in); + //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") + //static FString DisplayModeToString(EDisplayMode mode); + //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") + //static void IntToDisplayMode(int in, EDisplayMode& mode); + //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") + //static void DisplayModeToInt(EDisplayMode mode, int& out); + //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") + //static void GetCurrentDisplayMode(EDisplayMode& mode); + //UFUNCTION(BlueprintCallable, Category = "Settings Video|Display Mode") + //static void SetDisplayMode(EDisplayMode mode); + }; -- 2.45.2 From 509d2e9c98d1566df63843cdd1b985873ad5c164 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Thu, 9 Jan 2025 18:17:39 +0100 Subject: [PATCH 6/9] graphics settings code --- .../Lost_Edge/Private/CameraModeBase.cpp | 8 - .../Source/Lost_Edge/Private/CommonTexts.h | 10 ++ .../Lost_Edge/Private/CustomGameSettings.cpp | 21 ++- .../Lost_Edge/Private/CustomGameSettings.h | 54 +++---- .../Private/GraphicsSettingsHelper.cpp | 145 +++++++++++++++++- .../Private/GraphicsSettingsHelper.h | 51 ++++-- .../Source/Lost_Edge/Private/PlayerBase.cpp | 6 - 7 files changed, 230 insertions(+), 65 deletions(-) create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonTexts.h diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CameraModeBase.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CameraModeBase.cpp index 1742346..648f9e4 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CameraModeBase.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CameraModeBase.cpp @@ -27,14 +27,6 @@ void ACameraModeBase::BeginPlay() Super::BeginPlay(); auto world = GetWorld(); - - if(auto gameSettings = UCustomGameSettings::Get()) - { - if(auto camera = FindComponentByClass()) - { - camera->PostProcessSettings.MotionBlurAmount = gameSettings->bUseMotionBlur ? 1.0f : 0.0f; - } - } } void ACameraModeBase::Tick(float DeltaTime) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonTexts.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonTexts.h new file mode 100644 index 0000000..af603f0 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonTexts.h @@ -0,0 +1,10 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "CoreMinimal.h" + +namespace CommonTexts +{ + const FText Default = NSLOCTEXT("CommonTexts", "Default", "Default"); +} \ No newline at end of file diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp index 7584495..7692feb 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp @@ -4,11 +4,12 @@ #include "Kismet/GameplayStatics.h" +#include "GraphicsSettingsHelper.h" + namespace { - /** Game */ - constexpr float fDefaultMouseSensetivity = 0.5f; - constexpr bool bDefaultMouseInverted = false; + /** Graphics */ + constexpr bool bDefaultShowFps = false; /** Audio */ constexpr float fDefaultMasterVolume = 0.4f; @@ -16,12 +17,17 @@ namespace constexpr float fDefaultEffectsVolume = 1.0f; constexpr float fDefaultVoicesVolume = 1.0f; constexpr float fDefaultMenuVolume = 1.0f; + + /** Game */ + constexpr float fDefaultMouseSensetivity = 0.5f; + constexpr bool bDefaultMouseInverted = false; } UCustomGameSettings::UCustomGameSettings(const FObjectInitializer& ObjectInitializer) :Super(ObjectInitializer) { - bUseMotionBlur = false; - bShowFps = false; + /** Graphics */ + bShowFps = GetDefaultShowFps(); + UGraphicsSettingsHelper::SetDefaults(this); /** Audio */ fMasterVolume = GetDefaultMasterVolume(); @@ -40,6 +46,11 @@ UCustomGameSettings* UCustomGameSettings::Get() return Cast(UGameUserSettings::GetGameUserSettings()); } +LOST_EDGE_API bool UCustomGameSettings::GetDefaultShowFps() const +{ + return bDefaultShowFps; +} + /** Audio */ diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h index 239d687..c02f5c6 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h @@ -15,78 +15,78 @@ class UCustomGameSettings : public UGameUserSettings { GENERATED_BODY() + friend class UGraphicsSettingsHelper; + public: // Is auto defined by UE but implementation is in cpp UCustomGameSettings(const FObjectInitializer& ObjectInitializer); - UFUNCTION(BlueprintPure, Category = Settings, meta = (DisplayName = "Get Custom Game Settings")) + UFUNCTION(BlueprintPure, Category = "Settings", meta = (DisplayName = "Get Custom Game Settings")) static UCustomGameSettings* Get(); + /** Graphics */ - UPROPERTY(Config, BlueprintReadWrite) - bool bUseMotionBlur; - - UPROPERTY(Config, BlueprintReadWrite) + UFUNCTION(BlueprintPure, Category = "Settings|Graphics") + LOST_EDGE_API inline bool GetDefaultShowFps() const; + UPROPERTY(Config, BlueprintReadWrite, Category = "Settings|Graphics") bool bShowFps; - - /** * Audio * All values are clamped in [0.0 - 1.0] */ - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") LOST_EDGE_API inline float GetDefaultMasterVolume() const; // UFUNCTION doesn't support constexpr functions - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") LOST_EDGE_API inline float GetDefaultMusicVolume() const; // UFUNCTION doesn't support constexpr functions - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") LOST_EDGE_API inline float GetDefaultEffectsVolume() const; // UFUNCTION doesn't support constexpr functions - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") LOST_EDGE_API inline float GetDefaultVoicesVolume() const; // UFUNCTION doesn't support constexpr functions - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") LOST_EDGE_API inline float GetDefaultMenuVolume() const; // UFUNCTION doesn't support constexpr functions - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") float GetMasterVolume() const; - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") float GetMusicVolume() const; - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") float GetEffectsVolume() const; - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") float GetVoicesVolume() const; - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Audio") float GetMenuVolume() const; - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") void SetMasterVolume(float value); - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") void SetMusicVolume(float value); - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") void SetEffectsVolume(float value); - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") void SetVoicesVolume(float value); - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") void SetMenuVolume(float value); /** Game */ - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Game") LOST_EDGE_API inline float GetDefaultMouseSensetivity() const; /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Game") float GetMouseSensetivity() const; /** * Sets mouse sensetivity multiplier * @param value [0.1 - 2.0] */ - UFUNCTION(BlueprintCallable, Category = Settings) + UFUNCTION(BlueprintCallable, Category = "Settings|Game") void SetMouseSensetivity(float value); - UFUNCTION(BlueprintPure, Category = Settings) + UFUNCTION(BlueprintPure, Category = "Settings|Game") LOST_EDGE_API inline bool GetDefaultMouseInverted() const; - UPROPERTY(Config, BlueprintReadWrite) + UPROPERTY(Config, BlueprintReadWrite, Category = "Settings|Game") bool bMouseInverted; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp index 7057683..76b2352 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -5,15 +5,44 @@ #include "GenericPlatform/GenericApplication.h" #include "CommonFunctions.h" +#include "CommonTexts.h" #include "CustomGameSettings.h" +#include + namespace { const FIntPoint ipDefaultWindowPosition = { 0, 0 }; + std::optional ipPreviousWindowPosition; constexpr int32 iDefaultMonitorId = 0; const FIntPoint ipDefaultResolution = { 1920, 1080 }; + std::optional ipPreviousResolution; constexpr float fDefaultResolutionScale = 1.0f; constexpr int32 iDefaultFrameRateLimit = 120; + constexpr EDisplayMode eDefaultDisplayMode = EDisplayMode::Fullscreen; + std::optional ePreviousDisplayMode; +} + +bool UGraphicsSettingsHelper::AreSettingsRestorable(UCustomGameSettings* settings) +{ + return ipPreviousWindowPosition.has_value() + || ipPreviousResolution.has_value() + || ePreviousDisplayMode.has_value(); +} + +void UGraphicsSettingsHelper::SetDefaults(UCustomGameSettings* settings) +{ + { + FIntPoint pos = GetDefaultWindowPosition(settings); + settings->WindowPosX = pos.X; + settings->WindowPosY = pos.Y; + } + { + FIntPoint res = GetDefaultResolution(settings); + settings->ResolutionSizeX = res.X; + settings->ResolutionSizeY = res.Y; + } + settings->FullscreenMode = DisplayToWindowMode(GetDefaultDisplayMode(settings)); } FIntPoint UGraphicsSettingsHelper::GetDefaultWindowPosition([[maybe_unused]] UCustomGameSettings* settings) @@ -35,18 +64,29 @@ FIntPoint UGraphicsSettingsHelper::GetWindowPosition([[maybe_unused]] UCustomGam return GetDefaultWindowPosition(settings); } -void UGraphicsSettingsHelper::SetWindowPosition([[maybe_unused]] UCustomGameSettings* settings, const FIntPoint& pos) +void UGraphicsSettingsHelper::SetWindowPosition(UCustomGameSettings* settings, const FIntPoint& pos) { if(settings && GEngine && GEngine->GameViewport) { if(auto window = GEngine->GameViewport->GetWindow()) { + if(ipPreviousWindowPosition == pos) + ipPreviousWindowPosition.reset(); + else + ipPreviousWindowPosition = GetWindowPosition(settings); + window->MoveWindowTo(pos); settings->SetWindowPosition(pos.X, pos.Y); } } +} - return; +void UGraphicsSettingsHelper::RestoreWindowPosition(UCustomGameSettings* settings) +{ + if(!ipPreviousWindowPosition.has_value()) + return; + + SetWindowPosition(settings, ipPreviousWindowPosition.value()); } int32 UGraphicsSettingsHelper::GetDefaultMonitorId([[maybe_unused]] UCustomGameSettings* settings) @@ -120,6 +160,11 @@ void UGraphicsSettingsHelper::SetMonitor(UCustomGameSettings* settings, const in }); } +void UGraphicsSettingsHelper::RestoreMonitor(UCustomGameSettings* settings) +{ + RestoreWindowPosition(settings); +} + FIntPoint UGraphicsSettingsHelper::GetDefaultResolution([[maybe_unused]] UCustomGameSettings* settings) { return ipDefaultResolution; @@ -223,9 +268,23 @@ void UGraphicsSettingsHelper::SetResolution(UCustomGameSettings* settings, const return; settings->bUseDynamicResolution = true; + + if(ipPreviousResolution.has_value() && ipPreviousResolution == resolution) + ipPreviousResolution.reset(); + else + ipPreviousResolution = resolution; + settings->SetScreenResolution(resolution); } +void UGraphicsSettingsHelper::RestoreResolution(UCustomGameSettings* settings) +{ + if(!ipPreviousResolution.has_value()) + return; + + SetResolution(settings, ipPreviousResolution.value()); +} + float UGraphicsSettingsHelper::GetDefaultResolutionScale([[maybe_unused]] UCustomGameSettings* settings) { return fDefaultResolutionScale; @@ -295,3 +354,85 @@ TArray UGraphicsSettingsHelper::GetAvailableAspectRatiousOfMonitor(co return aspects.Array(); } +EDisplayMode UGraphicsSettingsHelper::GetDefaultDisplayMode([[maybe_unused]] UCustomGameSettings* settings) +{ + return eDefaultDisplayMode; +} + +EDisplayMode UGraphicsSettingsHelper::GetDisplayMode(UCustomGameSettings* settings) +{ + if(!settings) + return GetDefaultDisplayMode(settings); + + return WindowToDisplayMode(settings->GetFullscreenMode()); +} + +EDisplayMode UGraphicsSettingsHelper::TextToDisplayMode(const FText& in) +{ + static const UEnum* enumPtr = FindObject(ANY_PACKAGE, TEXT("EDisplayMode"), true); + if(!enumPtr) + return GetDefaultDisplayMode(nullptr); + + return static_cast(enumPtr->GetValueByName(FName{ *FTextInspector::GetSourceString(in) })); +} + +FText UGraphicsSettingsHelper::DisplayModeToText(const EDisplayMode mode) +{ + static const UEnum* enumPtr = FindObject(ANY_PACKAGE, TEXT("EDisplayMode"), true); + if(!enumPtr) + return CommonTexts::Default; + + return enumPtr->GetDisplayNameTextByIndex(static_cast(mode)); +} + +void UGraphicsSettingsHelper::SetDisplayMode(UCustomGameSettings* settings, const EDisplayMode mode) +{ + if(!settings) + return; + + if(ePreviousDisplayMode.has_value() && ePreviousDisplayMode == mode) + ePreviousDisplayMode.reset(); + else + ePreviousDisplayMode = mode; + + settings->SetFullscreenMode(DisplayToWindowMode(mode)); +} + +void UGraphicsSettingsHelper::RestoreDisplayMode(UCustomGameSettings* settings) +{ + if(!ePreviousDisplayMode.has_value()) + return; + + SetDisplayMode(settings, ePreviousDisplayMode.value()); +} + +inline constexpr EDisplayMode UGraphicsSettingsHelper::WindowToDisplayMode(const EWindowMode::Type mode) +{ + switch(mode) + { + case EWindowMode::Type::WindowedFullscreen: + return EDisplayMode::Borderless; + case EWindowMode::Type::Windowed: + return EDisplayMode::Windowed; + case EWindowMode::Type::Fullscreen: + default: + return EDisplayMode::Fullscreen; + } +} + +inline constexpr EWindowMode::Type UGraphicsSettingsHelper::DisplayToWindowMode(const EDisplayMode mode) +{ + switch(mode) + { + case EDisplayMode::Borderless: + return EWindowMode::Type::WindowedFullscreen; + case EDisplayMode::Windowed: + return EWindowMode::Type::Windowed; + case EDisplayMode::Fullscreen: + default: + return EWindowMode::Type::Fullscreen; + } +} + + + diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h index f20185b..5d5f1d6 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h @@ -18,19 +18,20 @@ public: TArray refreshRates; }; +/** Redefine of EWindowType, because it has duplicate without blueprint macro */ UENUM(BlueprintType, Category = "Settings|Graphics|Enums") enum class EDisplayMode : uint8 { - Fullscreen = 0, - Borderless = 1, - Windowed = 2 + Fullscreen = 0 UMETA(DisplayName = "Fullscreen"), + Borderless = 1 UMETA(DisplayName = "Borderless"), + Windowed = 2 UMETA(DisplayName = "Windowed") }; /** * Helper for trivial and complex graphic settings. * Most of functions work without settings pointer. It is there just for Blueprint call convinience. - * Helps with window position, monitor selection, resolution, resolution scale, frame rate limit, aspect ratio, - * display mode and gamma. + * Helps with window position, monitor selection, resolution, resolution scale, frame rate limit, aspect ratio, display mode. + * */ UCLASS() class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary @@ -38,13 +39,22 @@ class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary GENERATED_BODY() public: + UFUNCTION(BlueprintPure, Category = "Settings|Graphics", meta = (DisplayName = "AreGraphicsSettingsRestorable")) + static bool AreSettingsRestorable(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics", meta = (DisplayName = "SetGraphicsDefaults")) + static void SetDefaults(class UCustomGameSettings* settings); + +protected: // Window position setting is on the thin edge of user safeness, therefore protected. Please use SetMonitor(). UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Window") static FIntPoint GetDefaultWindowPosition(class UCustomGameSettings* settings); // inline functions need API macro, but API macro with static inline function results in "no definition" UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Window") static FIntPoint GetWindowPosition(class UCustomGameSettings* settings); UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Window") static void SetWindowPosition(class UCustomGameSettings* settings, const FIntPoint& pos); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Window") + static void RestoreWindowPosition(class UCustomGameSettings* settings); +public: UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") static int32 GetDefaultMonitorId(class UCustomGameSettings* settings); UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") @@ -56,6 +66,8 @@ public: static TArray GetAvailableMonitors(); UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Monitor") static void SetMonitor(class UCustomGameSettings* settings, const int32 id); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Monitor") + static void RestoreMonitor(class UCustomGameSettings* settings); UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution") static FIntPoint GetDefaultResolution(class UCustomGameSettings* settings); @@ -73,6 +85,8 @@ public: static TArray FilterResolutionsViaAspectRatio(const TArray& resolutions, const FIntPoint& aspectRatio); UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Resolution") static void SetResolution(class UCustomGameSettings* settings, const FIntPoint& resolution); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Resolution") + static void RestoreResolution(class UCustomGameSettings* settings); UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") static float GetDefaultResolutionScale(class UCustomGameSettings* settings); @@ -97,17 +111,20 @@ public: UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Aspect Ratio") static TArray GetAvailableAspectRatiousOfMonitor(const int32 monitor); - //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") - //static EDisplayMode StringToDisplayMode(FString in); - //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") - //static FString DisplayModeToString(EDisplayMode mode); - //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") - //static void IntToDisplayMode(int in, EDisplayMode& mode); - //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") - //static void DisplayModeToInt(EDisplayMode mode, int& out); - //UFUNCTION(BlueprintPure, Category = "Settings Video|Display Mode") - //static void GetCurrentDisplayMode(EDisplayMode& mode); - //UFUNCTION(BlueprintCallable, Category = "Settings Video|Display Mode") - //static void SetDisplayMode(EDisplayMode mode); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Display Mode") + static EDisplayMode GetDefaultDisplayMode(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Display Mode") + static EDisplayMode GetDisplayMode(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Display Mode") + static EDisplayMode TextToDisplayMode(const FText& in); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Display Mode") + static FText DisplayModeToText(const EDisplayMode mode); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Display Mode") + static void SetDisplayMode(class UCustomGameSettings* settings, const EDisplayMode mode); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Display Mode") + static void RestoreDisplayMode(class UCustomGameSettings* settings); +private: + inline constexpr static EDisplayMode WindowToDisplayMode(const EWindowMode::Type mode); + inline constexpr static EWindowMode::Type DisplayToWindowMode(const EDisplayMode mode); }; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp index e841f08..d9ca437 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp @@ -85,12 +85,6 @@ void APlayerBase::BeginPlay() cameraManager->ViewPitchMax = maxPitch; } - auto gameSettings = UCustomGameSettings::Get(); - if(gameSettings && camera) - { - camera->PostProcessSettings.MotionBlurAmount = gameSettings->bUseMotionBlur ? 1.0f : 0.0f; - } - LoadInteractablesActivators(); } -- 2.45.2 From 0176cc90dec48a6cdad9b60fca71ed1ee747196b Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Sun, 12 Jan 2025 23:49:42 +0100 Subject: [PATCH 7/9] graphics settings --- .../Config/DefaultGameUserSettings.ini | 15 +- .../Content/UI/BP_MainWidgetManager.uasset | 4 +- .../UICC_MainMenu_PageButtonParticle.uasset | 2 +- .../UIC_MainMenu_OptionsButton.uasset | 4 +- .../UIC_MainMenu_OptionsComboBox.uasset | 4 +- .../UIC_MainMenu_OptionsSlider.uasset | 4 +- .../Components/UIC_MainMenu_PageButton.uasset | 4 +- .../E_MainMenuOptionsButtonName.uasset | 4 +- .../UI_MainMenu_Page_Options_Graphics.uasset | 4 +- .../MainMenu/UI_MainMenuCredits.uasset | 3 - .../Blueprints/Overlays/UI_Crosshair.uasset | 4 +- .../Overlays/UI_DevelopBuildWarning.uasset | 4 +- .../Blueprints/Overlays/UI_FpsCounter.uasset | 3 + .../Content/UI/Blueprints/UI_Journal.uasset | 2 +- .../Content/UI/Components/UIC_ComboBox.uasset | 4 +- .../Content/UI/Components/UIC_Slider.uasset | 4 +- .../Lost_Edge/Private/CommonFunctions.cpp | 57 ++++++- .../Lost_Edge/Private/CommonFunctions.h | 16 ++ .../Lost_Edge/Private/CommonInspectors.cpp | 63 +++++++ .../Lost_Edge/Private/CommonInspectors.h | 34 ++++ .../Lost_Edge/Private/CustomGameSettings.cpp | 21 +++ .../Lost_Edge/Private/CustomGameSettings.h | 9 +- .../Private/GraphicsSettingsHelper.cpp | 158 +++++++++++++----- .../Private/GraphicsSettingsHelper.h | 33 +++- .../Private/Widgets/ComboBoxText.cpp | 48 +++++- .../Lost_Edge/Private/Widgets/ComboBoxText.h | 15 +- .../Widgets/ResolutionResponsiveWidget.cpp | 1 + .../Private/Widgets/WidgetsManager.cpp | 28 ++++ .../Private/Widgets/WidgetsManager.h | 7 + 29 files changed, 469 insertions(+), 90 deletions(-) delete mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset create mode 100644 UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_FpsCounter.uasset create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.cpp create mode 100644 UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.h diff --git a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini index d9bc256..4ac5f7e 100644 --- a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini +++ b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini @@ -1,5 +1,4 @@ [/Script/Lost_Edge.CustomGameSettings] -bUseMotionBlur=False bShowFps=False bMouseInverted=False fMouseSensetivity=1.000000 @@ -9,13 +8,13 @@ fEffectsVolume=1.000000 fVoicesVolume=1.000000 fMenuVolume=1.000000 bUseVSync=False -bUseDynamicResolution=False +bUseDynamicResolution=True ResolutionSizeX=1920 ResolutionSizeY=1080 LastUserConfirmedResolutionSizeX=1920 LastUserConfirmedResolutionSizeY=1080 -WindowPosX=-1 -WindowPosY=-1 +WindowPosX=0 +WindowPosY=0 FullscreenMode=1 LastConfirmedFullscreenMode=1 PreferredFullscreenMode=1 @@ -23,10 +22,10 @@ Version=5 AudioQualityLevel=0 LastConfirmedAudioQualityLevel=0 FrameRateLimit=0.000000 -DesiredScreenWidth=1280 -DesiredScreenHeight=720 -LastUserConfirmedDesiredScreenWidth=1280 -LastUserConfirmedDesiredScreenHeight=720 +DesiredScreenWidth=1920 +DesiredScreenHeight=1080 +LastUserConfirmedDesiredScreenWidth=1920 +LastUserConfirmedDesiredScreenHeight=1080 LastRecommendedScreenWidth=-1.000000 LastRecommendedScreenHeight=-1.000000 LastCPUBenchmarkResult=-1.000000 diff --git a/UnrealProject/Lost_Edge/Content/UI/BP_MainWidgetManager.uasset b/UnrealProject/Lost_Edge/Content/UI/BP_MainWidgetManager.uasset index d4d2dca..3c91fa7 100644 --- a/UnrealProject/Lost_Edge/Content/UI/BP_MainWidgetManager.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/BP_MainWidgetManager.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e95c10c69373b3a62ba6d80f00db0455308691cf9c0e2afc92c52aa9f3054ab6 -size 7924 +oid sha256:3d91fb19b4df3c5e5975e5e69d7c03e0fccb04ebd5597110665fd221cbe29121 +size 8472 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset index 0344799..3db4853 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6fe6c4fd42365952789dab56c8e6f45a8a19b5461f0e126b0bb394c6edb63821 +oid sha256:3c29909dc91b1fb532f4076a7ff9aeb6eed6d0115b23eaba3ea0f732533526bd size 6986 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset index 54b7f48..98e15ba 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ad7f08dfb64fd3f4ac0fbc6bd9ec81a4c113bfd3e2dde318325d131c746b8e49 -size 341283 +oid sha256:8b50db41b6db7ea0c2c6cade170d9adc711c65dfca29117895514508b3d0e45e +size 354685 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset index 1c20e64..3fefab2 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsComboBox.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ffbd972689ca6f97ab7b3d368e3e7cdbe26858359e0015a0ce77f685049fd10a -size 61581 +oid sha256:6cd52ec0367ede055718e6aed1eb8bf8108cdafb870bcab4cd4009293aff10cb +size 95169 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset index 557ab85..d9fce59 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_OptionsSlider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e8f62b2d0a9d81fd3585f9477b38acf9b8504847cf03df5a9441a19c22a61c10 -size 77333 +oid sha256:f10680b166aefad84bdc0235fcab111156c5cbec2fc51c6bac679d50d53b474b +size 87000 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset index 15b3d50..f3b7f39 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/UIC_MainMenu_PageButton.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f848f6e7ae72d8d0c99fe4ff5f8295b539e3ad15b0150801a6aa63c2ec72ed53 -size 367684 +oid sha256:3fb8b1d96e0a8a789365ba92a9ceb08af0b0172337d4661d3b37e23124e6aa39 +size 367737 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset index c36d271..7c953fd 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuOptionsButtonName.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:804ce49b67d36ed546a85af9413fd7a243ca8953562359a9ad1b4f00b156a5c9 -size 2910 +oid sha256:fb3b5ea4fd4300a59fa4ece35698d4f2c02f8c912272ab0d2d13f69325799c06 +size 3746 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset index 0e6aafd..0217c0d 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Options_Graphics.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6eeeec30266e2e9460df51d739cd18b360dbe381fde52167e1af15b6fb939153 -size 117065 +oid sha256:f327d2922e24e1831ae8e42a44b3cd262aa5981e10b0e47a30552b0de66b2f6c +size 482797 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset deleted file mode 100644 index e039ee0..0000000 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenuCredits.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c7e26391465b6d60a05d8fbd44b1108b13758332251eeb4b323011bf3272969 -size 929530 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_Crosshair.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_Crosshair.uasset index d535f98..1e9e34e 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_Crosshair.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_Crosshair.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be449754436e25a553da784db487d590b5990b9ab0edc3c04ea757d5acf218c7 -size 15255 +oid sha256:b76ba0b71b0575036ef253825438018704801044c797a3126457c0a460f0774f +size 19560 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_DevelopBuildWarning.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_DevelopBuildWarning.uasset index 06b2d4d..967b645 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_DevelopBuildWarning.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_DevelopBuildWarning.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7932c329679ea3c7d0ae5d5764dc839240321f676cad7bbebc55622326fd9b0f -size 13635 +oid sha256:bb43473e4b2e7f8ff988adb692cb781f3792a33b6145043ef058bb40094c90ac +size 14440 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_FpsCounter.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_FpsCounter.uasset new file mode 100644 index 0000000..9e1cd04 --- /dev/null +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/Overlays/UI_FpsCounter.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d63974d7101d71ebfd1708d3eff1414ef24e7dc96b0688f8ae35c74381e8e444 +size 67990 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/UI_Journal.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/UI_Journal.uasset index 2aa8060..56bb12f 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/UI_Journal.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/UI_Journal.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a5314ffaa13ed3a358ecd36f530f404cc1fe5500354e71fdb8cac1b15d00920e +oid sha256:4bedff5c2d811ec644c7d2012d6e7fb9ce2c168f6bd77116e9d0fbc18283540c size 28747 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset index bd8c7d1..f4c14b0 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_ComboBox.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:070138fc6cfd92dd686cf311d8895f074c53de94a648cdcb33e0c5956caba9c3 -size 121172 +oid sha256:0f131eb29362f2988881dc0723020d749a94da87994c6a13fbc0bc502a610f39 +size 184831 diff --git a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset index 2d1795a..a6de394 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Components/UIC_Slider.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:680dbf5d16e01d2ccc7ade57130e4668601dc605370b0f4362dbb8db7855102f -size 147470 +oid sha256:3d365a0de4ee355bfa57cf82ae8cb297e7e5713363ea2fc28abd72c18fec6354 +size 147896 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp index c859f95..11e9d00 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp @@ -105,15 +105,33 @@ FWorldDilationChangedDelegate& UCommonFunctions::GetWorldDilationChangedDelegate return SlowMotion::worldDilationChangedDelegate; } +TArray UCommonFunctions::IntArrayToStringArray(const TArray& in) +{ + TArray result; + result.Reserve(in.Num()); + for(int32 i : in) + result.Add(FString::FromInt(i)); + return MoveTemp(result); +} + +TArray UCommonFunctions::StringArrayToIntArray(const TArray& in) +{ + TArray result; + result.Reserve(in.Num()); + for(auto& i : in) + result.Add(FCString::Atoi(*i)); + return MoveTemp(result); +} + FString UCommonFunctions::IntPointToString(const FIntPoint& in) { - FString result = FString::Printf(TEXT("%sx%s"), *FString::FromInt(in.X), *FString::FromInt(in.Y)); + FString result = FString::Printf(TEXT("%dx%d"), in.X, in.Y); return MoveTemp(result); } FIntPoint UCommonFunctions::StringToIntPoint(const FString& in) { - FIntPoint result; + FIntPoint result{}; const FRegexPattern rgxP(FRegexPattern(TEXT("[0-9]+"))); FRegexMatcher rgx = FRegexMatcher(rgxP, in); @@ -125,6 +143,41 @@ FIntPoint UCommonFunctions::StringToIntPoint(const FString& in) return MoveTemp(result); } +TArray UCommonFunctions::IntPointArrayToStringArray(const TArray& in) +{ + TArray result; + result.Reserve(in.Num()); + for(auto& i : in) + result.Add(IntPointToString(i)); + return MoveTemp(result); +} + +TArray UCommonFunctions::StringArrayToIntPointArray(const TArray& in) +{ + TArray result; + result.Reserve(in.Num()); + for(auto& i : in) + result.Add(StringToIntPoint(i)); + return MoveTemp(result); +} + +int32 UCommonFunctions::GetLongestCharCount(TArray& in) +{ + int32 result = 0; + for(auto& i : in) + if(i.Len() > result) + result = i.Len(); + return result; +} + +void UCommonFunctions::SortIntPointArray(TArray& in) +{ + in.Sort([](const FIntPoint& a, const FIntPoint& b) + { + return a.X < b.X || a.Y < b.Y; + }); +} + int32 UCommonFunctions::GreatestCommonDivisor(int32 a, int32 b) { int32 temp; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h index d8539c8..29f2903 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.h @@ -44,10 +44,26 @@ public: + UFUNCTION(BlueprintPure, Category = TypeCasts) + static TArray IntArrayToStringArray(const TArray& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) + static TArray StringArrayToIntArray(const TArray& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) static FString IntPointToString(const FIntPoint& in); UFUNCTION(BlueprintPure, Category = TypeCasts) static FIntPoint StringToIntPoint(const FString& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) + static TArray IntPointArrayToStringArray(const TArray& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) + static TArray StringArrayToIntPointArray(const TArray& in); + UFUNCTION(BlueprintPure, Category = TypeCasts) + static void SortIntPointArray(UPARAM(ref) TArray& in); + + + + UFUNCTION(BlueprintPure, Category = String) + static int32 GetLongestCharCount(UPARAM(ref) TArray& in); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.cpp new file mode 100644 index 0000000..73d800a --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.cpp @@ -0,0 +1,63 @@ +// Oleg Petruny proprietary. + +#include "CommonInspectors.h" + +UEnum* UEnumInspector::GetEnumByName(const FString& name) +{ + static TMap map; + if(map.Contains(name)) + return map[name]; + + UEnum* enumPtr = FindObject((UPackage*)-1, *name, true); + map.Add(name, enumPtr); + return enumPtr; +} + +TArray UEnumInspector::GetEnumDisplayNames(const UEnum* enumPtr) +{ + if(!enumPtr) + return {}; + + auto enumPtrProxy = static_cast(enumPtr); + TArray result; + for(int32 i = 0; i < enumPtrProxy->Names.Num() - 1; ++i) // last UEnum value is Num counter + result.Add(enumPtr->GetDisplayNameTextByIndex(enumPtrProxy->Names[i].Value)); + return MoveTemp(result); +} + +TArray UEnumInspector::GetEnumValues(const UEnum* enumPtr) +{ + if(!enumPtr) + return {}; + + auto enumPtrProxy = static_cast(enumPtr); + TArray result; + for(int32 i = 0; i < enumPtrProxy->Names.Num() - 1; ++i) // last UEnum value is Num counter + result.Add(enumPtrProxy->Names[i].Value); + return MoveTemp(result); +} + +int32 UEnumInspector::GetEnumValueByValueId(const UEnum* enumPtr, const int32 id) +{ + if(!enumPtr) + return 0; + + auto enumPtrProxy = static_cast(enumPtr); + if(id < enumPtrProxy->Names.Num()) + return enumPtrProxy->Names[id].Value; + + return -1; +} + +int32 UEnumInspector::GetEnumValueIdByValue(const UEnum* enumPtr, const int32 value) +{ + if(!enumPtr) + return 0; + + auto enumPtrProxy = static_cast(enumPtr); + for(int32 i = 0; i < enumPtrProxy->Names.Num(); ++i) + if(enumPtrProxy->Names[i].Value == value) + return i; + + return int32(); +} diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.h new file mode 100644 index 0000000..04a7441 --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonInspectors.h @@ -0,0 +1,34 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "CoreMinimal.h" + +#include "CommonInspectors.generated.h" + + +UCLASS(Deprecated) +class UDEPRECATED_EnumInspectorProxy : public UEnum +{ + GENERATED_BODY() + + friend class UEnumInspector; +}; + +UCLASS() +class UEnumInspector : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintPure, Category = Enum) + static UEnum* GetEnumByName(const FString& name); + UFUNCTION(BlueprintPure, Category = Enum) + static TArray GetEnumDisplayNames(UPARAM(meta = (DisplayName = "enum")) const UEnum* enumPtr); + UFUNCTION(BlueprintPure, Category = Enum) + static TArray GetEnumValues(UPARAM(meta = (DisplayName = "enum")) const UEnum* enumPtr); + UFUNCTION(BlueprintPure, Category = Enum) + static int32 GetEnumValueByValueId(UPARAM(meta = (DisplayName = "enum")) const UEnum* enumPtr, const int32 id); + UFUNCTION(BlueprintPure, Category = Enum) + static int32 GetEnumValueIdByValue(UPARAM(meta = (DisplayName = "enum")) const UEnum* enumPtr, const int32 value); +}; \ No newline at end of file diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp index 7692feb..e7d4a08 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp @@ -5,6 +5,8 @@ #include "Kismet/GameplayStatics.h" #include "GraphicsSettingsHelper.h" +#include "MainGameModeBase.h" +#include "Widgets/WidgetsManager.h" namespace { @@ -46,6 +48,25 @@ UCustomGameSettings* UCustomGameSettings::Get() return Cast(UGameUserSettings::GetGameUserSettings()); } +void UCustomGameSettings::LoadSettings(bool bForceReload) +{ + Super::LoadSettings(bForceReload); + UpdateResolutionQuality(); +} + +void UCustomGameSettings::ApplySettings(bool bCheckForCommandLineOverrides) +{ + Super::ApplySettings(bCheckForCommandLineOverrides); + UGraphicsSettingsHelper::ApplySettings(this); + if(auto WM = AMainGameModeBase::GetWidgetsManager()) + { + if(bShowFps) + WM->ShowFpsCount(); + else + WM->HideFpsCount(); + } +} + LOST_EDGE_API bool UCustomGameSettings::GetDefaultShowFps() const { return bDefaultShowFps; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h index c02f5c6..5fc098b 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h @@ -24,6 +24,9 @@ public: UFUNCTION(BlueprintPure, Category = "Settings", meta = (DisplayName = "Get Custom Game Settings")) static UCustomGameSettings* Get(); + virtual void LoadSettings(bool bForceReload = false) override; + virtual void ApplySettings(bool bCheckForCommandLineOverrides) override; + /** Graphics */ @@ -92,8 +95,9 @@ public: protected: + /** Graphics */ UPROPERTY(Config) - float fMouseSensetivity; + int32 eAntiAliasingMethod; /** Audio */ UPROPERTY(Config) @@ -107,4 +111,7 @@ protected: UPROPERTY(Config) float fMenuVolume; + /** Game */ + UPROPERTY(Config) + float fMouseSensetivity; }; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp index 76b2352..b580e86 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -17,10 +17,12 @@ namespace constexpr int32 iDefaultMonitorId = 0; const FIntPoint ipDefaultResolution = { 1920, 1080 }; std::optional ipPreviousResolution; - constexpr float fDefaultResolutionScale = 1.0f; + constexpr float fDefaultResolutionScale = 100.0f; constexpr int32 iDefaultFrameRateLimit = 120; constexpr EDisplayMode eDefaultDisplayMode = EDisplayMode::Fullscreen; std::optional ePreviousDisplayMode; + constexpr bool bDefaultVSyncEnabled = false; + constexpr int32 eDefaultAntiAliasingMethod = static_cast(ELostEdgeAntiAliasingMethod::FXAA); } bool UGraphicsSettingsHelper::AreSettingsRestorable(UCustomGameSettings* settings) @@ -30,6 +32,16 @@ bool UGraphicsSettingsHelper::AreSettingsRestorable(UCustomGameSettings* setting || ePreviousDisplayMode.has_value(); } +void UGraphicsSettingsHelper::RestoreGraphicsSettings(UCustomGameSettings* settings) +{ + if(ipPreviousWindowPosition.has_value()) + SetWindowPosition(settings, ipPreviousWindowPosition.value()); + if(ipPreviousResolution.has_value()) + SetResolution(settings, ipPreviousResolution.value()); + if(ePreviousDisplayMode.has_value()) + SetDisplayMode(settings, ePreviousDisplayMode.value()); +} + void UGraphicsSettingsHelper::SetDefaults(UCustomGameSettings* settings) { { @@ -42,7 +54,23 @@ void UGraphicsSettingsHelper::SetDefaults(UCustomGameSettings* settings) settings->ResolutionSizeX = res.X; settings->ResolutionSizeY = res.Y; } + settings->bUseDynamicResolution = true; + settings->FrameRateLimit = GetDefaultFrameRateLimit(settings); + settings->SetResolutionScaleValueEx(fDefaultResolutionScale); settings->FullscreenMode = DisplayToWindowMode(GetDefaultDisplayMode(settings)); + settings->eAntiAliasingMethod = eDefaultAntiAliasingMethod; +} + +void UGraphicsSettingsHelper::ApplySettings(UCustomGameSettings* settings) +{ + if(!settings) + return; + + if(GEngine && GEngine->GameViewport) + if(auto window = GEngine->GameViewport->GetWindow()) + window->MoveWindowTo(settings->GetWindowPosition()); + + GEngine->Exec(UCustomGameSettings::Get()->GetWorld(), *FString::Printf(TEXT("r.AntiAliasingMethod %d"), settings->eAntiAliasingMethod)); } FIntPoint UGraphicsSettingsHelper::GetDefaultWindowPosition([[maybe_unused]] UCustomGameSettings* settings) @@ -66,18 +94,14 @@ FIntPoint UGraphicsSettingsHelper::GetWindowPosition([[maybe_unused]] UCustomGam void UGraphicsSettingsHelper::SetWindowPosition(UCustomGameSettings* settings, const FIntPoint& pos) { - if(settings && GEngine && GEngine->GameViewport) + if(settings) { - if(auto window = GEngine->GameViewport->GetWindow()) - { - if(ipPreviousWindowPosition == pos) - ipPreviousWindowPosition.reset(); - else - ipPreviousWindowPosition = GetWindowPosition(settings); + if(ipPreviousWindowPosition == pos) + ipPreviousWindowPosition.reset(); + else + ipPreviousWindowPosition = GetWindowPosition(settings); - window->MoveWindowTo(pos); - settings->SetWindowPosition(pos.X, pos.Y); - } + settings->SetWindowPosition(pos.X, pos.Y); } } @@ -126,10 +150,11 @@ int32 UGraphicsSettingsHelper::GetPrimaryMonitorId() TArray UGraphicsSettingsHelper::GetAvailableMonitorsNames() { - TArray names; auto monitors = GetAvailableMonitors(); - for(auto& m : monitors) - names.Add(m.ID); + TArray names; + names.Reserve(monitors.Num()); + for(int32 i = 0; i < monitors.Num(); ++i) + names.Add(FString::Printf(TEXT("%d - %s"), i + 1, *monitors[i].Name)); return MoveTemp(names); } @@ -195,11 +220,16 @@ TArray UGraphicsSettingsHelper::GetAllAvailableResol if(!RHIGetAvailableResolutions(buffer, false) || buffer.Num() == 0) return { {GetResolution(nullptr), {GetDefaultFrameRateLimit(nullptr)}} }; - TArray result = {}; + TArray result; int32 lastWidth = 0; int32 lastHeight = 0; + FIntPoint currentResolution = GetResolution(nullptr); + bool currentInfoPresent = false; for(auto& i : buffer) { + if(currentResolution.X == i.Width && currentResolution.Y == i.Height) + currentInfoPresent = true; + if(lastWidth != i.Width || lastHeight != i.Height) { result.Add({ {static_cast(i.Width), static_cast(i.Height)}, {static_cast(i.RefreshRate)} }); @@ -212,6 +242,10 @@ TArray UGraphicsSettingsHelper::GetAllAvailableResol } } + if(!currentInfoPresent) + if(auto settings = UCustomGameSettings::Get()) + result.Add({ currentResolution, { static_cast(settings->GetFrameRateLimit()) } }); + return MoveTemp(result); } @@ -222,6 +256,7 @@ TArray UGraphicsSettingsHelper::GetAllAvailableResolutions() return { {GetResolution(nullptr), {GetDefaultFrameRateLimit(nullptr)}} }; TArray result; + result.Reserve(buffer.Num() + 1); int32 lastWidth = 0; int32 lastHeight = 0; for(auto& i : buffer) @@ -233,20 +268,32 @@ TArray UGraphicsSettingsHelper::GetAllAvailableResolutions() lastWidth = i.Width; } } + + FIntPoint currentResolution = GetResolution(nullptr); + if(!result.Contains(currentResolution)) + result.Add(currentResolution); + return MoveTemp(result); } TArray UGraphicsSettingsHelper::GetAvailableResolutionsByMonitorId(const int32 id) { - TArray result; - + auto resolutions = GetAllAvailableResolutions(); FIntPoint nativeRes = GetNativeResolutionByMonitorId(id); - for(auto& i : GetAllAvailableResolutions()) + TArray result; + result.Reserve(resolutions.Num() + 1); + for(auto& i : resolutions) { if(i.X > nativeRes.X && i.Y > nativeRes.Y) continue; result.Add(i); } + if(id == GetMonitorId(nullptr)) + { + FIntPoint currentResolution = GetResolution(nullptr); + if(!result.Contains(currentResolution)) + result.Add(currentResolution); + } return MoveTemp(result); } @@ -267,8 +314,6 @@ void UGraphicsSettingsHelper::SetResolution(UCustomGameSettings* settings, const if(!settings) return; - settings->bUseDynamicResolution = true; - if(ipPreviousResolution.has_value() && ipPreviousResolution == resolution) ipPreviousResolution.reset(); else @@ -285,27 +330,11 @@ void UGraphicsSettingsHelper::RestoreResolution(UCustomGameSettings* settings) SetResolution(settings, ipPreviousResolution.value()); } -float UGraphicsSettingsHelper::GetDefaultResolutionScale([[maybe_unused]] UCustomGameSettings* settings) +float UGraphicsSettingsHelper::GetDefaultResolutionScaleFast(UCustomGameSettings* settings) { return fDefaultResolutionScale; } -float UGraphicsSettingsHelper::GetResolutionScale([[maybe_unused]] UCustomGameSettings* settings) -{ - if(auto settings = UCustomGameSettings::Get()) - return settings->GetResolutionScaleNormalized(); - - return 1.0f; -} - -void UGraphicsSettingsHelper::SetResolutionScale(UCustomGameSettings* settings, const float resolutionScale) -{ - if(!settings) - return; - - settings->SetResolutionScaleNormalized(resolutionScale); -} - int32 UGraphicsSettingsHelper::GetDefaultFrameRateLimit([[maybe_unused]] UCustomGameSettings* settings) { return iDefaultFrameRateLimit; @@ -315,8 +344,24 @@ TArray UGraphicsSettingsHelper::GetAvailableFrameRateLimitsForResolution( { auto resAndRates = GetAllAvailableResolutionsAndRefreshRates(); for(auto& i : resAndRates) + { if(i.resolution == resolution) + { + if(resolution == GetResolution(nullptr)) + if(auto settings = UCustomGameSettings::Get()) + if(!i.refreshRates.Contains(settings->GetFrameRateLimit())) + i.refreshRates.Add(settings->GetFrameRateLimit()); + + if(!i.refreshRates.Contains(GetDefaultFrameRateLimit(nullptr))) + i.refreshRates.Add(GetDefaultFrameRateLimit(nullptr)); + + if(!i.refreshRates.Contains(0)) + i.refreshRates.Add(0); + + i.refreshRates.Sort(); return MoveTemp(i.refreshRates); + } + } return { GetDefaultFrameRateLimit(nullptr) }; } @@ -350,8 +395,15 @@ TArray UGraphicsSettingsHelper::GetAvailableAspectRatiousOfMonitor(co TSet aspects; for(auto& i : resolutions) + { aspects.Add(GetAspectRatioFromResolution(i)); - return aspects.Array(); + UE_LOG(LogTemp, Log, TEXT("%dx%d = %dx%d"), i.X, i.Y, GetAspectRatioFromResolution(i).X, GetAspectRatioFromResolution(i).Y); + } + aspects.Add(GetAspectRatioFromResolution(GetResolution(nullptr))); + + TArray result = aspects.Array(); + UCommonFunctions::SortIntPointArray(result); + return MoveTemp(result); } EDisplayMode UGraphicsSettingsHelper::GetDefaultDisplayMode([[maybe_unused]] UCustomGameSettings* settings) @@ -406,6 +458,33 @@ void UGraphicsSettingsHelper::RestoreDisplayMode(UCustomGameSettings* settings) SetDisplayMode(settings, ePreviousDisplayMode.value()); } +bool UGraphicsSettingsHelper::GetDefaultVSyncEnabled(UCustomGameSettings* settings) +{ + return bDefaultVSyncEnabled; +} + +int32 UGraphicsSettingsHelper::GetDefaultAntiAliasingMethod(UCustomGameSettings* settings) +{ + return eDefaultAntiAliasingMethod; +} + +int32 UGraphicsSettingsHelper::GetAntiAliasingMethod(UCustomGameSettings* settings) +{ + static const auto cvar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.AntiAliasingMethod")); + if(cvar) + return cvar->GetInt(); + + return -1; +} + +void UGraphicsSettingsHelper::SetAntiAliasingMethod(UCustomGameSettings* settings, int32 method) +{ + if(!settings) + return; + + settings->eAntiAliasingMethod = FMath::Clamp(method, static_cast(ELostEdgeAntiAliasingMethod::None), static_cast(ELostEdgeAntiAliasingMethod::MSAA)); +} + inline constexpr EDisplayMode UGraphicsSettingsHelper::WindowToDisplayMode(const EWindowMode::Type mode) { switch(mode) @@ -433,6 +512,3 @@ inline constexpr EWindowMode::Type UGraphicsSettingsHelper::DisplayToWindowMode( return EWindowMode::Type::Fullscreen; } } - - - diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h index 5d5f1d6..6cae13e 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h @@ -27,6 +27,15 @@ enum class EDisplayMode : uint8 Windowed = 2 UMETA(DisplayName = "Windowed") }; +UENUM(BlueprintType) +enum class ELostEdgeAntiAliasingMethod : uint8 +{ + None = AAM_None UMETA(DisplayName = "None"), + FXAA = AAM_FXAA UMETA(DisplayName = "FXAA"), + TAA = AAM_TemporalAA UMETA(DisplayName = "TAA"), + MSAA = AAM_MSAA UMETA(DisplayName = "MSAA") +}; + /** * Helper for trivial and complex graphic settings. * Most of functions work without settings pointer. It is there just for Blueprint call convinience. @@ -39,10 +48,14 @@ class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary GENERATED_BODY() public: - UFUNCTION(BlueprintPure, Category = "Settings|Graphics", meta = (DisplayName = "AreGraphicsSettingsRestorable")) + UFUNCTION(BlueprintPure, Category = "Settings|Graphics", meta = (DisplayName = "Are Graphics Settings Restorable")) static bool AreSettingsRestorable(class UCustomGameSettings* settings); - UFUNCTION(BlueprintCallable, Category = "Settings|Graphics", meta = (DisplayName = "SetGraphicsDefaults")) + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics") + static void RestoreGraphicsSettings(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics", meta = (DisplayName = "Set Graphics Defaults")) static void SetDefaults(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics", meta = (DisplayName = "Apply Graphics Settings")) + static void ApplySettings(class UCustomGameSettings* settings); protected: // Window position setting is on the thin edge of user safeness, therefore protected. Please use SetMonitor(). UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Window") @@ -89,11 +102,7 @@ public: static void RestoreResolution(class UCustomGameSettings* settings); UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") - static float GetDefaultResolutionScale(class UCustomGameSettings* settings); - UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") - static float GetResolutionScale(class UCustomGameSettings* settings); - UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Resolution Scale") - static void SetResolutionScale(class UCustomGameSettings* settings, const float resolutionScale); + static float GetDefaultResolutionScaleFast(class UCustomGameSettings* settings); UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Frame Rate Limit") static int32 GetDefaultFrameRateLimit(class UCustomGameSettings* settings); @@ -124,6 +133,16 @@ public: UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Display Mode") static void RestoreDisplayMode(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|VSync") + static bool GetDefaultVSyncEnabled(class UCustomGameSettings* settings); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Anti Aliasing") + static int32 GetDefaultAntiAliasingMethod(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Anti Aliasing") + static int32 GetAntiAliasingMethod(class UCustomGameSettings* settings); + UFUNCTION(BlueprintCallable, Category = "Settings|Graphics|Anti Aliasing") + static void SetAntiAliasingMethod(class UCustomGameSettings* settings, int32 method); + private: inline constexpr static EDisplayMode WindowToDisplayMode(const EWindowMode::Type mode); inline constexpr static EWindowMode::Type DisplayToWindowMode(const EDisplayMode mode); diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp index dbd1fc0..8d0fd6f 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp @@ -6,15 +6,57 @@ void UComboBoxText::PostInitProperties() { Super::PostInitProperties(); - SetOptions(_DefaultOptions); + SetOptionsAsText(_DefaultOptions); _DefaultOptions.Empty(); + OnSelectionChanged.AddDynamic(this, &UComboBoxText::UpdateButtonPadding); + auto& style = GetWidgetStyle(); + buttonNormalLeftPadding = style.ComboButtonStyle.ButtonStyle.NormalPadding.Left; + buttonPressedLeftPadding = style.ComboButtonStyle.ButtonStyle.PressedPadding.Left; } -void UComboBoxText::SetOptions(const TArray& options) +void UComboBoxText::SetOptionsAsText(const TArray& options) { ClearSelection(); - Options.Empty(); + Options.Empty(options.Num()); for(auto& o : options) Options.Add(MakeShareable(new FString(o.ToString()))); RefreshOptions(); + PostOptionsSet(); +} + +void UComboBoxText::SetOptionsAsString(const TArray& options) +{ + ClearSelection(); + Options.Empty(options.Num()); + for(auto& o : options) + Options.Add(MakeShareable(new FString(o))); + RefreshOptions(); + PostOptionsSet(); +} + +TArray UComboBoxText::GetOptions() +{ + TArray result; + result.Reserve(Options.Num()); + for(auto& o : Options) + result.Add(*o); + return MoveTemp(result); +} + +void UComboBoxText::PostOptionsSet() +{ + longestCharCount = 0; + for(auto& o : Options) + if(o->Len() > longestCharCount) + longestCharCount = o->Len(); +} + +void UComboBoxText::UpdateButtonPadding(FString SelectedItem, ESelectInfo::Type SelectionType) +{ + const int32 len = longestCharCount - SelectedItem.Len(); + auto style = GetWidgetStyle(); + float padding = GetFont().Size * (static_cast(len)); + style.ComboButtonStyle.ButtonStyle.NormalPadding.Left = padding + buttonNormalLeftPadding; + style.ComboButtonStyle.ButtonStyle.PressedPadding.Left = padding + buttonPressedLeftPadding; + SetWidgetStyle(style); } diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h index 82321b7..930cb7e 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h @@ -15,9 +15,22 @@ public: virtual void PostInitProperties() override; UFUNCTION(BlueprintCallable) - void SetOptions(const TArray& options); + void SetOptionsAsText(const TArray& options); + + UFUNCTION(BlueprintCallable) + void SetOptionsAsString(const TArray& options); + + UFUNCTION(BlueprintPure) + TArray GetOptions(); protected: + void PostOptionsSet(); + UFUNCTION() + void UpdateButtonPadding(FString SelectedItem, ESelectInfo::Type SelectionType); + UPROPERTY(EditAnywhere, Category = ComboBoxTextDefault) TArray _DefaultOptions; + + int32 longestCharCount; + float buttonNormalLeftPadding, buttonPressedLeftPadding; }; diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ResolutionResponsiveWidget.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ResolutionResponsiveWidget.cpp index 2c4298a..ab29312 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ResolutionResponsiveWidget.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ResolutionResponsiveWidget.cpp @@ -3,6 +3,7 @@ #include "ResolutionResponsiveWidget.h" #include "Components/PanelSlot.h" +#include "GraphicsSettingsHelper.h" #include "UnrealClient.h" bool UResolutionResponsiveWidget::Initialize() diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp index 1bf8772..95b6a16 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.cpp @@ -10,6 +10,7 @@ #include "UObject/ScriptInterface.h" #include "CustomGameInstance.h" +#include "CustomGameSettings.h" #include "Interactable/Interactable.h" #include "Interactable/Modificators/InteractableModificator.h" #include "Interactable/Modificators/InventoryInteractableModificator.h" @@ -98,6 +99,12 @@ void UWidgetsManager::Init() journalWidget->SetVisibility(ESlateVisibility::Hidden); journalWidget->AddToViewport(); } + + if(auto settings = UCustomGameSettings::Get()) + { + if(settings->bShowFps) + ShowFpsCount(); + } } } @@ -156,6 +163,27 @@ void UWidgetsManager::HideMainMenu() +void UWidgetsManager::ShowFpsCount() +{ + if(fpsCountWidget) + return; + + if(auto PC = UGameplayStatics::GetPlayerController(GetWorld(), 0)) + fpsCountWidget = CreateWidget(PC, fpsCountWidgetClass); + fpsCountWidget->AddToViewport(); +} + +void UWidgetsManager::HideFpsCount() +{ + if(!fpsCountWidget) + return; + + fpsCountWidget->RemoveFromViewport(); + fpsCountWidget = nullptr; +} + + + void UWidgetsManager::ShowInteractionHints(const UInteractableModificator* modificator) { if(interactableHintWidgetManager) diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.h b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.h index d421895..058de50 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/WidgetsManager.h @@ -30,6 +30,9 @@ public: void ShowMainMenu(bool pause = true); void HideMainMenu(); + void ShowFpsCount(); + void HideFpsCount(); + UFUNCTION(BlueprintCallable, Category = WidgetsManager) void ShowInteractionHints(const class UInteractableModificator* modificator = nullptr); UFUNCTION(BlueprintCallable, Category = WidgetsManager) @@ -70,6 +73,10 @@ protected: TSubclassOf mainMenuWidgetClass; class UMainMenuWidget* mainMenuWidget = nullptr; + UPROPERTY(EditDefaultsOnly) + TSubclassOf fpsCountWidgetClass; + class UUserWidget* fpsCountWidget = nullptr; + UPROPERTY(EditDefaultsOnly) TSubclassOf interactableHintWidgetManagerClass; // hidden in cutscene class UInteractableHintWidgetManager* interactableHintWidgetManager = nullptr; -- 2.45.2 From 7ee5676411b6192f1071c74c1ecf0dbb4639d801 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Mon, 13 Jan 2025 09:58:12 +0100 Subject: [PATCH 8/9] Credits wip --- .../MainMenu/Components/Classes/UICC_MainMenu_Page.uasset | 4 ++-- .../Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset | 4 ++-- .../Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset index d0f659d..1cb1b20 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ef1817a6aa81c371c7edc45d33b8faeb2a19f22d52dc8c81e608be801904a84 -size 13552 +oid sha256:853b1a94e4f2ea8e6f8fd18543661899e336cb9465e358a182ff33b8ef60b1d6 +size 13602 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset index 223f22d..6bea3ff 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90a68584c3e325ad259b9ca90878ac34ac52c1bfb6d09c5236f80ac15733b6da -size 119873 +oid sha256:ec8ea90c9d0c499e787c49a523f0c84055f0eccd213ac8ab1d65a3cd0dd34d4f +size 69340 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index 6911cf6..4b764f7 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e19603b288905af80c6f53f14bdb6ce5b70af46c5f188a5b0a062e064d3545a8 -size 238305 +oid sha256:80629783384f5a668fe624b458c425bb3caa8047ae85589a96104f0a4cf91e2b +size 239444 -- 2.45.2 From 59dfc90fe9504cfb6c421f4b5c1f288888e9c6b3 Mon Sep 17 00:00:00 2001 From: Oleg Petruny Date: Mon, 13 Jan 2025 19:52:28 +0100 Subject: [PATCH 9/9] credits --- .../MainMenu/Components/Classes/UICC_MainMenu_Page.uasset | 4 ++-- .../Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset | 4 ++-- .../Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset | 4 ++-- .../Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset index 1cb1b20..bd484a6 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:853b1a94e4f2ea8e6f8fd18543661899e336cb9465e358a182ff33b8ef60b1d6 -size 13602 +oid sha256:b2e2b41d5236566cf0955b14d5fa49d0475768a03a04c493d2ef63ed438c9416 +size 16200 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset index 6bea3ff..9a34b41 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Pages/UI_MainMenu_Page_Credits.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ec8ea90c9d0c499e787c49a523f0c84055f0eccd213ac8ab1d65a3cd0dd34d4f -size 69340 +oid sha256:90e4a2d5a8bb2c7736d385ed55c8115997b7ff6c46ea8dbc82625277c2f343f2 +size 122677 diff --git a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset index 4b764f7..7b7195f 100644 --- a/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset +++ b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/UI_MainMenu.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:80629783384f5a668fe624b458c425bb3caa8047ae85589a96104f0a4cf91e2b -size 239444 +oid sha256:ff06f385a335042c3d5d0af814283bd9c622745fd44bde88c5dd0fc73a5f53ed +size 242163 diff --git a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp index b580e86..6db30fa 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -421,7 +421,7 @@ EDisplayMode UGraphicsSettingsHelper::GetDisplayMode(UCustomGameSettings* settin EDisplayMode UGraphicsSettingsHelper::TextToDisplayMode(const FText& in) { - static const UEnum* enumPtr = FindObject(ANY_PACKAGE, TEXT("EDisplayMode"), true); + static const UEnum* enumPtr = FindObject((UPackage*)-1, TEXT("EDisplayMode"), true); if(!enumPtr) return GetDefaultDisplayMode(nullptr); @@ -430,7 +430,7 @@ EDisplayMode UGraphicsSettingsHelper::TextToDisplayMode(const FText& in) FText UGraphicsSettingsHelper::DisplayModeToText(const EDisplayMode mode) { - static const UEnum* enumPtr = FindObject(ANY_PACKAGE, TEXT("EDisplayMode"), true); + static const UEnum* enumPtr = FindObject((UPackage*)-1, TEXT("EDisplayMode"), true); if(!enumPtr) return CommonTexts::Default; -- 2.45.2