Unstable 1.1.14.0
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#nullable enable
|
||||
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
sealed partial class TraitorManager
|
||||
{
|
||||
public static void ClientRead(IReadMessage msg)
|
||||
{
|
||||
//unused, but could be worth keeping in the messages regardless in case a mod wants to use these for something
|
||||
TraitorEvent.State state = (TraitorEvent.State)msg.ReadByte();
|
||||
Identifier eventIdentifier = msg.ReadIdentifier();
|
||||
if (GameMain.Client?.Character == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Received a traitor update when not controlling a character.");
|
||||
return;
|
||||
}
|
||||
GameMain.Client.Character.IsTraitor = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class TraitorMissionPrefab : Prefab
|
||||
{
|
||||
public static readonly PrefabCollection<TraitorMissionPrefab> Prefabs = new PrefabCollection<TraitorMissionPrefab>();
|
||||
|
||||
public readonly Sprite Icon;
|
||||
public readonly Color IconColor;
|
||||
|
||||
public TraitorMissionPrefab(ContentXElement element, TraitorMissionsFile file) : base(file, element.GetAttributeIdentifier("identifier", Identifier.Empty))
|
||||
{
|
||||
foreach (var subElement in element.Elements())
|
||||
{
|
||||
if (subElement.Name.ToString().Equals("icon", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Icon = new Sprite(subElement);
|
||||
IconColor = subElement.GetAttributeColor("color", Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
Icon?.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Barotrauma.Networking;
|
||||
using System;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class TraitorMissionResult
|
||||
{
|
||||
public TraitorMissionResult(IReadMessage inc)
|
||||
{
|
||||
MissionIdentifier = inc.ReadIdentifier();
|
||||
EndMessage = inc.ReadString();
|
||||
Success = inc.ReadBoolean();
|
||||
byte characterCount = inc.ReadByte();
|
||||
for (int i = 0; i < characterCount; i++)
|
||||
{
|
||||
UInt16 characterID = inc.ReadUInt16();
|
||||
var character = Entity.FindEntityByID(characterID) as Character;
|
||||
if (character != null) { Characters.Add(character); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user