Skip to content

Commit 4818814

Browse files
committed
started adding buildin Theme Editor, fix root folder browse button style, fix missing comment line,(re-commit some previous changes due to github issue..)
1 parent 020df12 commit 4818814

File tree

10 files changed

+489
-75
lines changed

10 files changed

+489
-75
lines changed

UnityLauncherPro/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@
9696
<setting name="adbLogCatArgs" serializeAs="String">
9797
<value>-s Unity ActivityManager PackageManager dalvikvm DEBUG -v color</value>
9898
</setting>
99+
<setting name="projectName" serializeAs="String">
100+
<value>0</value>
101+
</setting>
99102
</UnityLauncherPro.Properties.Settings>
100103
</userSettings>
101104
</configuration>

UnityLauncherPro/GetProjects.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Win32;
1+
using Microsoft.Win32;
22
using System;
33
using System.Collections.Generic;
44
using System.IO;
@@ -88,7 +88,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
8888
string customArgs = "";
8989
if (getArguments == true)
9090
{
91-
customArgs = folderExists ? Tools.ReadCustomLaunchArguments(projectPath, MainWindow.launcherArgumentsFile) : null;
91+
customArgs = folderExists ? Tools.ReadCustomProjectData(projectPath, MainWindow.launcherArgumentsFile) : null;
9292
}
9393

9494
// get git branchinfo, only if column in enabled
@@ -105,7 +105,23 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
105105
}
106106

107107
var p = new Project();
108-
p.Title = projectName;
108+
109+
switch (MainWindow.projectNameSetting)
110+
{
111+
case 0:
112+
p.Title = Tools.ReadCustomProjectData(projectPath, MainWindow.projectNameFile);
113+
break;
114+
case 1:
115+
p.Title = Tools.ReadProjectName(projectPath);
116+
break;
117+
default:
118+
p.Title = projectName;
119+
break;
120+
}
121+
122+
// if no custom data or no product name found
123+
if (string.IsNullOrEmpty(p.Title)) p.Title = projectName;
124+
109125
p.Version = projectVersion;
110126
p.Path = projectPath;
111127
p.Modified = lastUpdated;
@@ -120,8 +136,8 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
120136
p.folderExists = folderExists;
121137

122138
// if want to hide project and folder path for screenshot
123-
//p.Title = "Hidden Project";
124-
//p.Path = "C:/Hidden Path/";
139+
//p.Title = "Example Project ";
140+
//p.Path = "C:/Projects/ExamplePath/MyProj";
125141

126142
projectsFound.Add(p);
127143
} // valid key
@@ -132,3 +148,4 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
132148
} // Scan()
133149
} // class
134150
} // namespace
151+

