-
Notifications
You must be signed in to change notification settings - Fork 83
close_game_from_home: updated to handle the case where the game is not selected. #819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| // fail-safe against button drops and unexpected error messages. | ||
| pbf_mash_button(context, BUTTON_X, 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're now using visual inference, mashing X and B are no longer necessary, right? Should we remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes. Commented below without seeing this one on top (on the otherwise identical code).
|
|
||
| // this sequence will close the game from the home screen, | ||
| // regardless of whether the game is initially open or closed. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're actually gonna want to split this function into to, a blind one with the old behavior and the new feedback one. Since some of the older SwSh programs are able to run without feedback.
So give this the same treatment as start_game_from_home(). Rename the current one to start_game_from_home_blind(), then add the new feedback one.
| context.wait_for_all_requests(); | ||
| if (is_close_game_menu_visible(console)){ // game was initially open. | ||
| console.log("Detected close game menu."); | ||
| pbf_mash_button(context, BUTTON_A, 400ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to state machine this?
close game menu:
Press A
main menu:
if (close game seen) return;
if (main menu seen twice before) return;
if (main menu seen once before)
move joysticks, press Home.
else
mash X
|
|
||
| } | ||
| // fail-safe against button drops and unexpected error messages. | ||
| pbf_mash_button(context, BUTTON_X, 400ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can state machine the above, we can get rid of these two and save 2+ seconds from the reset sequence.
Uses a newly created CloseGameDetector.