From 84830f6365d73d0a0ee658ec43b666e0630690e1 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 5 May 2005 20:33:58 +0000 Subject: Status Window now have a button to show/hide Equipment Window. --- src/gui/status.cpp | 11 +++++++++++ src/gui/status.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 675c5575..24a63499 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -55,6 +55,10 @@ StatusWindow::StatusWindow(): setupButton = new Button("Setup"); setupButton->setEventId("Setup"); setupButton->addActionListener(this); + + equipmentButton = new Button("Equip."); + equipmentButton->setEventId("Equipment"); + equipmentButton->addActionListener(this); hp->setPosition(WIN_BORDER, WIN_BORDER); sp->setPosition(WIN_BORDER, hp->getY() + hp->getHeight() + CONTROLS_SEPARATOR); @@ -74,6 +78,7 @@ StatusWindow::StatusWindow(): 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()); + equipmentButton->setPosition(setupButton->getX() + setupButton->getWidth() + CONTROLS_SEPARATOR, statsButton->getY()); setContentSize(250, statsButton->getY() + statsButton->getHeight() + WIN_BORDER); @@ -92,6 +97,7 @@ StatusWindow::StatusWindow(): add(skillsButton); add(inventoryButton); add(setupButton); + add(equipmentButton); } StatusWindow::~StatusWindow() @@ -109,6 +115,7 @@ StatusWindow::~StatusWindow() delete skillsButton; delete inventoryButton; delete setupButton; + delete equipmentButton; } void StatusWindow::update() @@ -185,4 +192,8 @@ void StatusWindow::action(const std::string& eventId) { // Show / Hide the inventory dialog setupWindow->setVisible(true); } + if (eventId == "Equipment") { + // Show / Hide the inventory dialog + equipmentWindow->setVisible(!equipmentWindow->isVisible()); + } } diff --git a/src/gui/status.h b/src/gui/status.h index 17a472fe..4b485729 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, *setupButton; + gcn::Button *statsButton, *skillsButton, *inventoryButton, *setupButton, *equipmentButton; }; #endif -- cgit v1.2.3-70-g09d2