diff --git a/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.cpp b/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.cpp index 3a7775ca2..a0e0bd9a1 100644 --- a/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.cpp +++ b/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.cpp @@ -30,13 +30,15 @@ ShinySoundDetectedActionOption::ShinySoundDetectedActionOption( { {ShinySoundDetectedAction::STOP_PROGRAM, "stop", "Stop program and go Home. Send notification."}, {ShinySoundDetectedAction::NOTIFY_ON_FIRST_ONLY, "notify-first", "Keep running. Notify on first shiny sound only."}, + {ShinySoundDetectedAction::NO_NOTIFICATIONS, "no-notifications", "Keep running. Track shiny sounds without sending notifications."}, // {ShinySoundDetectedAction::NOTIFY_ON_ALL, "notify-all", "Keep running. Notify on all shiny sounds."}, }, LockMode::UNLOCK_WHILE_RUNNING, default_action ) , TAKE_VIDEO( - "Take Video:", + "Take Video:
" + "Records the first shiny sound using the switch capture button.
", LockMode::UNLOCK_WHILE_RUNNING, true ) @@ -84,12 +86,18 @@ bool ShinySoundDetectedActionOption::on_shiny_sound( return false; } + if (action == ShinySoundDetectedAction::NO_NOTIFICATIONS && current_count > 1) { + return false; + } + if (TAKE_VIDEO){ context.wait_for(SCREENSHOT_DELAY); pbf_press_button(context, BUTTON_CAPTURE, 2 * TICKS_PER_SECOND, 0); } - send_shiny_sound_notification(env, stream, error_coefficient); + if (action != ShinySoundDetectedAction::NO_NOTIFICATIONS) { + send_shiny_sound_notification(env, stream, error_coefficient); + } return action == ShinySoundDetectedAction::STOP_PROGRAM; } @@ -141,7 +149,13 @@ bool ShinySoundHandler::on_shiny_sound( return false; } - m_option.send_shiny_sound_notification(env, stream, error_coefficient); + if (action == ShinySoundDetectedAction::NO_NOTIFICATIONS && current_count > 1){ + return false; + } + + if (action != ShinySoundDetectedAction::NO_NOTIFICATIONS){ + m_option.send_shiny_sound_notification(env, stream, error_coefficient); + } if (m_pending_video.load(std::memory_order_acquire)){ stream.log("Back-to-back shiny sounds. Suppressing video.", COLOR_RED); diff --git a/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.h b/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.h index ac79001c8..01081bbee 100644 --- a/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.h +++ b/SerialPrograms/Source/PokemonLZA/Options/PokemonLZA_ShinyDetectedAction.h @@ -27,6 +27,7 @@ enum class ShinySoundDetectedAction{ STOP_PROGRAM, // stop program at first detected shiny sound NOTIFY_ON_FIRST_ONLY, // notify user only on the first shiny sound, keep running the program NOTIFY_ON_ALL, // notify on all shiny sounds, keep running the program + NO_NOTIFICATIONS // no notifications, still track shiny sounds };