diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-09-28 22:19:06 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-09-28 22:19:06 +0000 |
commit | 4d117b39c555966d7648a03e0127560278e47170 (patch) | |
tree | 9a8f6dca14a5b69b6860db91bb795adb351bb714 /src/gui/setup.cpp | |
parent | eb8dc37bfa07e1185308bc8d4748d92c69af1783 (diff) | |
download | mana-client-4d117b39c555966d7648a03e0127560278e47170.tar.gz mana-client-4d117b39c555966d7648a03e0127560278e47170.tar.bz2 mana-client-4d117b39c555966d7648a03e0127560278e47170.tar.xz mana-client-4d117b39c555966d7648a03e0127560278e47170.zip |
Added a Reset Win Positions to Default in the Setup win.
Diffstat (limited to 'src/gui/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index cc2150de..b9702e04 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -41,9 +41,14 @@ #include "../main.h" #include "../sound.h" -#define SETUP_WIDTH 240 - extern Graphics *graphics; +#include "gui/chat.h" +#include "gui/equipmentwindow.h" +#include "gui/help.h" +#include "gui/inventorywindow.h" +#include "gui/minimap.h" +#include "gui/skill.h" +#include "gui/status.h" ModeListModel::ModeListModel() { @@ -109,19 +114,21 @@ Setup::Setup(): musicLabel = new gcn::Label("Music volume"); applyButton = new Button("Apply"); cancelButton = new Button("Cancel"); + resetWinsToDefault = new Button("Reset Windows"); // Set events applyButton->setEventId("apply"); cancelButton->setEventId("cancel"); + resetWinsToDefault->setEventId("winsToDefault"); alphaSlider->setEventId("guialpha"); sfxSlider->setEventId("sfx"); musicSlider->setEventId("music"); customCursorCheckBox->setEventId("customcursor"); // Set dimensions/positions - setContentSize(SETUP_WIDTH, 226); + setContentSize(240, 246); - videoLabel->setPosition(SETUP_WIDTH - videoLabel->getWidth() - 5, 10); + videoLabel->setPosition(getWidth() - videoLabel->getWidth() - 5, 10); scrollArea->setDimension(gcn::Rectangle(10, 30, 90, 50)); modeList->setDimension(gcn::Rectangle(0, 0, 60, 50)); fsCheckBox->setPosition(110, 30); @@ -130,22 +137,24 @@ Setup::Setup(): alphaSlider->setDimension(gcn::Rectangle(10, 100, 100, 10)); alphaLabel->setPosition(20 + alphaSlider->getWidth(), 97); - audioLabel->setPosition(SETUP_WIDTH - videoLabel->getWidth() - 5, 120); + audioLabel->setPosition(getWidth() - videoLabel->getWidth() - 5, 120); soundCheckBox->setPosition(10, 140); sfxSlider->setDimension(gcn::Rectangle(10, 160, 100, 10)); musicSlider->setDimension(gcn::Rectangle(10, 180, 100, 10)); sfxLabel->setPosition(20 + sfxSlider->getWidth(), 157); musicLabel->setPosition(20 + musicSlider->getWidth(), 177); + resetWinsToDefault->setPosition(20, 197); cancelButton->setPosition( - SETUP_WIDTH - 5 - cancelButton->getWidth(), - 226 - 5 - cancelButton->getHeight()); + getWidth() - 10 - cancelButton->getWidth(), + getHeight() - 25 - cancelButton->getHeight()); applyButton->setPosition( - cancelButton->getX() - 5 - applyButton->getWidth(), - 226 - 5 - applyButton->getHeight()); + cancelButton->getX() - 10 - applyButton->getWidth(), + getHeight() - 25 - applyButton->getHeight()); // Listen for actions applyButton->addActionListener(this); cancelButton->addActionListener(this); + resetWinsToDefault->addActionListener(this); alphaSlider->addActionListener(this); sfxSlider->addActionListener(this); musicSlider->addActionListener(this); @@ -165,6 +174,7 @@ Setup::Setup(): add(musicSlider); add(sfxLabel); add(musicLabel); + add(resetWinsToDefault); add(applyButton); add(cancelButton); @@ -209,6 +219,7 @@ Setup::~Setup() delete customCursorCheckBox; delete soundCheckBox; delete audioLabel; + delete resetWinsToDefault; delete applyButton; delete cancelButton; delete alphaSlider; @@ -337,4 +348,33 @@ void Setup::action(const std::string &eventId) config.setValue("opengl", openGLEnabled ? 1 : 0); openGLCheckBox->setMarked(openGLEnabled); } + else if (eventId == "winsToDefault") + { + int screenW = graphics->getWidth(); + int screenH = graphics->getHeight(); + + statusWindow->setWidth(365); + statusWindow->setHeight(255); + statusWindow->setPosition((screenW - statusWindow->getWidth()) / 2, + (screenH - statusWindow->getHeight()) / 2); + + minimap->setPosition(3, 30); + + chatWindow->setWidth(600); + chatWindow->setHeight(100); + chatWindow->setPosition(0, screenH - chatWindow->getHeight()); + if (chatWindow->getContent() != NULL) + { + chatWindow->getContent()->setDimension(gcn::Rectangle(0,0,594,80)); + } + + inventoryWindow->setWidth(322); + inventoryWindow->setHeight(172); + inventoryWindow->setPosition(60, 5); + + equipmentWindow->setPosition(5,140); + + helpWindow->setPosition(100,100); + + } } |