Ejemplo n.º 1
0
            /// <summary>
            ///     Return the user's game region, either automatically by searching existing console directories or prompt
            ///     the user to select one.
            /// </summary>
            /// <param name="owner">Parent form</param>
            /// <param name="gameId">Game Id</param>
            /// <returns></returns>
            public string GetGameRegion(Form owner, string gameId)
            {
                if (MainWindow.Settings.RememberGameRegions)
                {
                    var gameRegion = MainWindow.Settings.GetGameRegion(gameId);

                    if (!string.IsNullOrEmpty(gameRegion))
                    {
                        return(gameRegion);
                    }
                }

                if (MainWindow.Settings.AutoDetectGameRegion)
                {
                    var foundRegions = Regions.Where(region => MainWindow.FtpConnection.DirectoryExists($"/dev_hdd0/game/{region}")).ToList();

                    foreach (var region in foundRegions.Where(region => DarkMessageBox.Show(MainWindow.Window,
                                                                                            $"Game Region: {region} has been found for: {Title}\nIs this correct?", "Found Game Region",
                                                                                            MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
                    {
                        return(region);
                    }

                    _ = DarkMessageBox.Show(MainWindow.Window,
                                            "Could not find any regions on your console for this game title. You must install the game update for this title first.",
                                            "No Game Update", MessageBoxIcon.Error);
                    return(null);
                }

                return(DialogExtensions.ShowListInputDialog(owner, "Game Regions", Regions.ToList()));
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the download url specified by the user if there are multiple types
        /// </summary>
        /// <returns>Download Archive URL</returns>
        public DownloadFiles GetDownloadFiles()
        {
            if (DownloadFiles.Count > 1)
            {
                var downloadNames = DownloadFiles.Select(x => x.Name).ToList();
                var downloadName  = DialogExtensions.ShowListInputDialog("Install Downloads", downloadNames);

                if (string.IsNullOrEmpty(downloadName))
                {
                    return(null);
                }

                return(DownloadFiles.First(x => x.Name.Equals(downloadName)));
            }
            else
            {
                return(DownloadFiles.First());
            }
        }