Added ambient heat to the HUD

This commit is contained in:
jBot-42 2015-09-20 08:26:44 -07:00 committed by jacob1
parent 9b9555226b
commit 78c700a62b
4 changed files with 16 additions and 7 deletions

View File

@ -12,11 +12,11 @@ static const char *introTextData =
"Use the mouse scroll wheel, or '[' and ']', to change the tool size for particles.\n" "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" "Middle click or Alt+Click to \"sample\" the particles.\n"
"Ctrl+Z will act as Undo.\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" "\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" "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'.\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"
"'L' will load 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"
"'P' will 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" "\n"
"Contributors: \bgStanislaw K Skowronek (Designed the original Powder Toy),\n" "Contributors: \bgStanislaw K Skowronek (Designed the original Powder Toy),\n"
"\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n" "\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n"

View File

@ -866,6 +866,11 @@ void GameController::ToggleAHeat()
gameModel->SetAHeatEnable(!gameModel->GetAHeatEnable()); gameModel->SetAHeatEnable(!gameModel->GetAHeatEnable());
} }
bool GameController::GetAHeatEnable()
{
return gameModel->GetAHeatEnable();
}
void GameController::ToggleNewtonianGravity() void GameController::ToggleNewtonianGravity()
{ {
if (gameModel->GetSimulation()->grav->ngrav_enable) if (gameModel->GetSimulation()->grav->ngrav_enable)

View File

@ -153,6 +153,7 @@ public:
void SwitchGravity(); void SwitchGravity();
void SwitchAir(); void SwitchAir();
void ToggleAHeat(); void ToggleAHeat();
bool GetAHeatEnable();
void ToggleNewtonianGravity(); void ToggleNewtonianGravity();
bool LoadClipboard(); bool LoadClipboard();

View File

@ -2325,13 +2325,16 @@ void GameView::OnDraw()
sampleInfo.str(std::string()); sampleInfo.str(std::string());
if(sample.particle.type) if(sample.particle.type)
{
sampleInfo << "#" << sample.ParticleID << ", "; sampleInfo << "#" << sample.ParticleID << ", ";
}
sampleInfo << "X:" << sample.PositionX << " Y:" << sample.PositionY; sampleInfo << "X:" << sample.PositionX << " Y:" << sample.PositionY;
if (sample.Gravity) if (sample.Gravity)
sampleInfo << " GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY; 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()); textWidth = Graphics::textwidth((char*)sampleInfo.str().c_str());
g->fillrect(XRES-20-textWidth, 27, textWidth+8, 14, 0, 0, 0, alpha*0.5f); 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); g->drawtext(XRES-16-textWidth, 30, (const char*)sampleInfo.str().c_str(), 255, 255, 255, alpha*0.75f);