From 8c4fc8f09626bf30d35454fad806230f3a823979 Mon Sep 17 00:00:00 2001 From: bird_egop Date: Wed, 5 Mar 2025 18:15:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=B8=20=D0=B8=20=D0=B4=D0=BE=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20?= =?UTF-8?q?=D0=B8=D0=B7=D1=8B=D1=81=D0=BA=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MissionTmaLib/ClanInfo.cs | 2 +- MissionTmaLib/Parsing/MissionTmaParser.cs | 2 +- NResUI/ImGuiUI/MissionTmaExplorer.cs | 10 ++--- NResUI/ImGuiUI/ScrExplorer.cs | 52 +++++++++++++++++++++-- ScrLib/ScrFile.cs | 23 +++++++--- ScrLib/ScrParser.cs | 2 +- 6 files changed, 73 insertions(+), 18 deletions(-) diff --git a/MissionTmaLib/ClanInfo.cs b/MissionTmaLib/ClanInfo.cs index b53955c..9067a92 100644 --- a/MissionTmaLib/ClanInfo.cs +++ b/MissionTmaLib/ClanInfo.cs @@ -20,7 +20,7 @@ public class ClanInfo /// Игра называет этот путь TreeName /// public string ResearchNResPath { get; set; } - public int UnkInt3 { get; set; } + public int Brains { get; set; } public int AlliesMapCount { get; set; } /// diff --git a/MissionTmaLib/Parsing/MissionTmaParser.cs b/MissionTmaLib/Parsing/MissionTmaParser.cs index 03abcd3..e324aba 100644 --- a/MissionTmaLib/Parsing/MissionTmaParser.cs +++ b/MissionTmaLib/Parsing/MissionTmaParser.cs @@ -118,7 +118,7 @@ public class MissionTmaParser if (4 < clanFeatureSet) { - clanTreeInfo.UnkInt3 = fileStream.ReadInt32LittleEndian(); + clanTreeInfo.Brains = fileStream.ReadInt32LittleEndian(); } if (5 < clanFeatureSet) diff --git a/NResUI/ImGuiUI/MissionTmaExplorer.cs b/NResUI/ImGuiUI/MissionTmaExplorer.cs index 5257e41..ffa1fbe 100644 --- a/NResUI/ImGuiUI/MissionTmaExplorer.cs +++ b/NResUI/ImGuiUI/MissionTmaExplorer.cs @@ -132,7 +132,7 @@ public class MissionTmaExplorer : IImGuiPanel ImGui.SameLine(); ImGui.Text(clanInfo.ClanType.ToReadableString()); - ImGui.Text("Скрипты поведения: "); + ImGui.Text("Скрипты поведения (Mission Scripts): "); Utils.ShowHint("Пути к файлам .scr и .fml описывающих настройку объектов и поведение AI"); ImGui.SameLine(); ImGui.Text(clanInfo.ScriptsString); @@ -176,14 +176,14 @@ public class MissionTmaExplorer : IImGuiPanel ImGui.Text("Отсутствует неизвестная часть"); } - ImGui.Text("Путь к файлу .trf: "); - Utils.ShowHint("Не до конца понятно, что означает, вероятно это NRes с деревом исследований"); + ImGui.Text("Дерево исследований: "); + Utils.ShowHint("NRes с деревом исследований"); ImGui.SameLine(); ImGui.Text(clanInfo.ResearchNResPath); - ImGui.Text("Неизвестное число 3: "); + ImGui.Text("Количество мозгов (Brains))): "); ImGui.SameLine(); - ImGui.Text(clanInfo.UnkInt3.ToString()); + ImGui.Text(clanInfo.Brains.ToString()); ImGui.Text("Матрица союзников"); Utils.ShowHint("Если 1, то кланы - союзники, и не нападают друг на друга"); diff --git a/NResUI/ImGuiUI/ScrExplorer.cs b/NResUI/ImGuiUI/ScrExplorer.cs index d7cff2f..bc56942 100644 --- a/NResUI/ImGuiUI/ScrExplorer.cs +++ b/NResUI/ImGuiUI/ScrExplorer.cs @@ -1,6 +1,7 @@ using ImGuiNET; using NResUI.Abstractions; using NResUI.Models; +using ScrLib; namespace NResUI.ImGuiUI; @@ -49,7 +50,7 @@ public class ScrExplorer : IImGuiPanel ImGui.TableSetupColumn("Индекс встроенного скрипта"); ImGui.TableSetupColumn("UnkInner2"); ImGui.TableSetupColumn("UnkInner3"); - ImGui.TableSetupColumn("Тип скрипта"); + ImGui.TableSetupColumn("Тип действия"); ImGui.TableSetupColumn("UnkInner5"); ImGui.TableSetupColumn("Кол-во аргументов"); ImGui.TableSetupColumn("Аргументы"); @@ -62,21 +63,66 @@ public class ScrExplorer : IImGuiPanel ImGui.TableNextRow(); ImGui.TableNextColumn(); ImGui.Text(inner.ScriptIndex.ToString()); + + if (inner.ScriptIndex == 2) + { + Utils.ShowHint("Первый аргумент - номер проблемы"); + } + + if (inner.ScriptIndex == 4) + { + Utils.ShowHint("Первый аргумент - номер проблемы"); + } + + if (inner.ScriptIndex == 8) + { + Utils.ShowHint("Установить dCurrentProblem стейт (VARSET:arg0)"); + } + + if (inner.ScriptIndex == 20) + { + Utils.ShowHint("Первый аргумент - номер проблемы"); + } + ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner2.ToString()); ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner3.ToString()); ImGui.TableNextColumn(); - ImGui.Text(inner.Type.ToString()); + ImGui.Text($"{(int) inner.Type}: {inner.Type:G}"); + if (inner.Type == ScrEntryInnerType._0) + { + Utils.ShowHint("0 обязан иметь аргументы"); + } + + if (inner.Type == ScrEntryInnerType.CheckInternalState) + { + Utils.ShowHint("Для 5 вообще не нужны данные, игра проверяет внутренний стейт"); + } + + if (inner.Type == ScrEntryInnerType.SetVarsetValue) + { + Utils.ShowHint("В случае 6, игра берёт UnkInner2 (индекс в Varset) и устанавливает ему значение UnkInner3"); + } + ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner5.ToString()); ImGui.TableNextColumn(); ImGui.Text(inner.ArgumentsCount.ToString()); ImGui.TableNextColumn(); - ImGui.Text(string.Join(", ", inner.Arguments)); + foreach (var argument in inner.Arguments) + { + if (ImGui.Button(argument.ToString())) + { + } + + ImGui.SameLine(); + } + ImGui.TableNextColumn(); ImGui.Text(inner.UnkInner7.ToString()); } + ImGui.EndTable(); } diff --git a/ScrLib/ScrFile.cs b/ScrLib/ScrFile.cs index 57371e5..11997e9 100644 --- a/ScrLib/ScrFile.cs +++ b/ScrLib/ScrFile.cs @@ -33,13 +33,7 @@ public class ScrEntryInner public int UnkInner2 { get; set; } public int UnkInner3 { get; set; } - /// - /// 0,1,2,3,4,5,6,-1 - /// - /// - /// 1 - неизвестно - /// 2 - noop - public int Type { get; set; } + public ScrEntryInnerType Type { get; set; } public int UnkInner5 { get; set; } @@ -48,4 +42,19 @@ public class ScrEntryInner public List Arguments { get; set; } public int UnkInner7 { get; set; } +} + +public enum ScrEntryInnerType +{ + Unspecified = -1, + _0 = 0, + _1 = 1, + _2 = 2, + _3 = 3, + _4 = 4, + CheckInternalState = 5, + /// + /// В случае 6, игра берёт UnkInner2 (индекс в Varset) и устанавливает ему значение UnkInner3 + /// + SetVarsetValue = 6, } \ No newline at end of file diff --git a/ScrLib/ScrParser.cs b/ScrLib/ScrParser.cs index 31abe29..78d20c0 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.Type = fs.ReadInt32LittleEndian(); + entryInner.Type = (ScrEntryInnerType)fs.ReadInt32LittleEndian(); entryInner.UnkInner5 = fs.ReadInt32LittleEndian(); entryInner.ArgumentsCount = fs.ReadInt32LittleEndian();