Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaClient/ClientSource/Items/Components/Scanner.cs
2022-02-26 02:43:01 +09:00

30 lines
974 B
C#

using Barotrauma.Networking;
namespace Barotrauma.Items.Components
{
partial class Scanner : ItemComponent, IServerSerializable
{
partial void UpdateProjSpecific()
{
if (Holdable != null && Holdable.Attached && (AlwaysDisplayProgressBar || DisplayProgressBar) && !IsScanCompleted)
{
Character.Controlled?.UpdateHUDProgressBar(this,
item.WorldPosition,
ScanTimer / ScanDuration,
GUIStyle.Red, GUIStyle.Green,
textTag: "progressbar.scanning");
}
}
public void ClientRead(ServerNetObject type, IReadMessage msg, float sendingTime)
{
bool wasScanCompletedPreviously = IsScanCompleted;
scanTimer = msg.ReadSingle();
if (!wasScanCompletedPreviously && IsScanCompleted)
{
OnScanCompleted?.Invoke(this);
}
}
}
}