31 lines
738 B
C#
Raw Normal View History

using HarmonyLib;
2021-12-24 21:39:32 -08:00
using QSB.Messaging;
using QSB.Patches;
2021-12-24 21:39:32 -08:00
using QSB.Tools.TranslatorTool.TranslationSync.Messages;
2021-11-25 15:25:17 +00:00
using QSB.Tools.TranslatorTool.TranslationSync.WorldObjects;
2021-02-24 10:45:25 +00:00
using QSB.WorldSync;
2022-03-02 19:46:33 -08:00
namespace QSB.Tools.TranslatorTool.TranslationSync.Patches;
internal class SpiralPatches : QSBPatch
{
2022-03-02 19:46:33 -08:00
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
2021-06-18 22:38:32 +01:00
2022-03-02 19:46:33 -08:00
[HarmonyPrefix]
[HarmonyPatch(typeof(NomaiText), nameof(NomaiText.SetAsTranslated))]
public static void SetAsTranslated(NomaiText __instance, int id)
{
if (__instance is GhostWallText)
{
2022-03-02 19:46:33 -08:00
return;
}
2022-03-02 19:46:33 -08:00
if (__instance.IsTranslated(id))
{
return;
}
2022-03-02 19:46:33 -08:00
__instance.GetWorldObject<QSBNomaiText>()
.SendMessage(new SetAsTranslatedMessage(id));
}
}