UnityLauncherPro/MainWindow.xaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -910,20 +910,21 @@
910910
<CheckBox x:Name="chkShowGitBranchColumn" Content="Show git branch column" Foreground="{DynamicResource ThemeButtonForeground}" Checked="ChkShowGitBranchColumn_CheckedChanged" Unchecked="ChkShowGitBranchColumn_CheckedChanged" Margin="0,0,0,4" ToolTip="Shows column for project git branch info" HorizontalAlignment="Left"/>
911911
<CheckBox x:Name="chkShowMissingFolderProjects" Content="Show projects that don't exist on disk" Foreground="{DynamicResource ThemeButtonForeground}" Checked="ChkShowMissingFolderProjects_CheckedChanged" Unchecked="ChkShowMissingFolderProjects_CheckedChanged" Margin="0,0,0,4" ToolTip="List in recent projects, even if the project folder is missing" HorizontalAlignment="Left"/>
912912
<CheckBox x:Name="chkAllowSingleInstanceOnly" Content="Allow single instance only" Foreground="{DynamicResource ThemeButtonForeground}" Checked="ChkAllowSingleInstanceOnly_CheckedChanged" Unchecked="ChkAllowSingleInstanceOnly_CheckedChanged" Margin="0,0,0,4" ToolTip="Activates already running instance, instead of starting new exe (not working if app is minized to taskbar)" HorizontalAlignment="Left"/>
913-
<CheckBox x:Name="chkEnableProjectRename" Content="Enable Project Rename F2 (Not recommended for beginners)" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Can use F2 to rename project folders, Note that project will disappears from list on refresh, unless you open it (since its new path, not in unity recent projects registry)" Checked="ChkEnableProjectRename_Checked" Unchecked="ChkEnableProjectRename_Checked" HorizontalAlignment="Left"/>
913+
<CheckBox x:Name="chkEnableProjectRename" Content="Enable Project title rename (F2)" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Renames project title only, DOES NOT rename project folder! New name is saved into ProjectSettings/ProjectName.txt" Checked="ChkEnableProjectRename_Checked" Unchecked="ChkEnableProjectRename_Checked" HorizontalAlignment="Left"/>
914914
<CheckBox x:Name="chkAskNameForQuickProject" Content="Ask name for New Project" Foreground="{DynamicResource ThemeButtonForeground}" Checked="ChkAskNameForQuickProject_Checked" Unchecked="ChkAskNameForQuickProject_Checked" Margin="0,0,0,4" ToolTip="If disabled, uses automatic quick project naming" HorizontalAlignment="Left"/>
915915
<CheckBox x:Name="chkStreamerMode" Content="Streamer Mode (hide project names and folders)" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Hide project names and folders in main view" Checked="ChkStreamerMode_Checked" Unchecked="ChkStreamerMode_Checked" HorizontalAlignment="Left"/>
916916
<CheckBox x:Name="chkShowPlatform" Content="Show current target platform (if exists in .csproj)" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Shows target platform column" Checked="ChkShowPlatform_Checked" Unchecked="ChkShowPlatform_Checked" HorizontalAlignment="Left"/>
917917
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,0,0,4">
918918
<CheckBox x:Name="chkUseCustomTheme" Content="Load custom theme" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Loads theme.ini from application folder" Checked="ChkUseCustomTheme_Checked" Unchecked="ChkUseCustomTheme_Checked" HorizontalAlignment="Left"/>
919919
<TextBox x:Name="txtCustomThemeFile" MinWidth="128" ToolTip="Default is theme.ini" Padding="0,3,0,0" Margin="5,0,0,0" Text="theme.ini" LostFocus="TxtCustomThemeFile_LostFocus" PreviewKeyDown="TxtCustomThemeFile_PreviewKeyDown" />
920920
<Button Style="{StaticResource CustomButton}" ToolTip="Reload theme" x:Name="btnReloadTheme" Content="" Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="BtnReloadTheme_Click" Margin="5,0,0,0"/>
921-
<Button Style="{StaticResource CustomButton}" ToolTip="Explore folder.." x:Name="btnExploreFolder" Content="..." Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="BtnExploreFolder_Click" Margin="5,0,0,0"/>
921+
<Button Style="{StaticResource CustomButton}" ToolTip="Explore Themes folder (application root)" x:Name="btnExploreFolder" Content="..." Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="BtnExploreFolder_Click" Margin="5,0,0,0"/>
922+
<Button Style="{StaticResource CustomButton}" ToolTip="Open theme editor" x:Name="btnThemeEditor" Content="" Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="BtnThemeEditor_Click" Margin="5,0,0,0"/>
922923
</StackPanel>
923924

