Unstable v0.19.5.0
This commit is contained in:
+6
-6
@@ -63,7 +63,7 @@ namespace Barotrauma
|
||||
files = contentPackage.Files.Select(File.FromContentFile).ToList();
|
||||
ModVersion = IncrementModVersion(contentPackage.ModVersion);
|
||||
IsCore = contentPackage is CorePackage;
|
||||
SteamWorkshopId = contentPackage.SteamWorkshopId;
|
||||
UgcId = contentPackage.UgcId;
|
||||
ExpectedHash = contentPackage.Hash;
|
||||
InstallTime = contentPackage.InstallTime;
|
||||
}
|
||||
@@ -90,9 +90,9 @@ namespace Barotrauma
|
||||
|
||||
public bool IsCore = false;
|
||||
|
||||
public UInt64 SteamWorkshopId = 0;
|
||||
public Option<ContentPackageId> UgcId = Option<ContentPackageId>.None();
|
||||
|
||||
public DateTime? InstallTime = null;
|
||||
public Option<DateTime> InstallTime = Option<DateTime>.None();
|
||||
|
||||
public bool HasFile(File file)
|
||||
=> Files.Any(f =>
|
||||
@@ -120,7 +120,7 @@ namespace Barotrauma
|
||||
public void DiscardHashAndInstallTime()
|
||||
{
|
||||
ExpectedHash = null;
|
||||
InstallTime = null;
|
||||
InstallTime = Option<DateTime>.None();
|
||||
}
|
||||
|
||||
public static string IncrementModVersion(string modVersion)
|
||||
@@ -155,11 +155,11 @@ namespace Barotrauma
|
||||
addRootAttribute("name", Name);
|
||||
if (!ModVersion.IsNullOrEmpty()) { addRootAttribute("modversion", ModVersion); }
|
||||
addRootAttribute("corepackage", IsCore);
|
||||
if (SteamWorkshopId != 0) { addRootAttribute("steamworkshopid", SteamWorkshopId); }
|
||||
if (UgcId.TryUnwrap(out var ugcId) && ugcId is SteamWorkshopId steamWorkshopId) { addRootAttribute("steamworkshopid", steamWorkshopId.Value); }
|
||||
addRootAttribute("gameversion", GameMain.Version);
|
||||
if (AltNames.Any()) { addRootAttribute("altnames", string.Join(",", AltNames)); }
|
||||
if (ExpectedHash != null) { addRootAttribute("expectedhash", ExpectedHash.StringRepresentation); }
|
||||
if (InstallTime != null) { addRootAttribute("installtime", ToolBox.Epoch.FromDateTime(InstallTime.Value)); }
|
||||
if (InstallTime.TryUnwrap(out var installTime)) { addRootAttribute("installtime", ToolBox.Epoch.FromDateTime(installTime)); }
|
||||
|
||||
files.ForEach(f => rootElement.Add(f.ToXElement()));
|
||||
|
||||
|
||||
@@ -45,9 +45,11 @@ namespace Barotrauma
|
||||
|
||||
var needInstalling = subscribedItems.Where(item
|
||||
=> !WorkshopPackages.Any(p
|
||||
=> item.Id == p.SteamWorkshopId
|
||||
&& p.InstallTime.HasValue
|
||||
&& item.LatestUpdateTime <= p.InstallTime))
|
||||
=> p.UgcId.TryUnwrap(out var ugcId)
|
||||
&& ugcId is SteamWorkshopId workshopId
|
||||
&& item.Id == workshopId.Value
|
||||
&& p.InstallTime.TryUnwrap(out var installTime)
|
||||
&& item.LatestUpdateTime <= installTime))
|
||||
.ToArray();
|
||||
if (needInstalling.Any())
|
||||
{
|
||||
|
||||
+6
-2
@@ -16,7 +16,7 @@ namespace Barotrauma.Transition
|
||||
/// Class dedicated to transitioning away from the old, shitty
|
||||
/// Mods + Submarines folders to the new LocalMods folder
|
||||
/// </summary>
|
||||
public static class UgcTransition
|
||||
public static class LegacySteamUgcTransition
|
||||
{
|
||||
private const string readmeName = "LOCALMODS_README.txt";
|
||||
|
||||
@@ -168,7 +168,11 @@ namespace Barotrauma.Transition
|
||||
addHeader(TextManager.Get("SubscribedMods"));
|
||||
foreach (var mod in mods.Mods)
|
||||
{
|
||||
addTickbox(mod.Dir, mod.Name, ticked: !ContentPackageManager.LocalPackages.Any(p => p.SteamWorkshopId != 0 && p.SteamWorkshopId == mod.Item?.Id));
|
||||
addTickbox(mod.Dir, mod.Name,
|
||||
ticked: !(mod.Item is { } item && ContentPackageManager.LocalPackages.Any(p =>
|
||||
p.UgcId.TryUnwrap(out var ugcId)
|
||||
&& ugcId is SteamWorkshopId workshopId
|
||||
&& workshopId.Value == item.Id)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user