[GUI] Replace "Show all error msgs" option with "Show debug msgs"

This commit is contained in:
VaDiM 2024-02-08 22:42:54 +03:00
parent 6fe12d274f
commit d4162161be
5 changed files with 15 additions and 20 deletions

View File

@ -20,7 +20,7 @@ namespace AssetStudio
var readed = reader.Position - reader.byteStart;
if (readed != reader.byteSize)
{
Logger.Info($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes");
Logger.Info($"Failed to read type, read {readed} bytes but expected {reader.byteSize} bytes");
}
return sb.ToString();
}
@ -177,7 +177,7 @@ namespace AssetStudio
var readed = reader.Position - reader.byteStart;
if (readed != reader.byteSize)
{
Logger.Info($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes");
Logger.Info($"Failed to read type, read {readed} bytes but expected {reader.byteSize} bytes");
}
return obj;
}

View File

@ -599,8 +599,8 @@
// debugMenuItem
//
this.debugMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem15,
this.showConsoleToolStripMenuItem,
this.toolStripMenuItem15,
this.writeLogToFileToolStripMenuItem,
this.exportClassStructuresMenuItem});
this.debugMenuItem.Name = "debugMenuItem";
@ -611,8 +611,8 @@
//
this.toolStripMenuItem15.CheckOnClick = true;
this.toolStripMenuItem15.Name = "toolStripMenuItem15";
this.toolStripMenuItem15.Size = new System.Drawing.Size(200, 22);
this.toolStripMenuItem15.Text = "Show all error messages";
this.toolStripMenuItem15.Size = new System.Drawing.Size(288, 22);
this.toolStripMenuItem15.Text = "Show debug messages in console logger";
this.toolStripMenuItem15.Click += new System.EventHandler(this.toolStripMenuItem15_Click);
//
// showConsoleToolStripMenuItem
@ -621,7 +621,7 @@
this.showConsoleToolStripMenuItem.CheckOnClick = true;
this.showConsoleToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.showConsoleToolStripMenuItem.Name = "showConsoleToolStripMenuItem";
this.showConsoleToolStripMenuItem.Size = new System.Drawing.Size(200, 22);
this.showConsoleToolStripMenuItem.Size = new System.Drawing.Size(288, 22);
this.showConsoleToolStripMenuItem.Text = "Show console logger";
this.showConsoleToolStripMenuItem.Click += new System.EventHandler(this.showConsoleToolStripMenuItem_Click);
//
@ -629,14 +629,14 @@
//
this.writeLogToFileToolStripMenuItem.CheckOnClick = true;
this.writeLogToFileToolStripMenuItem.Name = "writeLogToFileToolStripMenuItem";
this.writeLogToFileToolStripMenuItem.Size = new System.Drawing.Size(200, 22);
this.writeLogToFileToolStripMenuItem.Size = new System.Drawing.Size(288, 22);
this.writeLogToFileToolStripMenuItem.Text = "Write log to file";
this.writeLogToFileToolStripMenuItem.CheckedChanged += new System.EventHandler(this.writeLogToFileToolStripMenuItem_CheckedChanged);
//
// exportClassStructuresMenuItem
//
this.exportClassStructuresMenuItem.Name = "exportClassStructuresMenuItem";
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(200, 22);
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(288, 22);
this.exportClassStructuresMenuItem.Text = "Export class structures";
this.exportClassStructuresMenuItem.Click += new System.EventHandler(this.exportClassStructuresMenuItem_Click);
//
@ -1284,7 +1284,7 @@
this.goToSceneHierarchyToolStripMenuItem,
this.showOriginalFileToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(332, 246);
this.contextMenuStrip1.Size = new System.Drawing.Size(332, 224);
//
// copyToolStripMenuItem
//

View File

@ -1925,7 +1925,7 @@ namespace AssetStudioGUI
private void toolStripMenuItem15_Click(object sender, EventArgs e)
{
logger.ShowErrorMessage = toolStripMenuItem15.Checked;
logger.ShowDebugMessage = toolStripMenuItem15.Checked;
}
private void sceneTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)

View File

@ -9,7 +9,7 @@ namespace AssetStudioGUI
{
class GUILogger : ILogger
{
public bool ShowErrorMessage = false;
public bool ShowDebugMessage = false;
private bool IsFileLoggerRunning = false;
private string LoggerInitString;
private string FileLogName;
@ -123,6 +123,8 @@ namespace AssetStudioGUI
}
//Console logger
if (!ShowDebugMessage && loggerEvent == LoggerEvent.Debug)
return;
Console.WriteLine(FormatMessage(loggerEvent, message, toConsole: true));
//GUI logger
@ -132,14 +134,7 @@ namespace AssetStudioGUI
MessageBox.Show(message, "Error");
break;
case LoggerEvent.Warning:
if (ShowErrorMessage)
{
MessageBox.Show(message, "Warning");
}
else
{
action("An error has occurred. Turn on \"Show all error messages\" to see details next time.");
}
action("Some warnings occurred. See Console Logger for details.");
break;
case LoggerEvent.Debug:
break;

View File

@ -258,7 +258,7 @@ namespace CubismLive2DExtractor
}
else
{
Logger.Debug($"Exported {motions.Count} motion(s)");
Logger.Info($"Exported {motions.Count} motion(s)");
}
#endregion