summaryrefslogtreecommitdiff
path: root/src/game/GameController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GameController.cpp')
-rw-r--r--src/game/GameController.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 7b08716..3408ec5 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -86,6 +86,20 @@ public:
}
};
+class GameController::StampsCallback: public ControllerCallback
+{
+ GameController * cc;
+public:
+ StampsCallback(GameController * cc_) { cc = cc_; }
+ virtual void ControllerExit()
+ {
+ if(cc->stamps->GetStamp())
+ {
+ cc->gameModel->SetStamp(cc->stamps->GetStamp());
+ }
+ }
+};
+
GameController::GameController():
search(NULL),
renderOptions(NULL),
@@ -140,6 +154,24 @@ GameView * GameController::GetView()
return gameView;
}
+void GameController::PlaceStamp(ui::Point position)
+{
+ if(gameModel->GetStamp())
+ {
+ gameModel->GetSimulation()->Load(position.X, position.Y, gameModel->GetStamp()->data, gameModel->GetStamp()->dataLength);
+ gameModel->SetPaused(gameModel->GetPaused());
+ }
+}
+
+void GameController::PlaceClipboard(ui::Point position)
+{
+ if(gameModel->GetClipboard())
+ {
+ gameModel->GetSimulation()->Load(position.X, position.Y, gameModel->GetClipboard()->data, gameModel->GetClipboard()->dataLength);
+ gameModel->SetPaused(gameModel->GetPaused());
+ }
+}
+
void GameController::AdjustBrushSize(int direction)
{
ui::Point newSize = gameModel->GetBrush()->GetRadius() + ui::Point(direction, direction);
@@ -395,6 +427,12 @@ void GameController::OpenTags()
}
}
+void GameController::OpenStamps()
+{
+ stamps = new StampsController(new StampsCallback(this));
+ ui::Engine::Ref().ShowWindow(stamps->GetView());
+}
+
void GameController::OpenDisplayOptions()
{
//TODO: Implement