Example #1
0
 private void listBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left || e.Key == Key.Right || e.Key == Key.Up || e.Key == Key.Down)
     {
         SoundClass.PlayPS4Sound(SoundClass.Sound.Navigation);
     }
 }
Example #2
0
        private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                using (FileStream isoStream = File.OpenRead(MainWindow.isoFiles[listBox.SelectedIndex].ToString()))
                {
                    //use disk utils to read iso quickly
                    CDReader cd = new CDReader(isoStream, true);
                    //look for the spesific file
                    Stream fileStream = cd.OpenFile(@"SYSTEM.CNF", FileMode.Open);
                    // Use fileStream...
                    TextReader tr         = new StreamReader(fileStream);
                    string     fullstring = tr.ReadToEnd();//read string to end this will read all the info we need

                    //mine for info
                    string Is = @"\";
                    string Ie = ";";

                    //mine the start and end of the string
                    int start = fullstring.ToString().IndexOf(Is) + Is.Length;
                    int end   = fullstring.ToString().IndexOf(Ie, start);
                    if (end > start)
                    {
                        string PS2Id = fullstring.ToString().Substring(start, end - start);

                        if (PS2Id != string.Empty)
                        {
                            lblTitleId.Content = PS2Id.Replace(".", "").Replace("_", "");
                        }
                        else
                        {
                            System.Windows.Forms.MessageBox.Show("Could not load PS2 ID");
                        }
                    }
                    else
                    {
                        System.Windows.Forms.DialogResult dlr = System.Windows.Forms.MessageBox.Show("Could not load PS2 ID\n\n wpuld you like to submit an issue ?", "Error Reporting", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button2);
                        if (dlr == System.Windows.Forms.DialogResult.Yes)
                        {
                            //load github issue page
                            Process.Start(@"https://github.com/xXxTheDarkprogramerxXx/PS3Tools/issues");
                        }
                    }
                }
                SoundClass.PlayPS4Sound(SoundClass.Sound.Navigation);
            }
            catch (Exception ex)
            {
            }
        }
        public MessageBox(string Text, string Caption, PS4_MessageBoxButton _Buttons, SoundClass.Sound SoundToPlay)
        {
            InitializeComponent();
            lblTitle.Content     = Caption;
            Buttons              = _Buttons;
            txtErrorMessage.Text = Text;

            switch (Buttons)
            {
            case PS4_MessageBoxButton.OK:
            {
                btnPositive.Visibility = Visibility.Visible;
                btnPositive.Content    = "OK";
                btnPositive.Click     += BtnPositive_Click;
            }
            break;

            case PS4_MessageBoxButton.YesNo:
            {
                btnPositive.Visibility = Visibility.Visible;
                btnPositive.Content    = "Yes";
                btnPositive.Click     += BtnPositive_Click;

                btnNegative.Visibility = Visibility.Visible;
                btnNegative.Content    = "No";
                btnNegative.Click     += BtnNegative_Click;;
            }
            break;

            case PS4_MessageBoxButton.OKCancel:
            {
                btnPositive.Visibility = Visibility.Visible;
                btnPositive.Content    = "OK";
                btnPositive.Click     += BtnPositive_Click;

                btnNegative.Visibility = Visibility.Visible;
                btnNegative.Content    = "Cancel";
                btnNegative.Click     += BtnNegative_Click;
            }
            break;

            default:

                break;
            }

            SoundClass.PlayPS4Sound(SoundToPlay);
        }
