0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-05-18 19:31:17 +03:00
ParkanPlayground/NResUI/ImGuiUI/MessageBoxModalPanel.cs

33 lines
636 B
C#
Raw Normal View History

2024-11-15 20:29:02 +03:00
using System.Numerics;
using ImGuiNET;
using NResUI.Abstractions;
namespace NResUI.ImGuiUI;
public class MessageBoxModalPanel : ImGuiModalPanel
{
private string? _text;
protected override string ImGuiId { get; } = "#message-box";
public MessageBoxModalPanel()
{
WindowSize = new Vector2(300, 150);
}
public void Show(string? text)
{
_text = text;
base.Open();
}
protected override void OnImGuiRenderContent()
{
ImGui.Text(_text);
ImGui.Spacing();
if (ImGui.Button("Ок"))
{
ImGui.CloseCurrentPopup();
}
}
}