コード例 #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;
        }
コード例 #2
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())}";
        }
コード例 #3
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.";
            }
        }
コード例 #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())}";
        }
コード例 #5
0
 /// <summary>
 /// This button opens the controller settings option
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnControllerSettings(object sender, RoutedEventArgs e)
 {
     if (gameList.Items.Count == 0)
     {
         return;
     }
     Joystick = new JoystickControl(_contentControl, this);
     Joystick.LoadNewSettings(_gameNames[gameList.SelectedIndex], (ListBoxItem)gameList.SelectedItem);
     Joystick.Listen();
     Application.Current.Windows.OfType <MainWindow>().Single().contentControl.Content = Joystick;
 }