Skip to content

Commit c13da5c

Browse files
committed
adding shorter platform names
1 parent 6016015 commit c13da5c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

UnityLauncherPro/GetUnityInstallations.cs

+13-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace UnityLauncherPro
99
/// </summary>
1010
public static class GetUnityInstallations
1111
{
12+
static Dictionary<string, string> platformNames = new Dictionary<string, string> { { "androidplayer", "Android" }, { "windowsstandalonesupport", "Windows" }, { "LinuxStandalone", "Linux" }, { "OSXStandalone", "Mac" } };
13+
1214
// returns unity installations
1315
public static UnityInstallation[] Scan()
1416
{
@@ -75,11 +77,19 @@ static string[] GetPlatforms(string dataFolder)
7577
var platformFolder = Path.Combine(dataFolder, "PlaybackEngines");
7678
if (Directory.Exists(platformFolder) == false) return null;
7779
var directories = Directory.GetDirectories(platformFolder);
78-
// TODO get all platform names from those folders
79-
// TODO get platform foldername only
8080
for (int i = 0; i < directories.Length; i++)
8181
{
82-
directories[i] = Path.GetFileName(directories[i]);
82+
var foldername = Path.GetFileName(directories[i]).ToLower();
83+
// check if have better name in dictionary
84+
if (platformNames.ContainsKey(foldername))
85+
{
86+
directories[i] = platformNames[foldername];
87+
}
88+
else
89+
{
90+
directories[i] = foldername;
91+
}
92+
//Console.WriteLine(directories[i]);
8393
}
8494

8595
return directories;

UnityLauncherPro/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@
628628
</StackPanel>
629629

630630
<!-- links-->
631-
<Button Grid.Row="4" Style="{StaticResource CustomButton}" x:Name="btnOpenGithub" Margin="10,0,0,10" BorderBrush="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Center" Click="BtnOpenGithub_Click">
631+
<Button Grid.Row="4" Style="{StaticResource CustomButton}" x:Name="btnOpenGithub" Margin="0,0,15,10" BorderBrush="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Center" Click="BtnOpenGithub_Click">
632632
<Label Content="_View in Github" Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
633633
</Button>
634634

0 commit comments

Comments
 (0)