924925
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,0,0,4">
925926
<TextBox x:Name="txtRootFolderForNewProjects" MinWidth="300" ToolTip="Root folder for quick New Projects (so that you dont have to pick project folder every time)" Padding="0,3,0,0" TextChanged="TxtRootFolderForNewProjects_TextChanged" />
926-
<Button x:Name="btnBrowseProjectRootFolder" Content="..." Margin="6,0,0,0" MinWidth="32" Click="BtnBrowseProjectRootFolder_Click" />
927+
<Button Style="{StaticResource CustomButton}" x:Name="btnBrowseProjectRootFolder" Content="..." Margin="6,0,0,0" MinWidth="22" Click="BtnBrowseProjectRootFolder_Click" MinHeight="22" FontSize="16" ToolTip="Browse for new projects root folder.." />
927928
<Label Content="Root Folder for New Projects" Foreground="{DynamicResource ThemeButtonForeground}" />
928929
</StackPanel>
929930
<StackPanel Grid.Row="3" Orientation="Horizontal">
@@ -934,15 +935,20 @@
934935

935936
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="5,10,3,3" >
936937
<CheckBox x:Name="chkEnablePlatformSelection" Content="Enable Platform Selection (Experimental!)" Foreground="{DynamicResource ThemeButtonForeground}" Checked="ChkEnablePlatformSelection_Checked" Unchecked="ChkEnablePlatformSelection_Checked" Margin="0,0,0,4" ToolTip="Select target platform" HorizontalAlignment="Left"/>
937-
<StackPanel Grid.Row="3" Orientation="Horizontal">
938+
<StackPanel Orientation="Horizontal">
938939
<CheckBox x:Name="chkRunAutomatically" Content="Run automatically on startup " Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Run automatically using startup registry key" HorizontalAlignment="Left" Checked="ChkRunAutomatically_Checked" Unchecked="ChkRunAutomatically_Checked"/>
939940
<CheckBox x:Name="chkRunAutomaticallyMinimized" Content="as minimized" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Minimize to tray when started automatically" HorizontalAlignment="Left" Checked="ChkRunAutomaticallyMinimized_Checked" Unchecked="ChkRunAutomaticallyMinimized_Checked"/>
940941
</StackPanel>
941-
<StackPanel Grid.Row="3" Orientation="Horizontal">
942+
<StackPanel Orientation="Horizontal">
942943
<CheckBox x:Name="chkUseCustomLastModified" Content="Date format" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Last modified date format" HorizontalAlignment="Left" Checked="ChkUseCustomLastModified_Checked" Unchecked="ChkUseCustomLastModified_Checked"/>
943944
<TextBox x:Name="txtCustomDateTimeFormat" MinWidth="150" ToolTip="Default is dd/MM/yyyy HH:mm:ss" Padding="0,3,0,0" Margin="5,0,0,0" Text="dd/MM/yyyy HH:mm:ss" LostFocus="TxtCustomDateTimeFormat_LostFocus" TextChanged="TxtCustomDateTimeFormat_TextChanged" />
944945
</StackPanel>
945946
<CheckBox x:Name="chkHumanFriendlyDateTime" Content="Use human friendly last modified" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,4" ToolTip="Last modified date format" HorizontalAlignment="Left" Checked="ChkHumanFriendlyDateTime_Checked" Unchecked="ChkHumanFriendlyDateTime_Checked"/>
947+
<Label Foreground="{DynamicResource ThemeButtonForeground}">Project name:</Label>
948+
<StackPanel Orientation="Horizontal">
949+
<RadioButton x:Name="radioProjNameFolder" Content="Folder or ProjectName.txt" Foreground="{DynamicResource ThemeButtonForeground}" Margin="4,0,0,0" GroupName="toggleGroupProjectName" IsChecked="True" Checked="RadioProjNameFolder_Checked" ToolTip="Take project name from project folder name OR ProjectName.txt if file exists in ProjectSettings/ folder"/>
950+
<RadioButton x:Name="radioProjNameProductName" Content="Settings ProductName" Foreground="{DynamicResource ThemeButtonForeground}" Margin="5,0,0,0" GroupName="toggleGroupProjectName" Checked="RadioProjNameProductName_Checked" ToolTip="Take project name from player settings ProductName field"/>
951+
</StackPanel>
946952
</StackPanel>
947953
</StackPanel>
948954

0 commit comments

Comments
 (0)