diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 2fbed31d5..336acf971 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -39,6 +39,100 @@ GameView::GameView(): searchButton->SetTogglable(false); searchButton->SetActionCallback(new SearchAction(this)); AddComponent(searchButton); + + class ReloadAction : public ui::ButtonAction + { + GameView * v; + public: + ReloadAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + reloadButton = new ui::Button(ui::Point(16, Size.Y-18), ui::Point(16, 16), "\x91"); // TODO Position? + reloadButton->SetTogglable(false); + reloadButton->SetActionCallback(new ReloadAction(this)); + AddComponent(reloadButton); + + class SaveSimulationAction : public ui::ButtonAction + { + GameView * v; + public: + SaveSimulationAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + saveSimulationButton = new ui::Button(ui::Point(32, Size.Y-18), ui::Point(152, 16), "\x82"); // TODO All arguments + saveSimulationButton->SetTogglable(false); + saveSimulationButton->SetActionCallback(new SaveSimulationAction(this)); + AddComponent(saveSimulationButton); + + class UpVoteAction : public ui::ButtonAction + { + GameView * v; + public: + UpVoteAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + upVoteButton = new ui::Button(ui::Point(184, Size.Y-18), ui::Point(16, 16), "\xCB"); // TODO All arguments + upVoteButton->SetTogglable(false); + upVoteButton->SetActionCallback(new UpVoteAction(this)); + AddComponent(upVoteButton); + + class DownVoteAction : public ui::ButtonAction + { + GameView * v; + public: + DownVoteAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + downVoteButton = new ui::Button(ui::Point(200, Size.Y-18), ui::Point(16, 16), "\xCA"); // TODO All arguments + downVoteButton->SetTogglable(false); + downVoteButton->SetActionCallback(new DownVoteAction(this)); + AddComponent(downVoteButton); + + class TagSimulationAction : public ui::ButtonAction + { + GameView * v; + public: + TagSimulationAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->OpenSearch(); // TODO call proper function + } + }; + tagSimulationButton = new ui::Button(ui::Point(216, Size.Y-18), ui::Point(152, 16), "\x83"); // TODO All arguments + tagSimulationButton->SetTogglable(false); + tagSimulationButton->SetActionCallback(new TagSimulationAction(this)); + AddComponent(tagSimulationButton); + + //simul option + //erase all + // login + + class DisplayModeAction : public ui::ButtonAction + { + GameView * v; + public: + DisplayModeAction(GameView * _v) { v = _v; } + void ActionCallback(ui::Button * sender) + { + v->c->SetPaused(sender->GetToggleState()); // TODO call proper function + } + }; + displayModeButton = new ui::Button(ui::Point(Size.X-34, Size.Y-18), ui::Point(16, 16), "\xDA"); // TODO All arguments + displayModeButton->SetTogglable(true); + displayModeButton->SetActionCallback(new DisplayModeAction(this)); + AddComponent(displayModeButton); } void GameView::NotifyRendererChanged(GameModel * sender) diff --git a/src/game/GameView.h b/src/game/GameView.h index f34aedc14..772aa8a6f 100644 --- a/src/game/GameView.h +++ b/src/game/GameView.h @@ -22,6 +22,13 @@ private: //UI Elements ui::Button * pauseButton; ui::Button * searchButton; + ui::Button * reloadButton; + ui::Button * saveSimulationButton; + ui::Button * downVoteButton; + ui::Button * upVoteButton; + ui::Button * tagSimulationButton; + + ui::Button * displayModeButton; public: GameView(); void AttachController(GameController * _c){ c = _c; } diff --git a/src/search/SearchView.cpp b/src/search/SearchView.cpp index ca848b5a8..57e5558d3 100644 --- a/src/search/SearchView.cpp +++ b/src/search/SearchView.cpp @@ -107,12 +107,12 @@ SearchView::~SearchView() void SearchView::NotifySortChanged(SearchModel * sender) { - sortButton->SetText("Sort: "+sender->GetSort()); + sortButton->SetText("Sort: "+sender->GetSort()); } void SearchView::NotifyShowOwnChanged(SearchModel * sender) { - sortButton->SetToggleState(sender->GetShowOwn()); + sortButton->SetToggleState(sender->GetShowOwn()); } void SearchView::NotifyPageChanged(SearchModel * sender)