From 78c700a62bc95ae45c0d64a4d57143b362068e5c Mon Sep 17 00:00:00 2001 From: jBot-42 Date: Sun, 20 Sep 2015 08:26:44 -0700 Subject: [PATCH] Added ambient heat to the HUD --- data/IntroText.h | 10 +++++----- src/gui/game/GameController.cpp | 5 +++++ src/gui/game/GameController.h | 1 + src/gui/game/GameView.cpp | 7 +++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/data/IntroText.h b/data/IntroText.h index 63f400555..4901cbfb9 100644 --- a/data/IntroText.h +++ b/data/IntroText.h @@ -12,11 +12,11 @@ static const char *introTextData = "Use the mouse scroll wheel, or '[' and ']', to change the tool size for particles.\n" "Middle click or Alt+Click to \"sample\" the particles.\n" "Ctrl+Z will act as Undo.\n" - "\n\boUse 'Z' for a zoom tool. Click to make the drawable zoom window stay around. Use the wheel to change the zoom strength\n" - "The spacebar can be used to pause physics.\n" - "Use 'S' to save parts of the window as 'stamps'.\n" - "'L' will load the most recent stamp, 'K' shows a library of stamps you saved.\n" - "'P' will take a screenshot and save it into the current directory.\n" + "\n\boUse 'Z' for a zoom tool. Click to make the drawable zoom window stay around. Use the wheel to change the zoom strength.\n" + "The spacebar can be used to pause physics. Use 'F' to step ahead by one frame.\n" + "Use 'S' to save parts of the window as 'stamps'. 'L' loads the most recent stamp, 'K' shows a library of stamps you saved.\n" + "Use 'P' to take a screenshot and save it into the current directory.\n" + "Use 'H' to toggle the HUD. Use 'D' to toggle debug mode in the HUD.\n" "\n" "Contributors: \bgStanislaw K Skowronek (Designed the original Powder Toy),\n" "\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n" diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index fc721ee8f..2a06d3745 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -866,6 +866,11 @@ void GameController::ToggleAHeat() gameModel->SetAHeatEnable(!gameModel->GetAHeatEnable()); } +bool GameController::GetAHeatEnable() +{ + return gameModel->GetAHeatEnable(); +} + void GameController::ToggleNewtonianGravity() { if (gameModel->GetSimulation()->grav->ngrav_enable) diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index 606b47bfe..f49eb8cc3 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -153,6 +153,7 @@ public: void SwitchGravity(); void SwitchAir(); void ToggleAHeat(); + bool GetAHeatEnable(); void ToggleNewtonianGravity(); bool LoadClipboard(); diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index d96ddf9a2..3f7f51a8f 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2325,13 +2325,16 @@ void GameView::OnDraw() sampleInfo.str(std::string()); if(sample.particle.type) - { sampleInfo << "#" << sample.ParticleID << ", "; - } + sampleInfo << "X:" << sample.PositionX << " Y:" << sample.PositionY; + if (sample.Gravity) sampleInfo << " GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY; + if (c->GetAHeatEnable()) + sampleInfo << ", AHeat: " << std::fixed << sample.AirTemperature -273.15f << " C"; + textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str()); g->fillrect(XRES-20-textWidth, 27, textWidth+8, 14, 0, 0, 0, alpha*0.5f); g->drawtext(XRES-16-textWidth, 30, (const char*)sampleInfo.str().c_str(), 255, 255, 255, alpha*0.75f);