summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-09-06 13:48:31 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-06 23:35:33 (GMT)
commit1391de2e3a85ad0cb8c38286e51b0708d3415a43 (patch)
tree3d52618f9c4828479a1e40d5b68f946ce4d43868 /src/game
parent2243c86ef9858b3ea2c0e3e64bf201ec93c9cff7 (diff)
downloadpowder-1391de2e3a85ad0cb8c38286e51b0708d3415a43.zip
powder-1391de2e3a85ad0cb8c38286e51b0708d3415a43.tar.gz
Wall names in HUD
Conflicts: src/game/GameView.cpp
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp8
-rw-r--r--src/game/GameController.h1
-rw-r--r--src/game/GameView.cpp13
3 files changed, 18 insertions, 4 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 66557cc..aecdeaf 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -1192,6 +1192,14 @@ std::string GameController::ElementResolve(int type)
return "";
}
+std::string GameController::WallName(int type)
+{
+ if(gameModel && gameModel->GetSimulation() && gameModel->GetSimulation()->wtypes && type >= 0)
+ return std::string(gameModel->GetSimulation()->wtypes[type].name);
+ else
+ return "";
+}
+
void GameController::NotifyUpdateAvailable(Client * sender)
{
class UpdateConfirmation: public ConfirmDialogueCallback {
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 46941e7..07f37af 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -126,6 +126,7 @@ public:
ui::Point PointTranslate(ui::Point point);
ui::Point NormaliseBlockCoord(ui::Point point);
std::string ElementResolve(int type);
+ std::string WallName(int type);
void ResetAir();
void ResetSpark();
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index c101543..97a8634 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -1924,18 +1924,18 @@ void GameView::OnDraw()
std::stringstream sampleInfo;
sampleInfo.precision(2);
if(sample.particle.type)
- {
+ {
if(showDebug)
{
sampleInfo << c->ElementResolve(sample.particle.type);
if(sample.particle.ctype > 0 && sample.particle.ctype < PT_NUM)
sampleInfo << " (" << c->ElementResolve(sample.particle.ctype) << ")";
else
- sampleInfo << " ()";
- sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
+ sampleInfo << " ()";
sampleInfo << ", Temp: " << std::fixed << sample.particle.temp -273.15f;
sampleInfo << ", Life: " << sample.particle.life;
sampleInfo << ", Tmp: " << sample.particle.tmp;
+ sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
}
else
{
@@ -1943,12 +1943,17 @@ void GameView::OnDraw()
sampleInfo << "Molten " << c->ElementResolve(sample.particle.ctype);
else
sampleInfo << c->ElementResolve(sample.particle.type);
- sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
sampleInfo << ", Temp: " << std::fixed << sample.particle.temp -273.15f;
+ sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
}
if(sample.particle.type == PT_PHOT)
wavelengthGfx = sample.particle.ctype;
}
+ else if (sample.WallType)
+ {
+ sampleInfo << c->WallName(sample.WallType);
+ sampleInfo << ", Pressure: " << std::fixed << sample.AirPressure;
+ }
else
{
sampleInfo << "Empty, Pressure: " << std::fixed << sample.AirPressure;