From 25a4838a112fc31ced32509c72391853ec63ee68 Mon Sep 17 00:00:00 2001 From: Bitl Date: Fri, 24 Sep 2021 13:10:00 -0700 Subject: [PATCH] Enable gcAllowVeryLargeObjects, more stylish functionality --- Novetus/Novetus.ClientScriptTester/app.config | 4 + Novetus/NovetusCMD/app.config | 1 + .../Extended/LauncherFormExtended.cs | 2 +- .../Forms/LauncherForm/LauncherFormShared.cs | 7 +- .../Stylish/LauncherFormStylish.Designer.cs | 8 +- .../Stylish/LauncherFormStylish.cs | 55 ++++- .../Stylish/LauncherFormStylishInterface.xaml | 203 ++++++++++++++++-- .../LauncherFormStylishInterface.xaml.cs | 156 +++++++++++++- Novetus/NovetusLauncher/app.config | 1 + Novetus/NovetusURI/App.config | 7 +- 10 files changed, 405 insertions(+), 39 deletions(-) diff --git a/Novetus/Novetus.ClientScriptTester/app.config b/Novetus/Novetus.ClientScriptTester/app.config index 3c73782..1f8f1a2 100644 --- a/Novetus/Novetus.ClientScriptTester/app.config +++ b/Novetus/Novetus.ClientScriptTester/app.config @@ -1,5 +1,8 @@  + + + @@ -11,5 +14,6 @@ + \ No newline at end of file diff --git a/Novetus/NovetusCMD/app.config b/Novetus/NovetusCMD/app.config index e544f52..7540e2d 100644 --- a/Novetus/NovetusCMD/app.config +++ b/Novetus/NovetusCMD/app.config @@ -14,5 +14,6 @@ + diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index df14d8e..cfb7737 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 8973913..d747734 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -909,7 +909,12 @@ namespace NovetusLauncher public void RestartLauncherAfterSetting(CheckBox box, string title, string subText) { - switch (box.Checked) + RestartLauncherAfterSetting(box.Checked, title, subText); + } + + public void RestartLauncherAfterSetting(bool check, string title, string subText) + { + switch (check) { case false: MessageBox.Show("Novetus will now restart.", title, MessageBoxButtons.OK, MessageBoxIcon.Warning); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs index 955c5bc..d365676 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.Designer.cs @@ -40,9 +40,9 @@ namespace NovetusLauncher // this.elementHost1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(237)))), ((int)(((byte)(237))))); this.elementHost1.ForeColor = System.Drawing.SystemColors.ControlText; - this.elementHost1.Location = new System.Drawing.Point(-1, 116); + this.elementHost1.Location = new System.Drawing.Point(0, 116); this.elementHost1.Name = "elementHost1"; - this.elementHost1.Size = new System.Drawing.Size(707, 303); + this.elementHost1.Size = new System.Drawing.Size(706, 303); this.elementHost1.TabIndex = 0; this.elementHost1.Text = "elementHost1"; this.elementHost1.Child = null; @@ -66,9 +66,9 @@ namespace NovetusLauncher this.splashLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.splashLabel.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold); this.splashLabel.ForeColor = System.Drawing.Color.White; - this.splashLabel.Location = new System.Drawing.Point(12, 81); + this.splashLabel.Location = new System.Drawing.Point(9, 81); this.splashLabel.Name = "splashLabel"; - this.splashLabel.Size = new System.Drawing.Size(683, 32); + this.splashLabel.Size = new System.Drawing.Size(689, 32); this.splashLabel.TabIndex = 5; this.splashLabel.Text = "Novetus!"; this.splashLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs index 2538d4f..4d391ec 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs @@ -82,6 +82,12 @@ namespace NovetusLauncher } void LauncherFormStylish_Close(object sender, CancelEventArgs e) + { + CloseEvent(); + Application.Exit(); + } + + public void CloseEvent() { WriteConfigValues(); @@ -89,7 +95,6 @@ namespace NovetusLauncher { DiscordRPC.Shutdown(); } - Application.Exit(); } void splashLabel_Paint(object sender, PaintEventArgs e) @@ -111,23 +116,35 @@ namespace NovetusLauncher { GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); - //CloseOnLaunchCheckbox.Checked = GlobalVars.UserConfiguration.CloseOnLaunch; + launcherFormStylishInterface1.minimizeOnLaunchBox.IsChecked = GlobalVars.UserConfiguration.CloseOnLaunch; launcherFormStylishInterface1.userIDBox.Text = GlobalVars.UserConfiguration.UserID.ToString(); launcherFormStylishInterface1.tripcodeLabel.Content = GlobalVars.UserConfiguration.PlayerTripcode.ToString(); launcherFormStylishInterface1.maxPlayersBox.Text = GlobalVars.UserConfiguration.PlayerLimit.ToString(); launcherFormStylishInterface1.userNameBox.Text = GlobalVars.UserConfiguration.PlayerName; - //SelectedClientLabel.Text = GlobalVars.UserConfiguration.SelectedClient; - //SelectedMapLabel.Text = GlobalVars.UserConfiguration.Map; - //Tree.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.UserConfiguration.Map, Tree.Nodes); - //Tree.Focus(); + launcherFormStylishInterface1.mapsBox.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.UserConfiguration.Map, launcherFormStylishInterface1.mapsBox.Nodes); + launcherFormStylishInterface1.mapsBox.Focus(); launcherFormStylishInterface1.joinPortBox.Text = GlobalVars.JoinPort.ToString(); launcherFormStylishInterface1.serverPortBox.Text = GlobalVars.UserConfiguration.RobloxPort.ToString(); - //DiscordPresenceCheckbox.Checked = GlobalVars.UserConfiguration.DiscordPresence; + launcherFormStylishInterface1.discordRichPresenceBox.IsChecked = GlobalVars.UserConfiguration.DiscordPresence; launcherFormStylishInterface1.uPnPBox.IsChecked = GlobalVars.UserConfiguration.UPnP; launcherFormStylishInterface1.NotifBox.IsChecked = GlobalVars.UserConfiguration.ShowServerNotifications; launcherFormStylishInterface1.browserNameBox.Text = GlobalVars.UserConfiguration.ServerBrowserServerName; launcherFormStylishInterface1.browserAddressBox.Text = GlobalVars.UserConfiguration.ServerBrowserServerAddress; + switch (GlobalVars.UserConfiguration.LauncherStyle) + { + case Settings.Style.Compact: + launcherFormStylishInterface1.styleBox.SelectedIndex = 1; + break; + case Settings.Style.Extended: + launcherFormStylishInterface1.styleBox.SelectedIndex = 0; + break; + case Settings.Style.Stylish: + default: + launcherFormStylishInterface1.styleBox.SelectedIndex = 2; + break; + } + ReadClientValues(initial); } @@ -140,6 +157,30 @@ namespace NovetusLauncher MessageBox.Show("Config Saved!", "Novetus - Config Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } } + + public void ResetConfigValues(bool ShowBox = false) + { + //https://stackoverflow.com/questions/9029351/close-all-open-forms-except-the-main-menu-in-c-sharp + List
openForms = new List(); + + foreach (Form f in Application.OpenForms) + openForms.Add(f); + + foreach (Form f in openForms) + { + if (f.Name != Parent.Name) + f.Close(); + } + + GlobalFuncs.ResetConfigValues(Settings.Style.Stylish); + WriteConfigValues(); + ReadConfigValues(); + if (ShowBox) + { + MessageBox.Show("Config Reset!", "Novetus - Config Reset", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + public void ReadClientValues(bool initial = false) { GlobalFuncs.ReadClientValues(null, initial); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml index 098ce26..0177c6e 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml @@ -166,7 +166,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -559,7 +721,7 @@ -