Skip to content

Commit

Permalink
integrated RndMnkIII's analogizer settings wizard (mattpannella#386)
Browse files Browse the repository at this point in the history
* ported code from https://github.com/RndMnkIII/AnalogizerConfigurator/blob/main/Program.cs

* combined menu

* updated readme

* woops

* woops again

* Update AnalogizerSettingsService.cs

* cli stuff

* move the file automatically
  • Loading branch information
mattpannella authored Feb 4, 2025
1 parent 1f10f77 commit 1948740
Show file tree
Hide file tree
Showing 7 changed files with 560 additions and 180 deletions.
4 changes: 3 additions & 1 deletion MENU.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
4. Super GameBoy Aspect Ratio
1. Apply 8:7 Aspect Ratio to Super GameBoy cores
2. Restore 4:3 Aspect Ratio to Super GameBoy cores
5. Jotego Analogizer Config
5. Analogizer Config
1. Jotego Analogizer Config
2. Standard Analogizer Config
6. Go Back
7. Pocket Maintenance
1. Update Selected
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ Some archive.org sites require authentication to download the files. This makes
-p, --path Absolute path to install location
-c, --core The core you want to prune memories for
analogizer-setup Run the setup wizard to generate Analogizer settings files (By default, runs the standard setup)
-p, --path Absolute path to install location
-j, --jotego Run the setup for Jotego's cores
update-self Check for updates to pupdate
help Display more information on a specific command.
Expand Down
16 changes: 15 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ private static void Main(string[] args)
var parserResult = parser.ParseArguments<MenuOptions, FundOptions, UpdateOptions,
AssetsOptions, FirmwareOptions, ImagesOptions, InstanceGeneratorOptions,
UpdateSelfOptions, UninstallOptions, BackupSavesOptions, GameBoyPalettesOptions,
PocketLibraryImagesOptions, PocketExtrasOptions, DisplayModesOptions, PruneMemoriesOptions>(args)
PocketLibraryImagesOptions, PocketExtrasOptions, DisplayModesOptions, PruneMemoriesOptions,
AnalogizerSetupOptions>(args)
.WithNotParsed(errors =>
{
foreach (var error in errors)
Expand Down Expand Up @@ -213,6 +214,19 @@ private static void Main(string[] args)
AssetsService.PruneSaveStates(ServiceHelper.UpdateDirectory, options.CoreName);
break;

case AnalogizerSetupOptions options:
if (options.Jotego)
{
JotegoAnalogizerSettingsService settings = new JotegoAnalogizerSettingsService();
settings.RunAnalogizerSettings();
Console.WriteLine("Jotego Analogizer configuration updated.");
}
else
{
AnalogizerSettingsService.ShowWizard();
}
break;

default:
DisplayMenu(coreUpdaterService);
break;
Expand Down
10 changes: 10 additions & 0 deletions src/options/AnalogizerSetupOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using CommandLine;

namespace Pannella.Options;

[Verb("analogizer-setup", HelpText = "Set up Analogizer options")]
public class AnalogizerSetupOptions : BaseOptions
{
[Option ('j', "jotego", Required = false, HelpText = "Run the setup for Jotego's cores.")]
public bool Jotego { get; set; } = false;
}
30 changes: 23 additions & 7 deletions src/partials/Program.Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,38 @@ private static void DisplayMenu(CoreUpdaterService coreUpdaterService)

#endregion

#region Pocket Setup
#region Analogizer Setup

var pocketSetupMenu = new ConsoleMenu()
var analogizerMenu = new ConsoleMenu()
.Configure(menuConfig)
.Add("Manage Display Modes >", displayModesMenu.Show)
.Add("Download Images and Palettes >", downloadFilesMenu.Show)
.Add("Generate ROMs & JSON Files >", generateFilesMenu.Show)
.Add("Super GameBoy Aspect Ratio >", sgbAspectRatioMenu.Show)
.Add("Jotego Analogizer Config", _=>
{
AnalogizerSettingsService settings = new AnalogizerSettingsService();
JotegoAnalogizerSettingsService settings = new JotegoAnalogizerSettingsService();
settings.RunAnalogizerSettings();

Console.WriteLine("Jotego Analogizer configuration updated.");
Pause();
})
.Add("Standard Analogizer Config", _=>
{
AnalogizerSettingsService.ShowWizard();

Console.WriteLine("Analogizer configuration updated.");
Pause();
})
.Add("Go Back", ConsoleMenu.Close);

#endregion

#region Pocket Setup

var pocketSetupMenu = new ConsoleMenu()
.Configure(menuConfig)
.Add("Manage Display Modes >", displayModesMenu.Show)
.Add("Download Images and Palettes >", downloadFilesMenu.Show)
.Add("Generate ROMs & JSON Files >", generateFilesMenu.Show)
.Add("Super GameBoy Aspect Ratio >", sgbAspectRatioMenu.Show)
.Add("Analogizer Config >", analogizerMenu.Show)
.Add("Set Patreon Email Address", () =>
{
Console.WriteLine($"Current email address: {ServiceHelper.SettingsService.Config.patreon_email_address}");
Expand Down
Loading

0 comments on commit 1948740

Please sign in to comment.