mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
basic options window
This commit is contained in:
@@ -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()
|
||||
|
@@ -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();
|
||||
});
|
||||
}
|
||||
|
@@ -48,6 +48,7 @@ public:
|
||||
private:
|
||||
void enterGameButton_clicked();
|
||||
void infoButton_clicked();
|
||||
void optionsButton_clicked();
|
||||
|
||||
void enterGameWindowOkButton_clicked();
|
||||
|
||||
|
Reference in New Issue
Block a user