Esempio n. 1
0
        public static void ShowCustomListsDialog(Form owner, PlatformPrefix consoleType)
        {
            using CustomLists customListsDialog = new() { ConsoleType = consoleType };
            customListsDialog.ShowDialog(owner);
        }

        #endregion
    }
Esempio n. 2
0
        public static void ShowItemDetailsDialog(Form owner, PlatformPrefix consoleType, CategoriesData categories, ModItemData modItem)
        {
            XtraForm detailsDialog = new();

            switch (consoleType)
            {
            case PlatformPrefix.PS3:
                if (modItem.GetCategoryType(categories) == CategoryType.Game)
                {
                    detailsDialog = new GameModDialog
                    {
                        ModItem = modItem
                    };
                }
                else if (modItem.GetCategoryType(categories) == CategoryType.Homebrew)
                {
                    detailsDialog = new HomebrewDialog
                    {
                        ModItem = modItem
                    };
                }
                else if (modItem.GetCategoryType(categories) == CategoryType.Resource)
                {
                    detailsDialog = new ResourceDialog
                    {
                        ModItem = modItem
                    };
                }
                break;

            case PlatformPrefix.XBOX:
                detailsDialog = new PluginDialog
                {
                    ModItem = modItem
                };
                break;

            default:
                break;
            }

            XtraForm overlayForm = new();

            overlayForm.StartPosition   = FormStartPosition.Manual;
            overlayForm.FormBorderStyle = FormBorderStyle.None;
            overlayForm.Opacity         = .50d;
            overlayForm.BackColor       = Color.Black;
            overlayForm.Size            = owner.Size;
            overlayForm.Location        = owner.Location;
            overlayForm.ShowInTaskbar   = false;
            overlayForm.Show(owner);

            detailsDialog.Owner = owner;
            detailsDialog.ShowDialog();

            //Get rid of the overlay form
            overlayForm.Dispose();
        }
        public List <string> LocalInstallPaths(PlatformPrefix consoleType)
        {
            List <string> localInstallPaths = new();

            foreach (string installPath in InstallPaths)
            {
                if (consoleType == PlatformPrefix.PS3)
                {
                    localInstallPaths.Add(installPath.Replace("/{USBDEV}/", @"PS3\").Replace("/", @"\"));
                }
                else
                {
                    localInstallPaths.Add(installPath.Replace(@"Hdd:\ModioX\", @"XBOX"));
                }
            }

            return(localInstallPaths);
        }
Esempio n. 4
0
 /// <summary>
 /// Get all of the mods matching the specified filters.
 /// </summary>
 /// <param name="consoleType"></param>
 /// <param name="categoryId"></param>
 /// <param name="name"></param>
 /// <param name="region"></param>
 /// <param name="version"></param>
 /// <param name="author"></param>
 /// <returns></returns>
 public List <GameSaveItemData> GetGameSaveItems(PlatformPrefix consoleType, string categoryId, string name, string region, string version, string author)
 {
     return(categoryId switch
     {
         "fvrt" => GameSaves.Where(x =>
                                   MainWindow.Settings.FavoriteIds.Any(y => y.Platform.Equals(consoleType) && y.Ids.Contains(x.Id)) &&
                                   x.Name.ContainsIgnoreCase(name) &&
                                   x.Region.ContainsIgnoreCase(region) &&
                                   x.Version.ContainsIgnoreCase(version) &&
                                   x.Creators.ToArray().AnyContainsIgnoreCase(author))
         .ToList(),
         _ => GameSaves.Where(x =>
                              x.GetPlatform() == consoleType &&
                              (categoryId.IsNullOrEmpty() ? x.CategoryId.ContainsIgnoreCase(categoryId) : x.CategoryId.EqualsIgnoreCase(categoryId)) &&
                              x.Name.ContainsIgnoreCase(name) &&
                              x.Region.ContainsIgnoreCase(region) &&
                              x.Version.ContainsIgnoreCase(version) &&
                              x.Creators.ToArray().AnyContainsIgnoreCase(author))
         .ToList()
     });
Esempio n. 5
0
 /// <summary>
 /// Get the <see cref="ModItemData" /> matching the specified <see cref="ModItemData.Id" />.
 /// </summary>
 /// <param name="id">
 /// <see cref="ModItemData.Id" />
 /// </param>
 /// <returns> Mod details for the <see cref="ModItemData.Id" /> </returns>
 public ModItemData GetModById(PlatformPrefix consoleType, int id)
 {
     return(Mods.FirstOrDefault(modItem => modItem.GetPlatform() == consoleType && modItem.Id.Equals(id)));
 }
Esempio n. 6
0
 public static ConsoleProfile ShowConnectionsDialog(Form owner, PlatformPrefix consoleType)
 {
     using ConnectionsDialog connectConsole = new() { ConsoleType = consoleType };
     return(connectConsole.ShowDialog(owner) == DialogResult.OK ? connectConsole.ConsoleProfile : null);
 }