code optimizations

This commit is contained in:
Bitl 2024-03-29 17:29:55 -07:00
parent 08f799a50a
commit 9ad39c045a
3 changed files with 15 additions and 15 deletions

View File

@ -226,9 +226,7 @@ namespace Novetus.Core
GlobalVars.UserConfiguration = new FileFormat.Config(true);
GlobalVars.UserConfiguration.SaveSetting("SelectedClient", GlobalVars.ProgramInformation.DefaultClient);
GlobalVars.UserConfiguration.SaveSetting("Map", GlobalVars.ProgramInformation.DefaultMap);
GlobalVars.UserConfiguration.SaveSetting("MapPath", GlobalPaths.MapsDir + @"\\" + GlobalVars.ProgramInformation.DefaultMap);
GlobalVars.UserConfiguration.SaveSetting("MapPathSnip", GlobalPaths.MapsDirBase + @"\\" + GlobalVars.ProgramInformation.DefaultMap);
ResetMap();
#if LAUNCHER
GlobalVars.UserConfiguration.SaveSettingInt("LauncherStyle", (int)style);
#endif

View File

@ -68,6 +68,16 @@ namespace NovetusLauncher
#endregion
#region Form Event Functions
public void RefreshStylishTitle()
{
if (FormStyle == Settings.Style.Stylish)
{
Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " +
GlobalVars.UserConfiguration.ReadSetting("SelectedClient") + " | MAP: " +
GlobalVars.UserConfiguration.ReadSetting("Map") + "]";
}
}
public void InitForm()
{
HideMasterAddressWarning = false;
@ -98,12 +108,8 @@ namespace NovetusLauncher
}
}
if (FormStyle == Settings.Style.Stylish)
{
Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " +
GlobalVars.UserConfiguration.ReadSetting("SelectedClient") + " | MAP: " +
GlobalVars.UserConfiguration.ReadSetting("Map") + "]";
}
FileManagement.ResetMapIfNecessary();
RefreshStylishTitle();
if (GlobalVars.UserConfiguration.ReadSettingBool("WebProxyEnabled"))
{

View File

@ -139,9 +139,7 @@ namespace NovetusLauncher
launcherForm.SelectMap();
LoadMapDesc();
FormParent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " +
GlobalVars.UserConfiguration.ReadSetting("SelectedClient") + " | MAP: " +
GlobalVars.UserConfiguration.ReadSetting("Map") + "]";
launcherForm.RefreshStylishTitle();
}
private void clientListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
@ -193,9 +191,7 @@ namespace NovetusLauncher
return;
}
FormParent.Text = "Novetus " + GlobalVars.ProgramInformation.Version + " [CLIENT: " +
GlobalVars.UserConfiguration.ReadSetting("SelectedClient") + " | MAP: " +
GlobalVars.UserConfiguration.ReadSetting("Map") + "]";
launcherForm.RefreshStylishTitle();
Client.UpdateRichPresence(Client.GetStateForType(GlobalVars.GameOpened));