0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-09-13 18:20:30 +03:00
Files
ParkanPlayground/NResUI/ImGuiUI/VarsetExplorerPanel.cs
2025-09-04 03:13:46 +03:00

60 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using ImGuiNET;
using NResUI.Abstractions;
using NResUI.Models;
namespace NResUI.ImGuiUI;
public class VarsetExplorerPanel : IImGuiPanel
{
private readonly VarsetViewModel _viewModel;
public VarsetExplorerPanel(VarsetViewModel viewModel)
{
_viewModel = viewModel;
}
public void OnImGuiRender()
{
if (ImGui.Begin("VARSET Explorer"))
{
ImGui.Text(".var - это файл динамических настроек. Можно найти в MISSIONS/SCRIPTS/varset.var, а также внутри behpsp.res");
ImGui.Separator();
if (_viewModel.Items.Count == 0)
{
ImGui.Text("VARSET не загружен");
}
else
{
if (ImGui.BeginTable($"varset", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.NoHostExtendX))
{
ImGui.TableSetupColumn("Индекс");
ImGui.TableSetupColumn("Тип");
ImGui.TableSetupColumn("Имя");
ImGui.TableSetupColumn("Значение");
ImGui.TableHeadersRow();
for (int j = 0; j < _viewModel.Items.Count; j++)
{
var item = _viewModel.Items[j];
ImGui.TableNextRow();
ImGui.TableNextColumn();
ImGui.Text(j.ToString());
ImGui.TableNextColumn();
ImGui.Text(item.Type);
ImGui.TableNextColumn();
ImGui.Text(item.Name);
ImGui.TableNextColumn();
ImGui.Text(item.Value);
}
ImGui.EndTable();
}
ImGui.TreePop();
}
ImGui.End();
}
}
}