Add custom Name property for GDK package settings
This commit is contained in:
@@ -167,7 +167,6 @@ bool GDKPlatformTools::OnPostProcess(CookingData& data, GDKPlatformSettings* pla
|
|||||||
const auto gameSettings = GameSettings::Get();
|
const auto gameSettings = GameSettings::Get();
|
||||||
const auto project = Editor::Project;
|
const auto project = Editor::Project;
|
||||||
const Char* executableFilename = TEXT("FlaxGame.exe");
|
const Char* executableFilename = TEXT("FlaxGame.exe");
|
||||||
const String name = gameSettings->ProductName;
|
|
||||||
const String assetsFolder = data.DataOutputPath / TEXT("Assets");
|
const String assetsFolder = data.DataOutputPath / TEXT("Assets");
|
||||||
if (!FileSystem::DirectoryExists(assetsFolder))
|
if (!FileSystem::DirectoryExists(assetsFolder))
|
||||||
FileSystem::CreateDirectory(assetsFolder);
|
FileSystem::CreateDirectory(assetsFolder);
|
||||||
@@ -190,8 +189,10 @@ bool GDKPlatformTools::OnPostProcess(CookingData& data, GDKPlatformSettings* pla
|
|||||||
const String configFilePath = data.DataOutputPath / TEXT("MicrosoftGame.config");
|
const String configFilePath = data.DataOutputPath / TEXT("MicrosoftGame.config");
|
||||||
LOG(Info, "Generating config file to \"{0}\"", configFilePath);
|
LOG(Info, "Generating config file to \"{0}\"", configFilePath);
|
||||||
{
|
{
|
||||||
|
// Process name to be valid
|
||||||
StringBuilder sb;
|
StringBuilder sb;
|
||||||
Array<Char> validName;
|
Array<Char> validName;
|
||||||
|
const String& name = platformSettings->Name.HasChars() ? platformSettings->Name : gameSettings->ProductName;
|
||||||
for (int32 i = 0; i < name.Length() && validName.Count() <= 50; i++)
|
for (int32 i = 0; i < name.Length() && validName.Count() <= 50; i++)
|
||||||
{
|
{
|
||||||
auto c = name[i];
|
auto c = name[i];
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ API_CLASS(Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API GDKPlatf
|
|||||||
DECLARE_SCRIPTING_TYPE_MINIMAL(GDKPlatformSettings);
|
DECLARE_SCRIPTING_TYPE_MINIMAL(GDKPlatformSettings);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Game identity name stored in game package manifest (for store). If empty the product name will be used from Game Settings.
|
||||||
|
/// </summary>
|
||||||
|
API_FIELD(Attributes="EditorOrder(90), EditorDisplay(\"General\")")
|
||||||
|
String Name;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Game publisher identity name stored in game package manifest (for store).
|
/// Game publisher identity name stored in game package manifest (for store).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -113,6 +119,7 @@ public:
|
|||||||
// [SettingsBase]
|
// [SettingsBase]
|
||||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
|
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
|
||||||
{
|
{
|
||||||
|
DESERIALIZE(Name);
|
||||||
DESERIALIZE(PublisherName);
|
DESERIALIZE(PublisherName);
|
||||||
DESERIALIZE(PublisherDisplayName);
|
DESERIALIZE(PublisherDisplayName);
|
||||||
DESERIALIZE(Square150x150Logo);
|
DESERIALIZE(Square150x150Logo);
|
||||||
|
|||||||
Reference in New Issue
Block a user