mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Update save settings only when main window is closed
This commit is contained in:
parent
74ddb428ee
commit
d169de9a9e
@ -98,7 +98,6 @@ namespace GrasscutterTools.Forms
|
|||||||
{
|
{
|
||||||
// 保存文件路径
|
// 保存文件路径
|
||||||
Settings.Default.DropJsonPath = TxtDropJsonPath.Text;
|
Settings.Default.DropJsonPath = TxtDropJsonPath.Text;
|
||||||
Settings.Default.Save();
|
|
||||||
|
|
||||||
base.OnFormClosed(e);
|
base.OnFormClosed(e);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,6 @@ namespace GrasscutterTools.Forms
|
|||||||
{
|
{
|
||||||
// 保存文件路径
|
// 保存文件路径
|
||||||
Settings.Default.BannersJsonPath = TxtBannersJsonPath.Text;
|
Settings.Default.BannersJsonPath = TxtBannersJsonPath.Text;
|
||||||
Settings.Default.Save();
|
|
||||||
|
|
||||||
base.OnFormClosed(e);
|
base.OnFormClosed(e);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ namespace GrasscutterTools.Forms
|
|||||||
else
|
else
|
||||||
Settings.Default.MainFormSize = Size;
|
Settings.Default.MainFormSize = Size;
|
||||||
|
|
||||||
// 保存默认设置
|
// 保存设置
|
||||||
Settings.Default.Save();
|
Settings.Default.Save();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -80,7 +80,6 @@ namespace GrasscutterTools.Forms
|
|||||||
protected override void OnFormClosed(FormClosedEventArgs e)
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
Settings.Default.ShopJsonPath = TxtShopJsonPath.Text;
|
Settings.Default.ShopJsonPath = TxtShopJsonPath.Text;
|
||||||
Settings.Default.Save();
|
|
||||||
|
|
||||||
base.OnFormClosed(e);
|
base.OnFormClosed(e);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ namespace GrasscutterTools.Forms
|
|||||||
if (Settings.Default.ResourcesDirPath != resourcesDirPath)
|
if (Settings.Default.ResourcesDirPath != resourcesDirPath)
|
||||||
{
|
{
|
||||||
Settings.Default.ResourcesDirPath = resourcesDirPath;
|
Settings.Default.ResourcesDirPath = resourcesDirPath;
|
||||||
Settings.Default.Save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CmbLanguage.Items.Clear();
|
CmbLanguage.Items.Clear();
|
||||||
@ -104,7 +103,6 @@ namespace GrasscutterTools.Forms
|
|||||||
|
|
||||||
GenLines();
|
GenLines();
|
||||||
Settings.Default.TextMapFileName = CmbLanguage.Text;
|
Settings.Default.TextMapFileName = CmbLanguage.Text;
|
||||||
Settings.Default.Save();
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -77,6 +77,7 @@ namespace GrasscutterTools
|
|||||||
MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage);
|
MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage);
|
||||||
|
|
||||||
Application.Run(new Forms.FormMain());
|
Application.Run(new Forms.FormMain());
|
||||||
|
Console.WriteLine("Program end.");
|
||||||
}
|
}
|
||||||
|
|
||||||
#region - 全局异常处理 -
|
#region - 全局异常处理 -
|
||||||
@ -84,12 +85,16 @@ namespace GrasscutterTools
|
|||||||
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
string str = GetExceptionMsg(e.Exception, e.ToString());
|
string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||||
|
Console.WriteLine("Application_ThreadException");
|
||||||
|
Console.WriteLine(str);
|
||||||
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
{
|
{
|
||||||
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
|
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
|
||||||
|
Console.WriteLine("CurrentDomain_UnhandledException");
|
||||||
|
Console.WriteLine(str);
|
||||||
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,15 +31,5 @@ namespace GrasscutterTools.Utils
|
|||||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||||
"GrasscutterTools",
|
"GrasscutterTools",
|
||||||
filename);
|
filename);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// UID
|
|
||||||
/// </summary>
|
|
||||||
public static int UID { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 生成命令是否包含UID
|
|
||||||
/// </summary>
|
|
||||||
public static bool IsIncludeUID { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user