mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-15 18:39:50 +00:00
38 lines
893 B
C#
38 lines
893 B
C#
using QSB.Messaging;
|
|
using QSB.Tools.TranslatorTool.TranslationSync.Messages;
|
|
using QSB.Utility;
|
|
using QSB.WorldSync;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace QSB.Tools.TranslatorTool.TranslationSync.WorldObjects
|
|
{
|
|
internal class QSBNomaiText : WorldObject<NomaiText>
|
|
{
|
|
public override void SendResyncInfo(uint to)
|
|
{
|
|
if (QSBCore.IsHost)
|
|
{
|
|
GetTranslatedIds().ForEach(id =>
|
|
this.SendMessage(new SetAsTranslatedMessage(id) { To = to }));
|
|
}
|
|
}
|
|
|
|
public void SetAsTranslated(int id) => AttachedObject.SetAsTranslated(id);
|
|
|
|
public IEnumerable<int> GetTranslatedIds()
|
|
{
|
|
if (!AttachedObject._initialized)
|
|
{
|
|
// shouldn't happen, but does anyway sometimes. whatever lol
|
|
return Array.Empty<int>();
|
|
}
|
|
|
|
return AttachedObject._dictNomaiTextData
|
|
.Where(x => x.Value.IsTranslated)
|
|
.Select(x => x.Key);
|
|
}
|
|
}
|
|
}
|