BACK at "play again" should broadcast quit.
This commit is contained in:
parent
a9915dc092
commit
b84221eb3c
@ -1910,7 +1910,9 @@ int32_t rock_paper_scissors_app(void* p) {
|
|||||||
if((event.input.type == InputTypeLong) && (event.input.key == InputKeyBack)) {
|
if((event.input.type == InputTypeLong) && (event.input.key == InputKeyBack)) {
|
||||||
// Long press back to exit.
|
// Long press back to exit.
|
||||||
processing = false;
|
processing = false;
|
||||||
} else if((event.input.type == InputTypeShort) && (event.input.key == InputKeyBack)) {
|
} else if(
|
||||||
|
(event.input.type == InputTypeShort) && (event.input.key == InputKeyBack) &&
|
||||||
|
game_context->data->screen_state != ScreenFinishedGame) {
|
||||||
if(game_context->data->local_player == StateHostingLookingForPlayer) {
|
if(game_context->data->local_player == StateHostingLookingForPlayer) {
|
||||||
rps_broadcast_not_beacon(game_context);
|
rps_broadcast_not_beacon(game_context);
|
||||||
}
|
}
|
||||||
@ -2316,6 +2318,13 @@ int32_t rock_paper_scissors_app(void* p) {
|
|||||||
case InputKeyRight:
|
case InputKeyRight:
|
||||||
game_context->data->keyboard_col = 1; // NO - Back to main menu
|
game_context->data->keyboard_col = 1; // NO - Back to main menu
|
||||||
break;
|
break;
|
||||||
|
case InputKeyBack:
|
||||||
|
game_context->data->keyboard_col = 1; // NO - Back to main menu
|
||||||
|
rps_broadcast_quit(game_context);
|
||||||
|
game_context->data->local_player = StateMainMenuHost;
|
||||||
|
game_context->data->remote_player = StateUnknown;
|
||||||
|
game_context->data->screen_state = ScreenMainMenu;
|
||||||
|
break;
|
||||||
case InputKeyOk:
|
case InputKeyOk:
|
||||||
if(game_context->data->keyboard_col == 1) {
|
if(game_context->data->keyboard_col == 1) {
|
||||||
rps_broadcast_quit(game_context);
|
rps_broadcast_quit(game_context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user