diff --git a/data/ui/infoWindow.yml b/data/ui/infoWindow.yml index a492ab78..466c00f3 100644 --- a/data/ui/infoWindow.yml +++ b/data/ui/infoWindow.yml @@ -44,11 +44,12 @@ window#infoWindow: margin.right: 9 lineDecoration#bottomSeparator: - size: [218,2] anchors.left: parent.left - anchors.top: parent.top - margin.top: 181 + anchors.right: parent.right + anchors.bottom: parent.bottom + margin.bottom: 40 margin.left: 13 + margin.right: 13 button#okButton: text: Ok diff --git a/data/ui/optionsWindow.yml b/data/ui/optionsWindow.yml new file mode 100644 index 00000000..f580e888 --- /dev/null +++ b/data/ui/optionsWindow.yml @@ -0,0 +1,111 @@ +window#optionsWindow: + title: Info + size: [286, 262] + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + # general + button#generalButton: + text: General + anchors.left: parent.left + anchors.top: parent.top + margin.left: 18 + margin.top: 32 + + label#generalLabel: + text: |- + Change general + game options + anchors.left: parent.left + anchors.top: parent.top + margin.left: 117 + margin.top: 29 + + # graphics + button#graphicsButton: + text: Graphics + anchors.left: parent.left + anchors.top: parent.top + margin.left: 18 + margin.top: 65 + + label#graphicsLabel: + text: |- + Change graphics and + performance settings + anchors.left: parent.left + anchors.top: parent.top + margin.left: 117 + margin.top: 62 + + # console + button#consoleButton: + text: Console + anchors.left: parent.left + anchors.top: parent.top + margin.left: 18 + margin.top: 98 + + label#consoleLabel: + text: Customise the console + anchors.left: parent.left + anchors.top: parent.top + margin.left: 117 + margin.top: 95 + + # hotkeys + button#hotkeysButton: + text: Hotkeys + anchors.left: parent.left + anchors.top: parent.top + margin.left: 18 + margin.top: 131 + + label#hotkeysLabel: + text: Edit your hotkey texts + anchors.left: parent.left + anchors.top: parent.top + margin.left: 117 + margin.top: 128 + + lineDecoration#middleSeparator: + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + margin.bottom: 97 + margin.left: 18 + margin.right: 18 + + # motd + button#motdButton: + text: Motd + anchors.left: parent.left + anchors.bottom: parent.bottom + margin.left: 18 + margin.bottom: 60 + + label#motdLabel: + text: |- + Show the most recent + Message of the Day + anchors.left: parent.left + anchors.bottom: parent.bottom + margin.left: 117 + margin.bottom: 56 + + lineDecoration#bottomSeparator: + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + margin.bottom: 40 + margin.left: 13 + margin.right: 13 + + # ok button + button#okButton: + text: Ok + size: [43, 20] + anchors.right: parent.right + anchors.bottom: parent.bottom + margin.right: 10 + margin.bottom: 13 \ No newline at end of file diff --git a/src/framework/graphics/graphics.cpp b/src/framework/graphics/graphics.cpp index d2e127ee..230e4444 100644 --- a/src/framework/graphics/graphics.cpp +++ b/src/framework/graphics/graphics.cpp @@ -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() diff --git a/src/menustate.cpp b/src/menustate.cpp index f7a2f76a..59904741 100644 --- a/src/menustate.cpp +++ b/src/menustate.cpp @@ -48,6 +48,9 @@ void MenuState::onEnter() button = boost::static_pointer_cast(mainMenuPanel->getChildById("infoButton")); button->setOnClick(boost::bind(&MenuState::infoButton_clicked, this)); + + button = boost::static_pointer_cast(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(UILoader::loadFile("ui/optionsWindow.yml")); + window->getParent()->lockElement(window); + UIButtonPtr button = boost::static_pointer_cast(window->getChildById("okButton")); + button->setOnClick([] { + UIWindowPtr window = boost::static_pointer_cast(UIContainer::getRootContainer()->getChildById("optionsWindow")); + window->getParent()->unlockElement(); + window->destroy(); + }); +} diff --git a/src/menustate.h b/src/menustate.h index 39d919ba..c95007e6 100644 --- a/src/menustate.h +++ b/src/menustate.h @@ -48,6 +48,7 @@ public: private: void enterGameButton_clicked(); void infoButton_clicked(); + void optionsButton_clicked(); void enterGameWindowOkButton_clicked();