3 using System.Collections.Generic;
5 using System.Threading.Tasks;
11 public static partial class ContentPackageManager
13 public sealed
partial class PackageSource : ICollection<ContentPackage>
17 if (modProject.
IsCore) {
throw new ArgumentException(
"ModProject must not be a core package"); }
20 .CleanUpPathCrossPlatform(correctFilenameCase:
false);
21 modProject.
Save(fileListPath);
22 Refresh(); EnabledPackages.DisableRemovedMods();
29 return Regular.First(p => p.Path == fileListPath);
35 var
package = GetRegularModByPath(fileListPath);
36 EnabledPackages.EnableRegular(package);
42 private static async Task<IEnumerable<Steamworks.Ugc.Item>> EnqueueWorkshopUpdates()
44 ISet<Steamworks.Ugc.Item> subscribedItems = await SteamManager.Workshop.GetAllSubscribedItems();
46 var needInstalling = subscribedItems.Where(item
47 => !WorkshopPackages.Any(p
48 => p.UgcId.TryUnwrap(out var ugcId)
50 && item.Id == workshopId.
Value
51 && p.InstallTime.TryUnwrap(out var installTime)
52 && item.LatestUpdateTime <= installTime.ToUtcValue()))
54 if (!needInstalling.Any()) {
return Enumerable.Empty<Steamworks.Ugc.Item>(); }
57 needInstalling.Select(SteamManager.Workshop.DownloadModThenEnqueueInstall));
59 return needInstalling;
const string FileListFileName
RegularPackage GetRegularModByPath(string fileListPath)
RegularPackage SaveAndEnableRegularMod(ModProject modProject)
string SaveRegularMod(ModProject modProject)
IEnumerable< RegularPackage > Regular