feat: implemented delete/send buttons cluefinder

This commit is contained in:
Sara Gerretsen 2025-10-22 21:21:14 +02:00
parent e04455ec9d
commit 4e1fa51ecf
2 changed files with 19 additions and 4 deletions

View file

@ -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;
}

View file

@ -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<ClueMarker *> clue_markers{};
};