diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-19 13:44:59 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-19 13:44:59 (GMT) |
| commit | 44639a6423c03552a3c0faafab27ef8f395f73a6 (patch) | |
| tree | 1a4fc49a56060759fcbec6f18e9159cf126e8606 /src/game | |
| parent | 4a60b97c700c2f1843b7e99313554cb89fb5da4e (diff) | |
| download | powder-44639a6423c03552a3c0faafab27ef8f395f73a6.zip powder-44639a6423c03552a3c0faafab27ef8f395f73a6.tar.gz | |
Some folder changes, started search and client
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/GameController.cpp | 7 | ||||
| -rw-r--r-- | src/game/GameController.h | 3 | ||||
| -rw-r--r-- | src/game/GameModel.cpp | 2 | ||||
| -rw-r--r-- | src/game/GameModel.h | 2 | ||||
| -rw-r--r-- | src/game/GameView.cpp | 15 | ||||
| -rw-r--r-- | src/game/GameView.h | 9 |
6 files changed, 27 insertions, 11 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index becb540..e029fc9 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -4,6 +4,7 @@ #include "Config.h" #include "GameController.h" #include "GameModel.h" +#include "search/SearchController.h" #include "interface/Point.h" using namespace std; @@ -60,3 +61,9 @@ void GameController::SetPaused(bool pauseState) { gameModel->SetPaused(pauseState); } + +void GameController::OpenSearch() +{ + SearchController * search = new SearchController(); + ui::Engine::Ref().ShowWindow(search->GetView()); +} diff --git a/src/game/GameController.h b/src/game/GameController.h index c3c8273..d9755a1 100644 --- a/src/game/GameController.h +++ b/src/game/GameController.h @@ -5,7 +5,7 @@ #include "GameView.h" #include "GameModel.h" #include "interface/Point.h" -#include "Simulation.h" +#include "simulation/Simulation.h" using namespace std; @@ -23,6 +23,7 @@ public: void DrawPoints(queue<ui::Point*> & pointQueue); void Tick(); void SetPaused(bool pauseState); + void OpenSearch(); }; #endif // GAMECONTROLLER_H diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 96b29a9..3d5a800 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -1,7 +1,7 @@ #include "interface/Engine.h" #include "GameModel.h" #include "GameView.h" -#include "Simulation.h" +#include "simulation/Simulation.h" #include "Renderer.h" GameModel::GameModel(): diff --git a/src/game/GameModel.h b/src/game/GameModel.h index a2eb3ce..6cb74cb 100644 --- a/src/game/GameModel.h +++ b/src/game/GameModel.h @@ -2,7 +2,7 @@ #define GAMEMODEL_H #include <vector> -#include "Simulation.h" +#include "simulation/Simulation.h" #include "Renderer.h" #include "GameView.h" diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 2576527..2fbed31 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -24,6 +24,21 @@ GameView::GameView(): pauseButton->SetTogglable(true); pauseButton->SetActionCallback(new PauseAction(this)); AddComponent(pauseButton); + + class SearchAction : public ui::ButtonAction + { + GameView * v; + public: + SearchAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); + } + }; + searchButton = new ui::Button(ui::Point(1, Size.Y-18), ui::Point(16, 16), "\x81"); //Open + searchButton->SetTogglable(false); + searchButton->SetActionCallback(new SearchAction(this)); + AddComponent(searchButton); } void GameView::NotifyRendererChanged(GameModel * sender) diff --git a/src/game/GameView.h b/src/game/GameView.h index 531a4b9..f34aedc 100644 --- a/src/game/GameView.h +++ b/src/game/GameView.h @@ -21,20 +21,13 @@ private: Renderer * ren; //UI Elements ui::Button * pauseButton; + ui::Button * searchButton; public: GameView(); void AttachController(GameController * _c){ c = _c; } void NotifyRendererChanged(GameModel * sender); void NotifySimulationChanged(GameModel * sender); void NotifyPausedChanged(GameModel * sender); - /*virtual void DoMouseMove(int x, int y, int dx, int dy); - virtual void DoMouseDown(int x, int y, unsigned button); - virtual void DoMouseUp(int x, int y, unsigned button); - //virtual void DoMouseWheel(int x, int y, int d); - //virtual void DoKeyPress(int key, bool shift, bool ctrl, bool alt); - //virtual void DoKeyRelease(int key, bool shift, bool ctrl, bool alt); - virtual void DoTick(float dt); - virtual void DoDraw();*/ virtual void OnMouseMove(int x, int y, int dx, int dy); virtual void OnMouseDown(int x, int y, unsigned button); virtual void OnMouseUp(int x, int y, unsigned button); |
