From 5eb0d1bd27e09bd056093b2fd7b00e0f8dd13885 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 6 Mar 2018 21:01:49 -0500 Subject: [PATCH] add hidden settings for not including/loading pressure in saves, closes #524 If I ever redo the options menu, there will be an actual checkbox for these --- src/gui/game/GameController.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index fbba03fc4..f3ae7b68d 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -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) { @@ -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(); @@ -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;