summaryrefslogtreecommitdiff
path: root/src/gui/game/GameView.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-07-15 17:09:19 (GMT)
committer jacob1 <jfu614@gmail.com>2013-07-15 17:09:19 (GMT)
commit8d5fe459fe4e0b9d398d9eb6d273b71da1a77eec (patch)
treebf8a21584643a7f0fbfed9a6fb28ca62a0e3b4c0 /src/gui/game/GameView.cpp
parent0214fcb5aedd6f4ebd485388c1fe1cfd63eb82a0 (diff)
downloadpowder-8d5fe459fe4e0b9d398d9eb6d273b71da1a77eec.zip
powder-8d5fe459fe4e0b9d398d9eb6d273b71da1a77eec.tar.gz
'n' to toggle Newtonian Gravity, quickoption tooltips show which keys you need to press to toggle them
Diffstat (limited to 'src/gui/game/GameView.cpp')
-rw-r--r--src/gui/game/GameView.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp
index b1d46d2..3aac3fc 100644
--- a/src/gui/game/GameView.cpp
+++ b/src/gui/game/GameView.cpp
@@ -1395,6 +1395,8 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
case 'u':
c->ToggleAHeat();
break;
+ case 'n':
+ c->ToggleNewtonianGravity();
case '=':
if(ctrl)
c->ResetSpark();
@@ -2021,7 +2023,11 @@ void GameView::OnDraw()
else if(showHud)
{
//Draw info about simulation under cursor
- int wavelengthGfx = 0;
+ int wavelengthGfx = 0, alpha = 255;
+ if (toolTipPosition.Y < 120)
+ alpha = 255-toolTipPresence*3;
+ if (alpha < 50)
+ alpha = 50;
std::stringstream sampleInfo;
sampleInfo.precision(2);
if(sample.particle.type)
@@ -2081,8 +2087,8 @@ void GameView::OnDraw()
}
int textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str());
- g->fillrect(XRES-20-textWidth, 12, textWidth+8, 15, 0, 0, 0, 255*0.5);
- g->drawtext(XRES-16-textWidth, 16, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255*0.75);
+ g->fillrect(XRES-20-textWidth, 12, textWidth+8, 15, 0, 0, 0, alpha*0.5f);
+ g->drawtext(XRES-16-textWidth, 16, (const char*)sampleInfo.str().c_str(), 255, 255, 255, alpha*0.75f);
#ifndef OGLI
if(wavelengthGfx)
@@ -2134,8 +2140,8 @@ void GameView::OnDraw()
sampleInfo << " GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY;
textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str());
- g->fillrect(XRES-20-textWidth, 26, textWidth+8, 15, 0, 0, 0, 255*0.5);
- g->drawtext(XRES-16-textWidth, 30, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255*0.75);
+ g->fillrect(XRES-20-textWidth, 26, textWidth+8, 15, 0, 0, 0, alpha*0.5f);
+ g->drawtext(XRES-16-textWidth, 30, (const char*)sampleInfo.str().c_str(), 255, 255, 255, alpha*0.75f);
}
}