quantum-space-buddies/QSB/Tools/TranslatorTool/TranslationSync/Patches/SpiralPatches.cs
2022-03-02 19:46:33 -08:00

31 lines
738 B
C#

using HarmonyLib;
using QSB.Messaging;
using QSB.Patches;
using QSB.Tools.TranslatorTool.TranslationSync.Messages;
using QSB.Tools.TranslatorTool.TranslationSync.WorldObjects;
using QSB.WorldSync;
namespace QSB.Tools.TranslatorTool.TranslationSync.Patches;
internal class SpiralPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
[HarmonyPrefix]
[HarmonyPatch(typeof(NomaiText), nameof(NomaiText.SetAsTranslated))]
public static void SetAsTranslated(NomaiText __instance, int id)
{
if (__instance is GhostWallText)
{
return;
}
if (__instance.IsTranslated(id))
{
return;
}
__instance.GetWorldObject<QSBNomaiText>()
.SendMessage(new SetAsTranslatedMessage(id));
}
}