Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoCodeLeftBehind <jmcode@gmail.com>2017-02-07 08:13:55 +0300
committerNoCodeLeftBehind <jmcode@gmail.com>2017-02-07 08:13:55 +0300
commit6354057dc15d60a4ade0eba8552d76eb886897f3 (patch)
tree7df7db15b1fb811f33ab3e62ed6a1b99f9f7ec66
parentce6ae26792393c8f31fa52c32b404afb66207c8e (diff)
Improved artwork detection
Added support for an "art" folder (within the main application folder) into which the user can place a cover art set in .png or .jpg format. When the user adds a game, hakchi2 will look in the "art" folder for a cover art filename that matches the ROM filename. If hakchi2 finds a match, it will automatically use that cover art for the added game.
-rw-r--r--NesGame.cs9
-rw-r--r--art/README.txt1
-rw-r--r--hakchi_gui.csproj3
3 files changed, 13 insertions, 0 deletions
diff --git a/NesGame.cs b/NesGame.cs
index 7b6a23b9..2a3b9d89 100644
--- a/NesGame.cs
+++ b/NesGame.cs
@@ -311,6 +311,15 @@ namespace com.clusterrr.hakchi_gui
imagePath = Path.Combine(Path.GetDirectoryName(nesFileName), Path.GetFileNameWithoutExtension(nesFileName) + ".jpg");
if (File.Exists(imagePath))
cover = Image.FromFile(imagePath);
+
+ var artDirectory = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "art");
+ Directory.CreateDirectory(artDirectory);
+ imagePath = Path.Combine(artDirectory, Path.GetFileNameWithoutExtension(nesFileName) + ".png");
+ if (File.Exists(imagePath))
+ cover = Image.FromFile(imagePath);
+ imagePath = Path.Combine(artDirectory, Path.GetFileNameWithoutExtension(nesFileName) + ".jpg");
+ if (File.Exists(imagePath))
+ cover = Image.FromFile(imagePath);
}
if (cover != null)
SetImage(cover, ConfigIni.EightBitPngCompression);
diff --git a/art/README.txt b/art/README.txt
new file mode 100644
index 00000000..a2d5faa0
--- /dev/null
+++ b/art/README.txt
@@ -0,0 +1 @@
+Copy your cover art set here in .png or .jpg format, and hakchi2 will look here when adding games. If it finds a cover art filename that matches the ROM filename, hakchi2 will automatically use that cover art for that game.
diff --git a/hakchi_gui.csproj b/hakchi_gui.csproj
index 1dc719bb..66768504 100644
--- a/hakchi_gui.csproj
+++ b/hakchi_gui.csproj
@@ -302,6 +302,9 @@
<EmbeddedResource Include="WorkerForm.resx">
<DependentUpon>WorkerForm.cs</DependentUpon>
</EmbeddedResource>
+ <None Include="art\README.txt">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Include="data\fes1.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>