Example #4
0
        public void DoSettings()
        {
            //check control type
            if (Values[listBox.SelectedIndex].type != new Control())
            {
                ListViewItem lvi = listView.SelectedValue as ListViewItem;

                Values[listBox.SelectedIndex].SValue = lvi.Content.ToString();
                if (Values[listBox.SelectedIndex].SValue == "On")
                {
                    switch (Values[listBox.SelectedIndex].SettingName)
                    {
                    case "Overwrite Temp Folder":
                        Properties.Settings.Default.OverwriteTemp = true;
                        break;

                    case "Replace NP Title ID With PS2 Title ID":
                        Properties.Settings.Default.EnablePS2IDReplace = true;
                        break;

                    case "Enable Boot Logo":
                        Properties.Settings.Default.EnableBootScreen = true;
                        break;

                    case "Enable PS4 Ambient Music":
                        Properties.Settings.Default.EnableGuiMusic = true;

                        SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Music);

                        break;

                    case "Enable kozarovv Patches":
                        Properties.Settings.Default.EnableCustomConfigFetching = true;
                        break;

                    case "Use Specific Emu":
                        Properties.Settings.Default.UseSpesifcEmu = listView.SelectedItem.ToString();

                        //SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Music);

                        break;

                    case "Use LibOrbisPkg":
                        Properties.Settings.Default.UseLibOrbisPkg = true;
                        break;
                    }
                    Properties.Settings.Default.Save();//save the settings
                }
                else
                {
                    switch (Values[listBox.SelectedIndex].SettingName)
                    {
                    case "Overwrite Temp Folder":
                        Properties.Settings.Default.OverwriteTemp = false;
                        break;

                    case "Replace NP Title ID With PS2 Title ID":
                        Properties.Settings.Default.EnablePS2IDReplace = false;
                        break;

                    case "Enable Boot Logo":
                        Properties.Settings.Default.EnableBootScreen = false;

                        break;

                    case "Enable PS4 Ambient Music":
                        Properties.Settings.Default.EnableGuiMusic = false;
                        if (SoundClass.PS4BGMDevice != null)
                        {
                            SoundClass.PS4BGMDevice.Stop();
                        }
                        break;

                    case "Enable kozarovv Patches":
                        Properties.Settings.Default.EnableCustomConfigFetching = false;
                        break;

                    case "Use LibOrbisPkg":
                        Properties.Settings.Default.UseLibOrbisPkg = false;
                        break;

                    case "Use Specific Emu":
                        Properties.Settings.Default.UseSpesifcEmu = lvi.Content.ToString();
                        if (lvi.Content.ToString() == "Jax and Daxter")
                        {
                            //check if the item exists already
                            if (!Directory.Exists(AppCommonPath() + "Jax And Daxter"))
                            {
                                //check if the item is found
                                MessageBox ps4mes = new MessageBox("To Allow this feature an external download is needed \nWould you like to continue ?", "Download", PS4_MessageBoxButton.YesNo, SoundClass.Sound.Notification);
                                ps4mes.ShowDialog();
                                if (PS4_MessageBoxResult.Yes == MessageBox.ReturnResult)
                                {
                                    bgWorkerSS.RunWorkerAsync();
                                    startDownload("Jax and Daxter.zip");
                                }
                            }
                            else
                            {
                                MessageBox ps4mes = new MessageBox("Would you like to re-download the Jax And Daxter Emu ?", "Download", PS4_MessageBoxButton.YesNo, SoundClass.Sound.Notification);
                                ps4mes.ShowDialog();
                                if (PS4_MessageBoxResult.Yes == MessageBox.ReturnResult)
                                {
                                    bgWorkerSS.RunWorkerAsync();
                                    startDownload("Jax and Daxter.zip");
                                }
                            }
                        }
                        //SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Music);

                        break;
                    }
                    Properties.Settings.Default.Save();//save the settings
                }
            }
            else
            {
                using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
                {
                    System.Windows.Forms.DialogResult result = dialog.ShowDialog();
                    if (result == System.Windows.Forms.DialogResult.OK)
                    {
                        Properties.Settings.Default.TempPath = dialog.SelectedPath.ToString();
                    }
                    Values[listBox.SelectedIndex].SValue = Properties.Settings.Default.TempPath;
                }
                Properties.Settings.Default.Save();//save the settings
            }

            //close the options pannel
            MainWindowView.Opacity = 1.0f;
            OptionsView.Visibility = Visibility.Hidden;
            listBox.Background     = System.Windows.Media.Brushes.Transparent;

            ClearAndAddList();
        }
