Closed remyjette closed 2 weeks ago
I agree. I'll keep this PR for the BizHawkClient changes but revert the LauncherComponents.py changes in favor of #3714.
Re-tested everything after merging in main
now that #3714 merged - this issue with BizHawkClient is still in main
, and this PR still fixes the issue. It's now ready for review.
What is this fixing or adding?
Today the BizHawk Client calls
argparse.ArgumentParser.parse_args
with no arguments, so it parses the entirety ofsys.argv
. If BizHawkClient is invoked via the Launcher's command line (python3 Launcher.py BizHawkClient
), this means the user will see an error on launch:NotImplementedError: No Handler for BizHawkClient found.
If the user tries to pass a patch file (for example
python3 Launcher.py BizHawkClient patch.apemerald
) it won't start at all, failing to start withThe reason I noticed this I have a shortcut to the .AppImage with
BizHawkClient
as an argument (since there's no equivalent to ArchipelagoBizHawkClient.exe using the image), and I saw the above NotImplementedError every time I launched. It didn't prevent gameplay (this is not a blocker) but it would be nicer to not have the error.The fix:
The Launcher already passes the args to the component's registered
func
; the BizHawkClient'slaunch
andlaunch_client
functions just needed to forward those args along and use those instead of parsing fromsys.argv[1:]
(the default behavior ofparse_args
).How was this tested?
Tested both before and after my change, testing
Launcher.py BizHawkClient
,Launcher.py patch.emerald
,Launcher.py BizHawkClient patch.apemerald
,BizHawkClient.py
,BizHawkClient.py patch.apemerald
, and using the "Open Patch" button in the launcher.