Skip to content

Commit

Permalink
add hidden settings for not including/loading pressure in saves, closes
Browse files Browse the repository at this point in the history
#524

If I ever redo the options menu, there will be an actual checkbox for these
  • Loading branch information
jacob1 committed Mar 7, 2018
1 parent 68efe49 commit 5eb0d1b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/gui/game/GameController.cpp
Expand Up @@ -329,6 +329,10 @@ std::string GameController::GetSignText(int signID)

void GameController::PlaceSave(ui::Point position, bool includePressure)
{
bool incPressure = Client::Ref().GetPrefBool("Simulation.LoadPressure", true);
if (!incPressure)
includePressure = !includePressure;

GameSave *placeSave = gameModel->GetPlaceSave();
if (placeSave)
{
Expand Down Expand Up @@ -571,8 +575,11 @@ void GameController::ToolClick(int toolSelection, ui::Point point)

std::string GameController::StampRegion(ui::Point point1, ui::Point point2, bool includePressure)
{
GameSave * newSave;
newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, includePressure);
bool incPressure = Client::Ref().GetPrefBool("Simulation.IncludePressure", true);
if (!incPressure)
includePressure = !includePressure;

GameSave * newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, includePressure);
if(newSave)
{
newSave->paused = gameModel->GetPaused();
Expand All @@ -590,8 +597,11 @@ std::string GameController::StampRegion(ui::Point point1, ui::Point point2, bool

void GameController::CopyRegion(ui::Point point1, ui::Point point2, bool includePressure)
{
GameSave * newSave;
newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, includePressure);
bool incPressure = Client::Ref().GetPrefBool("Simulation.IncludePressure", true);
if (!incPressure)
includePressure = !includePressure;

GameSave * newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y, includePressure);
if(newSave)
{
Json::Value clipboardInfo;
Expand Down

0 comments on commit 5eb0d1b

Please sign in to comment.