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