Skip to content

Commit

Permalink
Fixed chat shadow transpiler
Browse files Browse the repository at this point in the history
  • Loading branch information
18107 committed Aug 27, 2021
1 parent 6868afc commit f2119fc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions PulsarPluginLoader/Chat/Extensions/HarmonyHandleChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,32 @@ static void Postfix(PLInGameUI __instance, ref string __state)
//Fixes shadow in currently typing
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
/*
if (PLNetworkManager.Instance.IsTyping)
{
stringBuilder2.Append(PLLocalize.Localize("Say: ", false));
stringBuilder2.Append(PLNetworkManager.Instance.CurrentChatText);
*/
List<CodeInstruction> targetSequence = new List<CodeInstruction>()
{
new CodeInstruction(OpCodes.Brfalse_S),
new CodeInstruction(OpCodes.Ldloc_S),
new CodeInstruction(OpCodes.Ldstr),
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Call),
new CodeInstruction(OpCodes.Callvirt),
new CodeInstruction(OpCodes.Pop),
new CodeInstruction(OpCodes.Ldloc_S),
new CodeInstruction(OpCodes.Ldsfld),
new CodeInstruction(OpCodes.Ldfld)
};

/*
if (PLNetworkManager.Instance.IsTyping)
{
stringBuilder2.Append(PLLocalize.Localize("Say: ", false));
stringBuilder2.Append(HarmonyColoredMessage.RemoveColor(PLNetworkManager.Instance.CurrentChatText));
*/
List<CodeInstruction> injectedSequence = new List<CodeInstruction>()
{
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(HarmonyColoredMessage), "RemoveColor"))
Expand Down

0 comments on commit f2119fc

Please sign in to comment.