added hotkey of ? as a way to toggle on/off the debug UI display

This commit is contained in:
Mark Vejvoda
2010-05-15 19:51:58 +00:00
parent 1ae2a9ae10
commit 83dbaf7886
3 changed files with 13 additions and 6 deletions

View File

@@ -1011,9 +1011,8 @@ void Game::render2d(){
}
}
if(config.getBool("DebugMode")){
renderer.renderText(
str, coreData.getMenuFontNormal(),
if(config.getBool("DebugMode") && gui.getShowDebugUI() == true) {
renderer.renderText(str, coreData.getMenuFontNormal(),
Vec3f(1.0f), 10, 500, false);
}

View File

@@ -118,6 +118,7 @@ void Gui::init(Game *game){
this->console= game->getConsole();
this->world= game->getWorld();
selection.init(this, world->getThisFactionIndex());
this->showDebugUI = false;
}
void Gui::end(){
@@ -338,6 +339,9 @@ void Gui::hotKey(char key){
else if(key=='B'){
selectInterestingUnit(iutBuiltBuilding);
}
else if(key=='?') {
this->showDebugUI = !this->showDebugUI;
}
else if(key=='R'){
// Here the user triggers a unit rotation while placing a unit
if(allowRotateUnits == true && isPlacingBuilding()) {

View File

@@ -133,6 +133,8 @@ private:
CardinalDir selectedBuildingFacing;
bool allowRotateUnits;
bool showDebugUI;
public:
Gui();
void init(Game *game);
@@ -177,6 +179,8 @@ public:
void switchToNextDisplayColor();
void onSelectionChanged();
bool getShowDebugUI() { return showDebugUI; }
private:
//orders