Skip to content
This repository was archived by the owner on Jan 21, 2023. It is now read-only.

Commit b146d25

Browse files
committed
add option to not show error message
1 parent 3129d67 commit b146d25

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

AssetStudioGUI/AssetStudioGUIForm.Designer.cs

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AssetStudioGUI/AssetStudioGUIForm.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ partial class AssetStudioGUIForm : Form
8585
private string openDirectoryBackup = string.Empty;
8686
private string saveDirectoryBackup = string.Empty;
8787

88+
private GUILogger logger;
89+
8890
[DllImport("gdi32.dll")]
8991
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
9092

@@ -100,7 +102,8 @@ public AssetStudioGUIForm()
100102
enablePreview.Checked = Properties.Settings.Default.enablePreview;
101103
FMODinit();
102104

103-
Logger.Default = new GUILogger(StatusStripUpdate);
105+
logger = new GUILogger(StatusStripUpdate);
106+
Logger.Default = logger;
104107
Progress.Default = new GUIProgress(SetProgressBarValue);
105108
Studio.StatusStripUpdate = StatusStripUpdate;
106109
}
@@ -2036,6 +2039,11 @@ private void tabControl2_SelectedIndexChanged(object sender, EventArgs e)
20362039
}
20372040
}
20382041

2042+
private void toolStripMenuItem15_Click(object sender, EventArgs e)
2043+
{
2044+
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
2045+
}
2046+
20392047
private void glControl1_MouseWheel(object sender, MouseEventArgs e)
20402048
{
20412049
if (glControl1.Visible)

AssetStudioGUI/GUILogger.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace AssetStudioGUI
66
{
77
class GUILogger : ILogger
88
{
9+
public bool ShowErrorMessage = true;
910
private Action<string> action;
1011

1112
public GUILogger(Action<string> action)
@@ -18,7 +19,10 @@ public void Log(LoggerEvent loggerEvent, string message)
1819
switch (loggerEvent)
1920
{
2021
case LoggerEvent.Error:
21-
MessageBox.Show(message);
22+
if (ShowErrorMessage)
23+
{
24+
MessageBox.Show(message);
25+
}
2226
break;
2327
default:
2428
action(message);

0 commit comments

Comments
 (0)