Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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()
     });
Esempio n. 3
0
 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()
     });
Esempio n. 4
0
        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;
 }