1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 00:55:20 +02:00

Show status message when changing block bounds (#11556)

This commit is contained in:
Wuzzy
2021-08-21 11:53:49 +00:00
committed by GitHub
parent e7b05beb7d
commit 6fd8aede48
3 changed files with 30 additions and 12 deletions

View File

@@ -2193,7 +2193,24 @@ void Game::toggleCinematic()
void Game::toggleBlockBounds()
{
if (client->checkPrivilege("basic_debug")) {
hud->toggleBlockBounds();
enum Hud::BlockBoundsMode newmode = hud->toggleBlockBounds();
switch (newmode) {
case Hud::BLOCK_BOUNDS_OFF:
m_game_ui->showTranslatedStatusText("Block bounds hidden");
break;
case Hud::BLOCK_BOUNDS_CURRENT:
m_game_ui->showTranslatedStatusText("Block bounds shown for current block");
break;
case Hud::BLOCK_BOUNDS_NEAR:
m_game_ui->showTranslatedStatusText("Block bounds shown for nearby blocks");
break;
case Hud::BLOCK_BOUNDS_MAX:
m_game_ui->showTranslatedStatusText("Block bounds shown for all blocks");
break;
default:
break;
}
} else {
m_game_ui->showTranslatedStatusText("Can't show block bounds (need 'basic_debug' privilege)");
}