Skip to content

Commit

Permalink
Implement Rudimentary Text Updates
Browse files Browse the repository at this point in the history
Changes:
- Added Temporary UI Text Updates for Verify Hash for Debugging
  • Loading branch information
DavidCarbon committed Jun 20, 2024
1 parent 60705fd commit df906fc
Show file tree
Hide file tree
Showing 8 changed files with 417 additions and 143 deletions.
88 changes: 1 addition & 87 deletions SBRW.Launcher.Net/App/UI_Forms/Parent_Screen/Screen_Parent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,93 +25,7 @@ public partial class Screen_Parent : Form
public Screen_Parent()
{
InitializeComponent();
#region Custom EventHandlers
MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Panel_Splash_Screen.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
Panel_Splash_Screen.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
Panel_Splash_Screen.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Panel_Form_Screens.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
Panel_Form_Screens.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
Panel_Form_Screens.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

PictureBox_Screen_Splash.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
PictureBox_Screen_Splash.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
PictureBox_Screen_Splash.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Load += new EventHandler(Parent_Screen_Load);
Shown += new EventHandler(Parent_Screen_Shown);
Clock.Tick += new EventHandler(Clock_Tick);

Button_Close.MouseEnter += new EventHandler(ButtonClose_MouseEnter);
Button_Close.MouseLeave += new EventHandler(ButtonClose_MouseLeaveANDMouseUp);
Button_Close.MouseUp += new MouseEventHandler(ButtonClose_MouseLeaveANDMouseUp);
Button_Close.MouseDown += new MouseEventHandler(ButtonClose_MouseDown);
Button_Close.Click += new EventHandler(Button_Close_Click);
#endregion

#region Custom Theme
/*******************************/
/* Set Font /
/*******************************/
#if !(RELEASE_UNIX || DEBUG_UNIX)
float MainFontSize = 9f * 96f / CreateGraphics().DpiY;
#else
float MainFontSize = 9f;
#endif

Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);
TextBox_Live_Log.Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);
GroupBox_Launcherlog.Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);

/********************************/
/* Set Theme Colors & Images /
/********************************/

SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer, true);

TransparencyKey = Color_Screen.BG_Splash;
BackgroundImage = Image_Background.Settings;

Button_Close.BackgroundImage = Button_Close.Icon_Order(SVG_Icon.Cross, SVG_Color.White);
PictureBox_Screen_Splash.BackgroundImage = Image_Other.Logo_Splash;

ForeColor = Color_Winform.Text_Fore_Color;
BackColor = Color_Winform.BG_Fore_Color;

GroupBox_Launcherlog.ForeColor = Color_Winform.Text_Fore_Color;
TextBox_Live_Log.ForeColor = Color_Winform.Secondary_Text_Fore_Color;
TextBox_Live_Log.BackColor = Color_Winform.BG_Darker_Fore_Color;

/*******************************/
/* Set Window Name /
/*******************************/

Icon = FormsIcon.Retrive_Icon();
Text = "SBRW Launcher: " + Application.ProductVersion;

this.Closing += (x, y) =>
{
if (FunctionStatus.LoadingComplete)
{
ClosingTasks();
}
else
{
FunctionStatus.LauncherForceClose = true;
}

Screen_Instance = null;
};
#endregion

