Skip to content

Commit cd7bcf4

Browse files
committed
add webgl relative build path setting field
1 parent 249fc45 commit cd7bcf4

File tree

5 files changed

+47
-18
lines changed

5 files changed

+47
-18
lines changed

UnityLauncherPro/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<setting name="showTargetPlatform" serializeAs="String">
6767
<value>False</value>
6868
</setting>
69+
<setting name="webglBuildPath" serializeAs="String">
70+
<value />
71+
</setting>
6972
</UnityLauncherPro.Properties.Settings>
7073
</userSettings>
7174
</configuration>

UnityLauncherPro/MainWindow.xaml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
<Separator/>
352352
<MenuItem x:Name="menuItemKillProcess" Header="Kill Process" Click="MenuItemKillProcess_Click" />
353353
<Separator/>
354-
<MenuItem x:Name="menuStartWebGLServer" Header="Start webgl server" Click="MenuStartWebGLServer_Click" />
354+
<MenuItem x:Name="menuStartWebGLServer" Header="Start WebGL server" Click="MenuStartWebGLServer_Click" />
355355
</ContextMenu>
356356
</DataGrid.ContextMenu>
357357

@@ -694,23 +694,27 @@
694694
</StackPanel>
695695
<!-- settings-->
696696
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="5,10,3,3" >
697-
<CheckBox x:Name="chkMinimizeToTaskbar" Content="Minimize to tray" Foreground="{DynamicResource ButtonForeground}" Checked="ChkMinimizeToTaskbar_CheckedChanged" Unchecked="ChkMinimizeToTaskbar_CheckedChanged" Margin="0,0,0,3" ToolTip="When window is minimized, hides application into taskbar icon area"/>
698-
<CheckBox x:Name="chkRegisterExplorerMenu" Content="Register Explorer context menu" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkRegisterExplorerMenu_CheckedChanged" Checked="ChkRegisterExplorerMenu_CheckedChanged" Margin="0,0,0,3" ToolTip="Install registry entry for Explorer context menu"/>
699-
<CheckBox x:Name="chkQuitAfterOpen" Content="Close after opening project" Foreground="{DynamicResource ButtonForeground}" Checked="ChkQuitAfterOpen_CheckedChanged" Unchecked="ChkQuitAfterOpen_CheckedChanged" Margin="0,0,0,3" ToolTip="Closes launcher after running project (not really useful)"/>
700-
<CheckBox x:Name="chkQuitAfterCommandline" Content="Close after launching from Explorer" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkQuitAfterCommandline_CheckedChanged" Checked="ChkQuitAfterCommandline_CheckedChanged" Margin="0,0,0,3" ToolTip="Close launcher after running from commandline or Explorer (recommended)"/>
701-
<CheckBox x:Name="chkShowLauncherArgumentsColumn" Content="Show commandline arguments column" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkShowLauncherArgumentsColumn_CheckedChanged" Checked="ChkShowLauncherArgumentsColumn_CheckedChanged" Margin="0,0,0,3" ToolTip="Shows column for custom project commandline params"/>
702-
<CheckBox x:Name="chkShowGitBranchColumn" Content="Show git branch column" Foreground="{DynamicResource ButtonForeground}" Checked="ChkShowGitBranchColumn_CheckedChanged" Unchecked="ChkShowGitBranchColumn_CheckedChanged" Margin="0,0,0,3" ToolTip="Shows column for project git branch info"/>
703-
<CheckBox x:Name="chkShowMissingFolderProjects" Content="Show projects that don't exist on disk" Foreground="{DynamicResource ButtonForeground}" Checked="ChkShowMissingFolderProjects_CheckedChanged" Unchecked="ChkShowMissingFolderProjects_CheckedChanged" Margin="0,0,0,3" ToolTip="List in recent projects, even if the project folder is missing"/>
704-
<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)"/>
705-
<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"/>
706-
<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"/>
707-
<CheckBox x:Name="chkStreamerMode" Content="Streamer Mode (hide project names and folders)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" ToolTip="Hide project names and folders in main view" Checked="ChkStreamerMode_Checked" Unchecked="ChkStreamerMode_Checked"/>
708-
<CheckBox x:Name="chkShowPlatform" Content="Show current target platform (if exists in .csproj)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,3" ToolTip="Shows target platform column" Checked="ChkShowPlatform_Checked" Unchecked="ChkShowPlatform_Checked"/>
709-
710-
<StackPanel Grid.Row="3" Orientation="Horizontal">
711-
<Label Content="Root Folder for New Projects" Foreground="{DynamicResource ButtonForeground}" />
697+
<CheckBox x:Name="chkMinimizeToTaskbar" Content="Minimize to tray" Foreground="{DynamicResource ButtonForeground}" Checked="ChkMinimizeToTaskbar_CheckedChanged" Unchecked="ChkMinimizeToTaskbar_CheckedChanged" Margin="0,0,0,4" ToolTip="When window is minimized, hides application into taskbar icon area"/>
698+
<CheckBox x:Name="chkRegisterExplorerMenu" Content="Register Explorer context menu" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkRegisterExplorerMenu_CheckedChanged" Checked="ChkRegisterExplorerMenu_CheckedChanged" Margin="0,0,0,4" ToolTip="Install registry entry for Explorer context menu"/>
699+
<CheckBox x:Name="chkQuitAfterOpen" Content="Close after opening project" Foreground="{DynamicResource ButtonForeground}" Checked="ChkQuitAfterOpen_CheckedChanged" Unchecked="ChkQuitAfterOpen_CheckedChanged" Margin="0,0,0,4" ToolTip="Closes launcher after running project (not really useful)"/>
700+
<CheckBox x:Name="chkQuitAfterCommandline" Content="Close after launching from Explorer" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkQuitAfterCommandline_CheckedChanged" Checked="ChkQuitAfterCommandline_CheckedChanged" Margin="0,0,0,4" ToolTip="Close launcher after running from commandline or Explorer (recommended)"/>
701+
<CheckBox x:Name="chkShowLauncherArgumentsColumn" Content="Show commandline arguments column" Foreground="{DynamicResource ButtonForeground}" Unchecked="ChkShowLauncherArgumentsColumn_CheckedChanged" Checked="ChkShowLauncherArgumentsColumn_CheckedChanged" Margin="0,0,0,4" ToolTip="Shows column for custom project commandline params"/>
702+
<CheckBox x:Name="chkShowGitBranchColumn" Content="Show git branch column" Foreground="{DynamicResource ButtonForeground}" Checked="ChkShowGitBranchColumn_CheckedChanged" Unchecked="ChkShowGitBranchColumn_CheckedChanged" Margin="0,0,0,4" ToolTip="Shows column for project git branch info"/>
703+
<CheckBox x:Name="chkShowMissingFolderProjects" Content="Show projects that don't exist on disk" Foreground="{DynamicResource ButtonForeground}" Checked="ChkShowMissingFolderProjects_CheckedChanged" Unchecked="ChkShowMissingFolderProjects_CheckedChanged" Margin="0,0,0,4" ToolTip="List in recent projects, even if the project folder is missing"/>
704+
<CheckBox x:Name="chkAllowSingleInstanceOnly" Content="Allow single instance only" Foreground="{DynamicResource ButtonForeground}" 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)"/>
705+
<CheckBox x:Name="chkEnableProjectRename" Content="Enable Project Rename F2 (Not recommended for beginners)" Foreground="{DynamicResource ButtonForeground}" 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"/>
706+
<CheckBox x:Name="chkAskNameForQuickProject" Content="Ask name for New Project" Foreground="{DynamicResource ButtonForeground}" Checked="ChkAskNameForQuickProject_Checked" Unchecked="ChkAskNameForQuickProject_Checked" Margin="0,0,0,4" ToolTip="If disabled, uses automatic quick project naming"/>
707+
<CheckBox x:Name="chkStreamerMode" Content="Streamer Mode (hide project names and folders)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,4" ToolTip="Hide project names and folders in main view" Checked="ChkStreamerMode_Checked" Unchecked="ChkStreamerMode_Checked"/>
708+
<CheckBox x:Name="chkShowPlatform" Content="Show current target platform (if exists in .csproj)" Foreground="{DynamicResource ButtonForeground}" Margin="0,0,0,4" ToolTip="Shows target platform column" Checked="ChkShowPlatform_Checked" Unchecked="ChkShowPlatform_Checked"/>
709+
710+
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,0,0,4">
712711
<TextBox x:Name="txtRootFolderForNewProjects" MinWidth="300" ToolTip="When you click &quot;Create Project&quot; in main page, new project is generated under this path+UnityVersion (eg. /2017a/)" Padding="0,3,0,0" TextChanged="TxtRootFolderForNewProjects_TextChanged" />
713712
<Button x:Name="btnBrowseProjectRootFolder" Content="..." Margin="6,0,0,0" MinWidth="32" Click="BtnBrowseProjectRootFolder_Click" />
713+
<Label Content="Root Folder for New Projects" Foreground="{DynamicResource ButtonForeground}" />
714+
</StackPanel>
715+
<StackPanel Grid.Row="3" Orientation="Horizontal">
716+
<TextBox x:Name="txtWebglRelativePath" MinWidth="200" ToolTip="Inside Builds/ folder you might have separate folder for webgl builds, like webgl/. User for starting WebGL server there" Padding="0,3,0,0" TextChanged="TxtWebglRelativePath_TextChanged" />
717+
<Label Content="Webgl Relative Build Path (inside Builds/)" Foreground="{DynamicResource ButtonForeground}" />
714718
</StackPanel>
715719
</StackPanel>
716720

