Add app version and ui orientation settings to iOS

This commit is contained in:
Wojtek Figat
2023-06-10 12:43:10 +02:00
parent ea4f97aad8
commit 5e07a42417
2 changed files with 56 additions and 4 deletions

View File

@@ -13,12 +13,47 @@ API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API
{
DECLARE_SCRIPTING_TYPE_MINIMAL(ApplePlatformSettings);
/// <summary>
/// The display orientation modes. Can be combined as flags.
/// </summary>
API_ENUM(Attributes="Flags") enum class UIInterfaceOrientations
{
// The device is in portrait mode, with the device upright and the Home button on the bottom.
Portrait = 1,
// The device is in portrait mode but is upside down, with the device upright and the Home button at the top.
PortraitUpsideDown = 2,
// The device is in landscape mode, with the device upright and the Home button on the left.
LandscapeLeft = 4,
// The device is in landscape mode, with the device upright and the Home button on the right.
LandscapeRight = 8,
// The all modes.
All = Portrait | PortraitUpsideDown | LandscapeLeft | LandscapeRight
};
/// <summary>
/// The app developer name - App Store Team ID.
/// </summary>
API_FIELD(Attributes="EditorOrder(10), EditorDisplay(\"General\")")
String AppTeamId;
/// <summary>
/// The app version number (matches CURRENT_PROJECT_VERSION in XCode).
/// </summary>
API_FIELD(Attributes="EditorOrder(20), EditorDisplay(\"General\")")
String AppVersion = TEXT("1");
/// <summary>
/// The UI interface orientation modes supported on iPhone devices.
/// </summary>
API_FIELD(Attributes="EditorOrder(200), EditorDisplay(\"UI\", \"Supported Interface Orientations (iPhone)\")")
UIInterfaceOrientations SupportedInterfaceOrientationsiPhone = UIInterfaceOrientations::All;
/// <summary>
/// The UI interface orientation modes supported on iPad devices.
/// </summary>
API_FIELD(Attributes="EditorOrder(210), EditorDisplay(\"UI\", \"Supported Interface Orientations (iPad)\")")
UIInterfaceOrientations SupportedInterfaceOrientationsiPad = UIInterfaceOrientations::All;
/// <summary>
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
/// </summary>
@@ -29,6 +64,9 @@ API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API
{
ApplePlatformSettings::Deserialize(stream, modifier);
DESERIALIZE(AppTeamId);
DESERIALIZE(AppVersion);
DESERIALIZE(SupportedInterfaceOrientationsiPhone);
DESERIALIZE(SupportedInterfaceOrientationsiPad);
}
};