The content package a submarine was saved with is included in the submarine preview, added a warning when attempting to start a campaign using a sub with a mismatching content package

This commit is contained in:
Joonas Rikkonen
2018-01-25 12:19:47 +02:00
parent e55c54b161
commit 09e4687cd0
5 changed files with 51 additions and 17 deletions
@@ -87,6 +87,8 @@ namespace Barotrauma
public int RecommendedCrewSizeMin = 1, RecommendedCrewSizeMax = 2;
public string RecommendedCrewExperience;
public string ContentPackage;
//properties ----------------------------------------------------
@@ -284,6 +286,7 @@ namespace Barotrauma
RecommendedCrewSizeMin = doc.Root.GetAttributeInt("recommendedcrewsizemin", 0);
RecommendedCrewSizeMax = doc.Root.GetAttributeInt("recommendedcrewsizemax", 0);
RecommendedCrewExperience = doc.Root.GetAttributeString("recommendedcrewexperience", "Unknown");
ContentPackage = doc.Root.GetAttributeString("contentpackage", "Unknown");
#if CLIENT
string previewImageData = doc.Root.GetAttributeString("previewimage", "");
@@ -1198,6 +1201,7 @@ namespace Barotrauma
element.Add(new XAttribute("recommendedcrewsizemin", RecommendedCrewSizeMin));
element.Add(new XAttribute("recommendedcrewsizemax", RecommendedCrewSizeMax));
element.Add(new XAttribute("recommendedcrewexperience", RecommendedCrewExperience ?? ""));
element.Add(new XAttribute("contentpackage", ContentPackage ?? ""));
foreach (MapEntity e in MapEntity.mapEntityList)
{