Skip to content

Commit a061ef8

Browse files
committed
add option to search from project path string also
1 parent 320e3e0 commit a061ef8

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

UnityLauncherPro/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105
<setting name="newProjectPlatform" serializeAs="String">
106106
<value />
107107
</setting>
108+
<setting name="searchProjectPathAlso" serializeAs="String">
109+
<value>False</value>
110+
</setting>
108111
</UnityLauncherPro.Properties.Settings>
109112
</userSettings>
110113
</configuration>

UnityLauncherPro/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@
10251025
</TextBox>
10261026
</StackPanel>
10271027
<CheckBox x:Name="chkHumanFriendlyDateTime" Content="Use human friendly last modified" ToolTip="Last modified date format" HorizontalAlignment="Left" Checked="ChkHumanFriendlyDateTime_Checked" Unchecked="ChkHumanFriendlyDateTime_Checked"/>
1028+
<CheckBox x:Name="chkSearchProjectPath" Content="Search project path also" ToolTip="Searches from project folder path and project name" HorizontalAlignment="Left" Checked="ChkSearchProjectPath_Checked" Unchecked="ChkSearchProjectPath_Checked"/>
10281029
<Label Foreground="{DynamicResource ThemeButtonForeground}" Padding="0,5,5,0">Project name:</Label>
10291030
<StackPanel Orientation="Horizontal">
10301031
<RadioButton x:Name="radioProjNameFolder" Content="ProjectName.txt or Folder" Margin="3,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"/>

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public partial class MainWindow : Window
2626
public const string appName = "UnityLauncherPro";
2727
public static string currentDateFormat = null;
2828
public static bool useHumanFriendlyDateFormat = false;
29+
public static bool searchProjectPathAlso = false;
2930
public static List<Project> projectsSource;
3031
public static UnityInstallation[] unityInstallationsSource;
3132
public static ObservableDictionary<string, string> unityInstalledVersions = new ObservableDictionary<string, string>(); // versionID and installation folder
@@ -271,7 +272,7 @@ void FilterBuildReport()
271272
private bool ProjectFilter(object item)
272273
{
273274
Project proj = item as Project;
274-
return (proj.Title.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1);
275+
return (proj.Title.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1) || (searchProjectPathAlso && (proj.Path.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1));
275276
}
276277

277278
private bool UpdatesFilter(object item)
@@ -376,7 +377,7 @@ void LoadSettings()
376377
}
377378

378379
useHumanFriendlyDateFormat = Properties.Settings.Default.useHumandFriendlyLastModified;
379-
380+
searchProjectPathAlso = Properties.Settings.Default.searchProjectPathAlso;
380381

381382
// recent grid column display index order
382383
var order = Properties.Settings.Default.recentColumnsOrder;
@@ -2398,6 +2399,16 @@ private void Window_SourceInitialized(object sender, EventArgs e)
23982399
Start();
23992400
}
24002401

2402+
private void ChkSearchProjectPath_Checked(object sender, RoutedEventArgs e)
2403+
{
2404+
if (this.IsActive == false) return; // dont run code on window init
2405+
var isChecked = (bool)((CheckBox)sender).IsChecked;
2406+
2407+
searchProjectPathAlso = isChecked;
2408+
Properties.Settings.Default.searchProjectPathAlso = isChecked;
2409+
Properties.Settings.Default.Save();
2410+
}
2411+
24012412
//private void BtnBrowseTemplateUnityPackagesFolder_Click(object sender, RoutedEventArgs e)
24022413
//{
24032414
// var folder = Tools.BrowseForOutputFolder("Select unitypackage Templates folder");

UnityLauncherPro/Properties/Settings.Designer.cs

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnityLauncherPro/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,8 @@
104104
<Setting Name="newProjectPlatform" Type="System.String" Scope="User">
105105
<Value Profile="(Default)" />
106106
</Setting>
107+
<Setting Name="searchProjectPathAlso" Type="System.Boolean" Scope="User">
108+
<Value Profile="(Default)">False</Value>
109+
</Setting>
107110
</Settings>
108111
</SettingsFile>

0 commit comments

Comments
 (0)