From fcdd2ffd21a0af7f24dbfc01ddb28f9085fad664 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 28 Aug 2022 21:03:21 +0200 Subject: [PATCH] Completada la carga de menus desde fichero --- data/menu/title.men | 2 +- source/game.cpp | 6 +++--- source/menu.cpp | 10 ++++++++++ source/prog.cpp | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/data/menu/title.men b/data/menu/title.men index a9a7586..4d257b3 100644 --- a/data/menu/title.men +++ b/data/menu/title.men @@ -13,7 +13,7 @@ backgroundColor=48,48,64,192 areElementsCenteredOnX=true isCenteredOnX=true -isCenteredOnY=false +centerX=160 selector_color=229,28,35,0 selector_text_color=255,180,0 diff --git a/source/game.cpp b/source/game.cpp index 89bbaba..5114b88 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -27,7 +27,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input) section.subsection = SUBSECTION_GAME_PLAY; musicEnabled = true; - debug = true; + debug = false; musicEnabled = !debug; } @@ -117,7 +117,7 @@ void Game::checkInput() if (input->checkInput(INPUT_BUTTON_2, REPEAT_FALSE)) { debug = !debug; - /*musicEnabled = !debug; + musicEnabled = !debug; if (musicEnabled) { JA_PlayMusic(music); @@ -125,7 +125,7 @@ void Game::checkInput() else { JA_StopMusic(); - }*/ + } } if (input->checkInput(INPUT_BUTTON_3, REPEAT_FALSE)) diff --git a/source/menu.cpp b/source/menu.cpp index 029583e..bc6c5be 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -214,6 +214,16 @@ bool Menu::setVars(std::string var, std::string value) x = std::stoi(value); } + else if (var == "centerX") + { + centerX = std::stoi(value); + } + + else if (var == "centerY") + { + centerY = std::stoi(value); + } + else if (var == "y") { y = std::stoi(value); diff --git a/source/prog.cpp b/source/prog.cpp index 8f16a8a..61bbf3d 100644 --- a/source/prog.cpp +++ b/source/prog.cpp @@ -26,7 +26,7 @@ Prog::Prog(std::string executablePath) } else { - section.name = SECTION_PROG_TITLE; + section.name = SECTION_PROG_LOGO; } input = new Input(asset->get("gamecontrollerdb.txt")); screen = new Screen(window, renderer, options);