Added logging.
This commit is contained in:
@@ -16,19 +16,21 @@ namespace AssetStudio
|
||||
|
||||
public interface ILogger
|
||||
{
|
||||
void Log(LoggerEvent loggerEvent, string message);
|
||||
string Log(LoggerEvent loggerEvent, string message);
|
||||
}
|
||||
|
||||
public sealed class DummyLogger : ILogger
|
||||
{
|
||||
public void Log(LoggerEvent loggerEvent, string message) { }
|
||||
public string Log(LoggerEvent loggerEvent, string message) => "";
|
||||
}
|
||||
|
||||
public sealed class ConsoleLogger : ILogger
|
||||
{
|
||||
public void Log(LoggerEvent loggerEvent, string message)
|
||||
public string Log(LoggerEvent loggerEvent, string message)
|
||||
{
|
||||
Console.WriteLine("[{0}] {1}", loggerEvent, message);
|
||||
var output = $"[{loggerEvent}] {message}";
|
||||
Console.WriteLine(output);
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -7,20 +8,90 @@ namespace AssetStudio
|
||||
{
|
||||
public static class Logger
|
||||
{
|
||||
public static ILogger Default = new DummyLogger();
|
||||
private static bool isDisposed = false;
|
||||
private static StreamWriter writer;
|
||||
|
||||
public static void Verbose(string message) => Default.Log(LoggerEvent.Verbose, message);
|
||||
public static void Debug(string message) => Default.Log(LoggerEvent.Debug, message);
|
||||
public static void Info(string message) => Default.Log(LoggerEvent.Info, message);
|
||||
public static void Warning(string message) => Default.Log(LoggerEvent.Warning, message);
|
||||
public static void Error(string message) => Default.Log(LoggerEvent.Error, message);
|
||||
public static ILogger Default = new DummyLogger();
|
||||
public static bool IsFileLogging = false;
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
if (!isDisposed)
|
||||
{
|
||||
writer.Dispose();
|
||||
isDisposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsFileInit()
|
||||
{
|
||||
if (IsFileLogging && writer == null)
|
||||
{
|
||||
var path = Path.Combine(Environment.CurrentDirectory, "logs.txt");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var prevPath = Path.Combine(Environment.CurrentDirectory, "logs-prev.txt");
|
||||
File.Copy(path, prevPath, true);
|
||||
File.Delete(path);
|
||||
}
|
||||
writer = File.CreateText(path);
|
||||
writer.AutoFlush = true;
|
||||
}
|
||||
return IsFileLogging;
|
||||
}
|
||||
|
||||
public static void Verbose(string message)
|
||||
{
|
||||
var msg = Default.Log(LoggerEvent.Verbose, message);
|
||||
if (IsFileInit())
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
public static void Debug(string message)
|
||||
{
|
||||
var msg = Default.Log(LoggerEvent.Debug, message);
|
||||
if (IsFileInit())
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
public static void Info(string message)
|
||||
{
|
||||
var msg = Default.Log(LoggerEvent.Info, message);
|
||||
if (IsFileInit())
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
public static void Warning(string message)
|
||||
{
|
||||
var msg = Default.Log(LoggerEvent.Warning, message);
|
||||
if (IsFileInit())
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
public static void Error(string message)
|
||||
{
|
||||
var msg = Default.Log(LoggerEvent.Error, message);
|
||||
if (IsFileInit())
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Error(string message, Exception e)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine(message);
|
||||
sb.AppendLine(e.ToString());
|
||||
Default.Log(LoggerEvent.Error, sb.ToString());
|
||||
var msg = Default.Log(LoggerEvent.Error, sb.ToString());
|
||||
if (IsFileLogging)
|
||||
{
|
||||
writer.WriteLine(msg);
|
||||
writer.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
99
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
99
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
@@ -92,16 +92,16 @@
|
||||
this.treeSearch = new System.Windows.Forms.TextBox();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.assetListView = new System.Windows.Forms.ListView();
|
||||
this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderContainer = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderPathID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderName = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnHeaderContainer = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnHeaderType = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnHeaderPathID = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnHeaderSize = new System.Windows.Forms.ColumnHeader();
|
||||
this.listSearch = new System.Windows.Forms.TextBox();
|
||||
this.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.classesListView = new System.Windows.Forms.ListView();
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
|
||||
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
|
||||
this.progressbarPanel = new System.Windows.Forms.Panel();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.tabControl2 = new System.Windows.Forms.TabControl();
|
||||
@@ -135,6 +135,7 @@
|
||||
this.exportAnimatorwithselectedAnimationClipMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.goToSceneHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.enableFileLogging = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
@@ -262,7 +263,8 @@
|
||||
this.enableResolveDependencies.Name = "enableResolveDependencies";
|
||||
this.enableResolveDependencies.Size = new System.Drawing.Size(225, 22);
|
||||
this.enableResolveDependencies.Text = "Enable resolve dependencies";
|
||||
this.enableResolveDependencies.ToolTipText = "Toggle the behaviour of loading assets.\nDisable to load file(s) without its dependencies.";
|
||||
this.enableResolveDependencies.ToolTipText = "Toggle the behaviour of loading assets.\nDisable to load file(s) without its depen" +
|
||||
"dencies.";
|
||||
this.enableResolveDependencies.CheckedChanged += new System.EventHandler(this.enableResolveDependencies_CheckedChanged);
|
||||
//
|
||||
// displayInfo
|
||||
@@ -287,7 +289,7 @@
|
||||
//
|
||||
// specifyUnityVersion
|
||||
//
|
||||
this.specifyUnityVersion.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
|
||||
this.specifyUnityVersion.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.specifyUnityVersion.Name = "specifyUnityVersion";
|
||||
this.specifyUnityVersion.Size = new System.Drawing.Size(100, 23);
|
||||
//
|
||||
@@ -559,7 +561,8 @@
|
||||
this.debugMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripMenuItem15,
|
||||
this.exportClassStructuresMenuItem,
|
||||
this.console});
|
||||
this.console,
|
||||
this.enableFileLogging});
|
||||
this.debugMenuItem.Name = "debugMenuItem";
|
||||
this.debugMenuItem.Size = new System.Drawing.Size(54, 20);
|
||||
this.debugMenuItem.Text = "Debug";
|
||||
@@ -604,14 +607,14 @@
|
||||
// buildCABMapToolStripMenuItem
|
||||
//
|
||||
this.buildCABMapToolStripMenuItem.Name = "buildCABMapToolStripMenuItem";
|
||||
this.buildCABMapToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.buildCABMapToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.buildCABMapToolStripMenuItem.Text = "Build CABMap";
|
||||
this.buildCABMapToolStripMenuItem.Click += new System.EventHandler(this.buildCABMapToolStripMenuItem_Click);
|
||||
//
|
||||
// buildAssetMapToolStripMenuItem
|
||||
//
|
||||
this.buildAssetMapToolStripMenuItem.Name = "buildAssetMapToolStripMenuItem";
|
||||
this.buildAssetMapToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||
this.buildAssetMapToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.buildAssetMapToolStripMenuItem.Text = "Build AssetMap";
|
||||
this.buildAssetMapToolStripMenuItem.Click += new System.EventHandler(this.buildAssetMapToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -657,9 +660,9 @@
|
||||
//
|
||||
this.tabPage1.Controls.Add(this.sceneTreeView);
|
||||
this.tabPage1.Controls.Add(this.treeSearch);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage1.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage1.Name = "tabPage1";
|
||||
this.tabPage1.Size = new System.Drawing.Size(472, 609);
|
||||
this.tabPage1.Size = new System.Drawing.Size(472, 607);
|
||||
this.tabPage1.TabIndex = 0;
|
||||
this.tabPage1.Text = "Scene Hierarchy";
|
||||
this.tabPage1.UseVisualStyleBackColor = true;
|
||||
@@ -681,7 +684,7 @@
|
||||
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.treeSearch.Location = new System.Drawing.Point(0, 0);
|
||||
this.treeSearch.Name = "treeSearch";
|
||||
this.treeSearch.Size = new System.Drawing.Size(472, 20);
|
||||
this.treeSearch.Size = new System.Drawing.Size(472, 23);
|
||||
this.treeSearch.TabIndex = 0;
|
||||
this.treeSearch.Text = " Search ";
|
||||
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
|
||||
@@ -693,9 +696,9 @@
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.assetListView);
|
||||
this.tabPage2.Controls.Add(this.listSearch);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Size = new System.Drawing.Size(472, 609);
|
||||
this.tabPage2.Size = new System.Drawing.Size(472, 607);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Asset List";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
@@ -712,9 +715,9 @@
|
||||
this.assetListView.FullRowSelect = true;
|
||||
this.assetListView.GridLines = true;
|
||||
this.assetListView.HideSelection = false;
|
||||
this.assetListView.Location = new System.Drawing.Point(0, 20);
|
||||
this.assetListView.Location = new System.Drawing.Point(0, 23);
|
||||
this.assetListView.Name = "assetListView";
|
||||
this.assetListView.Size = new System.Drawing.Size(472, 589);
|
||||
this.assetListView.Size = new System.Drawing.Size(472, 584);
|
||||
this.assetListView.TabIndex = 1;
|
||||
this.assetListView.UseCompatibleStateImageBehavior = false;
|
||||
this.assetListView.View = System.Windows.Forms.View.Details;
|
||||
@@ -754,7 +757,7 @@
|
||||
this.listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.listSearch.Location = new System.Drawing.Point(0, 0);
|
||||
this.listSearch.Name = "listSearch";
|
||||
this.listSearch.Size = new System.Drawing.Size(472, 20);
|
||||
this.listSearch.Size = new System.Drawing.Size(472, 23);
|
||||
this.listSearch.TabIndex = 0;
|
||||
this.listSearch.Text = " Filter ";
|
||||
this.listSearch.TextChanged += new System.EventHandler(this.ListSearchTextChanged);
|
||||
@@ -764,9 +767,9 @@
|
||||
// tabPage3
|
||||
//
|
||||
this.tabPage3.Controls.Add(this.classesListView);
|
||||
this.tabPage3.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage3.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage3.Name = "tabPage3";
|
||||
this.tabPage3.Size = new System.Drawing.Size(472, 609);
|
||||
this.tabPage3.Size = new System.Drawing.Size(472, 607);
|
||||
this.tabPage3.TabIndex = 2;
|
||||
this.tabPage3.Text = "Asset Classes";
|
||||
this.tabPage3.UseVisualStyleBackColor = true;
|
||||
@@ -782,7 +785,7 @@
|
||||
this.classesListView.Location = new System.Drawing.Point(0, 0);
|
||||
this.classesListView.MultiSelect = false;
|
||||
this.classesListView.Name = "classesListView";
|
||||
this.classesListView.Size = new System.Drawing.Size(472, 609);
|
||||
this.classesListView.Size = new System.Drawing.Size(472, 607);
|
||||
this.classesListView.TabIndex = 0;
|
||||
this.classesListView.UseCompatibleStateImageBehavior = false;
|
||||
this.classesListView.View = System.Windows.Forms.View.Details;
|
||||
@@ -834,9 +837,9 @@
|
||||
// tabPage4
|
||||
//
|
||||
this.tabPage4.Controls.Add(this.previewPanel);
|
||||
this.tabPage4.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage4.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage4.Name = "tabPage4";
|
||||
this.tabPage4.Size = new System.Drawing.Size(768, 607);
|
||||
this.tabPage4.Size = new System.Drawing.Size(768, 605);
|
||||
this.tabPage4.TabIndex = 0;
|
||||
this.tabPage4.Text = "Preview";
|
||||
this.tabPage4.UseVisualStyleBackColor = true;
|
||||
@@ -855,7 +858,7 @@
|
||||
this.previewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.previewPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.previewPanel.Name = "previewPanel";
|
||||
this.previewPanel.Size = new System.Drawing.Size(768, 607);
|
||||
this.previewPanel.Size = new System.Drawing.Size(768, 605);
|
||||
this.previewPanel.TabIndex = 1;
|
||||
this.previewPanel.Resize += new System.EventHandler(this.preview_Resize);
|
||||
//
|
||||
@@ -866,7 +869,7 @@
|
||||
this.assetInfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.assetInfoLabel.Location = new System.Drawing.Point(4, 7);
|
||||
this.assetInfoLabel.Name = "assetInfoLabel";
|
||||
this.assetInfoLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.assetInfoLabel.Size = new System.Drawing.Size(0, 15);
|
||||
this.assetInfoLabel.TabIndex = 0;
|
||||
//
|
||||
// FMODpanel
|
||||
@@ -885,7 +888,7 @@
|
||||
this.FMODpanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.FMODpanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.FMODpanel.Name = "FMODpanel";
|
||||
this.FMODpanel.Size = new System.Drawing.Size(768, 607);
|
||||
this.FMODpanel.Size = new System.Drawing.Size(768, 605);
|
||||
this.FMODpanel.TabIndex = 2;
|
||||
this.FMODpanel.Visible = false;
|
||||
//
|
||||
@@ -895,7 +898,7 @@
|
||||
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.FMODcopyright.Location = new System.Drawing.Point(214, 337);
|
||||
this.FMODcopyright.Name = "FMODcopyright";
|
||||
this.FMODcopyright.Size = new System.Drawing.Size(283, 13);
|
||||
this.FMODcopyright.Size = new System.Drawing.Size(316, 15);
|
||||
this.FMODcopyright.TabIndex = 9;
|
||||
this.FMODcopyright.Text = "Audio Engine supplied by FMOD by Firelight Technologies.";
|
||||
//
|
||||
@@ -905,7 +908,7 @@
|
||||
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODinfoLabel.Location = new System.Drawing.Point(269, 235);
|
||||
this.FMODinfoLabel.Name = "FMODinfoLabel";
|
||||
this.FMODinfoLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.FMODinfoLabel.Size = new System.Drawing.Size(0, 15);
|
||||
this.FMODinfoLabel.TabIndex = 8;
|
||||
//
|
||||
// FMODtimerLabel
|
||||
@@ -914,7 +917,7 @@
|
||||
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODtimerLabel.Location = new System.Drawing.Point(460, 235);
|
||||
this.FMODtimerLabel.Name = "FMODtimerLabel";
|
||||
this.FMODtimerLabel.Size = new System.Drawing.Size(78, 13);
|
||||
this.FMODtimerLabel.Size = new System.Drawing.Size(78, 15);
|
||||
this.FMODtimerLabel.TabIndex = 7;
|
||||
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0";
|
||||
//
|
||||
@@ -924,7 +927,7 @@
|
||||
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODstatusLabel.Location = new System.Drawing.Point(213, 235);
|
||||
this.FMODstatusLabel.Name = "FMODstatusLabel";
|
||||
this.FMODstatusLabel.Size = new System.Drawing.Size(47, 13);
|
||||
this.FMODstatusLabel.Size = new System.Drawing.Size(51, 15);
|
||||
this.FMODstatusLabel.TabIndex = 6;
|
||||
this.FMODstatusLabel.Text = "Stopped";
|
||||
//
|
||||
@@ -1001,14 +1004,14 @@
|
||||
this.fontPreviewBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.fontPreviewBox.Name = "fontPreviewBox";
|
||||
this.fontPreviewBox.ReadOnly = true;
|
||||
this.fontPreviewBox.Size = new System.Drawing.Size(768, 607);
|
||||
this.fontPreviewBox.Size = new System.Drawing.Size(768, 605);
|
||||
this.fontPreviewBox.TabIndex = 0;
|
||||
this.fontPreviewBox.Text = resources.GetString("fontPreviewBox.Text");
|
||||
this.fontPreviewBox.Visible = false;
|
||||
this.fontPreviewBox.WordWrap = false;
|
||||
//
|
||||
// glControl1
|
||||
//
|
||||
// glControl
|
||||
//
|
||||
this.glControl.API = OpenTK.Windowing.Common.ContextAPI.OpenGL;
|
||||
this.glControl.APIVersion = new System.Version(4, 6, 0, 0);
|
||||
this.glControl.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
@@ -1016,8 +1019,9 @@
|
||||
this.glControl.Flags = OpenTK.Windowing.Common.ContextFlags.Default;
|
||||
this.glControl.IsEventDriven = true;
|
||||
this.glControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.glControl.Name = "glControl1";
|
||||
this.glControl.Size = new System.Drawing.Size(768, 607);
|
||||
this.glControl.Name = "glControl";
|
||||
this.glControl.Profile = OpenTK.Windowing.Common.ContextProfile.Core;
|
||||
this.glControl.Size = new System.Drawing.Size(768, 605);
|
||||
this.glControl.TabIndex = 4;
|
||||
this.glControl.Visible = false;
|
||||
this.glControl.Load += new System.EventHandler(this.glControl1_Load);
|
||||
@@ -1030,13 +1034,13 @@
|
||||
// textPreviewBox
|
||||
//
|
||||
this.textPreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.textPreviewBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textPreviewBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.textPreviewBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.textPreviewBox.Multiline = true;
|
||||
this.textPreviewBox.Name = "textPreviewBox";
|
||||
this.textPreviewBox.ReadOnly = true;
|
||||
this.textPreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textPreviewBox.Size = new System.Drawing.Size(768, 607);
|
||||
this.textPreviewBox.Size = new System.Drawing.Size(768, 605);
|
||||
this.textPreviewBox.TabIndex = 2;
|
||||
this.textPreviewBox.Visible = false;
|
||||
this.textPreviewBox.WordWrap = false;
|
||||
@@ -1049,7 +1053,7 @@
|
||||
this.classTextBox.Name = "classTextBox";
|
||||
this.classTextBox.ReadOnly = true;
|
||||
this.classTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.classTextBox.Size = new System.Drawing.Size(768, 607);
|
||||
this.classTextBox.Size = new System.Drawing.Size(768, 605);
|
||||
this.classTextBox.TabIndex = 3;
|
||||
this.classTextBox.Visible = false;
|
||||
this.classTextBox.WordWrap = false;
|
||||
@@ -1057,9 +1061,9 @@
|
||||
// tabPage5
|
||||
//
|
||||
this.tabPage5.Controls.Add(this.dumpTextBox);
|
||||
this.tabPage5.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage5.Location = new System.Drawing.Point(4, 24);
|
||||
this.tabPage5.Name = "tabPage5";
|
||||
this.tabPage5.Size = new System.Drawing.Size(768, 607);
|
||||
this.tabPage5.Size = new System.Drawing.Size(768, 605);
|
||||
this.tabPage5.TabIndex = 1;
|
||||
this.tabPage5.Text = "Dump";
|
||||
this.tabPage5.UseVisualStyleBackColor = true;
|
||||
@@ -1072,7 +1076,7 @@
|
||||
this.dumpTextBox.Name = "dumpTextBox";
|
||||
this.dumpTextBox.ReadOnly = true;
|
||||
this.dumpTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.dumpTextBox.Size = new System.Drawing.Size(768, 607);
|
||||
this.dumpTextBox.Size = new System.Drawing.Size(768, 605);
|
||||
this.dumpTextBox.TabIndex = 0;
|
||||
this.dumpTextBox.WordWrap = false;
|
||||
//
|
||||
@@ -1157,6 +1161,14 @@
|
||||
this.showOriginalFileToolStripMenuItem.Visible = false;
|
||||
this.showOriginalFileToolStripMenuItem.Click += new System.EventHandler(this.showOriginalFileToolStripMenuItem_Click);
|
||||
//
|
||||
// enableFileLogging
|
||||
//
|
||||
this.enableFileLogging.CheckOnClick = true;
|
||||
this.enableFileLogging.Name = "enableFileLogging";
|
||||
this.enableFileLogging.Size = new System.Drawing.Size(191, 22);
|
||||
this.enableFileLogging.Text = "Enable file logging";
|
||||
this.enableFileLogging.CheckedChanged += new System.EventHandler(this.enableFileLogging_CheckedChanged);
|
||||
//
|
||||
// AssetStudioGUIForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
@@ -1312,6 +1324,7 @@
|
||||
private System.Windows.Forms.ToolStripComboBox specifyGame;
|
||||
private System.Windows.Forms.ToolStripMenuItem buildAssetMapToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem enableResolveDependencies;
|
||||
private System.Windows.Forms.ToolStripMenuItem enableFileLogging;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +128,8 @@ namespace AssetStudioGUI
|
||||
Logger.Default = logger;
|
||||
ConsoleHelper.ShowWindow(handle, ConsoleHelper.SW_HIDE);
|
||||
}
|
||||
enableFileLogging.Checked = Properties.Settings.Default.isFileLogging;
|
||||
Logger.IsFileLogging = Properties.Settings.Default.isFileLogging;
|
||||
Progress.Default = new Progress<int>(SetProgressBarValue);
|
||||
Studio.StatusStripUpdate = StatusStripUpdate;
|
||||
specifyGame.Items.AddRange(GameManager.GetGames());
|
||||
@@ -138,6 +140,10 @@ namespace AssetStudioGUI
|
||||
CABManager.LoadMap(Studio.Game);
|
||||
}
|
||||
|
||||
~AssetStudioGUIForm()
|
||||
{
|
||||
Logger.Dispose();
|
||||
}
|
||||
private void AssetStudioGUIForm_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
@@ -2214,6 +2220,14 @@ namespace AssetStudioGUI
|
||||
CABManager.LoadMap(Studio.Game);
|
||||
}
|
||||
|
||||
private void enableFileLogging_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.isFileLogging = enableFileLogging.Checked;
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
Logger.IsFileLogging = Properties.Settings.Default.isFileLogging;
|
||||
}
|
||||
|
||||
private void SpecifyAIVersionUpdate(bool value)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
|
||||
@@ -1,64 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AssetStudioGUI
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public void Log(LoggerEvent loggerEvent, string message)
|
||||
public string Log(LoggerEvent loggerEvent, string message)
|
||||
{
|
||||
switch (loggerEvent)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace AssetStudioGUI
|
||||
action(message);
|
||||
break;
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
AssetStudioGUI/Properties/Settings.Designer.cs
generated
15
AssetStudioGUI/Properties/Settings.Designer.cs
generated
@@ -491,5 +491,20 @@ namespace AssetStudioGUI.Properties
|
||||
this["exportAllUvsAsDiffuseMaps"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool isFileLogging
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((bool)(this["isFileLogging"]));
|
||||
}
|
||||
set
|
||||
{
|
||||
this["isFileLogging"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,5 +95,8 @@
|
||||
<Setting Name="enableResolveDependencies" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="isFileLogging" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
Reference in New Issue
Block a user