HUD toggle, addresses "h should toggle the HUD" in issue #23

This commit is contained in:
Simon Robertshaw 2012-07-29 15:08:38 +01:00
parent f8a6d2ea1f
commit 418373a3cd
2 changed files with 28 additions and 20 deletions

View File

@ -39,7 +39,8 @@ GameView::GameView():
infoTipPresence(0),
toolTipPosition(-1, -1),
shiftBehaviour(false),
ctrlBehaviour(false)
ctrlBehaviour(false),
showHud(true)
{
int currentX = 1;
@ -943,6 +944,9 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
case 'f':
c->FrameStep();
break;
case 'h':
showHud = !showHud;
break;
case 'b':
if(ctrl)
c->SetDecoration();
@ -1390,6 +1394,8 @@ void GameView::OnDraw()
}
}
if(showHud)
{
//Draw info about simulation under cursor
std::stringstream sampleInfo;
sampleInfo.precision(2);
@ -1418,6 +1424,7 @@ void GameView::OnDraw()
g->fillrect(12, 12, textWidth+8, 15, 0, 0, 0, 255*0.5);
g->drawtext(16, 16, (const char*)fpsInfo.str().c_str(), 32, 216, 255, 255*0.75);
#endif
}
//Tooltips
if(infoTipPresence)

View File

@ -40,6 +40,7 @@ private:
bool drawSnap;
bool shiftBehaviour;
bool ctrlBehaviour;
bool showHud;
int toolIndex;
int infoTipPresence;