diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index bb88c66e..23782161 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 0e7e6cda..1a827acd 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index b4ae87cb..c8a9e6d3 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/Byaml/BYAML.cs b/Switch_FileFormatsMain/FileFormats/Byaml/BYAML.cs index 598076ed..3a8e18e8 100644 --- a/Switch_FileFormatsMain/FileFormats/Byaml/BYAML.cs +++ b/Switch_FileFormatsMain/FileFormats/Byaml/BYAML.cs @@ -25,6 +25,10 @@ namespace FirstPlugin { using (var reader = new Switch_Toolbox.Library.IO.FileReader(stream, true)) { + //File too small to have any data + if (stream.Length <= 16) + return false; + if (reader.CheckSignature(2, "BY") || reader.CheckSignature(2, "YB")) return true; else diff --git a/Switch_FileFormatsMain/GUI/Byaml/ByamlEditor.cs b/Switch_FileFormatsMain/GUI/Byaml/ByamlEditor.cs index 691cca2a..9cf21adf 100644 --- a/Switch_FileFormatsMain/GUI/Byaml/ByamlEditor.cs +++ b/Switch_FileFormatsMain/GUI/Byaml/ByamlEditor.cs @@ -182,6 +182,8 @@ namespace FirstPlugin { foreach (dynamic k in list) { + Console.WriteLine("array item " + k.ToString()); + if ((k is Dictionary) || (k is List) || (k is List)) @@ -200,9 +202,11 @@ namespace FirstPlugin ValueTypeString = ValueType.ToString(); } + ListViewItem item = new ListViewItem(ValueText); item.SubItems.Add(ValueTypeString); item.SubItems.Add(ValueText); + if (k != null) item.Tag = new EditableNode(k, k); listViewCustom1.Items.Add(item); } @@ -226,13 +230,13 @@ namespace FirstPlugin { current.Text += $" : {dictionaryIndex++}"; current.Tag = node[k]; - // current.Nodes.Add("✯✯dummy✯✯"); //a text that can't be in a byml + current.Nodes.Add("✯✯dummy✯✯"); //a text that can't be in a byml } else if (node[k] is IList) { current.Text += $" : {arrayIndex++}"; current.Tag = ((IList)node[k]); - // current.Nodes.Add("✯✯dummy✯✯"); + current.Nodes.Add("✯✯dummy✯✯"); } else if (node[k] is IList) { @@ -273,13 +277,12 @@ namespace FirstPlugin { TreeNode current = addto.Add($" {dictionaryIndex++}"); current.Tag = ((IDictionary)k); - // current.Nodes.Add("✯✯dummy✯✯"); + current.Nodes.Add("✯✯dummy✯✯"); } else if (k is IList) { TreeNode current = addto.Add($" {arrayIndex++}"); current.Tag = ((IList)k); - // current.Nodes.Add("✯✯dummy✯✯"); } else if (k is IList) { diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 02e5262d..e9fcfc59 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