2022-01-21 15:13:16 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Tools.TranslatorTool.TranslationSync.Messages;
|
|
|
|
|
using QSB.Utility;
|
|
|
|
|
using QSB.WorldSync;
|
2021-12-28 02:03:58 -08:00
|
|
|
|
using System;
|
2021-12-26 20:10:38 -08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace QSB.Tools.TranslatorTool.TranslationSync.WorldObjects
|
|
|
|
|
{
|
|
|
|
|
internal class QSBNomaiText : WorldObject<NomaiText>
|
|
|
|
|
{
|
2022-02-16 02:30:01 -08:00
|
|
|
|
public override void SendInitialState(uint to) =>
|
|
|
|
|
GetTranslatedIds().ForEach(id =>
|
|
|
|
|
this.SendMessage(new SetAsTranslatedMessage(id) { To = to }));
|
2022-01-21 15:13:16 -08:00
|
|
|
|
|
2021-12-26 20:10:38 -08:00
|
|
|
|
public void SetAsTranslated(int id) => AttachedObject.SetAsTranslated(id);
|
|
|
|
|
|
2021-12-28 02:03:58 -08:00
|
|
|
|
public IEnumerable<int> GetTranslatedIds()
|
|
|
|
|
{
|
|
|
|
|
if (!AttachedObject._initialized)
|
|
|
|
|
{
|
|
|
|
|
// shouldn't happen, but does anyway sometimes. whatever lol
|
|
|
|
|
return Array.Empty<int>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AttachedObject._dictNomaiTextData
|
2021-12-26 20:10:38 -08:00
|
|
|
|
.Where(x => x.Value.IsTranslated)
|
|
|
|
|
.Select(x => x.Key);
|
2021-12-28 02:03:58 -08:00
|
|
|
|
}
|
2021-12-26 20:10:38 -08:00
|
|
|
|
}
|
|
|
|
|
}
|