UnityLauncherPro/MainWindow.xaml.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,12 @@ void LoadSettings()
251251
chkShowGitBranchColumn.IsChecked = Properties.Settings.Default.showGitBranchColumn;
252252
chkShowMissingFolderProjects.IsChecked = Properties.Settings.Default.showProjectsMissingFolder;
253253
chkAllowSingleInstanceOnly.IsChecked = Properties.Settings.Default.AllowSingleInstanceOnly;
254-
txtRootFolderForNewProjects.Text = Properties.Settings.Default.newProjectsRoot;
255254
chkAskNameForQuickProject.IsChecked = Properties.Settings.Default.askNameForQuickProject;
256255
chkEnableProjectRename.IsChecked = Properties.Settings.Default.enableProjectRename;
257256
chkStreamerMode.IsChecked = Properties.Settings.Default.streamerMode;
258257
chkShowPlatform.IsChecked = Properties.Settings.Default.showTargetPlatform;
258+
txtRootFolderForNewProjects.Text = Properties.Settings.Default.newProjectsRoot;
259+
txtWebglRelativePath.Text = Properties.Settings.Default.webglBuildPath;
259260

260261
// update optional grid columns, hidden or visible
261262
gridRecent.Columns[4].Visibility = (bool)chkShowLauncherArgumentsColumn.IsChecked ? Visibility.Visible : Visibility.Collapsed;
@@ -1646,7 +1647,7 @@ private void MenuStartWebGLServer_Click(object sender, RoutedEventArgs e)
16461647

