You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
26 lines
970 B
C++
26 lines
970 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Misc/Attribute.h"
|
|
#include "Input/Reply.h"
|
|
#include "IDetailCustomization.h"
|
|
#include "PropertyHandle.h"
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// FPerPlatformSettingsCustomization
|
|
|
|
class FPerPlatformSettingsCustomization : public IPropertyTypeCustomization
|
|
{
|
|
public:
|
|
// Makes a new instance of this detail layout class for a specific detail view requesting it
|
|
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
|
|
|
|
virtual void CustomizeHeader(TSharedRef<IPropertyHandle> PropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
|
|
virtual void CustomizeChildren(TSharedRef<IPropertyHandle> PropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
|
|
|
|
private:
|
|
FPerPlatformSettingsCustomization();
|
|
};
|