Skip to content

Commit 1d2a616

Browse files
committed
add StreamerMode option to hide project names and paths (font is set to 1.0)
1 parent 810ccb5 commit 1d2a616

File tree

7 files changed

+52
-7
lines changed

7 files changed

+52
-7
lines changed

UnityLauncherPro/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<setting name="enableProjectRename" serializeAs="String">
6161
<value>False</value>
6262
</setting>
63+
<setting name="streamerMode" serializeAs="String">
64+
<value>False</value>
65+
</setting>
6366
</UnityLauncherPro.Properties.Settings>
6467
</userSettings>
6568
</configuration>

UnityLauncherPro/Data/Project.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@ public class Project
1212
public string Arguments { set; get; }
1313
public string GITBranch { set; get; }
1414
public Process Process; // launched unity exe
15+
16+
public override string ToString()
17+
{
18+
return $"{Title} {Version} {Path} {Modified} {Arguments} {GITBranch} ";
19+
}
20+
1521
}
1622
}

UnityLauncherPro/GetProjects.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
112112
gitBranch = Tools.ReadGitBranchInfo(projectPath);
113113
}
114114

115-
116115
var p = new Project();
117116
p.Title = projectName;
118117
p.Version = projectVersion;
@@ -132,6 +131,5 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
132131

133132
return projectsFound;
134133
} // Scan()
135-
136134
} // class
137135
} // namespace

UnityLauncherPro/MainWindow.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
</DataGrid.CommandBindings>
310310

311311
<DataGrid.Columns>
312-
<DataGridTextColumn CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Title}" ClipboardContentBinding="{x:Null}" Header="Project" IsReadOnly="True" Width="150"/>
312+
<DataGridTextColumn x:Name="txtColumnTitle" CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Title}" ClipboardContentBinding="{x:Null}" Header="Project" IsReadOnly="True" Width="150"/>
313313
<DataGridTextColumn Binding="{Binding Version}" ClipboardContentBinding="{x:Null}" Header="Version" IsReadOnly="True" Width="72">
314314
<DataGridTextColumn.CellStyle>
315315
<Style TargetType="{x:Type DataGridCell}">
@@ -322,7 +322,7 @@
322322
</Style>
323323
</DataGridTextColumn.CellStyle>
324324
</DataGridTextColumn>
325-
<DataGridTextColumn CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Path}" ClipboardContentBinding="{x:Null}" Header="Path" IsReadOnly="True" Width="185"/>
325+
<DataGridTextColumn x:Name="txtColumnName" CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Path}" ClipboardContentBinding="{x:Null}" Header="Path" IsReadOnly="True" Width="185"/>
326326
<DataGridTextColumn CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Modified, StringFormat=\{0:dd/MM/yyyy HH:mm:ss\}}" ClipboardContentBinding="{x:Null}" Header="Modified" IsReadOnly="True" Width="120"/>
327327
<DataGridTextColumn CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding Arguments}" ClipboardContentBinding="{x:Null}" Header="Arguments" IsReadOnly="False" Width="100"/>
328328
<DataGridTextColumn CellStyle="{StaticResource NoFocusCellStyle}" Binding="{Binding GITBranch}" ClipboardContentBinding="{x:Null}" Header="GITBranch" IsReadOnly="True" Width="100"/>
@@ -661,6 +661,7 @@
661661
<CheckBox x:Name="chkAllowSingleInstanceOnly" Content="Allow single instance only" Foreground="{DynamicResource ButtonForeground}" Checked="ChkAllowSingleInstanceOnly_CheckedChanged" Unchecked="ChkAllowSingleInstanceOnly_CheckedChanged" Margin="0,0,0,3" ToolTip="Activates already running instance, instead of starting new exe (not working if app is minized to taskbar)"/>
662662
<CheckBox x:Name="chkEnableProjectRename" Content="Enable Project Renaming (Not recommended for beginners)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" 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"/>
663663
<CheckBox x:Name="chkAskNameForQuickProject" Content="Ask name for New Project" Foreground="{DynamicResource ButtonForeground}" Checked="ChkAskNameForQuickProject_Checked" Unchecked="ChkAskNameForQuickProject_Checked" Margin="0,0,0,3" ToolTip="If disabled, uses automatic quick project naming"/>
664+
<CheckBox x:Name="chkStreamerMode" Content="Streamer Mode (hide project names and folders)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" ToolTip="" Checked="ChkStreamerMode_Checked" Unchecked="ChkStreamerMode_Checked"/>
664665

