diff --git a/modules/you_done_it/clue_finder.cpp b/modules/you_done_it/clue_finder.cpp index 5a44bfb0..678b2bf1 100644 --- a/modules/you_done_it/clue_finder.cpp +++ b/modules/you_done_it/clue_finder.cpp @@ -30,6 +30,12 @@ void ClueFinder::on_button_pressed(String button) { if (button == "trigger_click") { take_photo(); } + if (button == "ax_button") { + send_photo(); + } + if (button == "by_button") { + delete_photo(); + } } void ClueFinder::_notification(int what) { @@ -70,9 +76,15 @@ void ClueFinder::remove_clue_marker(ClueMarker *marker) { } void ClueFinder::take_photo() { - print_line("TAKING PHOTO"); - if (ClueMarker * found{ find_current_clue() }) { - found->reveal(); - print_line("FOUND MARKER: ", found->get_path()); + this->found_marker = find_current_clue(); +} + +void ClueFinder::send_photo() { + if (this->found_marker) { + this->found_marker->reveal(); } } + +void ClueFinder::delete_photo() { + this->found_marker = nullptr; +} diff --git a/modules/you_done_it/clue_finder.h b/modules/you_done_it/clue_finder.h index 34eeda27..d9f1e2c0 100644 --- a/modules/you_done_it/clue_finder.h +++ b/modules/you_done_it/clue_finder.h @@ -21,7 +21,10 @@ public: void register_clue_marker(ClueMarker *marker); void remove_clue_marker(ClueMarker *marker); void take_photo(); + void send_photo(); + void delete_photo(); private: + ClueMarker *found_marker{ nullptr }; HashSet clue_markers{}; };