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

Commit

Permalink
add option to not show error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfare committed Jul 6, 2021
1 parent 3129d67 commit b146d25
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
13 changes: 13 additions & 0 deletions AssetStudioGUI/AssetStudioGUIForm.Designer.cs

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

10 changes: 9 additions & 1 deletion AssetStudioGUI/AssetStudioGUIForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ partial class AssetStudioGUIForm : Form
private string openDirectoryBackup = string.Empty;
private string saveDirectoryBackup = string.Empty;

private GUILogger logger;

[DllImport("gdi32.dll")]
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);

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

Logger.Default = new GUILogger(StatusStripUpdate);
logger = new GUILogger(StatusStripUpdate);
Logger.Default = logger;
Progress.Default = new GUIProgress(SetProgressBarValue);
Studio.StatusStripUpdate = StatusStripUpdate;
}
Expand Down Expand Up @@ -2036,6 +2039,11 @@ private void tabControl2_SelectedIndexChanged(object sender, EventArgs e)
}
}

private void toolStripMenuItem15_Click(object sender, EventArgs e)
{
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
}

private void glControl1_MouseWheel(object sender, MouseEventArgs e)
{
if (glControl1.Visible)
Expand Down
6 changes: 5 additions & 1 deletion AssetStudioGUI/GUILogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace AssetStudioGUI
{
class GUILogger : ILogger
{
public bool ShowErrorMessage = true;
private Action<string> action;

public GUILogger(Action<string> action)
Expand All @@ -18,7 +19,10 @@ public void Log(LoggerEvent loggerEvent, string message)
switch (loggerEvent)
{
case LoggerEvent.Error:
MessageBox.Show(message);
if (ShowErrorMessage)
{
MessageBox.Show(message);
}
break;
default:
action(message);
Expand Down

0 comments on commit b146d25

Please sign in to comment.