665666
<StackPanel Grid.Row="3" Orientation="Horizontal">
666667
<Label Content="Root Folder for New Projects" Foreground="{DynamicResource ButtonForeground}" />

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ void Start()
9595
notifyIcon = new System.Windows.Forms.NotifyIcon();
9696
notifyIcon.Icon = new Icon(Application.GetResourceStream(new Uri("pack://application:,,,/Images/icon.ico")).Stream);
9797
notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(NotifyIcon_MouseClick);
98+
99+
isInitializing = false;
98100
}
99101

100102
// bring old window to front, but needs matching appname.. https://stackoverflow.com/a/36804161/5452781
@@ -244,6 +246,7 @@ void LoadSettings()
244246
txtRootFolderForNewProjects.Text = Properties.Settings.Default.newProjectsRoot;
245247
chkAskNameForQuickProject.IsChecked = Properties.Settings.Default.askNameForQuickProject;
246248
chkEnableProjectRename.IsChecked = Properties.Settings.Default.enableProjectRename;
249+
chkStreamerMode.IsChecked = Properties.Settings.Default.streamerMode;
247250

248251
// update optional grid columns, hidden or visible
249252
gridRecent.Columns[4].Visibility = (bool)chkShowLauncherArgumentsColumn.IsChecked ? Visibility.Visible : Visibility.Collapsed;
@@ -265,7 +268,6 @@ void LoadSettings()
265268

266269
// other setting vars
267270
preferredVersion = Properties.Settings.Default.preferredVersion;
268-
269271
} // LoadSettings()
270272

271273
private void SaveSettingsOnExit()
@@ -409,8 +411,6 @@ void RefreshRecentProjects()
409411
Tools.SetFocusToGrid(gridRecent, lastSelectedProjectIndex);
410412
}
411413

412-
413-
414414
//
415415
//
416416
// EVENTS
@@ -1374,6 +1374,27 @@ private void ChkAskNameForQuickProject_Checked(object sender, RoutedEventArgs e)
13741374
Properties.Settings.Default.Save();
13751375
}
13761376

1377+
bool isInitializing = true; // used to avoid doing things while still starting up
1378+
private void ChkStreamerMode_Checked(object sender, RoutedEventArgs e)
1379+
{
1380+
var isChecked = (bool)chkStreamerMode.IsChecked;
1381+
1382+
Properties.Settings.Default.streamerMode = isChecked;
1383+
Properties.Settings.Default.Save();
1384+
1385+
// Create cellstyle and assign if enabled
1386+
Style cellStyle = new Style(typeof(DataGridCell));
1387+
cellStyle.Setters.Add(new Setter(FontSizeProperty, 1.0));
1388+
txtColumnTitle.CellStyle = isChecked ? cellStyle : null;
1389+
txtColumnName.CellStyle = isChecked ? cellStyle : null;
1390+
1391+
// need to reload list if user clicked
1392+
if (isInitializing == false)
1393+
{
1394+
RefreshRecentProjects();
1395+
}
1396+
}
1397+
13771398
// copies project folder, or unity exe folder, or unity version from current datagrid
13781399
public void CopyRowFolderToClipBoard(object sender, ExecutedRoutedEventArgs e)
13791400
{
@@ -1474,6 +1495,7 @@ private void GridRecent_ContextMenuOpening(object sender, ContextMenuEventArgs e
14741495
new KeyGesture(Key.Q, ModifierKeys.Alt)
14751496
}));
14761497

1498+
14771499
} // class
14781500
} //namespace
14791501

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
@@ -53,5 +53,8 @@
5353
<Setting Name="enableProjectRename" Type="System.Boolean" Scope="User">
5454
<Value Profile="(Default)">False</Value>
5555
</Setting>
56+
<Setting Name="streamerMode" Type="System.Boolean" Scope="User">
57+
<Value Profile="(Default)">False</Value>
58+
</Setting>
5659
</Settings>
5760
</SettingsFile>

0 commit comments

Comments
 (0)