forked from jaildesigner-jailgames/jaildoctors_dilemma
mogut options.section a SceneManager
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
|
||||
#include "core/input/global_inputs.hpp"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
@@ -13,11 +15,11 @@
|
||||
|
||||
namespace globalInputs {
|
||||
void quit() {
|
||||
const std::string code = Options::section.section == Options::Scene::GAME ? "PRESS AGAIN TO RETURN TO MENU" : "PRESS AGAIN TO EXIT";
|
||||
const std::string code = SceneManager::current == SceneManager::Scene::GAME ? "PRESS AGAIN TO RETURN TO MENU" : "PRESS AGAIN TO EXIT";
|
||||
auto code_found = stringInVector(Notifier::get()->getCodes(), code);
|
||||
if (code_found) {
|
||||
// Si la notificación de salir está activa, cambia de sección
|
||||
Options::section.section = Options::section.section == Options::Scene::GAME ? Options::Scene::TITLE : Options::Scene::QUIT;
|
||||
SceneManager::current = SceneManager::current == SceneManager::Scene::GAME ? SceneManager::Scene::TITLE : SceneManager::Scene::QUIT;
|
||||
} else {
|
||||
// Si la notificación de salir no está activa, muestra la notificación
|
||||
Notifier::get()->show({code}, NotificationText::CENTER, 2000, -1, true, code);
|
||||
@@ -26,16 +28,16 @@ void quit() {
|
||||
|
||||
// Cambia de seccion
|
||||
void skip_section() {
|
||||
switch (Options::section.section) {
|
||||
case Options::Scene::LOGO:
|
||||
case Options::Scene::LOADING_SCREEN:
|
||||
case Options::Scene::CREDITS:
|
||||
case Options::Scene::DEMO:
|
||||
case Options::Scene::GAME_OVER:
|
||||
case Options::Scene::ENDING:
|
||||
case Options::Scene::ENDING2:
|
||||
Options::section.section = Options::Scene::TITLE;
|
||||
Options::section.subsection = Options::SceneOptions::NONE;
|
||||
switch (SceneManager::current) {
|
||||
case SceneManager::Scene::LOGO:
|
||||
case SceneManager::Scene::LOADING_SCREEN:
|
||||
case SceneManager::Scene::CREDITS:
|
||||
case SceneManager::Scene::DEMO:
|
||||
case SceneManager::Scene::GAME_OVER:
|
||||
case SceneManager::Scene::ENDING:
|
||||
case SceneManager::Scene::ENDING2:
|
||||
SceneManager::current = SceneManager::Scene::TITLE;
|
||||
SceneManager::options = SceneManager::Options::NONE;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user