Unstable 0.17.0.0
This commit is contained in:
@@ -6,35 +6,16 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class TraitorMissionPrefab
|
||||
class TraitorMissionPrefab : Prefab
|
||||
{
|
||||
public static readonly List<TraitorMissionPrefab> List = new List<TraitorMissionPrefab>();
|
||||
|
||||
public readonly string Identifier;
|
||||
public static readonly PrefabCollection<TraitorMissionPrefab> Prefabs = new PrefabCollection<TraitorMissionPrefab>();
|
||||
|
||||
public readonly Sprite Icon;
|
||||
public readonly Color IconColor;
|
||||
|
||||
public static void Init()
|
||||
public TraitorMissionPrefab(ContentXElement element, TraitorMissionsFile file) : base(file, element.GetAttributeIdentifier("identifier", Identifier.Empty))
|
||||
{
|
||||
List.Clear();
|
||||
var files = GameMain.Instance.GetFilesOfType(ContentType.TraitorMissions);
|
||||
foreach (ContentFile file in files)
|
||||
{
|
||||
XDocument doc = XMLExtensions.TryLoadXml(file.Path);
|
||||
if (doc?.Root == null) { continue; }
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
{
|
||||
List.Add(new TraitorMissionPrefab(element));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TraitorMissionPrefab(XElement element)
|
||||
{
|
||||
Identifier = element.GetAttributeString("identifier", "");
|
||||
foreach (XElement subElement in element.Elements())
|
||||
foreach (var subElement in element.Elements())
|
||||
{
|
||||
if (subElement.Name.ToString().Equals("icon", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -43,5 +24,10 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
Icon?.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Barotrauma
|
||||
{
|
||||
public TraitorMissionResult(IReadMessage inc)
|
||||
{
|
||||
MissionIdentifier = inc.ReadString();
|
||||
MissionIdentifier = inc.ReadIdentifier();
|
||||
EndMessage = inc.ReadString();
|
||||
Success = inc.ReadBoolean();
|
||||
byte characterCount = inc.ReadByte();
|
||||
|
||||
Reference in New Issue
Block a user