Skip to content
Permalink
Browse files

[Templates] Remove the _Game from sample templates

  • Loading branch information
xen2 committed Dec 16, 2018
1 parent a2e151a commit 5467379f14c53af82f7af9685803f6843c524831
@@ -37,7 +37,7 @@
<ItemGroup>
<ProjectReference Include="..\<#= Properties.ProjectGameRelativePath #>">
<Project>{<#= Properties.ProjectGameGuid #>}</Project>
<Name><#= Properties.PackageGameName #></Name>
<Name><#= Properties.PackageGameAssemblyName #></Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -34,7 +34,7 @@
<ItemGroup>
<ProjectReference Include="..\<#= Properties.ProjectGameRelativePath #>">
<Project>{<#= Properties.ProjectGameGuid #>}</Project>
<Name><#= Properties.PackageGameName #></Name>
<Name><#= Properties.PackageGameAssemblyName #></Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -8,7 +8,7 @@
<mp:PhoneIdentity PhoneProductId="<#= identityGuid.ToString().ToLowerInvariant() #>" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName><#= Properties.PackageGameName #></DisplayName>
<DisplayName><#= Properties.PackageGameDisplayName #></DisplayName>
<PublisherDisplayName>publisher</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
@@ -34,7 +34,7 @@
<ItemGroup>
<ProjectReference Include="..\<#= Properties.ProjectGameRelativePath #>">
<Project>{<#= Properties.ProjectGameGuid #>}</Project>
<Name><#= Properties.PackageGameName #></Name>
<Name><#= Properties.PackageGameAssemblyName #></Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -26,7 +26,7 @@
<ItemGroup>
<ProjectReference Include="..\<#= Properties.ProjectGameRelativePath #>">
<Project>{<#= Properties.ProjectGameGuid #>}</Project>
<Name><#= Properties.PackageGameName #></Name>
<Name><#= Properties.PackageGameAssemblyName #></Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -66,15 +66,21 @@ public static IEnumerable<SolutionProject> UpdatePackagePlatforms(PackageTemplat
// Setup the ProjectGameGuid to be accessible from exec (in order to be able to link to the game project.
AddOption(parameters, "ProjectGameGuid", (package.Container as SolutionProject)?.Id ?? Guid.Empty);
AddOption(parameters, "ProjectGameRelativePath", (package.Container as SolutionProject)?.FullPath.MakeRelative(parameters.OutputDirectory).ToWindowsPath());
AddOption(parameters, "PackageGameAssemblyName", package.Meta.Name);

AddOption(parameters, "PackageGameName", package.Meta.Name);
AddOption(parameters, "PackageGameDisplayName", package.Meta.Title ?? package.Meta.Name);
// Sample templates still have .Game in their name
var packageNameWithoutGame = package.Meta.Name;
if (packageNameWithoutGame.EndsWith(".Game"))
packageNameWithoutGame = packageNameWithoutGame.Substring(0, packageNameWithoutGame.Length - ".Game".Length);

AddOption(parameters, "PackageGameName", packageNameWithoutGame);
AddOption(parameters, "PackageGameDisplayName", package.Meta.Title ?? packageNameWithoutGame);
// Escape illegal characters for the short name
AddOption(parameters, "PackageGameNameShort", Utilities.BuildValidClassName(package.Meta.Name.Replace(" ", string.Empty)));
AddOption(parameters, "PackageGameNameShort", Utilities.BuildValidClassName(packageNameWithoutGame.Replace(" ", string.Empty)));
AddOption(parameters, "PackageGameRelativePath", package.FullPath.MakeRelative(parameters.OutputDirectory).ToWindowsPath());

// Override namespace
AddOption(parameters, "Namespace", parameters.Namespace ?? Utilities.BuildValidNamespaceName(package.Meta.Name));
AddOption(parameters, "Namespace", parameters.Namespace ?? Utilities.BuildValidNamespaceName(packageNameWithoutGame));

// Add projects
var stepIndex = 0;
@@ -165,6 +171,10 @@ public static IEnumerable<SolutionProject> UpdatePackagePlatforms(PackageTemplat

public static UFile GeneratePlatformProjectLocation(string name, Package package, SolutionPlatform platform)
{
// Remove .Game suffix
if (name.EndsWith(".Game"))
name = name.Substring(0, name.Length - ".Game".Length);

var projectName = Utilities.BuildValidNamespaceName(name) + "." + platform.Name;
return UPath.Combine(UPath.Combine(package.RootDirectory.GetParent(), (UDirectory)projectName), (UFile)(projectName + ".csproj"));
}

0 comments on commit 5467379

Please sign in to comment.
You can’t perform that action at this time.