From 6510c7630af409713a132038b099847a1849c797 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 28 Feb 2010 13:23:19 +0000 Subject: [PATCH] Rename `throttle' to `power' in GUI --- src/Game.cpp | 5 ++++- src/gui/ThrottleMeter.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Game.cpp b/src/Game.cpp index 13fb8aa..8cb4b46 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -311,7 +311,10 @@ void Game::onKeyDown(SDLKey aKey) train->controller()->actOn(BRAKE_TOGGLE); break; case SDLK_r: - train->controller()->actOn(TOGGLE_REVERSE); + if (train->controller()->throttle() == 0) + train->controller()->actOn(TOGGLE_REVERSE); + else + messageArea->post("Reduce power first!", 51, 1000); break; case SDLK_LCTRL: train->controller()->actOn(SHOVEL_COAL); diff --git a/src/gui/ThrottleMeter.cpp b/src/gui/ThrottleMeter.cpp index 4109b43..4ec2db9 100644 --- a/src/gui/ThrottleMeter.cpp +++ b/src/gui/ThrottleMeter.cpp @@ -50,13 +50,15 @@ void ThrottleMeter::render(RenderContext& rc) const int ox = x(), oy = y(); rc.offset(ox, oy); - font->print(ox, oy, colour::WHITE, "Throttle: "); + static const string LABEL = "Power: "; + + font->print(ox, oy, colour::WHITE, LABEL); glPushMatrix(); const int off = (height() - METER_HEIGHT) / 2; - glTranslatef(ox + static_cast(font->text_width("Throttle: ")), + glTranslatef(ox + static_cast(font->text_width(LABEL)), static_cast(oy + off), 0.0f); const int unit = METER_WIDTH / (maxValue + 1); -- 2.39.2