Example #5
0
        public void DoSettings()
        {
            //check control type
            if (Values[listBox.SelectedIndex].type != new Control())
            {
                ListViewItem lvi = listView.SelectedValue as ListViewItem;

                Values[listBox.SelectedIndex].SValue = lvi.Content.ToString();
                if (Values[listBox.SelectedIndex].SValue == "On")
                {
                    switch (Values[listBox.SelectedIndex].SettingName)
                    {
                    case "Overwrite Temp Folder":
                        Properties.Settings.Default.OverwriteTemp = true;
                        break;

                    case "Replace NP Title ID With PS2 Title ID":
                        Properties.Settings.Default.EnablePS2IDReplace = true;
                        break;

                    case "Enable Boot Logo":
                        Properties.Settings.Default.EnableBootScreen = true;
                        break;

                    case "Enable PS4 Ambient Music":
                        Properties.Settings.Default.EnableGuiMusic = true;

                        SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Music);

                        break;

                    case "Enable kozarovv Patches":
                        Properties.Settings.Default.EnableCustomConfigFetching = true;
                        break;

                    case "★ Use New PS2 Emulator":
                        Properties.Settings.Default.EnableNewEmu = true;
                        break;

                    case "★ Enable Widescreen (16:9)":
                        Properties.Settings.Default.Widescreen = true;
                        break;

                    case "★ Possible Game Loading Fix":
                        Properties.Settings.Default.LoadingFix = true;
                        break;

                    case "★ Possible Graphics & Glitches Fix":
                        Properties.Settings.Default.GraphicsFix = true;
                        break;

                    case "★ Save last Background Image":
                        Properties.Settings.Default.SaveBackground = true;
                        break;

                    case "★ Use ISO filename as Game Title":
                        Properties.Settings.Default.GetTitle = true;
                        break;
                    }
                    Properties.Settings.Default.Save();//save the settings
                }
                else
                {
                    switch (Values[listBox.SelectedIndex].SettingName)
                    {
                    case "Overwrite Temp Folder":
                        Properties.Settings.Default.OverwriteTemp = false;
                        break;

                    case "Replace NP Title ID With PS2 Title ID":
                        Properties.Settings.Default.EnablePS2IDReplace = false;
                        break;

                    case "Enable Boot Logo":
                        Properties.Settings.Default.EnableBootScreen = false;

                        break;

                    case "Enable PS4 Ambient Music":
                        Properties.Settings.Default.EnableGuiMusic = false;
                        if (SoundClass.PS4BGMDevice != null)
                        {
                            SoundClass.PS4BGMDevice.Stop();
                        }
                        break;

                    case "Enable kozarovv Patches":
                        Properties.Settings.Default.EnableCustomConfigFetching = false;
                        break;

                    case "★ Use New PS2 Emulator":
                        Properties.Settings.Default.EnableNewEmu = false;
                        break;

                    case "★ Enable Widescreen (16:9)":
                        Properties.Settings.Default.Widescreen = false;
                        break;

                    case "★ Possible Game Loading Fix":
                        Properties.Settings.Default.LoadingFix = false;
                        break;

                    case "★ Possible Graphics & Glitches Fix":
                        Properties.Settings.Default.GraphicsFix = false;
                        break;

                    case "★ Save last Background Image":
                        Properties.Settings.Default.SaveBackground = false;
                        break;

                    case "★ Use ISO filename as Game Title":
                        Properties.Settings.Default.GetTitle = false;
                        break;
                    }
                    Properties.Settings.Default.Save();//save the settings
                }
            }
            else
            {
                using (var dialog = new System.Windows.Forms.FolderBrowserDialog())
                {
                    System.Windows.Forms.DialogResult result = dialog.ShowDialog();
                    if (result == System.Windows.Forms.DialogResult.OK)
                    {
                        Properties.Settings.Default.TempPath = dialog.SelectedPath.ToString();
                    }
                    Values[listBox.SelectedIndex].SValue = Properties.Settings.Default.TempPath;
                }
                Properties.Settings.Default.Save();//save the settings
            }

            //close the options pannel
            MainWindowView.Opacity = 1.0f;
            OptionsView.Visibility = Visibility.Hidden;
            listBox.Background     = System.Windows.Media.Brushes.Transparent;

            ClearAndAddList();
        }
