fixed saving issues

This commit is contained in:
Bitl 2021-11-04 10:13:37 -07:00
parent 12ec5b33c5
commit e62e237d45
6 changed files with 39 additions and 50 deletions

View File

@ -160,6 +160,13 @@ class CharacterCustomizationShared
GlobalFuncs.ReloadLoadoutValue();
}
public void CloseEvent()
{
GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "");
GlobalFuncs.ReloadLoadoutValue();
SaveOutfit(false);
}
public void ChangeTabs()
{
ColorView.SelectedIndices.Clear();
@ -610,10 +617,13 @@ class CharacterCustomizationShared
}
}
public void SaveOutfit()
public void SaveOutfit(bool box = true)
{
GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true);
MessageBox.Show("Outfit Saved!", "Novetus - Outfit Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
if (box)
{
MessageBox.Show("Outfit Saved!", "Novetus - Outfit Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
public void LoadOutfit()
@ -721,6 +731,7 @@ class CharacterCustomizationShared
public void Launch3DView()
{
GlobalFuncs.ReloadLoadoutValue();
SaveOutfit(false);
//HACK!
try
{

View File

@ -34,8 +34,7 @@ public partial class CharacterCustomizationCompact : Form
void CharacterCustomizationClose(object sender, CancelEventArgs e)
{
GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "");
GlobalFuncs.ReloadLoadoutValue();
characterCustomizationForm.CloseEvent();
}
#region Hats

View File

@ -36,8 +36,7 @@ public partial class CharacterCustomizationExtended : Form
void CharacterCustomizationClose(object sender, CancelEventArgs e)
{
GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "");
GlobalFuncs.ReloadLoadoutValue();
characterCustomizationForm.CloseEvent();
}
#region Hats

View File

@ -291,19 +291,7 @@ namespace NovetusLauncher
public void CloseEvent(CancelEventArgs e)
{
if (GlobalVars.AdminMode)
{
DialogResult closeNovetus = MessageBox.Show("You are in Admin Mode.\nAre you sure you want to quit Novetus?", "Novetus - Admin Mode Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (closeNovetus == DialogResult.No)
{
e.Cancel = true;
}
else
{
CloseEventInternal();
}
}
else if (GlobalVars.GameOpened != GlobalVars.OpenedGame.None)
if (GlobalVars.GameOpened != GlobalVars.OpenedGame.None)
{
switch (GlobalVars.GameOpened)
{
@ -317,9 +305,28 @@ namespace NovetusLauncher
break;
}
}
else
{
if (GlobalVars.AdminMode)
{
DialogResult closeNovetus = MessageBox.Show("You are in Admin Mode.\nAre you sure you want to quit Novetus?", "Novetus - Admin Mode Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (closeNovetus == DialogResult.No)
{
e.Cancel = true;
}
else
{
CloseEventInternal();
}
}
else
{
CloseEventInternal();
}
}
}
private void ShowCloseError(string text, string title, CancelEventArgs e)
public void ShowCloseError(string text, string title, CancelEventArgs e)
{
DialogResult closeNovetus = MessageBox.Show(text + "\nYou must close the game before closing Novetus.", "Novetus - " + title + " is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (closeNovetus == DialogResult.OK)

View File

@ -89,38 +89,11 @@ namespace NovetusLauncher
void LauncherFormStylish_Close(object sender, CancelEventArgs e)
{
CloseEvent(e);
launcherFormStylishInterface1.launcherForm.CloseEvent(e);
}
#endregion
#region Functions
public void CloseEvent(CancelEventArgs e)
{
if (GlobalVars.AdminMode)
{
DialogResult closeNovetus = MessageBox.Show("You are in Admin Mode.\nAre you sure you want to quit Novetus?", "Novetus - Admin Mode Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (closeNovetus == DialogResult.No)
{
e.Cancel = true;
}
else
{
CloseEventInternal();
}
}
}
public void CloseEventInternal()
{
WriteConfigValues();
if (GlobalVars.UserConfiguration.DiscordPresence)
{
DiscordRPC.Shutdown();
}
Application.Exit();
}
void splashLabel_Paint(object sender, PaintEventArgs e)
{

View File

@ -467,13 +467,13 @@ namespace NovetusLauncher
{
case 0:
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Extended;
FormParent.CloseEventInternal();
launcherForm.CloseEventInternal();
System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.Exit();
break;
case 1:
GlobalVars.UserConfiguration.LauncherStyle = Settings.Style.Compact;
FormParent.CloseEventInternal();
launcherForm.CloseEventInternal();
System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.Exit();
break;