Skip to content
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

Issue 219: Disable modification cards during quiz and memory game #223

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ Die SD Karte (Ordner mp3 und advert) hat sich gegenüber der Version 3.1.11 geä

# Change Log

## Version 3.1.12 (15.08.2024)
## Version 3.1.12 (16.08.2024)
- [Issue 220](https://github.com/tonuino/TonUINO-TNG/issues/220): New shortcut for switching BT on/off
- [Issue 219](https://github.com/tonuino/TonUINO-TNG/issues/219): Disable modification cards during quiz and memory game

## Version 3.1.11 (31.07.2024)
- [Issue 212](https://github.com/tonuino/TonUINO-TNG/issues/212): Sleep Timer Modification card doesn't work properly with NeoPixel Ring
Expand Down
2 changes: 1 addition & 1 deletion TonUINO-TNG.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void setup()
LOG(init_log, s_error, F("TonUINO Version 3.1 - refactored by Boerge1\n"));
LOG(init_log, s_error, F("created by Thorsten Voß and licensed under GNU/GPL."));
LOG(init_log, s_error, F("Information and contribution at https://tonuino.de.\n"));
LOG(init_log, s_error, F("V3.1.12 15.08.24\n"));
LOG(init_log, s_error, F("V3.1.12 16.08.24\n"));

#ifdef TonUINO_Classic
LOG(init_log, s_error, F("C "), lf_no);
Expand Down
2 changes: 2 additions & 0 deletions src/state_machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ void StartPlay::react(command_e const &/*cmd_e*/) {
void Quiz::entry() {
LOG(state_log, s_info, str_enter(), str_Quiz());
tonuino.disableStandbyTimer();
tonuino.resetActiveModifier();
tonuino.playFolder();
numAnswer = tonuino.getMyFolder().special;
numSolution = tonuino.getMyFolder().special2;
Expand Down Expand Up @@ -1139,6 +1140,7 @@ void Quiz::finish() {
void Memory::entry() {
LOG(state_log, s_info, str_enter(), str_Memory());
tonuino.disableStandbyTimer();
tonuino.resetActiveModifier();
tonuino.playFolder();
first = 0;
second = 0;
Expand Down
10 changes: 10 additions & 0 deletions src/tonuino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@ bool Tonuino::specialCard(const folderSettings &nfcTag) {
return true;
}

#ifdef QUIZ_GAME
if (SM_tonuino::is_in_state<Quiz>() && nfcTag.mode != pmode_t::bt_module)
return false;
#endif // QUIZ_GAME
#ifdef MEMORY_GAME
if (SM_tonuino::is_in_state<Memory>() && nfcTag.mode != pmode_t::bt_module)
return false;
#endif // MEMORY_GAME


switch (nfcTag.mode) {
case pmode_t::sleep_timer: LOG(card_log, s_info, F("act. sleepTimer"));
mp3.playAdvertisement(advertTracks::t_302_sleep , false/*olnyIfIsPlaying*/);
Expand Down