5#if WITH_EDITORONLY_DATA
6#include "GeneralProjectSettings.h"
7#include "AndroidRuntimeSettings.h"
12#define LogAPEX(pmt, ...) UE_LOG(LogApexSDKSettings, Log, TEXT(pmt), ##__VA_ARGS__)
13#define WarnAPEX(pmt, ...) UE_LOG(LogApexSDKSettings, Warning, TEXT(pmt), ##__VA_ARGS__)
14#define ErrorAPEX(pmt, ...) UE_LOG(LogApexSDKSettings, Error, TEXT(pmt), ##__VA_ARGS__)
15#define FatalAPEX(pmt, ...) UE_LOG(LogApexSDKSettings, Fatal, TEXT(pmt), ##__VA_ARGS__)
17UApexSDKSettings::UApexSDKSettings(
const FObjectInitializer& ObjectInitializer)
18 : Super(ObjectInitializer)
22 ModuleVersion =
"1.00.00";
28 TArray<FString> ModuleVersionArray;
34 int VersionPartCount = Version.ParseIntoArray(ModuleVersionArray, TEXT(
"."));
36 if (VersionPartCount != 3)
41 if (ModuleVersionArray[0].Len() <= 0 || ModuleVersionArray[0].StartsWith(
"0") || !ModuleVersionArray[0].IsNumeric())
46 if (ModuleVersionArray[1].Len() != 2 || !ModuleVersionArray[1].IsNumeric())
51 if (ModuleVersionArray[2].Len() != 2 || !ModuleVersionArray[2].IsNumeric())
59#if WITH_EDITORONLY_DATA
60void UApexSDKSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
62 if (PropertyChangedEvent.Property !=
nullptr)
64 const FName PropertyName(PropertyChangedEvent.Property->GetFName());
69 TArray<FString> ModuleVersionParts;
83 Super::PostEditChangeProperty(PropertyChangedEvent);
86void UApexSDKSettings::UpdateVersion(
const TArray<FString>& VersionParts,
const TArray<EPVRVersionFields>& Fields)
88 int MajorVerison = FCString::Atoi(*VersionParts[0]);
89 int MinorVersion = FCString::Atoi(*VersionParts[1]);
90 int PatchVersion = FCString::Atoi(*VersionParts[2]);
92 FString FullVersion = FString::Printf(TEXT(
"%i.%.2i.%.2i"), MajorVerison, MinorVersion, PatchVersion);
94 if (UGeneralProjectSettings* Settings = GetMutableDefault<UGeneralProjectSettings>())
96 Settings->ProjectVersion = FullVersion;
97 Settings->UpdateSinglePropertyInConfigFile(Settings->GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UGeneralProjectSettings, ProjectVersion)), Settings->GetDefaultConfigFilename());
100 if (UAndroidRuntimeSettings* Settings = GetMutableDefault<UAndroidRuntimeSettings>())
102 Settings->VersionDisplayName = FullVersion;
103 Settings->UpdateSinglePropertyInConfigFile(Settings->GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, VersionDisplayName)), Settings->GetDefaultConfigFilename());
107 FString AndroidVersionNumber = FString::Printf(TEXT(
"%i%.2i%.2i"), MajorVerison, MinorVersion, PatchVersion);
108 Settings->StoreVersion = FCString::Atoi(*AndroidVersionNumber);
109 Settings->UpdateSinglePropertyInConfigFile(Settings->GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UAndroidRuntimeSettings, StoreVersion)), Settings->GetDefaultConfigFilename());
117 static const FString DefaultGamePath = FString::Printf(TEXT(
"%sDefaultGame.ini"), *FPaths::SourceConfigDir());
120 if (GConfig->GetString(TEXT(
"/Script/PixoVR.PixoVRSettings"), TEXT(
"ModuleVersion"), Setting, DefaultGamePath))
122 GConfig->SetString(TEXT(
"/Script/PixoVR.PixoVRSettings"), TEXT(
"ModuleVersion"), *FullVersion, DefaultGamePath);
125 GConfig->Flush(
false, DefaultGamePath);
DEFINE_LOG_CATEGORY_STATIC(LogApexSDKSettings, Log, All)
#define ErrorAPEX(pmt,...)
UCLASS(config = Engine, defaultconfig)
bool CheckModuleVersion()
bool bSyncVersion
UPROPERTY(Config, EditAnywhere, Category = "Apex", meta = (DisplayName = "Sync Module Version",...
bool GetModuleVersionArray(FString Version, TArray< FString > &ModuleVersionArray)
FString ModuleVersion
UPROPERTY(Config, EditAnywhere, Category = "Apex", meta = (DisplayName = "Module Version"))
TArray< EPVRVersionFields > AdditionalVersionFields
UPROPERTY(Config, EditAnywhere, Category = "Apex", meta = (DisplayName = "Additional Synchronized Ver...