2020-12-31 12:10:55 +00:00
|
|
|
|
using OWML.Utils;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace QSB.TranslationSync.WorldObjects
|
|
|
|
|
{
|
|
|
|
|
internal class QSBComputer : WorldObject<NomaiComputer>
|
|
|
|
|
{
|
|
|
|
|
public override void Init(NomaiComputer computer, int id)
|
|
|
|
|
{
|
|
|
|
|
ObjectId = id;
|
|
|
|
|
AttachedObject = computer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void HandleSetAsTranslated(int id)
|
|
|
|
|
{
|
|
|
|
|
if (AttachedObject.IsTranslated(id))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-06-18 22:38:32 +01:00
|
|
|
|
|
2020-12-31 12:10:55 +00:00
|
|
|
|
AttachedObject.SetAsTranslated(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<int> GetTranslatedIds()
|
|
|
|
|
{
|
|
|
|
|
var activeList = AttachedObject.GetValue<List<NomaiComputerRing>>("_activeRingList");
|
|
|
|
|
foreach (var item in activeList)
|
|
|
|
|
{
|
|
|
|
|
if (AttachedObject.IsTranslated(item.GetEntryID()))
|
|
|
|
|
{
|
|
|
|
|
yield return item.GetEntryID();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-06-18 22:38:32 +01:00
|
|
|
|
|
2020-12-31 12:10:55 +00:00
|
|
|
|
var inactiveList = AttachedObject.GetValue<List<NomaiComputerRing>>("_inactiveRingList");
|
|
|
|
|
foreach (var item in inactiveList)
|
|
|
|
|
{
|
|
|
|
|
if (AttachedObject.IsTranslated(item.GetEntryID()))
|
|
|
|
|
{
|
|
|
|
|
yield return item.GetEntryID();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|