added hotkey of ? as a way to toggle on/off the debug UI display
This commit is contained in:
parent
1ae2a9ae10
commit
83dbaf7886
|
@ -1011,14 +1011,13 @@ void Game::render2d(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config.getBool("DebugMode")){
|
if(config.getBool("DebugMode") && gui.getShowDebugUI() == true) {
|
||||||
renderer.renderText(
|
renderer.renderText(str, coreData.getMenuFontNormal(),
|
||||||
str, coreData.getMenuFontNormal(),
|
Vec3f(1.0f), 10, 500, false);
|
||||||
Vec3f(1.0f), 10, 500, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//network status
|
//network status
|
||||||
if(renderNetworkStatus){
|
if(renderNetworkStatus) {
|
||||||
renderer.renderText(
|
renderer.renderText(
|
||||||
NetworkManager::getInstance().getGameNetworkInterface()->getNetworkStatus(),
|
NetworkManager::getInstance().getGameNetworkInterface()->getNetworkStatus(),
|
||||||
coreData.getMenuFontNormal(),
|
coreData.getMenuFontNormal(),
|
||||||
|
@ -1026,7 +1025,7 @@ void Game::render2d(){
|
||||||
}
|
}
|
||||||
|
|
||||||
//resource info
|
//resource info
|
||||||
if(!config.getBool("PhotoMode")){
|
if(!config.getBool("PhotoMode")) {
|
||||||
renderer.renderResourceStatus();
|
renderer.renderResourceStatus();
|
||||||
renderer.renderConsole(&console,showFullConsole);
|
renderer.renderConsole(&console,showFullConsole);
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,7 @@ void Gui::init(Game *game){
|
||||||
this->console= game->getConsole();
|
this->console= game->getConsole();
|
||||||
this->world= game->getWorld();
|
this->world= game->getWorld();
|
||||||
selection.init(this, world->getThisFactionIndex());
|
selection.init(this, world->getThisFactionIndex());
|
||||||
|
this->showDebugUI = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::end(){
|
void Gui::end(){
|
||||||
|
@ -338,6 +339,9 @@ void Gui::hotKey(char key){
|
||||||
else if(key=='B'){
|
else if(key=='B'){
|
||||||
selectInterestingUnit(iutBuiltBuilding);
|
selectInterestingUnit(iutBuiltBuilding);
|
||||||
}
|
}
|
||||||
|
else if(key=='?') {
|
||||||
|
this->showDebugUI = !this->showDebugUI;
|
||||||
|
}
|
||||||
else if(key=='R'){
|
else if(key=='R'){
|
||||||
// Here the user triggers a unit rotation while placing a unit
|
// Here the user triggers a unit rotation while placing a unit
|
||||||
if(allowRotateUnits == true && isPlacingBuilding()) {
|
if(allowRotateUnits == true && isPlacingBuilding()) {
|
||||||
|
|
|
@ -133,6 +133,8 @@ private:
|
||||||
CardinalDir selectedBuildingFacing;
|
CardinalDir selectedBuildingFacing;
|
||||||
bool allowRotateUnits;
|
bool allowRotateUnits;
|
||||||
|
|
||||||
|
bool showDebugUI;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Gui();
|
Gui();
|
||||||
void init(Game *game);
|
void init(Game *game);
|
||||||
|
@ -177,6 +179,8 @@ public:
|
||||||
void switchToNextDisplayColor();
|
void switchToNextDisplayColor();
|
||||||
void onSelectionChanged();
|
void onSelectionChanged();
|
||||||
|
|
||||||
|
bool getShowDebugUI() { return showDebugUI; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//orders
|
//orders
|
||||||
|
|
Loading…
Reference in New Issue
Block a user