diff --git a/.gitignore b/.gitignore index 976dfe31..687702c6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,4 @@ legacy/ /VCManualCreator /FriishProduce_v2.0 -/docs/site -/FriishProduce/Resources/icons/consoles/yspixel +/docs/site \ No newline at end of file diff --git a/FriishProduce/FileDatas/Icons.Designer.cs b/FriishProduce/FileDatas/Icons.Designer.cs new file mode 100644 index 00000000..adfc6d6e --- /dev/null +++ b/FriishProduce/FileDatas/Icons.Designer.cs @@ -0,0 +1,243 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FriishProduce.FileDatas { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Icons { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Icons() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FriishProduce.FileDatas.Icons", typeof(Icons).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon FC { + get { + object obj = ResourceManager.GetObject("FC", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon GB { + get { + object obj = ResourceManager.GetObject("GB", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon GBA { + get { + object obj = ResourceManager.GetObject("GBA", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon GBC { + get { + object obj = ResourceManager.GetObject("GBC", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon N64 { + get { + object obj = ResourceManager.GetObject("N64", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon NDS { + get { + object obj = ResourceManager.GetObject("NDS", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon NEO { + get { + object obj = ResourceManager.GetObject("NEO", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon NEOCD { + get { + object obj = ResourceManager.GetObject("NEOCD", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon NES { + get { + object obj = ResourceManager.GetObject("NES", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon PCE { + get { + object obj = ResourceManager.GetObject("PCE", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon PCECD { + get { + object obj = ResourceManager.GetObject("PCECD", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon PSX { + get { + object obj = ResourceManager.GetObject("PSX", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon SFC { + get { + object obj = ResourceManager.GetObject("SFC", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon SMD { + get { + object obj = ResourceManager.GetObject("SMD", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon SMS { + get { + object obj = ResourceManager.GetObject("SMS", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon SNES { + get { + object obj = ResourceManager.GetObject("SNES", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon TG16 { + get { + object obj = ResourceManager.GetObject("TG16", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon VB { + get { + object obj = ResourceManager.GetObject("VB", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/FriishProduce/FileDatas/Icons.resx b/FriishProduce/FileDatas/Icons.resx new file mode 100644 index 00000000..beaa8333 --- /dev/null +++ b/FriishProduce/FileDatas/Icons.resx @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\icons\consoles\yspixel\Fc_Pad1.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\GBPocket_Gray.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Gba02.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\GBC_Purple.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\N64_Pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Logo_NDS.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Logo_NeoGeo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Logo_NeoGeoCD.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Nes_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Pce_02_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Pce_Duo-RxPad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Ps_pad03.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Sfc_pad02.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\MD_Pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Sms_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\Snes_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\TurboGrafx_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\icons\consoles\yspixel\VirtualBoy_pad.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/FriishProduce/FriishProduce.csproj b/FriishProduce/FriishProduce.csproj index 7e75cd50..87f7cc01 100644 --- a/FriishProduce/FriishProduce.csproj +++ b/FriishProduce/FriishProduce.csproj @@ -179,6 +179,11 @@ True Apps.resx + + True + True + Icons.resx + True True @@ -350,6 +355,10 @@ ResXFileCodeGenerator Apps.Designer.cs + + ResXFileCodeGenerator + Icons.Designer.cs + ResXFileCodeGenerator SaveImages.Designer.cs @@ -536,6 +545,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/FriishProduce/MainForm.cs b/FriishProduce/MainForm.cs index 8b04851b..46f97b60 100644 --- a/FriishProduce/MainForm.cs +++ b/FriishProduce/MainForm.cs @@ -17,23 +17,6 @@ public partial class MainForm : Form private Wait wait = new(false); #region //////////////////// Platforms //////////////////// - public readonly IDictionary Icons = new Dictionary - { - { Platform.NES, new Icon(Properties.Resources.nintendo_nes, 16, 16).ToBitmap() }, - { Platform.SNES, new Icon(Properties.Resources.nintendo_super_nes, 16, 16).ToBitmap() }, - { Platform.N64, new Icon(Properties.Resources.nintendo_nintendo64, 16, 16).ToBitmap() }, - { Platform.SMS, new Icon(Properties.Resources.sega_master_system, 16, 16).ToBitmap() }, - { Platform.SMD, new Icon(Properties.Resources.sega_genesis, 16, 16).ToBitmap() }, - { Platform.PCE, new Icon(Properties.Resources.nec_turbografx_16, 16, 16).ToBitmap() }, - { Platform.PCECD, new Icon(Properties.Resources.nec_turbografx_16, 16, 16).ToBitmap() }, - { Platform.NEO, new Icon(Properties.Resources.snk_neo_geo_aes, 16, 16).ToBitmap() }, - { Platform.C64, Properties.Resources.c64 }, - { Platform.MSX, Properties.Resources.msx }, - { Platform.PSX, new Icon(Properties.Resources.sony_playstation, 16, 16).ToBitmap() }, - { Platform.Flash, Properties.Resources.flash }, - { Platform.RPGM, new Icon(Properties.Resources.rpg2003, 16, 16).ToBitmap() } - }; - private static readonly string[] platformsList = new string[] { Platform.NES.ToString(), @@ -93,7 +76,7 @@ private ToolStripItem[] platformsStripItemList() list.Add(new ToolStripMenuItem ( Program.Lang.Format(("project_type", Name), Program.Lang.Console(converted)), - Icons[converted], + Platforms.Icons[converted], addProject, platform + "0" )); @@ -156,7 +139,7 @@ private void RefreshForm() vistaMenu.SetImage(preferences, toolbarPreferences.Image); foreach (MenuItem item in new_project.MenuItems.OfType()) if (Enum.TryParse(item.Name, out Platform converted)) - vistaMenu.SetImage(item, Icons[converted]); + vistaMenu.SetImage(item, Platforms.Icons[converted]); BrowseProject.Title = new Regex(@"\(.*\)").Replace(open_project.Text, "").Replace("&", ""); SaveProject.Title = new Regex(@"\(.*\)").Replace(save_project_as.Text, "").Replace("&", ""); @@ -647,13 +630,13 @@ private void Form_DragDrop(object sender, DragEventArgs e) switch (value) { default: - foreach (var tuple in Filters.ROM) + foreach (var tuple in Platforms.Filters) { - foreach (var extension in tuple.Extensions) + foreach (var extension in tuple.Value) { if (extension.ToLower().Contains(value)) { - addTab(tuple.Platform, null, file); + addTab(tuple.Key ?? Platform.NES, null, file); return; } }; diff --git a/FriishProduce/ProjectForm.cs b/FriishProduce/ProjectForm.cs index 7c13fe26..d5bf2b76 100644 --- a/FriishProduce/ProjectForm.cs +++ b/FriishProduce/ProjectForm.cs @@ -305,10 +305,10 @@ private libWiiSharp.Region _bannerRegion { value = channels != null ? inWadRegion switch { Region.Japan => 0, Region.Europe => 2, Region.Korea => 3, _ => 1 } : 1; - if (!isVirtualConsole && Program.Lang.Current.StartsWith("ja")) + if (!isVirtualConsole && Program.Lang.GetRegion() is Language.Region.Japan) value = 0; - if (!isVirtualConsole && Program.Lang.Current.StartsWith("ko")) + if (!isVirtualConsole && Program.Lang.GetRegion() is Language.Region.Korea) value = 3; } @@ -760,11 +760,11 @@ private void Setup() default: try { - var extensions = Filters.ROM.Where(x => x.Platform == (targetPlatform == Platform.S32X ? Platform.SMD : targetPlatform)).ToArray()[0]; - for (int i = 0; i < extensions.Extensions.Length; i++) - if (!extensions.Extensions[i].StartsWith("*")) extensions.Extensions[i] = "*" + extensions.Extensions[i]; + var extensions = Platforms.Filters.Where(x => x.Key == (targetPlatform == Platform.S32X ? Platform.SMD : targetPlatform)).ToArray()[0]; + for (int i = 0; i < extensions.Value.Length; i++) + if (!extensions.Value[i].StartsWith("*")) extensions.Value[i] = "*" + extensions.Value[i]; - browseROM.Filter = Program.Lang.Format(("filter.rom", null), Program.Lang.Console(targetPlatform), string.Join(", ", extensions.Extensions), string.Join(";", extensions.Extensions)); + browseROM.Filter = Program.Lang.Format(("filter.rom", null), Program.Lang.Console(targetPlatform), string.Join(", ", extensions.Value), string.Join(";", extensions.Value)); } catch { @@ -803,11 +803,7 @@ private void Form_Shown(object sender, EventArgs e) // Set icon // ******** if (Program.MainForm != null) - { - using var icon = new Bitmap(Program.MainForm.Icons[targetPlatform]); - icon.MakeTransparent(Color.White); - Icon = Icon.FromHandle(icon.GetHicon()); - } + Icon = Icon.FromHandle(Platforms.Icons[targetPlatform].GetHicon()); // Cosmetic // ******** @@ -1868,8 +1864,8 @@ private void AddBases() foreach (var entry in channels.Entries) { - var title = entry.Regions.Contains(0) && Program.Lang.Current.StartsWith("ja") ? entry.Titles[0] - : entry.Regions.Contains(0) && Program.Lang.Current.StartsWith("ko") ? entry.Titles[entry.Titles.Count - 1] + var title = entry.Regions.Contains(0) && Program.Lang.GetRegion() is Language.Region.Japan ? entry.Titles[0] + : entry.Regions.Contains(0) && Program.Lang.GetRegion() is Language.Region.Korea ? entry.Titles[entry.Titles.Count - 1] : entry.Regions.Contains(0) && entry.Regions.Count > 1 ? entry.Titles[1] : entry.Titles[0]; @@ -1927,65 +1923,12 @@ private void Base_SelectedIndexChanged(object sender, EventArgs e) // If so, make Japan/Korea region item the first in the WAD region context list // ******** var selected = regions.IndexOf(Program.Lang.String("region_u")); + Language.Region region = Program.Lang.GetRegion(); - var altRegions = new Dictionary() - { - { "-JP", 0 }, - { "-KR", 1 }, - { "-GB", 2 }, - { "-IE", 2 }, - { "-BE", 2 }, - { "-FR", 2 }, - { "-ES", 2 }, - { "-PT", 2 }, - { "-IN", 2 }, - { "-ZA", 2 }, - { "-AU", 2 }, - { "-NZ", 2 }, - { "-CA", 3 }, - { "-US", 3 }, - { "-419", 3 }, - { "-MX", 3 }, - { "-CO", 3 }, - { "-EC", 3 }, - { "-VN", 3 }, - { "-CL", 3 }, - { "-AR", 3 }, - { "-BR", 3 }, - { "ja", 0 }, - { "ko", 1 }, - { "fr", 2 }, - { "es", 2 }, - { "de", 2 }, - { "nl", 2 }, - { "it", 2 }, - { "pl", 2 }, - { "ru", 2 }, - { "uk", 2 }, - { "tr", 2 }, - { "hu", 2 }, - { "ro", 2 }, - { "ca", 2 }, - { "eu", 2 }, - { "gl", 2 }, - { "ast", 2 }, - { "dk", 2 }, - { "no", 2 }, - { "sv", 2 }, - { "fi", 2 }, - }; - - foreach (var item in altRegions) - if (Program.Lang.Current.ToLower().StartsWith(item.Key) || Program.Lang.Current.ToUpper().EndsWith(item.Key)) - { - selected = regions.IndexOf(item.Value == 0 ? Program.Lang.String("region_j") - : item.Value == 1 ? Program.Lang.String("region_k") - : item.Value == 2 ? Program.Lang.String("region_e") - : Program.Lang.String("region_u")); - - if (selected == -1 && item.Value == 1) selected = regions.IndexOf(Program.Lang.String("region_u")); - break; - } + selected = regions.IndexOf(region is Language.Region.Japan ? Program.Lang.String("region_j") + : region is Language.Region.Korea ? Program.Lang.String("region_k") + : region is Language.Region.Europe ? Program.Lang.String("region_e") + : Program.Lang.String("region_u")); if (selected == -1) selected = 0; diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Fc_Pad1.ico b/FriishProduce/Resources/icons/consoles/yspixel/Fc_Pad1.ico new file mode 100644 index 00000000..e56d71b3 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Fc_Pad1.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/GBC_Purple.ico b/FriishProduce/Resources/icons/consoles/yspixel/GBC_Purple.ico new file mode 100644 index 00000000..bed1b26e Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/GBC_Purple.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/GBPocket_Gray.ico b/FriishProduce/Resources/icons/consoles/yspixel/GBPocket_Gray.ico new file mode 100644 index 00000000..02424c43 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/GBPocket_Gray.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Gba02.ico b/FriishProduce/Resources/icons/consoles/yspixel/Gba02.ico new file mode 100644 index 00000000..52797e19 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Gba02.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Logo_NDS.ico b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NDS.ico new file mode 100644 index 00000000..2dbf4e4c Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NDS.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeo.ico b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeo.ico new file mode 100644 index 00000000..dda6e6d6 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeo.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeoCD.ico b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeoCD.ico new file mode 100644 index 00000000..aa46a4fd Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Logo_NeoGeoCD.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/MD_Pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/MD_Pad.ico new file mode 100644 index 00000000..5d771da2 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/MD_Pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/N64_Pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/N64_Pad.ico new file mode 100644 index 00000000..5821c1ec Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/N64_Pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Nes_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/Nes_pad.ico new file mode 100644 index 00000000..c5d6fefc Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Nes_pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Pce_02_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/Pce_02_pad.ico new file mode 100644 index 00000000..114649ba Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Pce_02_pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Pce_Duo-RxPad.ico b/FriishProduce/Resources/icons/consoles/yspixel/Pce_Duo-RxPad.ico new file mode 100644 index 00000000..d735d8f6 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Pce_Duo-RxPad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Ps_pad03.ico b/FriishProduce/Resources/icons/consoles/yspixel/Ps_pad03.ico new file mode 100644 index 00000000..ed9713ee Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Ps_pad03.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Sfc_pad02.ico b/FriishProduce/Resources/icons/consoles/yspixel/Sfc_pad02.ico new file mode 100644 index 00000000..fe88f26a Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Sfc_pad02.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Sms_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/Sms_pad.ico new file mode 100644 index 00000000..261ae7ab Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Sms_pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/Snes_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/Snes_pad.ico new file mode 100644 index 00000000..70267901 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/Snes_pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/TurboGrafx_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/TurboGrafx_pad.ico new file mode 100644 index 00000000..5e7f788f Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/TurboGrafx_pad.ico differ diff --git a/FriishProduce/Resources/icons/consoles/yspixel/VirtualBoy_pad.ico b/FriishProduce/Resources/icons/consoles/yspixel/VirtualBoy_pad.ico new file mode 100644 index 00000000..90408e01 Binary files /dev/null and b/FriishProduce/Resources/icons/consoles/yspixel/VirtualBoy_pad.ico differ diff --git a/FriishProduce/Subforms/ContentOptions/Options_VC_SEGA.cs b/FriishProduce/Subforms/ContentOptions/Options_VC_SEGA.cs index d6724a2a..9e53fa89 100644 --- a/FriishProduce/Subforms/ContentOptions/Options_VC_SEGA.cs +++ b/FriishProduce/Subforms/ContentOptions/Options_VC_SEGA.cs @@ -40,7 +40,7 @@ protected override void ClearOptions() { { "console.brightness", Program.Config.sega.console_brightness }, { "console.disable_resetbutton", Program.Config.sega.console_disableresetbutton }, - { "country", Program.Lang.Current.StartsWith("ja") ? "jp" : Program.Config.sega.country }, + { "country", Program.Lang.GetRegion() is Language.Region.Japan ? "jp" : Program.Config.sega.country }, { "dev.mdpad.enable_6b", Program.Config.sega.dev_mdpad_enable_6b }, { "save_sram", Program.Config.sega.save_sram }, { "machine_md.use_4ptap", null }, diff --git a/FriishProduce/_classes/Databases/ChannelData.cs b/FriishProduce/_classes/Databases/ChannelData.cs index e21cf968..20cb8f77 100644 --- a/FriishProduce/_classes/Databases/ChannelData.cs +++ b/FriishProduce/_classes/Databases/ChannelData.cs @@ -296,7 +296,7 @@ private void GetEntries(Platform c, byte[] file) catch { y.EmuRevs.Add(0); } } - if (!Program.Lang.Current.StartsWith("ja") && !Program.Lang.Current.StartsWith("ko") && !Program.Lang.Current.StartsWith("zh")) + if (Program.Lang.GetRegion() is not Language.Region.Japan and not Language.Region.Korea && !Program.Lang.Current.StartsWith("zh")) { // Change Japanese title to English if language is not CJK if (y.Regions.Count == 1 && y.Regions[0] == 0 && item.GetProperty("titles").GetArrayLength() > 1) @@ -328,7 +328,7 @@ private void GetEntries(Platform c, byte[] file) } } - if (!(Program.Lang.Current.StartsWith("ja") && !y.Regions.Contains(0)) || c == Platform.Flash || c == Platform.C64 || c == Platform.MSX) + if (!(Program.Lang.GetRegion() is Language.Region.Japan && !y.Regions.Contains(0)) || c == Platform.Flash || c == Platform.C64 || c == Platform.MSX) Entries.Add(y); } } diff --git a/FriishProduce/_classes/Helpers/BannerPreview.cs b/FriishProduce/_classes/Helpers/BannerPreview.cs index cee39216..9156263d 100644 --- a/FriishProduce/_classes/Helpers/BannerPreview.cs +++ b/FriishProduce/_classes/Helpers/BannerPreview.cs @@ -10,15 +10,6 @@ namespace FriishProduce { public class Preview { - public enum Language - { - America, - Japanese, - Korean, - Europe, - Auto - } - private Bitmap RoundCorners(Bitmap x, int CornerRadius, bool Smooth = false) { CornerRadius *= 2; @@ -301,13 +292,28 @@ private void resetBG(Platform platform, int target, libWiiSharp.Region region) /// Year the game was released /// No. of players supported /// Platform/console - /// Banner region/language: Japanese, Korean, Europe or America + /// Banner region + /// Language, automatically takes value from app language/WAD region if set to -1 /// - public Bitmap Banner(Bitmap img, string text, int year, int players, Platform platform, libWiiSharp.Region region) + public Bitmap Banner(Bitmap img, string text, int year, int players, Platform platform, libWiiSharp.Region region, int lang = -1) { if (banner != null) banner.Dispose(); banner = new Bitmap(width, height); + if (lang < 0 || lang > 7) + lang = Program.Lang.Current == "de" ? 1 + : Program.Lang.Current == "fr" ? 2 + : Program.Lang.Current == "es" ? 3 + : Program.Lang.Current == "it" ? 4 + : Program.Lang.Current == "nl" ? 5 + : Program.Lang.GetRegion() is Language.Region.Japan || region == libWiiSharp.Region.Japan ? 6 + : Program.Lang.GetRegion() is Language.Region.Korea || region == libWiiSharp.Region.Korea ? 7 + : 0; + + if (lang is 1 or 4 or 5) region = libWiiSharp.Region.Europe; + if (lang is 6) region = libWiiSharp.Region.Japan; + if (lang is 7) region = libWiiSharp.Region.Korea; + if (img == null) { img = new Bitmap(256, 192); @@ -320,11 +326,11 @@ public Bitmap Banner(Bitmap img, string text, int year, int players, Platform pl switch (platform) { case Platform.NES: - target = region switch { libWiiSharp.Region.Japan or libWiiSharp.Region.Korea => 1, _ => 0 }; + target = lang switch { 6 or 7 => 1, _ => 0 }; break; case Platform.SNES: - target = region switch { libWiiSharp.Region.Japan or libWiiSharp.Region.Korea => 3, _ => 2 }; + target = lang switch { 6 or 7 => 3, _ => 2 }; break; case Platform.N64: @@ -341,7 +347,7 @@ public Bitmap Banner(Bitmap img, string text, int year, int players, Platform pl case Platform.PCE: case Platform.PCECD: - target = region switch { libWiiSharp.Region.Japan or libWiiSharp.Region.Korea => 8, _ => 7 }; + target = lang switch { 6 or 7 => 8, _ => 7 }; break; case Platform.NEO: @@ -373,23 +379,31 @@ public Bitmap Banner(Bitmap img, string text, int year, int players, Platform pl #region -- Define left text color and contents -- var leftTextColor = target == 2 ? Color.Black : target == 8 ? Color.FromArgb(90, 90, 90) : BannerSchemes.GetBrightness(target, 0) < 0.8 ? Color.White : Color.FromArgb(50, 50, 50); - string released = region == libWiiSharp.Region.Japan ? "{0}年発売" - : region == libWiiSharp.Region.Korea ? "일본판 발매년도\r\n{0}년" - : Program.Lang.Current == "nl" ? "Release: {0}" - : Program.Lang.Current == "es" ? "Año: {0}" - : Program.Lang.Current == "it" ? "Pubblicato: {0}" - : Program.Lang.Current == "fr" ? "Publié en {0}" - : Program.Lang.Current == "de" ? "Erschienen: {0}" - : "Released: {0}"; - - string numPlayers = region == libWiiSharp.Region.Japan ? "プレイ人数\r\n{0}人" - : region == libWiiSharp.Region.Korea ? "플레이 인원수\r\n{0}명" - : Program.Lang.Current == "nl" ? "{0} speler(s)" - : Program.Lang.Current == "es" ? "Jugadores: {0}" - : Program.Lang.Current == "it" ? "Giocatori: {0}" - : Program.Lang.Current == "fr" ? "Joueurs: {0}" - : Program.Lang.Current == "de" ? "{0} Spieler" - : "Players: {0}"; + string released = lang switch + { + 0 => "Released: {0}", + 1 => "Erschienen: {0}", + 2 => "Publié en {0}", + 3 => "Año: {0}", + 4 => "Pubblicato: {0}", + 5 => "Release: {0}", + 6 => "{0}年発売", + 7 => "일본판 발매년도\r\n{0}년", + _ => "{0}" + }; + + string numPlayers = lang switch + { + 0 => "Players: {0}", + 1 => "{0} Spieler", + 2 => "Joueurs: {0}", + 3 => "Jugadores: {0}", + 4 => "Giocatori: {0}", + 5 => "{0} speler(s)", + 6 => "プレイ人数\r\n{0}人", + 7 => "플레이 인원수\r\n{0}명", + _ => "{0}" + }; #endregion using (Graphics g = Graphics.FromImage(banner)) diff --git a/FriishProduce/_classes/Platform.cs b/FriishProduce/_classes/Platform.cs index 5788dc55..27869c0c 100644 --- a/FriishProduce/_classes/Platform.cs +++ b/FriishProduce/_classes/Platform.cs @@ -23,24 +23,125 @@ public enum Platform RPGM, } - public static class Filters + public static class Platforms { - public static System.Collections.Generic.List<(Platform Platform, string[] Extensions)> ROM = new() + public static System.Collections.Generic.Dictionary Icons { - (Platform.NES, new string[] { ".nes" }), - (Platform.SNES, new string[] { ".sfc", ".smc" }), - (Platform.N64, new string[] { ".n64", ".v64", ".z64" }), - (Platform.SMS, new string[] { ".sms" }), - (Platform.S32X, new string[] { ".bin", ".gen", ".md" }), - (Platform.SMD, new string[] { ".bin", ".gen", ".md" }), - (Platform.PCE, new string[] { ".pce" }), - (Platform.NEO, new string[] { ".zip" }), - (Platform.MSX, new string[] { ".rom", ".mx1", ".mx2" }), - (Platform.C64, new string[] { ".d64", /* ".t64" */ }), - (Platform.GB, new string[] { ".gb" }), - (Platform.GBC, new string[] { ".gbc" }), - (Platform.GBA, new string[] { ".gba" }), - }; + get + { + System.Collections.Generic.Dictionary orig = new() + { + { + Platform.NES, + Program.Lang.GetRegion() is Language.Region.Japan + ? FileDatas.Icons.FC : FileDatas.Icons.NES + }, + + { + Platform.SNES, + Program.Lang.GetRegion() is Language.Region.Americas or Language.Region.International + ? FileDatas.Icons.SNES : FileDatas.Icons.SFC + }, + + { + Platform.N64, + FileDatas.Icons.N64 + }, + + { + Platform.SMS, + FileDatas.Icons.SMS + }, + + { + Platform.SMD, + FileDatas.Icons.SMD + }, + + { + Platform.PCE, + Program.Lang.GetRegion() is Language.Region.Japan + ? FileDatas.Icons.PCE : FileDatas.Icons.TG16 + }, + + { + Platform.PCECD, + Program.Lang.GetRegion() is Language.Region.Japan + ? FileDatas.Icons.PCECD : FileDatas.Icons.TG16 + }, + + { + Platform.NEO, + FileDatas.Icons.NEO + }, + + { + Platform.C64, + System.Drawing.Icon.FromHandle(Properties.Resources.flash.GetHicon()) + }, + + { + Platform.MSX, + System.Drawing.Icon.FromHandle(Properties.Resources.c64.GetHicon()) + }, + + { + Platform.Flash, + System.Drawing.Icon.FromHandle(Properties.Resources.msx.GetHicon()) + }, + + { + Platform.PSX, + FileDatas.Icons.PSX + }, + + { + Platform.RPGM, + Properties.Resources.rpg2003 + } + }; + + System.Collections.Generic.Dictionary resized = new(); + + foreach (var item in orig) + { + if (item.Key is Platform.RPGM) + resized.Add(item.Key, new System.Drawing.Icon(item.Value, 16, 16).ToBitmap()); + else + { + System.Drawing.Bitmap b = new(16, 16); + using System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(b); + g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; + g.DrawImage(item.Value.ToBitmap(), 0, 0, 16, 16); + resized.Add(item.Key, b); + } + }; + + return resized; + } + } + + public static System.Collections.Generic.Dictionary Filters + { + get => new() + { + { Platform.NES, new string[] { ".nes" } }, + { Platform.SNES, new string[] { ".sfc", ".smc" } }, + { Platform.N64, new string[] { ".n64", ".v64", ".z64" } }, + { Platform.SMS, new string[] { ".sms" } }, + { Platform.S32X, new string[] { ".bin", ".gen", ".md" } }, + { Platform.SMD, new string[] { ".bin", ".gen", ".md" } }, + { Platform.PCE, new string[] { ".pce" } }, + { Platform.NEO, new string[] { ".zip" } }, + { Platform.MSX, new string[] { ".rom", ".mx1", ".mx2" } }, + { Platform.C64, new string[] { ".d64", /* ".t64" */ } }, + { Platform.GB, new string[] { ".gb" } }, + { Platform.GBC, new string[] { ".gbc" } }, + { Platform.GBA, new string[] { ".gba" } }, + }; + } } public enum Buttons diff --git a/FriishProduce/_classes/Program/Language.cs b/FriishProduce/_classes/Program/Language.cs index 96b63761..0f0b57ef 100644 --- a/FriishProduce/_classes/Program/Language.cs +++ b/FriishProduce/_classes/Program/Language.cs @@ -205,6 +205,81 @@ public ScriptType GetScript(string text) : ScriptType.Normal; } + public enum Region + { + International = -1, + Japan = 0, + Korea = 1, + Europe = 2, + Americas = 3, + China = 4, + HKTW = 5, + } + + public Region GetRegion() + { + int region = -1; + + var altRegions = new Dictionary() + { + { "-JP", 0 }, + { "-KR", 1 }, + { "-GB", 2 }, + { "-IE", 2 }, + { "-BE", 2 }, + { "-FR", 2 }, + { "-ES", 2 }, + { "-PT", 2 }, + { "-IN", 2 }, + { "-ZA", 2 }, + { "-AU", 2 }, + { "-NZ", 2 }, + { "-CA", 3 }, + { "-US", 3 }, + { "-419", 3 }, + { "-MX", 3 }, + { "-CO", 3 }, + { "-EC", 3 }, + { "-VN", 3 }, + { "-CL", 3 }, + { "-AR", 3 }, + { "-BR", 3 }, + { "-CN", 4 }, + { "-HK", 5 }, + { "-TW", 5 }, + { "ja", 0 }, + { "ko", 1 }, + { "fr", 2 }, + { "es", 2 }, + { "de", 2 }, + { "nl", 2 }, + { "it", 2 }, + { "pl", 2 }, + { "ru", 2 }, + { "uk", 2 }, + { "tr", 2 }, + { "hu", 2 }, + { "ro", 2 }, + { "ca", 2 }, + { "eu", 2 }, + { "gl", 2 }, + { "ast", 2 }, + { "dk", 2 }, + { "no", 2 }, + { "sv", 2 }, + { "fi", 2 }, + }; + + foreach (var item in altRegions) + if (Program.Lang.Current.ToLower().StartsWith(item.Key) || Program.Lang.Current.ToUpper().EndsWith(item.Key)) + { + region = item.Value; + break; + } + + return (Region)region; + } + /// /// Localizes a control or form using an auto-determined or manually-inputted tag name. /// diff --git a/FriishProduce/_classes/Utilities.cs b/FriishProduce/_classes/Utilities.cs index 02262e69..13adef0b 100644 --- a/FriishProduce/_classes/Utilities.cs +++ b/FriishProduce/_classes/Utilities.cs @@ -199,7 +199,7 @@ public static bool InternetTest(string URL = null) private static string Message(string msg, string url) { int colon = msg.IndexOf(':'); - char dot = Program.Lang.GetScript(msg) == Language.ScriptType.CJK && !Program.Lang.Current.StartsWith("ko") ? '。' : '.'; + char dot = Program.Lang.GetScript(msg) == Language.ScriptType.CJK && Program.Lang.GetRegion() is not Language.Region.Korea ? '。' : '.'; if (!string.IsNullOrWhiteSpace(url) && msg.Contains(url) && colon > 0) msg = msg.Substring(0, colon); if (msg[msg.Length - 1] != dot) msg += dot; diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 4734d004..b33302c2 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -8,7 +8,6 @@ nav: - Tutorial: tutorial.md - FAQ: faq.md - Translate: translate.md - - About: about.md theme: # Bootstrap theme settings @@ -69,7 +68,6 @@ plugins: Home: Accueil Tutorial: Tutoriel Translate: Traduire - About: À propos - locale: es name: Español @@ -79,7 +77,6 @@ plugins: Tutorial: Tutorial FAQ: Preguntas frecuentes Translate: Traducir - About: Acerca de - locale: ja name: 日本語 @@ -88,8 +85,7 @@ plugins: Home: ホームページ Tutorial: 使い方 Translate: 翻訳 - FAQ: よくあるご質問 - About: ついて + FAQ: よくある質問 extra: # The language switcher values are stored here.