you can now skip player configuration. better uri status code

This commit is contained in:
Bitl 2022-08-21 09:00:31 -07:00
parent 5a26ab634e
commit d14d39ca58
5 changed files with 130 additions and 98 deletions

View File

@ -74,6 +74,7 @@ public class FileFormat
Priority = ProcessPriorityClass.RealTime; Priority = ProcessPriorityClass.RealTime;
FirstServerLaunch = true; FirstServerLaunch = true;
NewGUI = false; NewGUI = false;
URIQuickConfigure = true;
} }
public string SelectedClient { get; set; } public string SelectedClient { get; set; }
@ -103,6 +104,7 @@ public class FileFormat
public ProcessPriorityClass Priority { get; set; } public ProcessPriorityClass Priority { get; set; }
public bool FirstServerLaunch { get; set; } public bool FirstServerLaunch { get; set; }
public bool NewGUI { get; set; } public bool NewGUI { get; set; }
public bool URIQuickConfigure { get; set; }
} }
#endregion #endregion

View File

@ -253,6 +253,7 @@ public class GlobalFuncs
ini.IniWriteValue(section, "ClientLaunchPriority", ((int)GlobalVars.UserConfiguration.Priority).ToString()); ini.IniWriteValue(section, "ClientLaunchPriority", ((int)GlobalVars.UserConfiguration.Priority).ToString());
ini.IniWriteValue(section, "FirstServerLaunch", GlobalVars.UserConfiguration.FirstServerLaunch.ToString()); ini.IniWriteValue(section, "FirstServerLaunch", GlobalVars.UserConfiguration.FirstServerLaunch.ToString());
ini.IniWriteValue(section, "NewGUI", GlobalVars.UserConfiguration.NewGUI.ToString()); ini.IniWriteValue(section, "NewGUI", GlobalVars.UserConfiguration.NewGUI.ToString());
ini.IniWriteValue(section, "URIQuickConfigure", GlobalVars.UserConfiguration.URIQuickConfigure.ToString());
ConfigUseOldValIfExists(ini, section, "ItemMakerDisableHelpMessage", "AssetSDKDisableHelpMessage", GlobalVars.UserConfiguration.DisabledAssetSDKHelp.ToString(), write); ConfigUseOldValIfExists(ini, section, "ItemMakerDisableHelpMessage", "AssetSDKDisableHelpMessage", GlobalVars.UserConfiguration.DisabledAssetSDKHelp.ToString(), write);
ConfigUseOldValIfExists(ini, section, "AssetLocalizerSaveBackups", "AssetSDKFixerSaveBackups", GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups.ToString(), write); ConfigUseOldValIfExists(ini, section, "AssetLocalizerSaveBackups", "AssetSDKFixerSaveBackups", GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups.ToString(), write);
@ -272,7 +273,7 @@ public class GlobalFuncs
disablehelpmessage, discord, mappath, mapsnip, disablehelpmessage, discord, mappath, mapsnip,
graphics, reshade, qualitylevel, style, savebackups, altIP, graphics, reshade, qualitylevel, style, savebackups, altIP,
disReshadeDel, showNotifs, SB_Name, SB_Address, priority, disReshadeDel, showNotifs, SB_Name, SB_Address, priority,
firstServerLaunch, newgui; firstServerLaunch, newgui, quickconfigure;
INIFile ini = new INIFile(cfgpath); INIFile ini = new INIFile(cfgpath);
@ -301,6 +302,7 @@ public class GlobalFuncs
priority = ini.IniReadValue(section, "ClientLaunchPriority", ((int)GlobalVars.UserConfiguration.Priority).ToString()); priority = ini.IniReadValue(section, "ClientLaunchPriority", ((int)GlobalVars.UserConfiguration.Priority).ToString());
firstServerLaunch = ini.IniReadValue(section, "FirstServerLaunch", GlobalVars.UserConfiguration.FirstServerLaunch.ToString()); firstServerLaunch = ini.IniReadValue(section, "FirstServerLaunch", GlobalVars.UserConfiguration.FirstServerLaunch.ToString());
newgui = ini.IniReadValue(section, "NewGUI", GlobalVars.UserConfiguration.NewGUI.ToString()); newgui = ini.IniReadValue(section, "NewGUI", GlobalVars.UserConfiguration.NewGUI.ToString());
quickconfigure = ini.IniReadValue(section, "URIQuickConfigure", GlobalVars.UserConfiguration.URIQuickConfigure.ToString());
disablehelpmessage = ConfigUseOldValIfExists(ini, section, "ItemMakerDisableHelpMessage", "AssetSDKDisableHelpMessage", GlobalVars.UserConfiguration.DisabledAssetSDKHelp.ToString(), write); disablehelpmessage = ConfigUseOldValIfExists(ini, section, "ItemMakerDisableHelpMessage", "AssetSDKDisableHelpMessage", GlobalVars.UserConfiguration.DisabledAssetSDKHelp.ToString(), write);
savebackups = ConfigUseOldValIfExists(ini, section, "AssetLocalizerSaveBackups", "AssetSDKFixerSaveBackups", GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups.ToString(), write); savebackups = ConfigUseOldValIfExists(ini, section, "AssetLocalizerSaveBackups", "AssetSDKFixerSaveBackups", GlobalVars.UserConfiguration.AssetSDKFixerSaveBackups.ToString(), write);
@ -344,6 +346,7 @@ public class GlobalFuncs
GlobalVars.UserConfiguration.Priority = (ProcessPriorityClass)ValueInt(priority, Convert.ToInt32(DefaultConfiguration.Priority)); GlobalVars.UserConfiguration.Priority = (ProcessPriorityClass)ValueInt(priority, Convert.ToInt32(DefaultConfiguration.Priority));
GlobalVars.UserConfiguration.FirstServerLaunch = ValueBool(firstServerLaunch, DefaultConfiguration.FirstServerLaunch); GlobalVars.UserConfiguration.FirstServerLaunch = ValueBool(firstServerLaunch, DefaultConfiguration.FirstServerLaunch);
GlobalVars.UserConfiguration.NewGUI = ValueBool(newgui, DefaultConfiguration.NewGUI); GlobalVars.UserConfiguration.NewGUI = ValueBool(newgui, DefaultConfiguration.NewGUI);
GlobalVars.UserConfiguration.URIQuickConfigure = ValueBool(quickconfigure, DefaultConfiguration.URIQuickConfigure);
string oldMapath = Path.GetDirectoryName(GlobalVars.UserConfiguration.MapPath); string oldMapath = Path.GetDirectoryName(GlobalVars.UserConfiguration.MapPath);
//update the map path if the file doesn't exist and write to config. //update the map path if the file doesn't exist and write to config.
@ -2017,6 +2020,17 @@ public class GlobalFuncs
return rbxexe; return rbxexe;
} }
#if URI
public static void UpdateStatus(Label label, string status)
{
LogPrint(status);
if (label != null)
{
label.Text = status;
}
}
#endif
#if URI #if URI
public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, Label label) public static void LaunchRBXClient(ScriptType type, bool no3d, bool nomap, EventHandler e, Label label)
#elif LAUNCHER #elif LAUNCHER
@ -2148,10 +2162,7 @@ public class GlobalFuncs
if (!SecurityFuncs.CheckMD5(fileMD5, fullFilePath)) if (!SecurityFuncs.CheckMD5(fileMD5, fullFilePath))
{ {
#if URI #if URI
if (label != null) UpdateStatus(label, "The client has been detected as modified.");
{
label.Text = "The client has been detected as modified.";
}
#elif LAUNCHER #elif LAUNCHER
if (box != null) if (box != null)
{ {
@ -2246,10 +2257,7 @@ public class GlobalFuncs
else else
{ {
#if URI #if URI
if (label != null) UpdateStatus(label, "The client has been detected as modified.");
{
label.Text = "The client has been detected as modified.";
}
#elif LAUNCHER #elif LAUNCHER
if (box != null) if (box != null)
{ {
@ -2311,10 +2319,7 @@ public class GlobalFuncs
#endif #endif
{ {
#if URI #if URI
if (label != null) UpdateStatus(label, "Error: " + ex.Message);
{
label.Text = "Error: " + ex.Message;
}
#elif LAUNCHER #elif LAUNCHER
if (box != null) if (box != null)
{ {

View File

@ -69,10 +69,13 @@ namespace NovetusURI
#region Form Events #region Form Events
void LoaderFormLoad(object sender, EventArgs e) void LoaderFormLoad(object sender, EventArgs e)
{ {
GlobalFuncs.LogPrint("Booting Quick Configure...."); if (GlobalVars.UserConfiguration.URIQuickConfigure)
QuickConfigure main = new QuickConfigure(); {
main.ShowDialog(); GlobalFuncs.UpdateStatus(label1, "Loading Player Configuration Menu....");
System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0); QuickConfigure main = new QuickConfigure();
main.ShowDialog();
System.Threading.Timer timer = new System.Threading.Timer(new TimerCallback(CheckIfFinished), null, 1, 0);
}
} }
void StartGame() void StartGame()
@ -99,17 +102,15 @@ namespace NovetusURI
} }
else else
{ {
GlobalFuncs.LogPrint("Ready to launch."); GlobalFuncs.UpdateStatus(label1, "Ready to launch.");
Visible = true; Visible = true;
CenterToScreen(); CenterToScreen();
if (GlobalVars.UserConfiguration.DiscordPresence) if (GlobalVars.UserConfiguration.DiscordPresence)
{ {
GlobalFuncs.LogPrint("Starting Discord Rich Presence..."); GlobalFuncs.UpdateStatus(label1, "Starting Discord Rich Presence...");
label1.Text = "Starting Discord Rich Presence...";
StartDiscord(); StartDiscord();
} }
GlobalFuncs.LogPrint("Launching Game..."); GlobalFuncs.UpdateStatus(label1, "Launching Game...");
label1.Text = "Launching Game...";
LocalFuncs.SetupURIValues(); LocalFuncs.SetupURIValues();
StartGame(); StartGame();
} }

View File

@ -37,35 +37,36 @@ namespace NovetusURI
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(QuickConfigure)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(QuickConfigure));
this.textBox1 = new System.Windows.Forms.TextBox(); this.NameBox = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox(); this.IDBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button(); this.CustomizeButton = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button(); this.PlayButton = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button(); this.RegenIDButton = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label(); this.TripcodeLabel = new System.Windows.Forms.Label();
this.DontShowBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// textBox1 // NameBox
// //
this.textBox1.Location = new System.Drawing.Point(55, 12); this.NameBox.Location = new System.Drawing.Point(55, 12);
this.textBox1.Name = "textBox1"; this.NameBox.Name = "NameBox";
this.textBox1.Size = new System.Drawing.Size(357, 20); this.NameBox.Size = new System.Drawing.Size(155, 20);
this.textBox1.TabIndex = 0; this.NameBox.TabIndex = 0;
this.textBox1.Text = "Player"; this.NameBox.Text = "Player";
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.NameBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged); this.NameBox.TextChanged += new System.EventHandler(this.TextBox1TextChanged);
// //
// textBox2 // IDBox
// //
this.textBox2.Location = new System.Drawing.Point(55, 38); this.IDBox.Location = new System.Drawing.Point(55, 38);
this.textBox2.Name = "textBox2"; this.IDBox.Name = "IDBox";
this.textBox2.Size = new System.Drawing.Size(357, 20); this.IDBox.Size = new System.Drawing.Size(155, 20);
this.textBox2.TabIndex = 1; this.IDBox.TabIndex = 1;
this.textBox2.Text = "0"; this.IDBox.Text = "0";
this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.IDBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.textBox2.TextChanged += new System.EventHandler(this.TextBox2TextChanged); this.IDBox.TextChanged += new System.EventHandler(this.TextBox2TextChanged);
// //
// label1 // label1
// //
@ -83,75 +84,92 @@ namespace NovetusURI
this.label2.TabIndex = 3; this.label2.TabIndex = 3;
this.label2.Text = "ID"; this.label2.Text = "ID";
// //
// button1 // CustomizeButton
// //
this.button1.Location = new System.Drawing.Point(12, 64); this.CustomizeButton.Location = new System.Drawing.Point(214, 10);
this.button1.Name = "button1"; this.CustomizeButton.Name = "CustomizeButton";
this.button1.Size = new System.Drawing.Size(198, 23); this.CustomizeButton.Size = new System.Drawing.Size(198, 23);
this.button1.TabIndex = 4; this.CustomizeButton.TabIndex = 4;
this.button1.Text = "Customize Character"; this.CustomizeButton.Text = "Customize Character";
this.button1.UseVisualStyleBackColor = true; this.CustomizeButton.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.Button1Click); this.CustomizeButton.Click += new System.EventHandler(this.Button1Click);
// //
// button2 // PlayButton
// //
this.button2.Location = new System.Drawing.Point(12, 93); this.PlayButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button2.Name = "button2"; this.PlayButton.Location = new System.Drawing.Point(15, 111);
this.button2.Size = new System.Drawing.Size(400, 23); this.PlayButton.Name = "PlayButton";
this.button2.TabIndex = 5; this.PlayButton.Size = new System.Drawing.Size(397, 43);
this.button2.Text = "Close"; this.PlayButton.TabIndex = 5;
this.button2.UseVisualStyleBackColor = true; this.PlayButton.Text = "Play!";
this.button2.Click += new System.EventHandler(this.Button2Click); this.PlayButton.UseVisualStyleBackColor = true;
this.PlayButton.Click += new System.EventHandler(this.Button2Click);
// //
// button3 // RegenIDButton
// //
this.button3.Location = new System.Drawing.Point(216, 64); this.RegenIDButton.Location = new System.Drawing.Point(214, 36);
this.button3.Name = "button3"; this.RegenIDButton.Name = "RegenIDButton";
this.button3.Size = new System.Drawing.Size(196, 23); this.RegenIDButton.Size = new System.Drawing.Size(198, 23);
this.button3.TabIndex = 6; this.RegenIDButton.TabIndex = 6;
this.button3.Text = "Regenerate Player ID"; this.RegenIDButton.Text = "Regenerate Player ID";
this.button3.UseVisualStyleBackColor = true; this.RegenIDButton.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.Button3Click); this.RegenIDButton.Click += new System.EventHandler(this.Button3Click);
// //
// label3 // TripcodeLabel
// //
this.label3.Location = new System.Drawing.Point(3, 119); this.TripcodeLabel.Location = new System.Drawing.Point(4, 61);
this.label3.Name = "label3"; this.TripcodeLabel.Name = "TripcodeLabel";
this.label3.Size = new System.Drawing.Size(419, 18); this.TripcodeLabel.Size = new System.Drawing.Size(419, 18);
this.label3.TabIndex = 7; this.TripcodeLabel.TabIndex = 7;
this.label3.Text = "qwertyuiopasdfghjklz"; this.TripcodeLabel.Text = "qwertyuiopasdfghjklz";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.TripcodeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// DontShowBox
//
this.DontShowBox.AutoSize = true;
this.DontShowBox.Location = new System.Drawing.Point(162, 88);
this.DontShowBox.Name = "DontShowBox";
this.DontShowBox.Size = new System.Drawing.Size(108, 17);
this.DontShowBox.TabIndex = 8;
this.DontShowBox.Text = "Don\'t show again";
this.DontShowBox.UseVisualStyleBackColor = true;
this.DontShowBox.CheckedChanged += new System.EventHandler(this.DontShowBox_CheckedChanged);
// //
// QuickConfigure // QuickConfigure
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(424, 139); this.ClientSize = new System.Drawing.Size(424, 166);
this.Controls.Add(this.label3); this.Controls.Add(this.DontShowBox);
this.Controls.Add(this.button3); this.Controls.Add(this.TripcodeLabel);
this.Controls.Add(this.button2); this.Controls.Add(this.RegenIDButton);
this.Controls.Add(this.button1); this.Controls.Add(this.PlayButton);
this.Controls.Add(this.CustomizeButton);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2); this.Controls.Add(this.IDBox);
this.Controls.Add(this.textBox1); this.Controls.Add(this.NameBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "QuickConfigure"; this.Name = "QuickConfigure";
this.Text = "Player Configuration";
this.Closing += new System.ComponentModel.CancelEventHandler(this.QuickConfigureClose); this.Closing += new System.ComponentModel.CancelEventHandler(this.QuickConfigureClose);
this.Load += new System.EventHandler(this.QuickConfigureLoad); this.Load += new System.EventHandler(this.QuickConfigureLoad);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.Button button3; private System.Windows.Forms.Button RegenIDButton;
private System.Windows.Forms.Button button2; private System.Windows.Forms.Button PlayButton;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button CustomizeButton;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox IDBox;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox NameBox;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label TripcodeLabel;
private System.Windows.Forms.CheckBox DontShowBox;
} }
} }

View File

@ -32,34 +32,35 @@ namespace NovetusURI
void ReadConfigValues(string cfgpath) void ReadConfigValues(string cfgpath)
{ {
GlobalFuncs.Config(cfgpath, false); GlobalFuncs.Config(cfgpath, false);
textBox2.Text = GlobalVars.UserConfiguration.UserID.ToString(); DontShowBox.Checked = GlobalVars.UserConfiguration.URIQuickConfigure;
label3.Text = GlobalVars.PlayerTripcode.ToString(); IDBox.Text = GlobalVars.UserConfiguration.UserID.ToString();
textBox1.Text = GlobalVars.UserConfiguration.PlayerName; TripcodeLabel.Text = GlobalVars.PlayerTripcode.ToString();
NameBox.Text = GlobalVars.UserConfiguration.PlayerName;
} }
void GeneratePlayerID() void GeneratePlayerID()
{ {
GlobalFuncs.GeneratePlayerID(); GlobalFuncs.GeneratePlayerID();
textBox2.Text = GlobalVars.UserConfiguration.UserID.ToString(); IDBox.Text = GlobalVars.UserConfiguration.UserID.ToString();
} }
void TextBox1TextChanged(object sender, EventArgs e) void TextBox1TextChanged(object sender, EventArgs e)
{ {
GlobalVars.UserConfiguration.PlayerName = textBox1.Text; GlobalVars.UserConfiguration.PlayerName = NameBox.Text;
} }
void TextBox2TextChanged(object sender, EventArgs e) void TextBox2TextChanged(object sender, EventArgs e)
{ {
int parsedValue; int parsedValue;
if (int.TryParse(textBox2.Text, out parsedValue)) if (int.TryParse(IDBox.Text, out parsedValue))
{ {
if (textBox2.Text.Equals("")) if (IDBox.Text.Equals(""))
{ {
GlobalVars.UserConfiguration.UserID = 0; GlobalVars.UserConfiguration.UserID = 0;
} }
else else
{ {
GlobalVars.UserConfiguration.UserID = Convert.ToInt32(textBox2.Text); GlobalVars.UserConfiguration.UserID = Convert.ToInt32(IDBox.Text);
} }
} }
else else
@ -78,6 +79,11 @@ namespace NovetusURI
Close(); Close();
} }
private void DontShowBox_CheckedChanged(object sender, EventArgs e)
{
GlobalVars.UserConfiguration.URIQuickConfigure = DontShowBox.Checked;
}
void QuickConfigureClose(object sender, CancelEventArgs e) void QuickConfigureClose(object sender, CancelEventArgs e)
{ {
GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true);