Skip to content

Commit 4b1cfb2

Browse files
V1.0.0.11
Release Publish
1 parent f45d1a5 commit 4b1cfb2

86 files changed

Lines changed: 1611 additions & 236 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
0 Bytes
Binary file not shown.

PS4 PS2 Classis GUI/PS4 PS2 Classics Gui (WPF)/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<setting name="FirstTime" serializeAs="String">
4141
<value>True</value>
4242
</setting>
43+
<setting name="FontInstalled" serializeAs="String">
44+
<value>False</value>
45+
</setting>
4346
</PS4_PS2_Classics_Gui__WPF_.Properties.Settings>
4447
</userSettings>
4548
</configuration>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Microsoft.Win32;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Drawing.Text;
5+
using System.IO;
6+
using System.Linq;
7+
using System.Runtime.InteropServices;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
11+
namespace PS4_PS2_Classics_Gui__WPF_
12+
{
13+
public class FontInstaller
14+
{
15+
[DllImport("gdi32", EntryPoint = "AddFontResource")]
16+
public static extern int AddFontResourceA(string lpFileName);
17+
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
18+
private static extern int AddFontResource(string lpszFilename);
19+
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
20+
private static extern int CreateScalableFontResource(uint fdwHidden, string
21+
lpszFontRes, string lpszFontFile, string lpszCurrentPath);
22+
23+
/// <summary>
24+
/// Installs font on the user's system and adds it to the registry so it's available on the next session
25+
/// Your font must be included in your project with its build path set to 'Content' and its Copy property
26+
/// set to 'Copy Always'
27+
/// </summary>
28+
/// <param name="contentFontName">Your font to be passed as a resource (i.e. "myfont.tff")</param>
29+
public static void RegisterFont(string contentFontName)
30+
{
31+
// Creates the full path where your font will be installed
32+
var fontDestination = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Fonts), contentFontName);
33+
34+
if (!File.Exists(fontDestination))
35+
{
36+
// Copies font to destination
37+
System.IO.File.Copy(Path.Combine(System.IO.Directory.GetCurrentDirectory(), contentFontName), fontDestination);
38+
39+
// Retrieves font name
40+
// Makes sure you reference System.Drawing
41+
PrivateFontCollection fontCol = new PrivateFontCollection();
42+
fontCol.AddFontFile(fontDestination);
43+
var actualFontName = fontCol.Families[0].Name;
44+
45+
//Add font
46+
AddFontResource(fontDestination);
47+
//Add registry entry
48+
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", actualFontName, contentFontName, RegistryValueKind.String);
49+
}
50+
}
51+
52+
}
53+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Window x:Class="PS4_PS2_Classics_Gui__WPF_.HowToUse.HowToUse"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:PS4_PS2_Classics_Gui__WPF_.HowToUse"
7+
mc:Ignorable="d"
8+
Title="HowToUse" Height="480" Width="960" Icon="/Resources/favicon.ico" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="WidthAndHeight" Loaded="Window_Loaded" >
9+
<Window.Background>
10+
<ImageBrush ImageSource="/Resources/flow.png"/>
11+
</Window.Background>
12+
<Grid>
13+
<Image x:Name="image" HorizontalAlignment="Left" Height="313" Margin="83,10,0,0" VerticalAlignment="Top" Width="764"/>
14+
<ScrollViewer Margin="83,331,115.6,13.4" Height="106" >
15+
<TextBlock x:Name="textBlock" TextWrapping="WrapWithOverflow" HorizontalAlignment="Left" Text="TextBlock" VerticalAlignment="Top" Width="780" Foreground="White"/>
16+
</ScrollViewer>
17+
<Image x:Name="imgback" HorizontalAlignment="Left" Height="48" Margin="10,190,0,0" VerticalAlignment="Top" Width="48" Source="/Resources/icons8-go-back-24.png" Stretch="Fill" MouseEnter="imagforward_MouseEnter" MouseLeave="imgback_MouseLeave" MouseDown="imgback_MouseDown">
18+
<Image.Style>
19+
<Style TargetType="{x:Type Image}">
20+
<Setter Property="Source" Value="/Resources/icons8-go-back-24.png"/>
21+
<Style.Triggers>
22+
<Trigger Property="IsMouseOver" Value="True">
23+
<Setter Property="Source" Value="/Resources/icons8-go-back-24 (1).png"/>
24+
</Trigger>
25+
</Style.Triggers>
26+
</Style>
27+
</Image.Style>
28+
</Image>
29+
<Image x:Name="imagforward" HorizontalAlignment="Left" Height="48" Margin="871,197,0,0" VerticalAlignment="Top" Width="48" Source="/Resources/icons8-go-back-24.png" RenderTransformOrigin="0.5,0.5" Stretch="Fill" MouseEnter="imagforward_MouseEnter" MouseLeave="imgback_MouseLeave" MouseDown="imagforward_MouseDown">
30+
<Image.Style>
31+
<Style TargetType="{x:Type Image}">
32+
<Setter Property="Source" Value="/Resources/icons8-go-back-24.png"/>
33+
<Style.Triggers>
34+
<Trigger Property="IsMouseOver" Value="True">
35+
<Setter Property="Source" Value="/Resources/icons8-go-back-24 (1).png"/>
36+
</Trigger>
37+
</Style.Triggers>
38+
</Style>
39+
</Image.Style>
40+
<Image.RenderTransform>
41+
<TransformGroup>
42+
<ScaleTransform/>
43+
<SkewTransform/>
44+
<RotateTransform Angle="180"/>
45+
<TranslateTransform/>
46+
</TransformGroup>
47+
</Image.RenderTransform>
48+
</Image>
49+
50+
</Grid>
51+
</Window>
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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+
}

PS4 PS2 Classis GUI/PS4 PS2 Classics Gui (WPF)/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
<!--<MenuItem Header="Add Custom .lua configs" Click="MenuItem_Click_3" />-->
2626
<Separator/>
2727
<MenuItem Header="Credits" Click="MenuItem_Click_4" />
28+
<Separator/>
29+
<MenuItem Header="How To Use" Click="MenuItem_Click_8" />
2830
</MenuItem>
2931
</Menu>
3032

@@ -81,6 +83,7 @@
8183
</Grid>
8284
<Grid x:Name="OptionS" MouseDown="Grid_MouseDown" Background="Black" Opacity="0.71" Width="390" HorizontalAlignment="Right" VerticalAlignment="Stretch">
8385
<Label x:Name="PS2Titlelbl" Content="PS2 ISO:" HorizontalAlignment="Left" Margin="0,42,0,0" VerticalAlignment="Top" AllowDrop="False" FontSize="15" FontFamily="Yu Gothic" Foreground="#FFFFFFFF" Background="{x:Null}" />
86+
8487
<TextBox x:Name="txtPath" Text="" HorizontalAlignment="Left" Margin="10,76,0,0" VerticalAlignment="Top" AllowDrop="False" FontSize="20" FontFamily="Yu Gothic" Foreground="#FFFFFFFF" Height="40" Background="{x:Null}" Width="250"/>
8588
<Button x:Name="btnSelectISO" Content="" HorizontalAlignment="Left" Margin="265,76,0,0" VerticalAlignment="Top" Width="53" Height="40" Click="btnSelectISO_Click" BorderBrush="Black">
8689
<Button.Background>

0 commit comments

Comments
 (0)