Esempio n. 1
0
        /// <summary>
        /// When the selection in the listbox is changed, this is run. It loads in the currently selected game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (gameList.Items.Count == 0)
            {
                return;
            }
            var modifyItem  = (ListBoxItem)((ListBox)sender).SelectedItem;
            var profile     = _gameNames[gameList.SelectedIndex];
            var icon        = profile.IconName;
            var imageBitmap = new BitmapImage(File.Exists(icon)
                ? new Uri("pack://siteoforigin:,,,/" + icon, UriKind.Absolute)
                : new Uri("../Resources/teknoparrot_by_pooterman-db9erxd.png", UriKind.Relative));

            image1.Source = imageBitmap;
            _gameSettings.LoadNewSettings(profile, modifyItem, _contentControl, this);
            Joystick.LoadNewSettings(profile, modifyItem, MainWindow.ParrotData);
            if (!profile.HasSeparateTestMode)
            {
                ChkTestMenu.IsChecked = false;
                ChkTestMenu.IsEnabled = false;
            }
            else
            {
                ChkTestMenu.IsEnabled = true;
                ChkTestMenu.ToolTip   = "Enable or disable test mode.";
            }
            gameInfoText.Text = _gameNames[gameList.SelectedIndex].GameInfo.SmallText;
        }
Esempio n. 2
0
        private void GameListComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var modifyItem = (ComboBoxItem)((ComboBox)sender).SelectedItem;
            var profile    = (GameProfile)((ComboBoxItem)((ComboBox)sender).SelectedItem).Tag;
            var icon       = profile.IconName;
            Uri imageUri;

            if (File.Exists(icon))
            {
                imageUri = new Uri(icon, UriKind.Relative);
            }
            else
            {
                imageUri = new Uri("Resources/teknoparrot_by_pooterman-db9erxd.png", UriKind.Relative);
            }
            BitmapImage imageBitmap = new BitmapImage(imageUri);

            MainLogo.Source = imageBitmap;
            GameSettingsControl.LoadNewSettings(profile, modifyItem);
            JoystickControl.LoadNewSettings(profile, modifyItem, _parrotData);
            if (!profile.HasSeparateTestMode)
            {
                ChkTestMenu.IsChecked = false;
                ChkTestMenu.IsEnabled = false;
            }
            else
            {
                ChkTestMenu.IsEnabled = true;
                ChkTestMenu.ToolTip   = "Enable or disable test mode.";
            }
        }
Esempio n. 3
0
        /// <summary>
        /// When the selection in the listbox is changed, this is run. It loads in the currently selected game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (gameList.Items.Count == 0)
            {
                return;
            }

            var modifyItem = (ListBoxItem)((ListBox)sender).SelectedItem;
            var profile    = _gameNames[gameList.SelectedIndex];

            UpdateIcon(profile.IconName.Split('/')[1], ref gameIcon);

            _gameSettings.LoadNewSettings(profile, modifyItem, _contentControl, this);
            Joystick.LoadNewSettings(profile, modifyItem);
            if (!profile.HasSeparateTestMode)
            {
                ChkTestMenu.IsChecked = false;
                ChkTestMenu.IsEnabled = false;
            }
            else
            {
                ChkTestMenu.IsEnabled = true;
                ChkTestMenu.ToolTip   = "Enable or disable test mode.";
            }
            var selectedGame = _gameNames[gameList.SelectedIndex];

            gameInfoText.Text = $"Emulator: {selectedGame.EmulatorType}\n{(selectedGame.GameInfo == null ? "No Game Information Available" : selectedGame.GameInfo.ToString())}";
        }
Esempio n. 4
0
        /// <summary>
        /// When the selection in the listbox is changed, this is run. It loads in the currently selected game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (gameList.Items.Count == 0)
            {
                return;
            }

            var modifyItem = (ListBoxItem)((ListBox)sender).SelectedItem;
            var profile    = _gameNames[gameList.SelectedIndex];

            UpdateIcon(profile.IconName.Split('/')[1], ref gameIcon);

            _gameSettings.LoadNewSettings(profile, modifyItem, _contentControl, this);
            Joystick.LoadNewSettings(profile, modifyItem);
            if (!profile.HasSeparateTestMode)
            {
                ChkTestMenu.IsChecked = false;
                ChkTestMenu.IsEnabled = false;
            }
            else
            {
                ChkTestMenu.IsEnabled = true;
                ChkTestMenu.ToolTip   = Properties.Resources.LibraryToggleTestMode;
            }
            var selectedGame = _gameNames[gameList.SelectedIndex];

            gameInfoText.Text = $"{Properties.Resources.LibraryEmulator}: {selectedGame.EmulatorType} ({(selectedGame.Is64Bit ? "x64" : "x86")})\n{(selectedGame.GameInfo == null ? Properties.Resources.LibraryNoInfo : selectedGame.GameInfo.ToString())}";
        }