Remove goto
This commit is contained in:
@@ -300,19 +300,13 @@ internal unsafe class GameFunctions : IDisposable
|
||||
|
||||
private nint ResolveTextCommandPlaceholderDetour(nint a1, byte* placeholderText, byte a3, byte a4)
|
||||
{
|
||||
if (ReplacementName == null)
|
||||
goto Original;
|
||||
|
||||
var placeholder = MemoryHelper.ReadStringNullTerminated((nint) placeholderText);
|
||||
if (placeholder != Placeholder)
|
||||
goto Original;
|
||||
if (ReplacementName == null || placeholder != Placeholder)
|
||||
return ResolveTextCommandPlaceholderHook!.Original(a1, placeholderText, a3, a4);
|
||||
|
||||
MemoryHelper.WriteString(PlaceholderNamePtr, ReplacementName);
|
||||
ReplacementName = null;
|
||||
|
||||
return PlaceholderNamePtr;
|
||||
|
||||
Original:
|
||||
return ResolveTextCommandPlaceholderHook!.Original(a1, placeholderText, a3, a4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
|
||||
using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload;
|
||||
|
||||
namespace ChatTwo.Ui;
|
||||
@@ -64,7 +65,7 @@ public class SeStringDebugger : Window
|
||||
ImGui.TextUnformatted("Nothing to show");
|
||||
}
|
||||
|
||||
private static void ProcessPayloads(List<Payload> payloads)
|
||||
private void ProcessPayloads(List<Payload> payloads)
|
||||
{
|
||||
foreach (var payload in payloads)
|
||||
{
|
||||
@@ -152,6 +153,7 @@ public class SeStringDebugger : Window
|
||||
RenderMetadataDictionary("Link AutoTranslatePayload", new Dictionary<string, string?>
|
||||
{
|
||||
{ "Text", at.Text },
|
||||
{ "Data", string.Join(" ", at.Encode().Select(b => b.ToString("X2"))) },
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user