From be60d8d72fb5cab931031d9d545eca5bd10be6c8 Mon Sep 17 00:00:00 2001 From: bird_egop Date: Thu, 4 Sep 2025 03:13:46 +0300 Subject: [PATCH] Examples and fixes --- NResUI/ImGuiUI/CpDatSchemeExplorer.cs | 28 ++++++++++----------------- NResUI/ImGuiUI/MainMenuBar.cs | 2 +- NResUI/ImGuiUI/MissionTmaExplorer.cs | 3 +++ NResUI/ImGuiUI/NResExplorerPanel.cs | 3 +++ NResUI/ImGuiUI/ScrExplorer.cs | 3 +++ NResUI/ImGuiUI/TexmExplorer.cs | 3 +++ NResUI/ImGuiUI/VarsetExplorerPanel.cs | 3 +++ 7 files changed, 26 insertions(+), 19 deletions(-) diff --git a/NResUI/ImGuiUI/CpDatSchemeExplorer.cs b/NResUI/ImGuiUI/CpDatSchemeExplorer.cs index 7e3a90f..6c13c7e 100644 --- a/NResUI/ImGuiUI/CpDatSchemeExplorer.cs +++ b/NResUI/ImGuiUI/CpDatSchemeExplorer.cs @@ -1,8 +1,7 @@ -using CpDatLib; +using CpDatLib; using ImGuiNET; using NResUI.Abstractions; using NResUI.Models; -using ScrLib; namespace NResUI.ImGuiUI; @@ -19,6 +18,9 @@ public class CpDatSchemeExplorer : IImGuiPanel { if (ImGui.Begin("cp .dat Scheme Explorer")) { + ImGui.Text("cp .dat - это файл схема здания или робота. Их можно найти в папке UNITS"); + ImGui.Separator(); + var cpDat = _viewModel.CpDatScheme; if (_viewModel.HasFile && cpDat is not null) { @@ -32,8 +34,7 @@ public class CpDatSchemeExplorer : IImGuiPanel ImGui.Separator(); - if (ImGui.BeginTable("content", 7, - ImGuiTableFlags.Borders | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.NoHostExtendX)) + if (ImGui.BeginTable("content", 7, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.NoHostExtendX)) { ImGui.TableSetupColumn("Уровень вложенности"); ImGui.TableSetupColumn("Архив"); @@ -69,8 +70,7 @@ public class CpDatSchemeExplorer : IImGuiPanel void DrawEntry(CpDatEntry entry, int index) { - if (ImGui.TreeNodeEx( - $"Элемент: \"{entry.ArchiveFile}/{entry.ArchiveEntryName}\" - {entry.Description}##entry_{index}")) + if (ImGui.TreeNodeEx($"Элемент: \"{entry.ArchiveFile}/{entry.ArchiveEntryName}\" - {entry.Description}##entry_{index}")) { ImGui.Text("Magic1: "); ImGui.SameLine(); @@ -88,17 +88,9 @@ public class CpDatSchemeExplorer : IImGuiPanel ImGui.SameLine(); ImGui.Text(entry.ChildCount.ToString()); - if (entry.Children.Count > 0) + foreach (var child in entry.Children) { - if (ImGui.TreeNodeEx("Дочерние элементы")) - { - foreach (var child in entry.Children) - { - DrawEntry(child, ++index); - } - - ImGui.TreePop(); - } + DrawEntry(child, ++index); } ImGui.TreePop(); @@ -113,8 +105,8 @@ public class CpDatSchemeExplorer : IImGuiPanel { ImGui.Text("cp .dat не открыт"); } - - ImGui.End(); } + + ImGui.End(); } } \ No newline at end of file diff --git a/NResUI/ImGuiUI/MainMenuBar.cs b/NResUI/ImGuiUI/MainMenuBar.cs index 704eb17..bd54813 100644 --- a/NResUI/ImGuiUI/MainMenuBar.cs +++ b/NResUI/ImGuiUI/MainMenuBar.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; using CpDatLib; using ImGuiNET; using MissionTmaLib; diff --git a/NResUI/ImGuiUI/MissionTmaExplorer.cs b/NResUI/ImGuiUI/MissionTmaExplorer.cs index ffa1fbe..7b77318 100644 --- a/NResUI/ImGuiUI/MissionTmaExplorer.cs +++ b/NResUI/ImGuiUI/MissionTmaExplorer.cs @@ -18,6 +18,9 @@ public class MissionTmaExplorer : IImGuiPanel { if (ImGui.Begin("Mission TMA Explorer")) { + ImGui.Text("data.tma - это файл миссии. Его можно найти в папке MISSIONS"); + ImGui.Separator(); + var mission = _viewModel.Mission; if (_viewModel.HasFile && mission is not null) { diff --git a/NResUI/ImGuiUI/NResExplorerPanel.cs b/NResUI/ImGuiUI/NResExplorerPanel.cs index 173d0e7..21fe34a 100644 --- a/NResUI/ImGuiUI/NResExplorerPanel.cs +++ b/NResUI/ImGuiUI/NResExplorerPanel.cs @@ -17,6 +17,9 @@ public class NResExplorerPanel : IImGuiPanel { if (ImGui.Begin("NRes Explorer")) { + ImGui.Text("NRes - это файл-архив. Они имеют разные расширения. Примеры - Textures.lib, weapon.rlb, object.dlb, behpsp.res"); + ImGui.Separator(); + if (!_viewModel.HasFile) { ImGui.Text("No NRes is opened"); diff --git a/NResUI/ImGuiUI/ScrExplorer.cs b/NResUI/ImGuiUI/ScrExplorer.cs index bc56942..e444d7e 100644 --- a/NResUI/ImGuiUI/ScrExplorer.cs +++ b/NResUI/ImGuiUI/ScrExplorer.cs @@ -18,6 +18,9 @@ public class ScrExplorer : IImGuiPanel { if (ImGui.Begin("SCR Explorer")) { + ImGui.Text("scr - это файл AI скриптов. Их можно найти в папке MISSIONS/SCRIPTS"); + ImGui.Separator(); + var scr = _viewModel.Scr; if (_viewModel.HasFile && scr is not null) { diff --git a/NResUI/ImGuiUI/TexmExplorer.cs b/NResUI/ImGuiUI/TexmExplorer.cs index 4901887..3118b2f 100644 --- a/NResUI/ImGuiUI/TexmExplorer.cs +++ b/NResUI/ImGuiUI/TexmExplorer.cs @@ -21,6 +21,9 @@ public class TexmExplorer : IImGuiPanel { if (ImGui.Begin("TEXM Explorer")) { + ImGui.Text("TEXM - это файл текстуры. Их можно найти внутри NRes архивов, например Textures.lib"); + ImGui.Separator(); + if (!_viewModel.HasFile) { ImGui.Text("No TEXM opened"); diff --git a/NResUI/ImGuiUI/VarsetExplorerPanel.cs b/NResUI/ImGuiUI/VarsetExplorerPanel.cs index 9818f4a..8c9f988 100644 --- a/NResUI/ImGuiUI/VarsetExplorerPanel.cs +++ b/NResUI/ImGuiUI/VarsetExplorerPanel.cs @@ -17,6 +17,9 @@ public class VarsetExplorerPanel : IImGuiPanel { if (ImGui.Begin("VARSET Explorer")) { + ImGui.Text(".var - это файл динамических настроек. Можно найти в MISSIONS/SCRIPTS/varset.var, а также внутри behpsp.res"); + ImGui.Separator(); + if (_viewModel.Items.Count == 0) { ImGui.Text("VARSET не загружен");