From 58d59c662e74e5cbbe6305c1d6be3d326cfe34fe Mon Sep 17 00:00:00 2001 From: Bitl Date: Tue, 21 Sep 2021 17:47:59 -0700 Subject: [PATCH] implement extra button images. implement a few things --- .../Extended/LauncherFormExtended.cs | 2 +- .../Forms/LauncherForm/LauncherFormShared.cs | 29 ++++--- .../Stylish/LauncherFormStylishInterface.xaml | 80 ++++++++---------- .../LauncherFormStylishInterface.xaml.cs | 63 ++++++++++++++ .../NovetusLauncher/Novetus.Launcher.csproj | 10 +++ .../Resources/BuildSolo2_click.png | Bin 0 -> 6012 bytes .../Resources/BuildSolo2_hover.png | Bin 0 -> 7632 bytes .../Resources/JoinServer_click.png | Bin 0 -> 7733 bytes .../Resources/JoinServer_hover.png | Bin 0 -> 10955 bytes .../Resources/PlaySolo_click.png | Bin 0 -> 7940 bytes .../Resources/PlaySolo_hover.png | Bin 0 -> 10540 bytes .../Resources/StartServer_click.png | Bin 0 -> 5901 bytes .../Resources/StartServer_hover.png | Bin 0 -> 6786 bytes .../Resources/refresh_hover.png | Bin 0 -> 588 bytes .../Resources/search_hover.png | Bin 0 -> 462 bytes 15 files changed, 128 insertions(+), 56 deletions(-) create mode 100644 Novetus/NovetusLauncher/Resources/BuildSolo2_click.png create mode 100644 Novetus/NovetusLauncher/Resources/BuildSolo2_hover.png create mode 100644 Novetus/NovetusLauncher/Resources/JoinServer_click.png create mode 100644 Novetus/NovetusLauncher/Resources/JoinServer_hover.png create mode 100644 Novetus/NovetusLauncher/Resources/PlaySolo_click.png create mode 100644 Novetus/NovetusLauncher/Resources/PlaySolo_hover.png create mode 100644 Novetus/NovetusLauncher/Resources/StartServer_click.png create mode 100644 Novetus/NovetusLauncher/Resources/StartServer_hover.png create mode 100644 Novetus/NovetusLauncher/Resources/refresh_hover.png create mode 100644 Novetus/NovetusLauncher/Resources/search_hover.png diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index cfb7737..df14d8e 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -343,7 +343,7 @@ namespace NovetusLauncher private void button23_Click(object sender, EventArgs e) { - launcherForm.AddNewMap(); + } #endregion } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index 7d15786..84f9741 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -379,7 +379,7 @@ namespace NovetusLauncher } } - if (gameType == ScriptType.Client && GlobalVars.LocalPlayMode) + if (gameType == ScriptType.Client && GlobalVars.LocalPlayMode && FormStyle != Settings.Style.Stylish) { GeneratePlayerID(); GenerateTripcode(); @@ -469,13 +469,11 @@ namespace NovetusLauncher } // FINALLY. https://stackoverflow.com/questions/11530643/treeview-search - public void SearchMaps() + public TreeNode SearchMapsInternal(string searchText) { - string searchText = SearchBar.Text; - if (string.IsNullOrWhiteSpace(searchText)) { - return; + return null; }; try @@ -493,9 +491,7 @@ namespace NovetusLauncher { TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex]; LastNodeIndex++; - Tree.SelectedNode = selectedNode; - Tree.SelectedNode.Expand(); - Tree.Select(); + return selectedNode; } else { @@ -506,15 +502,26 @@ namespace NovetusLauncher SearchNodes(searchText, Tree.Nodes[0]); TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex]; LastNodeIndex++; - Tree.SelectedNode = selectedNode; - Tree.SelectedNode.Expand(); - Tree.Select(); + return selectedNode; } } catch (Exception ex) { GlobalFuncs.LogExceptions(ex); MessageBox.Show("The map '" + searchText + "' cannot be found. Please try another term.", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return null; + } + } + + public void SearchMaps() + { + TreeNode node = SearchMapsInternal(SearchBar.Text); + + if (node != null) + { + Tree.SelectedNode = node; + Tree.SelectedNode.Expand(); + Tree.Select(); } } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml index 28874dd..bbba1ca 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml @@ -181,19 +181,17 @@ - + - - + - - + @@ -214,19 +212,17 @@ - + - - + - - + @@ -247,19 +243,17 @@ - + - - + - - + @@ -280,19 +274,17 @@ - + - - + - - + @@ -313,20 +305,20 @@ - - + + - - + - - + @@ -347,20 +339,20 @@ - - + + - - + - - + @@ -538,7 +530,7 @@ -