diff --git a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini index 6c87b93..4ac5f7e 100644 --- a/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini +++ b/UnrealProject/Lost_Edge/Config/DefaultGameUserSettings.ini @@ -1,16 +1,20 @@ [/Script/Lost_Edge.CustomGameSettings] -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 +bUseDynamicResolution=True ResolutionSizeX=1920 ResolutionSizeY=1080 LastUserConfirmedResolutionSizeX=1920 LastUserConfirmedResolutionSizeY=1080 -WindowPosX=-1 -WindowPosY=-1 +WindowPosX=0 +WindowPosY=0 FullscreenMode=1 LastConfirmedFullscreenMode=1 PreferredFullscreenMode=1 @@ -18,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/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/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_Page.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/Components/Classes/UICC_MainMenu_Page.uasset new file mode 100644 index 0000000..bd484a6 --- /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:b2e2b41d5236566cf0955b14d5fa49d0475768a03a04c493d2ef63ed438c9416 +size 16200 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..3db4853 --- /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:3c29909dc91b1fb532f4076a7ff9aeb6eed6d0115b23eaba3ea0f732533526bd +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..98e15ba --- /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:8b50db41b6db7ea0c2c6cade170d9adc711c65dfca29117895514508b3d0e45e +size 354685 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..3fefab2 --- /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:6cd52ec0367ede055718e6aed1eb8bf8108cdafb870bcab4cd4009293aff10cb +size 95169 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..d9fce59 --- /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: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 new file mode 100644 index 0000000..f3b7f39 --- /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:3fb8b1d96e0a8a789365ba92a9ceb08af0b0172337d4661d3b37e23124e6aa39 +size 367737 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/E_MainMenuButtonNames.uasset b/UnrealProject/Lost_Edge/Content/UI/Blueprints/MainMenu/E_MainMenuButtonNames.uasset deleted file mode 100644 index 38dd715..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:ef4f7af31939d83d337b5e3664f3c6c3dda992897b3dc77895f1c98456083420 -size 4447 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..7c953fd --- /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:fb3b5ea4fd4300a59fa4ece35698d4f2c02f8c912272ab0d2d13f69325799c06 +size 3746 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..9a34b41 --- /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:90e4a2d5a8bb2c7736d385ed55c8115997b7ff6c46ea8dbc82625277c2f343f2 +size 122677 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..ecaeb54 --- /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: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 new file mode 100644 index 0000000..ebde59a --- /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: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 new file mode 100644 index 0000000..20f4953 --- /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: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 new file mode 100644 index 0000000..89640c2 --- /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: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 new file mode 100644 index 0000000..0217c0d --- /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:f327d2922e24e1831ae8e42a44b3cd262aa5981e10b0e47a30552b0de66b2f6c +size 482797 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 22d4b4f..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:3ae4f8d697d46434366827562a388480f4b09f9fe022e12ba3b5f7aade8ffbc4 -size 174730 +oid sha256:ff06f385a335042c3d5d0af814283bd9c622745fd44bde88c5dd0fc73a5f53ed +size 242163 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 76c474d..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:aa445eb438ecf53694584bda7e43c7746a2c61238d98b4e5b0665e3b98b4e87f -size 929306 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 deleted file mode 100644 index 828f58f..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:a1c5e7352b100ccabe043eee5ffd02b83fd1b2d5109144c28c687609841291b0 -size 130173 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/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/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/Classes/UICC_MainMenu_PageButtonParticle.uasset b/UnrealProject/Lost_Edge/Content/UI/Components/Classes/UICC_MainMenu_PageButtonParticle.uasset deleted file mode 100644 index 175d3e9..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:cd2cb854bac32344c95a52bb2dbd96d1d71fb6c413c16b6e7bbeb3356bc813df -size 6659 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 5a2495d..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:7db291a28abb65d5b7fa53ac78c8cfa3cc1581a15704e0380b2a91f63bf4b6d7 -size 7395 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..f4c14b0 --- /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:0f131eb29362f2988881dc0723020d749a94da87994c6a13fbc0bc502a610f39 +size 184831 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..d6c2568 --- /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: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 44cd3ff..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:d8eb2ca474902a3180db5dafe6dc2ac2d9972a83384bb6a3a05c2ba51d58005e -size 341174 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 ea80e93..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:aa41827ace0e485a32ad9ba233912f258ee5cfd0990ccdd117eaa007cb8379ae -size 39310 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 b8c0590..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:3e7383a2ca520d9cae3f262a2f4c2d858f9e27921bda642df800558977fc0b0a -size 39423 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 89dcec6..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:b22ad29cebdf628e50306fa7ec0eadfd98d8f817bd02cee0f1e7c0186070ee49 -size 55275 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 deleted file mode 100644 index 994ba3e..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:f3ca9755fe19acf488007b1ed6ca99f8ef93f8bfce932d0939fab5502b136e55 -size 358593 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 a73c9d5..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:1643864c41e24f3b31d7cc2e7ae81d5a81662e040da7ed680094fc3035edcb02 -size 447458 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 38918f0..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:5932ca564d4f73b9e5c0b3e22a096cf0ce974808343bbb40ced10fe79414de99 -size 86177 +oid sha256:3d365a0de4ee355bfa57cf82ae8cb297e7e5713363ea2fc28abd72c18fec6354 +size 147896 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/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/CommonFunctions.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CommonFunctions.cpp index c45eec7..11e9d00 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; @@ -95,6 +105,91 @@ 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("%dx%d"), in.X, 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); +} + +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; + 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 56d9dae..29f2903 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); @@ -41,6 +44,34 @@ 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); + + + + 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/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/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/CustomGameInstance.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp index cfe6c93..60769f0 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.cpp @@ -6,10 +6,17 @@ #include "Kismet/KismetSystemLibrary.h" #include "ContentLoader.h" +#include "CustomGameSettings.h" #include "Levels/LevelBase.h" #include "PlayerBase.h" #include "SaveData.h" +namespace +{ + constexpr auto saveName = TEXT("Save"); + constexpr int32 saveIndex = 0; +} + UCustomGameInstance* UCustomGameInstance::instance = nullptr; void UCustomGameInstance::Init() @@ -17,8 +24,28 @@ void UCustomGameInstance::Init() UGameInstance::Init(); instance = this; + contentLoader = NewObject(this); - saveData = Cast(UGameplayStatics::CreateSaveGameObject(USaveData::StaticClass())); + 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); + else + saveData = Cast(UGameplayStatics::CreateSaveGameObject(USaveData::StaticClass())); +} + +void UCustomGameInstance::Shutdown() +{ + if(auto settings = UCustomGameSettings::Get()) + settings->SaveSettings(); + + Super::Shutdown(); } UCustomGameInstance* UCustomGameInstance::Get() @@ -34,6 +61,22 @@ 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()) + return GI->saveData != nullptr; + + return false; +} + void UCustomGameInstance::SaveGame(FName checkpointName) { auto levelScript = ALevelBase::Get(); @@ -56,12 +99,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..d2cd197 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameInstance.h @@ -20,17 +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(); @@ -46,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..e7d4a08 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.cpp @@ -4,12 +4,43 @@ #include "Kismet/GameplayStatics.h" +#include "GraphicsSettingsHelper.h" +#include "MainGameModeBase.h" +#include "Widgets/WidgetsManager.h" + +namespace +{ + /** Graphics */ + constexpr bool bDefaultShowFps = 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; + + /** Game */ + constexpr float fDefaultMouseSensetivity = 0.5f; + constexpr bool bDefaultMouseInverted = false; +} + UCustomGameSettings::UCustomGameSettings(const FObjectInitializer& ObjectInitializer) :Super(ObjectInitializer) { - bUseMotionBlur = false; - bShowFps = false; - bMouseInverted = false; - fMouseSensetivity = 1.0f; + /** Graphics */ + bShowFps = GetDefaultShowFps(); + UGraphicsSettingsHelper::SetDefaults(this); + + /** Audio */ + fMasterVolume = GetDefaultMasterVolume(); + fMusicVolume = GetDefaultMusicVolume(); + fEffectsVolume = GetDefaultEffectsVolume(); + fVoicesVolume = GetDefaultVoicesVolume(); + fMenuVolume = GetDefaultMenuVolume(); + + /** Game */ + fMouseSensetivity = GetDefaultMouseSensetivity(); + bMouseInverted = GetDefaultMouseInverted(); } UCustomGameSettings* UCustomGameSettings::Get() @@ -17,12 +48,111 @@ 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; +} + + + +/** Audio */ +inline float UCustomGameSettings::GetDefaultMasterVolume() const +{ + return fDefaultMasterVolume; +} +inline float UCustomGameSettings::GetDefaultMusicVolume() const +{ + return fDefaultMusicVolume; +} +inline float UCustomGameSettings::GetDefaultEffectsVolume() const +{ + return fDefaultEffectsVolume; +} +inline float UCustomGameSettings::GetDefaultVoicesVolume() const +{ + return fDefaultVoicesVolume; +} +inline 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); +} + +/** 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); } -float UCustomGameSettings::GetMouseSensetivity() const +inline bool UCustomGameSettings::GetDefaultMouseInverted() const { - return fMouseSensetivity; -} \ No newline at end of file + 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 fbc5795..5fc098b 100644 --- a/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/CustomGameSettings.h @@ -10,40 +10,108 @@ * 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() + + friend class UGraphicsSettingsHelper; 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")) + 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 */ + 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|Audio") + LOST_EDGE_API inline float GetDefaultMasterVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + LOST_EDGE_API inline float GetDefaultMusicVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + LOST_EDGE_API inline float GetDefaultEffectsVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + LOST_EDGE_API inline float GetDefaultVoicesVolume() const; // UFUNCTION doesn't support constexpr functions + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + LOST_EDGE_API inline float GetDefaultMenuVolume() const; // UFUNCTION doesn't support constexpr functions + + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + float GetMasterVolume() const; + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + float GetMusicVolume() const; + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + float GetEffectsVolume() const; + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + float GetVoicesVolume() const; + UFUNCTION(BlueprintPure, Category = "Settings|Audio") + float GetMenuVolume() const; + + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") + void SetMasterVolume(float value); + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") + void SetMusicVolume(float value); + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") + void SetEffectsVolume(float value); + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") + void SetVoicesVolume(float value); + UFUNCTION(BlueprintCallable, Category = "Settings|Audio") + void SetMenuVolume(float value); + + + + /** Game */ + 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|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); - /** Returns mouse sensetivity multiplier in [0.1 - 2.0] */ - UFUNCTION(BlueprintCallable, Category = Settings) - float GetMouseSensetivity() const; - - UPROPERTY(Config, BlueprintReadWrite) - bool bUseMotionBlur; - - UPROPERTY(Config, BlueprintReadWrite) - bool bShowFps; - - UPROPERTY(Config, BlueprintReadWrite) + UFUNCTION(BlueprintPure, Category = "Settings|Game") + LOST_EDGE_API inline bool GetDefaultMouseInverted() const; + UPROPERTY(Config, BlueprintReadWrite, Category = "Settings|Game") bool bMouseInverted; + + protected: + /** Graphics */ + UPROPERTY(Config) + int32 eAntiAliasingMethod; + + /** Audio */ + UPROPERTY(Config) + float fMasterVolume; + UPROPERTY(Config) + float fMusicVolume; + UPROPERTY(Config) + float fEffectsVolume; + UPROPERTY(Config) + float fVoicesVolume; + UPROPERTY(Config) + float fMenuVolume; + + /** Game */ UPROPERTY(Config) float fMouseSensetivity; - }; 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/GraphicsSettingsHelper.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp new file mode 100644 index 0000000..6db30fa --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.cpp @@ -0,0 +1,514 @@ +// Oleg Petruny proprietary. + +#include "GraphicsSettingsHelper.h" + +#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 = 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) +{ + return ipPreviousWindowPosition.has_value() + || ipPreviousResolution.has_value() + || 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) +{ + { + 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->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) +{ + 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(UCustomGameSettings* settings, const FIntPoint& pos) +{ + if(settings) + { + if(ipPreviousWindowPosition == pos) + ipPreviousWindowPosition.reset(); + else + ipPreviousWindowPosition = GetWindowPosition(settings); + + settings->SetWindowPosition(pos.X, pos.Y); + } +} + +void UGraphicsSettingsHelper::RestoreWindowPosition(UCustomGameSettings* settings) +{ + if(!ipPreviousWindowPosition.has_value()) + return; + + SetWindowPosition(settings, ipPreviousWindowPosition.value()); +} + +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() +{ + auto monitors = GetAvailableMonitors(); + for(int32 i = 0; i < monitors.Num(); i++) + if(monitors[i].bIsPrimary) + return i; + + return GetDefaultMonitorId(nullptr); +} + +TArray UGraphicsSettingsHelper::GetAvailableMonitorsNames() +{ + auto monitors = GetAvailableMonitors(); + 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); +} + +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 + }); +} + +void UGraphicsSettingsHelper::RestoreMonitor(UCustomGameSettings* settings) +{ + RestoreWindowPosition(settings); +} + +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; + 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)} }); + lastHeight = i.Height; + lastWidth = i.Width; + } + else + { + result[result.Num() - 1].refreshRates.Add(static_cast(i.RefreshRate)); + } + } + + if(!currentInfoPresent) + if(auto settings = UCustomGameSettings::Get()) + result.Add({ currentResolution, { static_cast(settings->GetFrameRateLimit()) } }); + + return MoveTemp(result); +} + +TArray UGraphicsSettingsHelper::GetAllAvailableResolutions() +{ + TArray buffer; + if(!RHIGetAvailableResolutions(buffer, false) || buffer.Num() == 0) + return { {GetResolution(nullptr), {GetDefaultFrameRateLimit(nullptr)}} }; + + TArray result; + result.Reserve(buffer.Num() + 1); + 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; + } + } + + FIntPoint currentResolution = GetResolution(nullptr); + if(!result.Contains(currentResolution)) + result.Add(currentResolution); + + return MoveTemp(result); +} + +TArray UGraphicsSettingsHelper::GetAvailableResolutionsByMonitorId(const int32 id) +{ + auto resolutions = GetAllAvailableResolutions(); + FIntPoint nativeRes = GetNativeResolutionByMonitorId(id); + 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); +} + +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; + + 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::GetDefaultResolutionScaleFast(UCustomGameSettings* settings) +{ + return fDefaultResolutionScale; +} + +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) + { + 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) }; +} + +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)); + 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) +{ + 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((UPackage*)-1, 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((UPackage*)-1, 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()); +} + +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) + { + 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 new file mode 100644 index 0000000..6cae13e --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/GraphicsSettingsHelper.h @@ -0,0 +1,149 @@ +// Oleg Petruny proprietary. + +#pragma once + +#include "Kismet/BlueprintFunctionLibrary.h" + +#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; +}; + +/** Redefine of EWindowType, because it has duplicate without blueprint macro */ +UENUM(BlueprintType, Category = "Settings|Graphics|Enums") +enum class EDisplayMode : uint8 +{ + Fullscreen = 0 UMETA(DisplayName = "Fullscreen"), + Borderless = 1 UMETA(DisplayName = "Borderless"), + 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. + * Helps with window position, monitor selection, resolution, resolution scale, frame rate limit, aspect ratio, display mode. + * + */ +UCLASS() +class UGraphicsSettingsHelper : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintPure, Category = "Settings|Graphics", meta = (DisplayName = "Are Graphics Settings Restorable")) + static bool AreSettingsRestorable(class UCustomGameSettings* settings); + 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") + 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") + static int32 GetMonitorId(class UCustomGameSettings* settings); + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Monitor") + static int32 GetPrimaryMonitorId(); + 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(BlueprintCallable, Category = "Settings|Graphics|Monitor") + static void RestoreMonitor(class UCustomGameSettings* settings); + + 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(BlueprintCallable, Category = "Settings|Graphics|Resolution") + static void RestoreResolution(class UCustomGameSettings* settings); + + UFUNCTION(BlueprintPure, Category = "Settings|Graphics|Resolution Scale") + static float GetDefaultResolutionScaleFast(class UCustomGameSettings* settings); + + 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|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); + + 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/PlayerBase.cpp b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/PlayerBase.cpp index 853d6ba..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(); } @@ -371,16 +365,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..8d0fd6f --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.cpp @@ -0,0 +1,62 @@ +// Oleg Petruny proprietary. + +#include "ComboBoxText.h" + +void UComboBoxText::PostInitProperties() +{ + Super::PostInitProperties(); + + 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::SetOptionsAsText(const TArray& options) +{ + ClearSelection(); + 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 new file mode 100644 index 0000000..930cb7e --- /dev/null +++ b/UnrealProject/Lost_Edge/Source/Lost_Edge/Private/Widgets/ComboBoxText.h @@ -0,0 +1,36 @@ +// 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 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/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..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,24 +30,9 @@ public: UPROPERTY(BlueprintAssignable) FMainMenuClosedDelegate OnMainMenuClosedDelegate; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonContinue; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonLoadLastSave; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonNewGame; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonOptions; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonCredits; - UPROPERTY(meta = (BindWidget)) - class UMainMenuButtonWidget* ButtonExit; - - UPROPERTY(Transient, meta = (BindWidgetAnim)) - class UWidgetAnimation* showFullAnimation; - UPROPERTY(Transient, meta = (BindWidgetAnim)) - class UWidgetAnimation* showFastAnimation; - UPROPERTY(Transient, meta = (BindWidgetAnim)) + UPROPERTY(BlueprintReadOnly, Transient, meta = (BindWidgetAnim)) + class UWidgetAnimation* extendAnimation; + UPROPERTY(BlueprintReadOnly, Transient, meta = (BindWidgetAnim)) class UWidgetAnimation* closeAnimation; protected: 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;