Commit Graph

3 Commits

Author SHA1 Message Date
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
michael noland
c8dc8362b7 Prevent a crash when there is more than one kind of UPlatformSettings usage in a project
- Removed the problematic static that caused the crash and introduced a new caching system via a UPlatformSettingsManager class that keeps explicit references to the settings instead of adding them to the root
- Switched the platform names to be more consistently FName instead of roundtripping through FString

- Slightly unrelated: Added DeterminesOutputType metadata to FindParentWidgetOfType to avoid needing an extra cast in typical usage

#jira UE-142875
#rb nick.darnell
#preflight 620c788a252ef638b5806fd7

#ROBOMERGE-AUTHOR: michael.noland
#ROBOMERGE-SOURCE: CL 19060400 in //UE5/Release-5.0/... via CL 19076932
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19120907 by michael noland in ue5-main branch]
2022-02-24 14:23:31 -05:00
Nick Darnell
19eecbd0c5 Project Settings - Adding a way to easily introduce per platform settings objects that are correctly saved outside the game ini, and instead store their configuration to each platform's NDA'ed location, if they're a confidential platform. These platform options are kept in sync with what platforms you have enabled for your project (though a restart is required to see that reflected in the settings).
The base class of any per platform settings.  The pattern for using these is as follows.

Step 1) Subclass UPlatformSettings, UMyPerPlatformSettings : public UPlatformSettings.

Step 2) For your system should already have a UDeveloperSettings that you created so that
        users can customize other properties for your system in the project.  On that class
        you need to create a property of type FPerPlatformSettings, e.g.
        UPROPERTY(EditAnywhere, Category=Platform)
        FPerPlatformSettings PlatformOptions

Step 3) In your UDeveloperSettings subclasses construct, there should be a line like this,
        PlatformOptions.Settings = UPlatformSettings::GetAllPlatformSettings<UMyPerPlatformSettings>();
        This will actually ensure that you initialize the settings exposed in the editor to whatever
        the current platform configuration is for them.

Step 4) Nothing else needed.  In your system code, you will just call
        UMyPerPlatformSettings* MySettings = UPlatformSettings::GetSettingsForPlatform<UMyPerPlatformSettings>()
        that will get you the current settings for the active platform, or the simulated platform in the editor.

#review-16603960 Josh.Adams, Michael.Noland, Daren.Cheng
#fyi Josh.Adams, Michael.Noland, Daren.Cheng

[CL 16603959 by Nick Darnell in ue5-main branch]
2021-06-09 09:14:21 -04:00