diff options
author | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2008-06-04 08:32:39 +0000 |
---|---|---|
committer | Mateusz Kaduk <mateusz.kaduk@gmail.com> | 2008-06-04 08:32:39 +0000 |
commit | 54d3f15fde8305e7e65944668bde66d7a4e127db (patch) | |
tree | bad2722f67eabff7adad0fc1890e1307ca6e8b1c /src/gui/setup_video.cpp | |
parent | 0fdbf1d62c1add8800ffc7171a1911e1e243ac2a (diff) | |
download | mana-54d3f15fde8305e7e65944668bde66d7a4e127db.tar.gz mana-54d3f15fde8305e7e65944668bde66d7a4e127db.tar.bz2 mana-54d3f15fde8305e7e65944668bde66d7a4e127db.tar.xz mana-54d3f15fde8305e7e65944668bde66d7a4e127db.zip |
Added switch option drawing nicknames only if mouse hover. Useful in crowded places.
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r-- | src/gui/setup_video.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index eb3c3df2..4d9b5d74 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -106,6 +106,7 @@ Setup_Video::Setup_Video(): mFullScreenEnabled(config.getValue("screen", 0)), mOpenGLEnabled(config.getValue("opengl", 0)), mCustomCursorEnabled(config.getValue("customcursor", 1)), + mVisibleNamesEnabled(config.getValue("visiblenames", 1)), mOpacity(config.getValue("guialpha", 0.8)), mFps((int)config.getValue("fpslimit", 60)), mModeListModel(new ModeListModel()), @@ -113,6 +114,7 @@ Setup_Video::Setup_Video(): mFsCheckBox(new CheckBox(_("Full screen"), mFullScreenEnabled)), mOpenGLCheckBox(new CheckBox(_("OpenGL"), mOpenGLEnabled)), mCustomCursorCheckBox(new CheckBox(_("Custom cursor"), mCustomCursorEnabled)), + mVisibleNamesCheckBox(new CheckBox(_("Visible names"), mVisibleNamesEnabled)), mAlphaSlider(new Slider(0.2, 1.0)), mFpsCheckBox(new CheckBox(_("FPS Limit:"))), mFpsSlider(new Slider(10, 200)), @@ -143,12 +145,13 @@ Setup_Video::Setup_Video(): mFsCheckBox->setPosition(110, 10); mOpenGLCheckBox->setPosition(110, 30); mCustomCursorCheckBox->setPosition(110, 50); - mAlphaSlider->setDimension(gcn::Rectangle(10, 80, 100, 10)); + mVisibleNamesCheckBox->setPosition(110, 70); + mAlphaSlider->setDimension(gcn::Rectangle(10, 100, 100, 10)); alphaLabel->setPosition(20 + mAlphaSlider->getWidth(), mAlphaSlider->getY()); - mFpsCheckBox->setPosition(90, 100); - mFpsSlider->setDimension(gcn::Rectangle(10, 100, 75, 10)); - mFpsField->setPosition(100 + mFpsCheckBox->getWidth(), 100); + mFpsCheckBox->setPosition(90, 120); + mFpsSlider->setDimension(gcn::Rectangle(10, 120, 75, 10)); + mFpsField->setPosition(100 + mFpsCheckBox->getWidth(), 120); mFpsField->setWidth(30); mModeList->setSelected(-1); @@ -161,6 +164,7 @@ Setup_Video::Setup_Video(): mFpsCheckBox->setSelected(mFps > 0); mCustomCursorCheckBox->setActionEventId("customcursor"); + mVisibleNamesCheckBox->setActionEventId("visiblenames"); mAlphaSlider->setActionEventId("guialpha"); mFpsCheckBox->setActionEventId("fpslimitcheckbox"); mFpsSlider->setActionEventId("fpslimitslider"); @@ -172,6 +176,7 @@ Setup_Video::Setup_Video(): mOverlayDetailField->setActionEventId("overlaydetailfield"); mCustomCursorCheckBox->addActionListener(this); + mVisibleNamesCheckBox->addActionListener(this); mAlphaSlider->addActionListener(this); mFpsCheckBox->addActionListener(this); mFpsSlider->addActionListener(this); @@ -183,26 +188,26 @@ Setup_Video::Setup_Video(): mOverlayDetailSlider->addActionListener(this); mOverlayDetailField->addKeyListener(this); - mScrollRadiusSlider->setDimension(gcn::Rectangle(10, 120, 75, 10)); + mScrollRadiusSlider->setDimension(gcn::Rectangle(10, 140, 75, 10)); gcn::Label *scrollRadiusLabel = new gcn::Label(_("Scroll radius")); - scrollRadiusLabel->setPosition(90, 120); - mScrollRadiusField->setPosition(180, 120); + scrollRadiusLabel->setPosition(90, 140); + mScrollRadiusField->setPosition(180, 140); mScrollRadiusField->setWidth(30); mScrollRadiusField->setText(toString(mOriginalScrollRadius)); mScrollRadiusSlider->setValue(mOriginalScrollRadius); - mScrollLazinessSlider->setDimension(gcn::Rectangle(10, 140, 75, 10)); + mScrollLazinessSlider->setDimension(gcn::Rectangle(10, 160, 75, 10)); gcn::Label *scrollLazinessLabel = new gcn::Label(_("Scroll laziness")); - scrollLazinessLabel->setPosition(90, 140); - mScrollLazinessField->setPosition(180, 140); + scrollLazinessLabel->setPosition(90, 160); + mScrollLazinessField->setPosition(180, 160); mScrollLazinessField->setWidth(30); mScrollLazinessField->setText(toString(mOriginalScrollLaziness)); mScrollLazinessSlider->setValue(mOriginalScrollLaziness); - mOverlayDetailSlider->setDimension(gcn::Rectangle(10, 160, 75, 10)); + mOverlayDetailSlider->setDimension(gcn::Rectangle(10, 180, 75, 10)); gcn::Label *overlayDetailLabel = new gcn::Label(_("Ambient FX")); - overlayDetailLabel->setPosition(90, 160); - mOverlayDetailField->setPosition(180, 160); + overlayDetailLabel->setPosition(90, 180); + mOverlayDetailField->setPosition(180, 180); mOverlayDetailField->setWidth(30); switch (mOverlayDetail) { @@ -222,6 +227,7 @@ Setup_Video::Setup_Video(): add(mFsCheckBox); add(mOpenGLCheckBox); add(mCustomCursorCheckBox); + add(mVisibleNamesCheckBox); add(mAlphaSlider); add(alphaLabel); add(mFpsCheckBox); @@ -288,6 +294,7 @@ void Setup_Video::apply() // We sync old and new values at apply time mFullScreenEnabled = config.getValue("screen", 0); mCustomCursorEnabled = config.getValue("customcursor", 1); + mVisibleNamesEnabled = config.getValue("visiblenames", 1); mOpacity = config.getValue("guialpha", 0.8); mOverlayDetail = (int)config.getValue("OverlayDetail", 2); mOpenGLEnabled = config.getValue("opengl", 0); @@ -319,6 +326,7 @@ void Setup_Video::cancel() mFsCheckBox->setSelected(mFullScreenEnabled); mOpenGLCheckBox->setSelected(mOpenGLEnabled); mCustomCursorCheckBox->setSelected(mCustomCursorEnabled); + mVisibleNamesCheckBox->setSelected(mVisibleNamesEnabled); mAlphaSlider->setValue(mOpacity); mOverlayDetailSlider->setValue(mOverlayDetail); @@ -329,6 +337,7 @@ void Setup_Video::cancel() config.setValue("screen", mFullScreenEnabled ? 1 : 0); config.setValue("customcursor", mCustomCursorEnabled ? 1 : 0); + config.setValue("visiblenames", mVisibleNamesEnabled ? 1 : 0); config.setValue("guialpha", mOpacity); config.setValue("opengl", mOpenGLEnabled ? 1 : 0); } @@ -344,6 +353,11 @@ void Setup_Video::action(const gcn::ActionEvent &event) config.setValue("customcursor", mCustomCursorCheckBox->isSelected() ? 1 : 0); } + else if (event.getId() == "visiblenames") + { + config.setValue("visiblenames", + mVisibleNamesCheckBox->isSelected() ? 1 : 0); + } else if (event.getId() == "fpslimitslider") { mFps = (int) mFpsSlider->getValue(); |