From 867a5de016b85b3102ccfd09c5549446c791a924 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 30 Apr 2024 08:42:11 +0200 Subject: [PATCH] Restore old TabItem function with byte* string (#1797) * Restore old TabItem function with byte* strinf * typo --- Dalamud/Interface/Utility/Raii/EndObjects.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Utility/Raii/EndObjects.cs b/Dalamud/Interface/Utility/Raii/EndObjects.cs index 082ac217c..3377b51bc 100644 --- a/Dalamud/Interface/Utility/Raii/EndObjects.cs +++ b/Dalamud/Interface/Utility/Raii/EndObjects.cs @@ -104,9 +104,12 @@ public static partial class ImRaii public static IEndObject TabItem(string label) => new EndConditionally(ImGui.EndTabItem, ImGui.BeginTabItem(label)); + public static unsafe IEndObject TabItem(byte* label, ImGuiTabItemFlags flags) + => new EndConditionally(ImGuiNative.igEndTabItem, ImGuiNative.igBeginTabItem(label, null, flags) != 0); + public static unsafe IEndObject TabItem(string label, ImGuiTabItemFlags flags) { - // I am so sorry for this. + // One-off for now, we should make this into a generic solution if we need it more often const int ImGuiNET_Util_StackAllocationSizeLimit = 2048; byte* native_label;