16471648
if (string.IsNullOrEmpty(projPath) == true) return;
16481649

1649-
var buildPath = Path.Combine(projPath, "Builds");
1650+
var buildPath = Path.Combine(projPath, "Builds", txtWebglRelativePath.Text);
16501651
if (Directory.Exists(buildPath) == false) return;
16511652

16521653
if (unityInstalledVersions.ContainsKey(proj.Version) == false) return;
@@ -1681,6 +1682,12 @@ private void MenuStartWebGLServer_Click(object sender, RoutedEventArgs e)
16811682
Tools.OpenURL("http://localhost:" + port);
16821683
}
16831684
}
1685+
1686+
private void TxtWebglRelativePath_TextChanged(object sender, TextChangedEventArgs e)
1687+
{
1688+
Properties.Settings.Default.newProjectsRoot = txtWebglRelativePath.Text;
1689+
Properties.Settings.Default.Save();
1690+
}
16841691
} // class
16851692
} //namespace
16861693

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
@@ -59,5 +59,8 @@
5959
<Setting Name="showTargetPlatform" Type="System.Boolean" Scope="User">
6060
<Value Profile="(Default)">False</Value>
6161
</Setting>
62+
<Setting Name="webglBuildPath" Type="System.String" Scope="User">
63+
<Value Profile="(Default)" />
64+
</Setting>
6265
</Settings>
6366
</SettingsFile>

0 commit comments

Comments
 (0)