|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Drawing; |
| 4 | +using System.Drawing.Imaging; |
| 5 | +using System.IO; |
| 6 | +using System.Linq; |
| 7 | +using System.Text; |
| 8 | +using System.Threading.Tasks; |
| 9 | +using System.Windows; |
| 10 | +using System.Windows.Controls; |
| 11 | +using System.Windows.Data; |
| 12 | +using System.Windows.Documents; |
| 13 | +using System.Windows.Input; |
| 14 | +using System.Windows.Media; |
| 15 | +using System.Windows.Media.Imaging; |
| 16 | +using System.Windows.Shapes; |
| 17 | + |
| 18 | +namespace PS4_PS2_Classics_Gui__WPF_.HowToUse |
| 19 | +{ |
| 20 | + /// <summary> |
| 21 | + /// Interaction logic for HowToUse.xaml |
| 22 | + /// </summary> |
| 23 | + public partial class HowToUse : Window |
| 24 | + { |
| 25 | + public HowToUse() |
| 26 | + { |
| 27 | + InitializeComponent(); |
| 28 | + } |
| 29 | + |
| 30 | + int CurrentIdx = 0; |
| 31 | + |
| 32 | + public class TutorialImages |
| 33 | + { |
| 34 | + public string TutorialText { get; set; } |
| 35 | + public Bitmap TutorialImage { get; set; } |
| 36 | + } |
| 37 | + |
| 38 | + public List<TutorialImages> TutWithImages = new List<TutorialImages>(); |
| 39 | + |
| 40 | + public static BitmapSource ConvertToImageSource(Bitmap bitmap) |
| 41 | + { |
| 42 | + if (bitmap == null) |
| 43 | + throw new ArgumentNullException("bitmap"); |
| 44 | + |
| 45 | + var rect = new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height); |
| 46 | + |
| 47 | + var bitmapData = bitmap.LockBits( |
| 48 | + rect, |
| 49 | + ImageLockMode.ReadWrite, |
| 50 | + System.Drawing.Imaging.PixelFormat.Format32bppArgb); |
| 51 | + |
| 52 | + try |
| 53 | + { |
| 54 | + var size = (rect.Width * rect.Height) * 4; |
| 55 | + |
| 56 | + return BitmapSource.Create( |
| 57 | + bitmap.Width, |
| 58 | + bitmap.Height, |
| 59 | + bitmap.HorizontalResolution, |
| 60 | + bitmap.VerticalResolution, |
| 61 | + PixelFormats.Bgra32, |
| 62 | + null, |
| 63 | + bitmapData.Scan0, |
| 64 | + size, |
| 65 | + bitmapData.Stride); |
| 66 | + } |
| 67 | + finally |
| 68 | + { |
| 69 | + bitmap.UnlockBits(bitmapData); |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + private void imagforward_MouseEnter(object sender, MouseEventArgs e) |
| 74 | + { |
| 75 | + if(imagforward.IsMouseOver == true) |
| 76 | + { |
| 77 | + imagforward.Source = ConvertToImageSource(Properties.Resources.icons8_go_back_24__1_); |
| 78 | + } |
| 79 | + if(imgback.IsMouseOver == true) |
| 80 | + { |
| 81 | + imgback.Source = ConvertToImageSource(Properties.Resources.icons8_go_back_24__1_); |
| 82 | + } |
| 83 | + } |
| 84 | + |
| 85 | + private void Window_Loaded(object sender, RoutedEventArgs e) |
| 86 | + { |
| 87 | + //programically add the steps and description |
| 88 | + TutWithImages.Add(new TutorialImages{ TutorialText = "Welcome to the Tutorial \n\nThis is the main UI(User interface) for PS2 Classics \n\nThe Main Controls for this screen are as follows\n\n * File \n\n * Mute Button\n\n * PS2 ISO Path\n\n * ISO Button \n\n * NP Title ID\n\n * Title Text Box\n\n * Create PS2 Classics Button ", TutorialImage = Properties.Resources.MainUI }); |
| 89 | + TutWithImages.Add(new TutorialImages { TutorialText = "File Menu \n\n There are 5 Options on this menu \n\n\t*Settings\n\n\tThis Opens The Settings View\n\n\t*Log an issue\n\n Allows You To Log an Issue on my Github\n\n\t*Add Custom PS2 Config\n\n\t This allows you to use a custom config for the PS2 Classic(This Overrides the default one)\n\n\t*Credits\n\n\tThis Opens Up The Credit View Thanks Everyone\n\n\t*How To Use\n\n\tOpens This View", TutorialImage = Properties.Resources.MainUIFile }); |
| 90 | + TutWithImages.Add(new TutorialImages { TutorialText = "Settings \n\nThis view will have all the settings for PS2 Classics Gui you can turn any setting on and off from here", TutorialImage = Properties.Resources.SettingsView }); |
| 91 | + //TutWithImages.Add(new TutorialImages { TutorialText = "Log an Issue\n\nThis will open up a browser to github so you can log an issue", TutorialImage = Properties.Resources.MainUIFile }); |
| 92 | + //TutWithImages.Add(new TutorialImages { TutorialText = "Add Custom Config\n\nThis will allow you to replace the default "}) |
| 93 | + TutWithImages.Add(new TutorialImages { TutorialText = "Mute/Unmute XMB Music\n\nThis will mute and unmute PS2 Classics Music (XMB Music)\n\nThis option can be found at the top right of the screen",TutorialImage = Properties.Resources.Mute_Inmute }); |
| 94 | + |
| 95 | + TutWithImages.Add(new TutorialImages { TutorialText = "Single ISO\n\nTo Add a single iso for PS2 classics Click on the ISO Button and select you single iso \nthis will auto load the PS2 Title as Np Title ID into the GUI\n\n(Attached is 2 image to show the process) \n Current 1/2 " , TutorialImage = Properties.Resources.PS2_Single_ISO}); |
| 96 | + |
| 97 | + TutWithImages.Add(new TutorialImages { TutorialText = "Single ISO\n\nTo Add a single iso for PS2 classics Click on the ISO Button and select you single iso \nthis will auto load the PS2 Title as Np Title ID into the GUI\n\n(Attached is 2 image to show the process) \n Current 2/2 ", TutorialImage = Properties.Resources.PS2_NP_Title_ID }); |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + TutWithImages.Add(new TutorialImages { TutorialText = "Multi ISO\n\nTo Add Multiple iso(s) for PS2 classics Click on the ISO Button and select all your desired iso (s) Maximum of 7 allowed\nYou will need to add a Np Title ID into the GUI\n\n(Attached is 3 image to show the process) \n Current 1/3 ", TutorialImage = Properties.Resources.MultiISO1}); |
| 102 | + |
| 103 | + TutWithImages.Add(new TutorialImages { TutorialText = "Multi ISO\n\nTo Add Multiple iso(s) for PS2 classics Click on the ISO Button and select all your desired iso (s) Maximum of 7 allowed \nYou will need to add a Np Title ID into the GUI\n\n(Attached is 3 image to show the process) \n Current 2/3 ", TutorialImage = Properties.Resources.MultiISO2 }); |
| 104 | + |
| 105 | + TutWithImages.Add(new TutorialImages { TutorialText = "Multi ISO\n\nTo Add Multiple iso(s) for PS2 classics Click on the ISO Button and select all your desired iso (s) Maximum of 7 allowed \nYou will need to add a Np Title ID into the GUI\n\n(Attached is 3 image to show the process) \n Current 3/3 ", TutorialImage = Properties.Resources.MultiISO3 }); |
| 106 | + |
| 107 | + TutWithImages.Add(new TutorialImages { TutorialText = "Title \n\nThis is the Title you will see on the PS4 XMB", TutorialImage = Properties.Resources.PS2_Title }); |
| 108 | + |
| 109 | + TutWithImages.Add(new TutorialImages { TutorialText = "Click Create PS2 Classics\n\nThis will start the creation process select a location to save and wait for it to complete", TutorialImage = Properties.Resources.Custom_Create }); |
| 110 | + //load starting items |
| 111 | + SetImageIndInfo(); |
| 112 | + } |
| 113 | + |
| 114 | + private void imgback_MouseLeave(object sender, MouseEventArgs e) |
| 115 | + { |
| 116 | + |
| 117 | + imagforward.Source = ConvertToImageSource(Properties.Resources.icons8_go_back_24); |
| 118 | + |
| 119 | + imgback.Source = ConvertToImageSource(Properties.Resources.icons8_go_back_24); |
| 120 | + |
| 121 | + } |
| 122 | + |
| 123 | + private void imgback_MouseDown(object sender, MouseButtonEventArgs e) |
| 124 | + { |
| 125 | + if(CurrentIdx > 0) |
| 126 | + { |
| 127 | + CurrentIdx--; |
| 128 | + SetImageIndInfo(); |
| 129 | + |
| 130 | + } |
| 131 | + } |
| 132 | + |
| 133 | + private void SetImageIndInfo() |
| 134 | + { |
| 135 | + if(TutWithImages.Count <= CurrentIdx) |
| 136 | + { |
| 137 | + return; |
| 138 | + } |
| 139 | + textBlock.Text = TutWithImages[CurrentIdx].TutorialText; |
| 140 | + image.Source = ConvertToImageSource(TutWithImages[CurrentIdx].TutorialImage); |
| 141 | + SoundClass.PlayPS4Sound(SoundClass.Sound.Navigation); |
| 142 | + } |
| 143 | + |
| 144 | + private void imagforward_MouseDown(object sender, MouseButtonEventArgs e) |
| 145 | + { |
| 146 | + if(CurrentIdx < (TutWithImages.Count -1)) |
| 147 | + { |
| 148 | + CurrentIdx++; |
| 149 | + SetImageIndInfo(); |
| 150 | + |
| 151 | + } |
| 152 | + } |
| 153 | + } |
| 154 | +} |
0 commit comments