summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2006-09-20 12:48:29 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2006-09-20 12:48:29 +0000
commita72ec09ed3d7161b372ee43ff18a828964add512 (patch)
tree7936071dd641b85206220d8e02e639847ef7e740 /src/gui/setup_video.cpp
parent525056d28875eea1c17fd181fe4e51a42c9ce30b (diff)
downloadmana-a72ec09ed3d7161b372ee43ff18a828964add512.tar.gz
mana-a72ec09ed3d7161b372ee43ff18a828964add512.tar.bz2
mana-a72ec09ed3d7161b372ee43ff18a828964add512.tar.xz
mana-a72ec09ed3d7161b372ee43ff18a828964add512.zip
Added a slider for controlling the OverlayDetail (based on a patch by VictorSan)
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r--src/gui/setup_video.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 7abcde53..22d0520e 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -120,7 +120,10 @@ Setup_Video::Setup_Video():
mScrollLazinessField(new TextField()),
mOriginalScrollRadius((int) config.getValue("ScrollRadius", 32)),
mScrollRadiusSlider(new Slider(0, 128)),
- mScrollRadiusField(new TextField())
+ mScrollRadiusField(new TextField()),
+ mOverlayDetail((int) config.getValue("OverlayDetail", 2)),
+ mOverlayDetailSlider(new Slider(0, 2)),
+ mOverlayDetailField(new gcn::Label(""))
{
setOpaque(false);
@@ -162,6 +165,8 @@ Setup_Video::Setup_Video():
mScrollRadiusField->setEventId("scrollradiusfield");
mScrollLazinessSlider->setEventId("scrolllazinessslider");
mScrollLazinessField->setEventId("scrolllazinessfield");
+ mOverlayDetailSlider->setEventId("overlaydetailslider");
+ mOverlayDetailField->setEventId("overlaydetailfield");
mCustomCursorCheckBox->addActionListener(this);
mAlphaSlider->addActionListener(this);
@@ -172,6 +177,8 @@ Setup_Video::Setup_Video():
mScrollRadiusField->addKeyListener(this);
mScrollLazinessSlider->addActionListener(this);
mScrollLazinessField->addKeyListener(this);
+ mOverlayDetailSlider->addActionListener(this);
+ mOverlayDetailField->addKeyListener(this);
mScrollRadiusSlider->setDimension(gcn::Rectangle(10, 120, 75, 10));
gcn::Label *scrollRadiusLabel = new gcn::Label("Scroll radius");
@@ -189,6 +196,25 @@ Setup_Video::Setup_Video():
mScrollLazinessField->setText(toString(mOriginalScrollLaziness));
mScrollLazinessSlider->setValue(mOriginalScrollLaziness);
+ mOverlayDetailSlider->setDimension(gcn::Rectangle(10, 160, 75, 10));
+ gcn::Label *overlayDetailLabel = new gcn::Label("Ambient FX");
+ overlayDetailLabel->setPosition(90, 160);
+ mOverlayDetailField->setPosition(180, 160);
+ mOverlayDetailField->setWidth(30);
+ switch (mOverlayDetail)
+ {
+ case 0:
+ mOverlayDetailField->setCaption("off");
+ break;
+ case 1:
+ mOverlayDetailField->setCaption("low");
+ break;
+ case 2:
+ mOverlayDetailField->setCaption("high");
+ break;
+ }
+ mOverlayDetailSlider->setValue(mOverlayDetail);
+
add(scrollArea);
add(mFsCheckBox);
add(mOpenGLCheckBox);
@@ -204,6 +230,9 @@ Setup_Video::Setup_Video():
add(mScrollLazinessSlider);
add(scrollLazinessLabel);
add(mScrollLazinessField);
+ add(mOverlayDetailSlider);
+ add(overlayDetailLabel);
+ add(mOverlayDetailField);
}
Setup_Video::~Setup_Video()
@@ -257,6 +286,7 @@ void Setup_Video::apply()
mFullScreenEnabled = config.getValue("screen", 0);
mCustomCursorEnabled = config.getValue("customcursor", 1);
mOpacity = config.getValue("guialpha", 0.8);
+ mOverlayDetail = (int)config.getValue("OverlayDetail", 2);
mOpenGLEnabled = config.getValue("opengl", 0);
}
@@ -287,6 +317,7 @@ void Setup_Video::cancel()
mOpenGLCheckBox->setMarked(mOpenGLEnabled);
mCustomCursorCheckBox->setMarked(mCustomCursorEnabled);
mAlphaSlider->setValue(mOpacity);
+ mOverlayDetailSlider->setValue(mOverlayDetail);
mScrollRadiusField->setText(toString(mOriginalScrollRadius));
mScrollLazinessField->setText(toString(mOriginalScrollLaziness));
@@ -327,6 +358,23 @@ void Setup_Video::action(const std::string &event, gcn::Widget *widget)
mScrollLazinessField->setText(toString(val));
config.setValue("ScrollLaziness", val);
}
+ else if (event == "overlaydetailslider")
+ {
+ int val = (int)mOverlayDetailSlider->getValue();
+ switch (val)
+ {
+ case 0:
+ mOverlayDetailField->setCaption("off");
+ break;
+ case 1:
+ mOverlayDetailField->setCaption("low");
+ break;
+ case 2:
+ mOverlayDetailField->setCaption("high");
+ break;
+ }
+ config.setValue("OverlayDetail", val);
+ }
else if (event == "fpslimitcheckbox")
{
if (mFpsCheckBox->isMarked())