private void OnSelectMods(object sender, EventArgs e) { oldMods = ModManager.ModStatus; ModSelection m = new ModSelection(IsHost ? ModSelectionType.All : ModSelectionType.ClientSide); m.Closed += m_Closed; GameBase.ShowDialog(m); }
internal static ModAction Create(ModSelection selection, IModelRepositoryMod parent) { return(selection switch { ModSelectionNone => new SelectNone(), ModSelectionLoading => new SelectLoading(), ModSelectionDisabled => new SelectDisabled(), ModSelectionDownload download => new SelectStorage(download.DownloadStorage), ModSelectionStorageMod actionStorageMod => new SelectMod(actionStorageMod.StorageMod, CoreCalculation.GetModAction(parent, actionStorageMod.StorageMod)), _ => throw new ArgumentException() });
public static PersistedSelection?FromSelection(ModSelection selection) { // TODO: PersistedSelection shouldn't have to know about None/Loading details return(selection switch { ModSelectionNone => null, ModSelectionLoading => null, ModSelectionDisabled => new PersistedSelection(PersistedSelectionType.DoNothing, null, null), ModSelectionStorageMod storageModAction => storageModAction.StorageMod.GetStorageModIdentifiers(), ModSelectionDownload downloadAction => downloadAction.DownloadStorage.AsStorageIdentifier(), _ => throw new ArgumentException() });
public static ModSelectionItem ToItem(this ModSelection entity) { var item = new ModSelectionItem() { Id = entity.Id, ModName = entity.ModName, IsChecked = entity.IsChecked, IsDirty = false }; return(item); }
public void SetSelection(ModSelection selection) { _selection = selection; }