Example #6
0
        // private List

        public void DoSettings()
        {
            //check control type
            if (Values[ListView.SelectedIndex].type.GetType().Name == "Control")
            {
                string settingname = Values[ListView.SelectedIndex].SettingName.ToString();
                //     if (Values[ListView.SelectedIndex].SettingName.ToString() == "GS Uprender")
                // {
                //     //Open Config Screen

                //     OptionsList optionlist = new OptionsList(Enum.GetNames(typeof(Constants.Config_Emu_PS4.Gs_Uprender)), Values[ListView.SelectedIndex].SettingName.ToString());
                //     optionlist.ShowDialog();

                //}

                // if (Values[ListView.SelectedIndex].SettingName.ToString() == "GS Upscale")
                // {
                //     //Open Config Screen

                //     OptionsList optionlist = new OptionsList(Enum.GetNames(typeof(Constants.Config_Emu_PS4.Gs_Upscale)), Values[ListView.SelectedIndex].SettingName.ToString());
                //     optionlist.ShowDialog();

                // }
                SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Info_Pannel_Sound);
                switch (settingname)
                {
                case "GS Uprender":
                    OptionsList optionlist = new OptionsList(Enum.GetNames(typeof(Constants.Config_Emu_PS4.Gs_Uprender)), Values[ListView.SelectedIndex].SettingName.ToString());
                    optionlist.ShowDialog();
                    break;

                case "GS Upscale":
                    optionlist = new OptionsList(Enum.GetNames(typeof(Constants.Config_Emu_PS4.Gs_Upscale)), Values[ListView.SelectedIndex].SettingName.ToString());
                    optionlist.ShowDialog();
                    break;

                default:
                    new MessageBox(settingname + "Not Implemented", "Error", PS4_MessageBoxButton.OK, SoundClass.Sound.Error).ShowDialog();
                    break;
                }
            }
            if (Values[ListView.SelectedIndex].type.GetType().Name == "TextBox")
            {
                EditText EditText = new EditText(Values[ListView.SelectedIndex].SValue[0]);
                EditText.ShowDialog();
                Values[ListView.SelectedIndex].SValue[0] = EditText._Value;
                SoundClass.PlayPS4Sound(SoundClass.Sound.PS4_Info_Pannel_Sound);

                string var = GetDescription <Record>(nameof(config.recod.audio_ext));

                switch (Values[ListView.SelectedIndex].SettingName.ToString())
                {
                case "Config Local Lua":
                    config.config_local_lua = Values[ListView.SelectedIndex].SValue[0];
                    break;

                case "Load Tooling Lua":
                    config.load_tooling_lua = Values[ListView.SelectedIndex].SValue[0];
                    break;

                case "Record Audio":
                    config.recod.audio = Values[ListView.SelectedIndex].SValue[0];
                    break;

                case "Record Audio Img":
                    config.recod.audio_img = Values[ListView.SelectedIndex].SValue[0];
                    break;

                case "Record Audio Image":
                    config.recod.audio_img = Values[ListView.SelectedIndex].SValue[0];
                    break;
                    //case :
                    //    config.recod.audio_img = Values[ListView.SelectedIndex].SValue[0];
                    //    break;
                }
            }
            else
            {
                Properties.Settings.Default.Save();//save the settings
            }
            ClearandReload();
        }