diff --git a/NResUI/ImGuiUI/ScrExplorer.cs b/NResUI/ImGuiUI/ScrExplorer.cs index f064f8b..d7cff2f 100644 --- a/NResUI/ImGuiUI/ScrExplorer.cs +++ b/NResUI/ImGuiUI/ScrExplorer.cs @@ -46,10 +46,10 @@ public class ScrExplorer : IImGuiPanel if (ImGui.BeginTable($"Элементы##{i:0000}", 8, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.NoHostExtendX)) { - ImGui.TableSetupColumn("Индекс скрипта"); + ImGui.TableSetupColumn("Индекс встроенного скрипта"); ImGui.TableSetupColumn("UnkInner2"); ImGui.TableSetupColumn("UnkInner3"); - ImGui.TableSetupColumn("UnkInner4"); + ImGui.TableSetupColumn("Тип скрипта"); ImGui.TableSetupColumn("UnkInner5"); ImGui.TableSetupColumn("Кол-во аргументов"); ImGui.TableSetupColumn("Аргументы"); @@ -67,7 +67,7 @@ public class ScrExplorer : IImGuiPanel ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner3.ToString()); ImGui.TableNextColumn(); - ImGui.Text(inner.UnkInner4.ToString()); + ImGui.Text(inner.Type.ToString()); ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner5.ToString()); ImGui.TableNextColumn(); diff --git a/ParkanPlayground/Extensions.cs b/ParkanPlayground/Extensions.cs deleted file mode 100644 index 0897333..0000000 --- a/ParkanPlayground/Extensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Buffers.Binary; -using System.Text; - -namespace ParkanPlayground; - -public static class Extensions -{ - public static int ReadInt32LittleEndian(this FileStream fs) - { - Span buf = stackalloc byte[4]; - fs.ReadExactly(buf); - - return BinaryPrimitives.ReadInt32LittleEndian(buf); - } - - public static float ReadFloatLittleEndian(this FileStream fs) - { - Span buf = stackalloc byte[4]; - fs.ReadExactly(buf); - - return BinaryPrimitives.ReadSingleLittleEndian(buf); - } - - public static string ReadLengthPrefixedString(this FileStream fs) - { - var len = fs.ReadInt32LittleEndian(); - - if (len == 0) - { - return ""; - } - - var buffer = new byte[len]; - - fs.ReadExactly(buffer, 0, len); - - return Encoding.ASCII.GetString(buffer, 0, len); - } -} \ No newline at end of file diff --git a/ScrLib/ScrFile.cs b/ScrLib/ScrFile.cs index 1ff618d..57371e5 100644 --- a/ScrLib/ScrFile.cs +++ b/ScrLib/ScrFile.cs @@ -6,9 +6,9 @@ public class ScrFile /// тут всегда число 59 (0x3b) - это число известных игре скриптов /// public int Magic { get; set; } - + public int EntryCount { get; set; } - + public List Entries { get; set; } } @@ -17,7 +17,7 @@ public class ScrEntry public string Title { get; set; } public int Index { get; set; } - + public int InnerCount { get; set; } public List Inners { get; set; } @@ -32,7 +32,15 @@ public class ScrEntryInner public int UnkInner2 { get; set; } public int UnkInner3 { get; set; } - public int UnkInner4 { get; set; } + + /// + /// 0,1,2,3,4,5,6,-1 + /// + /// + /// 1 - неизвестно + /// 2 - noop + public int Type { get; set; } + public int UnkInner5 { get; set; } public int ArgumentsCount { get; set; } diff --git a/ScrLib/ScrParser.cs b/ScrLib/ScrParser.cs index c8b0b0a..31abe29 100644 --- a/ScrLib/ScrParser.cs +++ b/ScrLib/ScrParser.cs @@ -31,7 +31,7 @@ public class ScrParser entryInner.UnkInner2 = fs.ReadInt32LittleEndian(); entryInner.UnkInner3 = fs.ReadInt32LittleEndian(); - entryInner.UnkInner4 = fs.ReadInt32LittleEndian(); + entryInner.Type = fs.ReadInt32LittleEndian(); entryInner.UnkInner5 = fs.ReadInt32LittleEndian(); entryInner.ArgumentsCount = fs.ReadInt32LittleEndian();