#region Update Variables
Screen_Instance = this;
//Button_One.Text = DialogResult.OK.ToString();
#endregion
Set_Visuals();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using SBRW.Launcher.RunTime.LauncherCore.Visuals;
using SBRW.Launcher.Core.Theme;
using SBRW.Launcher.RunTime.LauncherCore.Global;
using SBRW.Launcher.RunTime.LauncherCore.Support;
using SBRW.Launcher.RunTime.LauncherCore.Visuals;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace SBRW.Launcher.App.UI_Forms.Parent_Screen
{
Expand Down Expand Up @@ -35,5 +40,98 @@ private void ButtonClose_MouseLeaveANDMouseUp(object sender, EventArgs e)
{
Button_Close.BackgroundImage = Button_Close.Icon_Order(SVG_Icon.Cross, SVG_Color.White);
}
/// <summary>
///
/// </summary>
private void Set_Visuals()
{
#region Custom EventHandlers
MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Panel_Splash_Screen.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
Panel_Splash_Screen.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
Panel_Splash_Screen.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Panel_Form_Screens.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
Panel_Form_Screens.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
Panel_Form_Screens.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

PictureBox_Screen_Splash.MouseMove += new MouseEventHandler(Move_Window_Mouse_Move);
PictureBox_Screen_Splash.MouseUp += new MouseEventHandler(Move_Window_Mouse_Up);
PictureBox_Screen_Splash.MouseDown += new MouseEventHandler(Move_Window_Mouse_Down);

Load += new EventHandler(Parent_Screen_Load);
Shown += new EventHandler(Parent_Screen_Shown);
Clock.Tick += new EventHandler(Clock_Tick);

Button_Close.MouseEnter += new EventHandler(ButtonClose_MouseEnter);
Button_Close.MouseLeave += new EventHandler(ButtonClose_MouseLeaveANDMouseUp);
Button_Close.MouseUp += new MouseEventHandler(ButtonClose_MouseLeaveANDMouseUp);
Button_Close.MouseDown += new MouseEventHandler(ButtonClose_MouseDown);
Button_Close.Click += new EventHandler(Button_Close_Click);
#endregion

#region Custom Theme
/*******************************/
/* Set Font /
/*******************************/
#if !(RELEASE_UNIX || DEBUG_UNIX)
float MainFontSize = 9f * 96f / CreateGraphics().DpiY;
#else
float MainFontSize = 9f;
#endif

Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);
TextBox_Live_Log.Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);
GroupBox_Launcherlog.Font = new Font(FormsFont.Primary(), MainFontSize, FontStyle.Regular);

/********************************/
/* Set Theme Colors & Images /
/********************************/

SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer, true);

TransparencyKey = Color_Screen.BG_Splash;
BackgroundImage = Image_Background.Settings;

Button_Close.BackgroundImage = Button_Close.Icon_Order(SVG_Icon.Cross, SVG_Color.White);
PictureBox_Screen_Splash.BackgroundImage = Image_Other.Logo_Splash;

ForeColor = Color_Winform.Text_Fore_Color;
BackColor = Color_Winform.BG_Fore_Color;

GroupBox_Launcherlog.ForeColor = Color_Winform.Text_Fore_Color;
TextBox_Live_Log.ForeColor = Color_Winform.Secondary_Text_Fore_Color;
TextBox_Live_Log.BackColor = Color_Winform.BG_Darker_Fore_Color;

/*******************************/
/* Set Window Name /
/*******************************/

Icon = FormsIcon.Retrive_Icon();
Text = "SBRW Launcher: " + Application.ProductVersion;

this.Closing += (x, y) =>
{
if (FunctionStatus.LoadingComplete)
{
ClosingTasks();
}
else
{
FunctionStatus.LauncherForceClose = true;
}

Screen_Instance = null;
};
#endregion

