Completada la carga de menus desde fichero

This commit is contained in:
2022-08-28 21:03:21 +02:00
parent d5a069b8db
commit fcdd2ffd21
4 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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);

View File

@@ -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);