globalInputs implementat en totes les seccions excepte Title i Game

This commit is contained in:
2025-02-23 08:57:01 +01:00
parent 2ac425483b
commit 8ae686a70b
14 changed files with 121 additions and 305 deletions

View File

@@ -22,6 +22,7 @@
#include "utils.h" // for options_t, cheat_t, stringToColor
#include "options.h"
#include "notifier.h"
#include "global_inputs.h"
// Constructor
Game::Game()
@@ -201,12 +202,7 @@ void Game::checkEvents()
// Comprueba el teclado
void Game::checkInput()
{
if (input_->checkInput(input_exit, REPEAT_FALSE))
{
options.section.name = SECTION_TITLE;
}
else if (input_->checkInput(input_toggle_music, REPEAT_FALSE))
if (input_->checkInput(input_toggle_music, REPEAT_FALSE))
{
board_.music = !board_.music;
board_.music ? JA_ResumeMusic() : JA_PauseMusic();
@@ -217,39 +213,7 @@ void Game::checkInput()
switchPause();
}
else if (input_->checkInput(input_toggle_border, REPEAT_FALSE))
{
screen_->toggleBorder();
reLoadTextures();
}
else if (input_->checkInput(input_toggle_videomode, REPEAT_FALSE))
{
screen_->toggleVideoMode();
reLoadTextures();
}
else if (input_->checkInput(input_toggle_shaders, REPEAT_FALSE))
{
screen_->toggleShaders();
}
else if (input_->checkInput(input_window_dec_size, REPEAT_FALSE))
{
screen_->decWindowSize();
reLoadTextures();
}
else if (input_->checkInput(input_window_inc_size, REPEAT_FALSE))
{
screen_->incWindowSize();
reLoadTextures();
}
else if (input_->checkInput(input_toggle_palette, REPEAT_FALSE))
{
switchPalette();
}
globalInputs::check();
}
// Bucle para el juego
@@ -506,7 +470,7 @@ void Game::killPlayer()
setBlackScreen();
// Crea la nueva habitación y el nuevo jugador
room_ = new Room(resource_->getRoom(current_room_),item_tracker_, &board_.items, board_.jailEnabled);
room_ = new Room(resource_->getRoom(current_room_), item_tracker_, &board_.items, board_.jailEnabled);
const std::string playerPNG = options.cheat.altSkin ? "player2.png" : "player.png";
const std::string playerANI = options.cheat.altSkin ? "player2.ani" : "player.ani";
const player_t player = {spawn_point_, playerPNG, playerANI, room_};