Skip to content

Commit 46d75a9

Browse files
committed
Fix tutorial key.
SDL2 causes the key char to be '/' instead of '?'. This is a known issue when updating libtcod versions.
1 parent dfa1533 commit 46d75a9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/screen_game.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ bool Game::update(float elapsed, TCOD_key_t &k,TCOD_mouse_t &mouse) {
250250
if ( finalExplosion <= 1.0f ) finalExplosion -= elapsed/finalExplosionTime;
251251

252252

253-
if ( helpOn && (k.c == '?' || k.c == ' ') && ! k.pressed ) {
253+
if ( helpOn && (k.c == '/' || k.c == ' ') && ! k.pressed ) {
254254
helpOn=false;
255255
resumeGame();
256256
return true;

src/ui_tuto.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ bool Tutorial::update(float elapsed, TCOD_key_t &k,TCOD_mouse_t &mouse) {
372372
pages[id].con->setCharForeground(w-1,0,TCODColor::lightGrey);
373373
}
374374
if ( (mouse.lbutton_pressed && mouse.cx == x + w - 1 && mouse.cy == y )
375-
|| (!k.pressed && (k.c == '?' || k.c ==' ' || k.vk == TCODK_ESCAPE )) || tutoElapsed > pages[id].delay ) {
375+
|| (!k.pressed && (k.c == '/' || k.c ==' ' || k.vk == TCODK_ESCAPE )) || tutoElapsed > pages[id].delay ) {
376376
if (renderMenu) gameEngine->gui.setMode(GUI_NONE);
377-
else if ( k.c != '?') closeLiveTuto();
377+
else if ( k.c != '/') closeLiveTuto();
378378
else gameEngine->gui.setMode(GUI_TUTORIAL);
379379
}
380380
if ( renderMenu && menu.size() > 1 && fadeOutDelay == 0.0f ) {
@@ -394,7 +394,7 @@ bool Tutorial::update(float elapsed, TCOD_key_t &k,TCOD_mouse_t &mouse) {
394394
setNewPage(id);
395395
}
396396
}
397-
} else if ( k.c == '?' && ! k.pressed ) {
397+
} else if ( k.c == '/' && ! k.pressed ) {
398398
gameEngine->gui.setMode(GUI_TUTORIAL);
399399
}
400400
return true;

0 commit comments

Comments
 (0)