2021-10-15 21:06:51 +01:00
|
|
|
|
using HarmonyLib;
|
2021-12-24 21:39:32 -08:00
|
|
|
|
using QSB.Messaging;
|
2020-12-31 12:10:55 +00:00
|
|
|
|
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;
|
2020-12-31 12:10:55 +00:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.Tools.TranslatorTool.TranslationSync.Patches;
|
|
|
|
|
|
|
|
|
|
internal class SpiralPatches : QSBPatch
|
2020-12-31 12:10:55 +00:00
|
|
|
|
{
|
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-02-24 22:04:54 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
return;
|
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
if (__instance.IsTranslated(id))
|
|
|
|
|
{
|
|
|
|
|
return;
|
2022-02-27 04:40:44 -08:00
|
|
|
|
}
|
2022-03-02 19:46:33 -08:00
|
|
|
|
|
|
|
|
|
__instance.GetWorldObject<QSBNomaiText>()
|
|
|
|
|
.SendMessage(new SetAsTranslatedMessage(id));
|
2020-12-31 12:10:55 +00:00
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|