void SetupBuiltInFavorites() { var container = new BuiltInContentContainer("Favorites"); _disposables.Add(Network.Items.KeepCollectionInSync(container.Items, x => x.IsFavorite)); _disposables.Add(Network.Items.ItemChanged.Where(x => x.PropertyName == "IsFavorite") .Subscribe(x => { if (x.Sender.IsFavorite) { _builtinFavorites.Items.AddLocked(x.Sender); } else { _builtinFavorites.Items.RemoveLocked(x.Sender); } })); _builtinFavorites = new BrowseContentLibraryItemViewModel <BuiltInContentContainer>(_library, container, SixIconFont.withSIX_icon_Star, BuiltInGroup, true) { IconForeground = SixColors.SixOrange, IsRoot = true, SortOrder = 8 }; Items.Add(_builtinFavorites); }
void SetupBuiltInFeatured() { var container = new BuiltInContentContainer("Featured"); _builtinFeatured = new BrowseContentLibraryItemViewModel <BuiltInContentContainer>(_library, container, SixIconFont.withSIX_icon_Ribbon, BuiltInGroup, true) { IconForeground = SixColors.SixOrange, IsRoot = true, SortOrder = 7, IsHead = true }; container.Items.AddRangeLocked(_game.Lists.Collections.Where(x => _desiredModsets.Any(y => y.Equals(x.Id))).Concat(Network.Items.Where(IsFeatured))); Items.AddLocked(_builtinFeatured); }
void SetupNetwork() { var container = new BuiltInContentContainer("Browse"); _disposables.Add(_missionList.Missions.KeepCollectionInSync2(container.Items, x => x.GameMatch(_game))); _network = new NetworkLibraryItemViewModel(_library, container, BuiltInGroup) { IsRoot = true, SortOrder = 6 }; lock (Items) Items.Insert(0, _network); SetupUpdates(); SetupBuiltInFeatured(); SetupBuiltInFavorites(); SetupBuiltInRecent(); }
void SetupBuiltInPlaylist() { var container = new BuiltInContentContainer("Playlist"); SyncCgsMods(_game.CalculatedSettings.CurrentMods, container); _disposables.Add(_game.CalculatedSettings.WhenAnyValue(x => x.CurrentMods) .Subscribe(x => SyncCgsMods(x, container))); var playlist = new BrowseContentLibraryItemViewModel <BuiltInContentContainer>(_library, container, SixIconFont.withSIX_icon_Play) { Description = "All mods that will be used to Launch or Update, incl dependencies and server mods", IsFeatured = true, IsRoot = true, IconForeground = SixColors.SixGreen, SortOrder = 1 }; Items.Add(playlist); }
void SetupBuiltInRecent() { var container = new BuiltInContentContainer("Recent"); _settings.ModOptions.RecentCollections.Select(FindModSet) .Where(x => x != null) .SyncCollection(container.Items); _builtinRecent = new BrowseContentLibraryItemViewModel <BuiltInContentContainer>(_library, container, SixIconFont.withSIX_icon_Clock, BuiltInGroup, true) { IsRoot = true, SortOrder = 9 }; _disposables.Add(_settings.ModOptions.RecentCollections.TrackChangesDerrivedConvert(_builtinRecent.Items, FindModSet, set => FindModSet(set) != null)); Items.Add(_builtinRecent); }
void SetupNetwork() { var container = new BuiltInContentContainer("Browse"); _disposables.Add(_contentList.Mods.KeepCollectionInSyncOfType(container.Items, y => y.GameMatch(_modding))); Network = new NetworkLibraryItemViewModel(_library, container, BuiltInGroup) { IsRoot = true, SortOrder = 6, IsHead = true }; lock (Items) Items.Insert(0, Network); SetupUpdates(); SetupBuiltInFeatured(); SetupBuiltInFavorites(); SetupBuiltInRecent(); }
void SetupBuiltInFavorites() { var container = new BuiltInContentContainer("Favorites"); _disposables.Add(_network.Items.KeepCollectionInSyncOfType <Mission, IContent>(container.Items, x => x.IsFavorite)); _builtinFavorites = new MissionContentLibraryItemViewModel <BuiltInContentContainer>(_library, container, SixIconFont.withSIX_icon_Star, BuiltInGroup, true) { IconForeground = SixColors.SixOrange, IsRoot = true, SortOrder = 8 }; // TODO: These probably gets reset if _network.Items resets.. SetupFavoriteTracking(_network.Items); foreach (var g in _gameFolders) { SetupFavoriteTracking(g.Model.Items); } Items.Add(_builtinFavorites); }