mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-06 08:27:27 +02:00
Started the rest of the UI
This commit is contained in:
@@ -39,6 +39,100 @@ GameView::GameView():
|
|||||||
searchButton->SetTogglable(false);
|
searchButton->SetTogglable(false);
|
||||||
searchButton->SetActionCallback(new SearchAction(this));
|
searchButton->SetActionCallback(new SearchAction(this));
|
||||||
AddComponent(searchButton);
|
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)
|
void GameView::NotifyRendererChanged(GameModel * sender)
|
||||||
|
@@ -22,6 +22,13 @@ private:
|
|||||||
//UI Elements
|
//UI Elements
|
||||||
ui::Button * pauseButton;
|
ui::Button * pauseButton;
|
||||||
ui::Button * searchButton;
|
ui::Button * searchButton;
|
||||||
|
ui::Button * reloadButton;
|
||||||
|
ui::Button * saveSimulationButton;
|
||||||
|
ui::Button * downVoteButton;
|
||||||
|
ui::Button * upVoteButton;
|
||||||
|
ui::Button * tagSimulationButton;
|
||||||
|
|
||||||
|
ui::Button * displayModeButton;
|
||||||
public:
|
public:
|
||||||
GameView();
|
GameView();
|
||||||
void AttachController(GameController * _c){ c = _c; }
|
void AttachController(GameController * _c){ c = _c; }
|
||||||
|
Reference in New Issue
Block a user