#region Update Variables
Screen_Instance = this;
//Button_One.Text = DialogResult.OK.ToString();
#endregion
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using SBRW.Launcher.Core.Theme;
using SBRW.Launcher.RunTime.InsiderKit;
using SBRW.Launcher.RunTime.LauncherCore.APICheckers;
using SBRW.Launcher.RunTime.LauncherCore.Downloader;
using SBRW.Launcher.RunTime.LauncherCore.Global;
using SBRW.Launcher.RunTime.LauncherCore.Lists;
using SBRW.Launcher.RunTime.LauncherCore.Logger;
Expand Down Expand Up @@ -101,6 +102,27 @@ private void Button_CDN_Selector_Click(object sender, EventArgs e)
}
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Button_Verify_Scan_Click(object sender, EventArgs e)
{
if (Download_Raw.Thread != default)
{
Button_Verify_Scan.Text = "Stop Scan";
/* Downloader is Running */
Download_Raw.Stop();
}
else
{
Button_Verify_Scan.Text = "Start Scan";
/* Downloader is Running */
Download_Raw.Verify_CDN_URL = Save_Settings.Live_Data.Launcher_CDN;
Download_Raw.Start();
}
}
/// <summary>
/// Settings Verify Hash
/// </summary>
/// <param name="sender"></param>
Expand Down Expand Up @@ -493,6 +515,42 @@ private void CheckBox_Enable_ACM_CheckedChanged(object sender, EventArgs e)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CheckBox_Alt_WebCalls_CheckedChanged(object sender, EventArgs e)
{
CheckBox_Alt_WebCalls.Text = $"Alternative WebCalls {(CheckBox_Alt_WebCalls.Checked ? "(Enabled)" : "(Disabled)")}";
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CheckBox_Proxy_CheckedChanged(object sender, EventArgs e)
{
CheckBox_Proxy.Text = $"Proxy {(CheckBox_Proxy.Checked ? "(Enabled)" : "(Disabled)")}";
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CheckBox_Host_to_IP_CheckedChanged(object sender, EventArgs e)
{
CheckBox_Host_to_IP.Text = $"IP Converter {(CheckBox_Host_to_IP.Checked ? "(Enabled)" : "(Disabled)")}";
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CheckBox_Proxy_Domain_CheckedChanged(object sender, EventArgs e)
{
CheckBox_Proxy_Domain.Text = $"Proxy Domain {(CheckBox_Proxy_Domain.Checked ? "(Enabled)" : "(Disabled)")}";
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CheckBox_Enable_Affinity_Range_CheckedChanged(object sender, EventArgs e)
{
CheckBox_Enable_Affinity_Range.Text = $"Affinity Range {(CheckBox_Enable_Affinity_Range.Checked ? "(Enabled)" :"(Disabled)")}";
Expand Down Expand Up @@ -833,13 +891,24 @@ private async void Screen_Settings_Load(object sender, EventArgs e)
NewGameFilesPath = Save_Settings.Live_Data.Game_Path;
NewLauncherPath = Locations.LauncherFolder;

CheckBox_Proxy.Checked = !Save_Settings.Proxy_RunTime();
CheckBox_RPC.Checked = !Save_Settings.RPC_Discord();
CheckBox_Proxy.Checked = Save_Settings.Proxy_RunTime();
CheckBox_RPC.Checked = Save_Settings.RPC_Discord();
CheckBox_Alt_WebCalls.Checked = Save_Settings.WebCalls_Alt();
CheckBox_Theme_Support.Checked = Save_Settings.Theme_Custom();
CheckBox_JSON_Update_Cache.Checked = Save_Settings.Update_Frequency_JSON();
CheckBox_Proxy_Domain.Checked = Save_Settings.Proxy_Domain();
CheckBox_Host_to_IP.Checked = !Save_Settings.Legacy_Host_To_IP();
CheckBox_Host_to_IP.Checked = Save_Settings.Legacy_Host_To_IP();

/* Trigger Events for CheckBox Text */
CheckBox_Enable_Affinity_Range_CheckedChanged(default, default);
CheckBox_RPC_CheckedChanged(default, default);
CheckBox_JSON_Update_Cache_CheckedChanged(default, default);
CheckBox_Theme_Support_CheckedChanged(default, default);
CheckBox_Enable_ACM_CheckedChanged(default, default);
CheckBox_Alt_WebCalls_CheckedChanged(default, default);
CheckBox_Proxy_CheckedChanged(default, default);
CheckBox_Host_to_IP_CheckedChanged(default, default);
CheckBox_Proxy_Domain_CheckedChanged(default, default);

switch (Save_Settings.Downloader_Game())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ private void Enable_Affinity_Range(bool Enable_Affinity_Range)
{
NumericUpDown_Range_Affinity.Increment = 2;
NumericUpDown_Range_Affinity.Minimum = 2;
NumericUpDown_Range_Affinity.Maximum = Environment.ProcessorCount >= 8 ? 8 : Environment.ProcessorCount.Equals(6) ? 6 : 4;
NumericUpDown_Range_Affinity.Maximum = Environment.ProcessorCount >= 8 ? 8 : Environment.ProcessorCount == 6 ? 6 : 4;
NumericUpDown_Range_Affinity.Value = Environment.ProcessorCount >= 4 ? 4 : 2;
Label_Affinity_Core_Calculator.Visible = true;
Panel_Affinity_Range.Visible = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private void Set_Visuals()
Button_Console_Submit.Click += new EventHandler(Console_Enter);
Button_CDN_List.Click += new EventHandler(Button_CDN_Selector_Click);
Button_CDN_List_Setup.Click += new EventHandler(Button_CDN_Selector_Click);
Button_Verify_Scan.Click += new EventHandler(Button_Game_Verify_Files_Click);
Button_Verify_Scan.Click += new EventHandler(Button_Verify_Scan_Click);
Button_Save.Click += new EventHandler(SettingsSave_Click);
Button_Save_Setup.Click += new EventHandler(SettingsSave_Click);
Button_Experiments.Click += new EventHandler(Button_Experiments_Click);
Expand Down Expand Up @@ -542,6 +542,10 @@ private void Set_Visuals()
CheckBox_JSON_Update_Cache.CheckedChanged += new EventHandler(CheckBox_JSON_Update_Cache_CheckedChanged);
CheckBox_Theme_Support.CheckedChanged += new EventHandler(CheckBox_Theme_Support_CheckedChanged);
CheckBox_Enable_ACM.CheckedChanged += new EventHandler(CheckBox_Enable_ACM_CheckedChanged);
CheckBox_Alt_WebCalls.CheckedChanged += new EventHandler(CheckBox_Alt_WebCalls_CheckedChanged);
CheckBox_Proxy.CheckedChanged += new EventHandler(CheckBox_Proxy_CheckedChanged);
CheckBox_Host_to_IP.CheckedChanged += new EventHandler(CheckBox_Host_to_IP_CheckedChanged);
CheckBox_Proxy_Domain.CheckedChanged += new EventHandler(CheckBox_Proxy_Domain_CheckedChanged);

/********************************/
/* Sets Red Buttons/Disables /
Expand Down Expand Up @@ -745,6 +749,10 @@ private void Set_Visuals()
Button_Verify_Scan.FlatAppearance.BorderColor = Color_Winform_Buttons.Blue_Border_Color;
Button_Verify_Scan.FlatAppearance.MouseOverBackColor = Color_Winform_Buttons.Blue_Mouse_Over_Back_Color;

GroupBox_Verify_Scan.ForeColor = Color_Winform.Text_Fore_Color;
TextBox_Verify_Scan.ForeColor = Color_Winform.Secondary_Text_Fore_Color;
TextBox_Verify_Scan.BackColor = Color_Winform.BG_Darker_Fore_Color;

/********************************/
/* Events Handlers /
/********************************/
Expand All @@ -755,8 +763,10 @@ private void Set_Visuals()
/* Hardcoded Text [Linux Fix] /
/********************************/

VerifyHashWelcome.Text = "Welcome!\n\nThe scanning process is pretty quick,\nbut may still take a while." +
"\nDepending on your connection,\nre-downloading will take the longest\nPlease allow it to complete fully!";
TextBox_Verify_Scan.AppendText(
$"Welcome!{Environment.NewLine}The scanning process is pretty quick, but may still take a while." +
$"{Environment.NewLine}Depending on your connection, re-downloading will take the longest. " +
$"{Environment.NewLine}Please allow it to complete fully!");
Label_Verify_Scan.Text = "Scanning Progress:";
//DownloadProgressText.Text = "Download Progress:";
//VerifyHashText.Text = "Please select \"Start Scan\" \nTo begin Validating Gamefiles";
Expand Down
8 changes: 4 additions & 4 deletions SBRW.Launcher.RunTime/InsiderKit/BuildInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ public class BuildInformation
{
/* Current month, day, year (2 digits), and letter! Ex: 12-15-20-A */
/* If a second build gets release within the same day bump letter version up (No R2 or D2)*/
const string DATE = "06-19-2024";
const string DATE_SHORT = "06-19-24";
const string TIME = "2236";
const string TIME_SECONDS = "05";
const string DATE = "06-20-2024";
const string DATE_SHORT = "06-20-24";
const string TIME = "0213";
const string TIME_SECONDS = "01";
const string TIME_ZONE = "-07:00";
/// <summary>
/// Build Information <i>(Full Information)</i>
Expand Down
Loading

0 comments on commit df906fc

Please sign in to comment.