diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup.cpp | 4 | ||||
-rw-r--r-- | src/gui/status.cpp | 11 | ||||
-rw-r--r-- | src/gui/status.h | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 6610314e..330315dc 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -34,7 +34,6 @@ #include "radiobutton.h" #include "ok_dialog.h" #include "../main.h" -#include <SDL.h> #ifndef WIN32 extern Sound sound; @@ -136,7 +135,8 @@ void Setup::action(const std::string& eventId) { if (eventId == "apply") { setVisible(false); - int sel = modeList->getSelected(); + int sel = 0; + sel = modeList->getSelected(); // Display settings if (fsCheckBox->isMarked() && config.getValue("screen", 0) == 2) diff --git a/src/gui/status.cpp b/src/gui/status.cpp index e5482f09..ac587a01 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -51,6 +51,10 @@ StatusWindow::StatusWindow(): inventoryButton->setEventId("Inventory"); inventoryButton->addActionListener(this); + setupButton = new Button("Config"); + setupButton->setEventId("Config"); + setupButton->addActionListener(this); + hp->setPosition(WIN_BORDER, WIN_BORDER); sp->setPosition(WIN_BORDER, hp->getY() + hp->getHeight() + CONTROLS_SEPARATOR); healthBar = new ProgressBar(1.0f, WIN_BORDER + hp->getWidth() + CONTROLS_SEPARATOR, WIN_BORDER + 3, 80, 0, 255, 0); @@ -68,6 +72,7 @@ StatusWindow::StatusWindow(): statsButton->setPosition(WIN_BORDER, xpBar->getY() + xpBar->getHeight() + 2*CONTROLS_SEPARATOR); skillsButton->setPosition(statsButton->getX() + statsButton->getWidth() + CONTROLS_SEPARATOR, statsButton->getY()); inventoryButton->setPosition(skillsButton->getX() + skillsButton->getWidth() + CONTROLS_SEPARATOR, statsButton->getY()); + setupButton->setPosition(inventoryButton->getX() + inventoryButton->getWidth() + CONTROLS_SEPARATOR, statsButton->getY()); setSize(250, statsButton->getY() + statsButton->getHeight() + WIN_BORDER); @@ -85,6 +90,7 @@ StatusWindow::StatusWindow(): add(statsButton); add(skillsButton); add(inventoryButton); + add(setupButton); } StatusWindow::~StatusWindow() @@ -101,6 +107,7 @@ StatusWindow::~StatusWindow() delete statsButton; delete skillsButton; delete inventoryButton; + delete setupButton; } void StatusWindow::update() @@ -173,4 +180,8 @@ void StatusWindow::action(const std::string& eventId) { // Show / Hide the inventory dialog inventoryWindow->setVisible(!inventoryWindow->isVisible()); } + if (eventId == "Config") { + // Show / Hide the inventory dialog + setupWindow->setVisible(true); + } } diff --git a/src/gui/status.h b/src/gui/status.h index 7406f977..17a472fe 100644 --- a/src/gui/status.h +++ b/src/gui/status.h @@ -62,7 +62,7 @@ class StatusWindow : public Window, public gcn::ActionListener { gcn::Label *expLabel, *jobExpLabel; ProgressBar *healthBar, *manaBar; ProgressBar *xpBar, *jobXpBar; - gcn::Button *statsButton, *skillsButton, *inventoryButton; + gcn::Button *statsButton, *skillsButton, *inventoryButton, *setupButton; }; #endif |