Skip to content

Commit b84a226

Browse files
committed
Merge branch 'dev'
* dev: (25 commits) make searchprojectpath checkbox checked on load settings new project: Fix create new project platform argument if pressed enter to create., When new project is added as first item add modified date and platform also., add option to search from project path string also editors: "update" button now sets search filter as current version minus patch, move download context menus under "Download" root menuitem, add Check Updates context menu, new project: F2:focus project name field, F3: select next platform, F4: select next template, Tools: move ADB args to settings tab fix new project from explorer context menu (main window was visible behind new project window) new project: added platform selection, load/save last used platform selection, new project: improve new project automatic naming (add unity minor versio number to name, and fallback to timestamp if a-z letters are taken), if press ESC while combobox dropdown is open then close that dropdown (instead of closing window), adding platform selection (combobox to select target platform) theme editor: some cleanup clear search after add project manually (otherwise cannot see it, unless it matches search), adding template folder option for new projects remove some duplicate/unused colors (see Colors.xaml) NOTE: this breaks some colors in existing templates. ThemeEditor: dont allow opening multiple windows, bring to front if already open theme editor: disable window resize, fix year string for saved theme comment customdatetime: add red outline for invalid values, add new theme colors, theme editor: sort by key, disable column rearrange and sort click, set first row autoselected, set datagrid header visible and styled, add new theme colors to checkboxes and radiobuttons set sliders to Int ticks, start initial cleanup rebuild radiobutton from template, add radiobutton theme colors theme editor: rebuild checkbox from template, add ThemeSystemHighlight color load settings at init (to get correct window size), set missing textbox theme color assigments, theme editor: creating checkbox template style, add undo to theme editor color slider value, keep previous theme file name in save dialog, arrange theme colors resource a bit load themes from application/Themes/ folder, remove themefile global var, move Start() method into OnWindowLoaded (to get nicer error messages), make highlight and inactive highlight colors for recent datagrid transparent (to see custom selected row colors), theme editor: clear orig colors list on enter window theme editor: add save dialog, take current active colors when opening theme editor, fix selected color RGB textbox values, fix nullref if click empty row in theme colors datagrid, create Themes/ folder to root if missing theme editor: add reset theme, add save theme (to file), set theme editor window colors to local colors (so they wont ever get changed) add editor list context menu: to download modules (webgl, ios, android) ... # Conflicts: # UnityLauncherPro/App.config # UnityLauncherPro/MainWindow.xaml # UnityLauncherPro/MainWindow.xaml.cs # UnityLauncherPro/Properties/Settings.Designer.cs # UnityLauncherPro/Properties/Settings.settings
2 parents 9427316 + a4b8b39 commit b84a226

15 files changed

+1115
-174
lines changed

Diff for: UnityLauncherPro/App.config

+9
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@
9999
<setting name="projectName" serializeAs="String">
100100
<value>0</value>
101101
</setting>
102+
<setting name="templatePackagesFolder" serializeAs="String">
103+
<value />
104+
</setting>
105+
<setting name="newProjectPlatform" serializeAs="String">
106+
<value />
107+
</setting>
108+
<setting name="searchProjectPathAlso" serializeAs="String">
109+
<value>False</value>
110+
</setting>
102111
</UnityLauncherPro.Properties.Settings>
103112
</userSettings>
104113
</configuration>

Diff for: UnityLauncherPro/Data/ThemeColor.cs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.ComponentModel;
3+
using System.Globalization;
4+
using System.Windows.Data;
5+
using System.Windows.Media;
6+
7+
namespace UnityLauncherPro
8+
{
9+
public class ThemeColor : IValueConverter
10+
{
11+
public string Key { get; set; }
12+
public SolidColorBrush Brush { get; set; }
13+
14+
15+
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
16+
{
17+
return (SolidColorBrush)value;
18+
}
19+
20+
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21+
{
22+
throw new NotImplementedException();
23+
}
24+
}
25+
}

Diff for: UnityLauncherPro/GetProjects.cs

+59-3
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;
@@ -78,6 +78,8 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
7878
projectName = projectPath;
7979
}
8080

81+
//Console.WriteLine("valueName="+ valueName+" , projectName =" + projectName);
82+
8183
// get last modified date from folder
8284
DateTime? lastUpdated = folderExists ? Tools.GetLastModifiedTime(projectPath) : null;
8385

@@ -136,15 +138,69 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
136138
p.folderExists = folderExists;
137139

138140
// if want to hide project and folder path for screenshot
139-
//p.Title = "Hidden Project";
140-
//p.Path = "C:/Hidden Path/";
141+
//p.Title = "Example Project ";
142+
//p.Path = "C:/Projects/ExamplePath/MyProj";
141143

142144
projectsFound.Add(p);
143145
} // valid key
144146
} // each key
145147
} // for each registry root
146148

149+
// NOTE sometimes projects are in wrong order, seems to be related to messing up your unity registry, the keys are received in created order (so if you had removed/modified them manually, it might return wrong order instead of 0 - 40)
150+
147151
return projectsFound;
148152
} // Scan()
153+
154+
public static bool RemoveRecentProject(string projectPathToRemove)
155+
{
156+
var hklm = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
157+
158+
// check each version path
159+
for (int i = 0, len = registryPathsToCheck.Length; i < len; i++)
160+
{
161+
RegistryKey key = hklm.OpenSubKey(registryPathsToCheck[i], true);
162+
163+
if (key == null)
164+
{
165+
continue;
166+
}
167+
else
168+
{
169+
//Console.WriteLine("Null registry key at " + registryPathsToCheck[i]);
170+
}
171+
172+
// parse recent project paths
173+
foreach (var valueName in key.GetValueNames())
174+
{
175+
if (valueName.IndexOf("RecentlyUsedProjectPaths-") == 0)
176+
{
177+
string projectPath = "";
178+
// check if binary or not
179+
var valueKind = key.GetValueKind(valueName);
180+
if (valueKind == RegistryValueKind.Binary)
181+
{
182+
byte[] projectPathBytes = (byte[])key.GetValue(valueName);
183+
projectPath = Encoding.UTF8.GetString(projectPathBytes, 0, projectPathBytes.Length - 1);
184+
}
185+
else // should be string then
186+
{
187+
projectPath = (string)key.GetValue(valueName);
188+
}
189+
190+
// if our project folder, remove registry item
191+
if (projectPath == projectPathToRemove)
192+
{
193+
Console.WriteLine("Deleted registery item: " + valueName + " projectPath=" + projectPath);
194+
key.DeleteValue(valueName);
195+
return true;
196+
}
197+
198+
} // valid key
199+
} // each key
200+
} // for each registry root
201+
return false;
202+
} // RemoveRecentProject()
203+
149204
} // class
150205
} // namespace
206+

Diff for: UnityLauncherPro/GetUnityInstallations.cs

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public static UnityInstallation[] Scan()
8282
} // got folders
8383
} // all root folders
8484

85+
// sort by version
8586
results.Sort((s1, s2) => Tools.VersionAsInt(s2.Version).CompareTo(Tools.VersionAsInt(s1.Version)));
8687

8788
return results.ToArray();

0 commit comments

Comments
 (0)