mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-23 04:53:09 +00:00
Fix null types when clicked on in byaml editor
This commit is contained in:
parent
589198eb3a
commit
a3b9d1363c
6 changed files with 25 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -5,13 +5,17 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using Switch_Toolbox.Library.IO;
|
||||
using Syroot.BinaryData;
|
||||
using System.IO;
|
||||
|
||||
namespace FirstPlugin
|
||||
{
|
||||
public class SAHT
|
||||
{
|
||||
public SAHT(string FileName) {
|
||||
Read(new FileReader(FileName));
|
||||
public string FileName { get; set; }
|
||||
|
||||
public SAHT(string fileName) {
|
||||
FileName = fileName;
|
||||
Read(new FileReader(fileName));
|
||||
}
|
||||
|
||||
public List<HashEntry> HashEntries = new List<HashEntry>();
|
||||
|
@ -32,10 +36,19 @@ namespace FirstPlugin
|
|||
HashEntries.Add(entry);
|
||||
}
|
||||
|
||||
ToTextFile();
|
||||
}
|
||||
|
||||
public void ToTextFile()
|
||||
{
|
||||
StringWriter writer = new StringWriter();
|
||||
|
||||
foreach (var entry in HashEntries)
|
||||
{
|
||||
Console.WriteLine(entry.Hash + " " + entry.Name);
|
||||
writer.WriteLine($"{entry.Name}={entry.Hash.ToString("x")}");
|
||||
}
|
||||
|
||||
File.WriteAllText(FileName + ".txt", writer.ToString());
|
||||
}
|
||||
|
||||
public class HashEntry
|
||||
|
|
|
@ -184,11 +184,18 @@ namespace FirstPlugin
|
|||
}
|
||||
|
||||
string ValueText = (k == null ? "<NULL>" : k.ToString());
|
||||
string ValueTypeString = "";
|
||||
|
||||
Type ValueType = k.GetType();
|
||||
if (k == null)
|
||||
ValueTypeString = "NULL";
|
||||
else
|
||||
{
|
||||
Type ValueType = k.GetType();
|
||||
ValueTypeString = ValueType.ToString();
|
||||
}
|
||||
|
||||
ListViewItem item = new ListViewItem(ValueText);
|
||||
item.SubItems.Add(ValueType.ToString());
|
||||
item.SubItems.Add(ValueTypeString);
|
||||
item.SubItems.Add(ValueText);
|
||||
|
||||
listViewCustom1.Items.Add(item);
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue