Don Melitonitzada la classe Notifier e independitzada de la classe Screen

Ara es poden afegir codis a les notificacions per identificarles
This commit is contained in:
2024-10-15 20:09:09 +02:00
parent e99c2c5265
commit de6508c37c
10 changed files with 506 additions and 463 deletions

View File

@@ -3,6 +3,7 @@
#include "input.h" // for Input, inputs_e, INPUT_DO_NOT_ALLOW_REPEAT
#include "jail_audio.h" // for JA_EnableMusic, JA_EnableSound
#include "lang.h" // for getText
#include "notifier.h" // for Notifier
#include "options.h" // for options
#include "on_screen_help.h"
#include "screen.h" // for Screen
@@ -28,14 +29,14 @@ namespace globalInputs
// Termina
void quit(section::Options code)
{
if (Screen::get()->notificationsAreActive())
if (Notifier::get()->isActive())
{
section::name = section::Name::QUIT;
section::options = code;
}
else
{
Screen::get()->showNotification(lang::getText(94));
Notifier::get()->showText(lang::getText(94));
}
}
@@ -43,7 +44,7 @@ namespace globalInputs
void reset()
{
section::name = section::Name::INIT;
Screen::get()->showNotification("Reset");
Notifier::get()->showText("Reset");
}
// Activa o desactiva el audio
@@ -52,7 +53,7 @@ namespace globalInputs
options.audio.sound.enabled = options.audio.music.enabled = !options.audio.music.enabled;
JA_EnableMusic(options.audio.music.enabled);
JA_EnableSound(options.audio.sound.enabled);
Screen::get()->showNotification("Audio " + boolToOnOff(options.audio.music.enabled));
Notifier::get()->showText("Audio " + boolToOnOff(options.audio.music.enabled));
}
// Comprueba los inputs que se pueden introducir en cualquier sección del juego