mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-05-18 11:21:18 +03:00
scr reversed type
This commit is contained in:
parent
d7eb23e9e0
commit
76ef68635e
@ -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();
|
||||
|
@ -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<byte> buf = stackalloc byte[4];
|
||||
fs.ReadExactly(buf);
|
||||
|
||||
return BinaryPrimitives.ReadInt32LittleEndian(buf);
|
||||
}
|
||||
|
||||
public static float ReadFloatLittleEndian(this FileStream fs)
|
||||
{
|
||||
Span<byte> 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);
|
||||
}
|
||||
}
|
@ -6,9 +6,9 @@ public class ScrFile
|
||||
/// тут всегда число 59 (0x3b) - это число известных игре скриптов
|
||||
/// </summary>
|
||||
public int Magic { get; set; }
|
||||
|
||||
|
||||
public int EntryCount { get; set; }
|
||||
|
||||
|
||||
public List<ScrEntry> 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<ScrEntryInner> 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; }
|
||||
|
||||
/// <summary>
|
||||
/// 0,1,2,3,4,5,6,-1
|
||||
/// </summary>
|
||||
///
|
||||
/// <para>1 - неизвестно</para>
|
||||
/// <para>2 - noop</para>
|
||||
public int Type { get; set; }
|
||||
|
||||
public int UnkInner5 { get; set; }
|
||||
|
||||
public int ArgumentsCount { get; set; }
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user