basic options window

This commit is contained in:
Eduardo Bart
2011-04-17 18:15:24 -03:00
parent 8ef534e7b7
commit 5be199e566
5 changed files with 131 additions and 10 deletions

View File

@@ -118,17 +118,11 @@ void Graphics::beginRender()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
// quads is the default drawing mode
glBegin(GL_QUADS);
m_drawMode = DRAW_QUADS;
}
void Graphics::endRender()
{
// end last drawing
glEnd();
m_drawMode = DRAW_NONE;
disableDrawing();
}
void Graphics::disableDrawing()

View File

@@ -48,6 +48,9 @@ void MenuState::onEnter()
button = boost::static_pointer_cast<UIButton>(mainMenuPanel->getChildById("infoButton"));
button->setOnClick(boost::bind(&MenuState::infoButton_clicked, this));
button = boost::static_pointer_cast<UIButton>(mainMenuPanel->getChildById("optionsButton"));
button->setOnClick(boost::bind(&MenuState::optionsButton_clicked, this));
}
void MenuState::onLeave()
@@ -124,3 +127,14 @@ void MenuState::enterGameWindowOkButton_clicked()
//m_protocolLogin->login(accountName, password);
}
void MenuState::optionsButton_clicked()
{
UIWindowPtr window = boost::static_pointer_cast<UIWindow>(UILoader::loadFile("ui/optionsWindow.yml"));
window->getParent()->lockElement(window);
UIButtonPtr button = boost::static_pointer_cast<UIButton>(window->getChildById("okButton"));
button->setOnClick([] {
UIWindowPtr window = boost::static_pointer_cast<UIWindow>(UIContainer::getRootContainer()->getChildById("optionsWindow"));
window->getParent()->unlockElement();
window->destroy();
});
}

View File

@@ -48,6 +48,7 @@ public:
private:
void enterGameButton_clicked();
void infoButton_clicked();
void optionsButton_clicked();
void enterGameWindowOkButton_clicked();