summaryrefslogtreecommitdiff
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
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)
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/setup.cpp4
-rw-r--r--src/gui/setup_video.cpp50
-rw-r--r--src/gui/setup_video.h4
4 files changed, 58 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index fa13b62b..68b057b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
data/graphics/items/generic-pinkantennae.png,
data/graphics/items/Makefile.am, data/items.xml:
Added drops for new monsters.
+ * src/gui/setup.cpp, src/gui/setup_video.cpp,
+ src/gui/setup_video.h: Added a slider for controlling the overlay
+ detail to the video setup dialog based on a patch by VictorSan.
2006-09-19 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 1fe22ea6..7deb39ff 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -43,7 +43,7 @@ Setup::Setup():
Window("Setup")
{
int width = 230;
- int height = 225;
+ int height = 245;
setContentSize(width, height);
const char *buttonNames[] = {
@@ -58,7 +58,7 @@ Setup::Setup():
}
TabbedContainer *panel = new TabbedContainer();
- panel->setDimension(gcn::Rectangle(5, 5, 220, 185));
+ panel->setDimension(gcn::Rectangle(5, 5, 220, 205));
panel->setOpaque(false);
SetupTab *tab;
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())
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index 3b5c00a5..df6dc85e 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -73,6 +73,10 @@ class Setup_Video : public SetupTab, public gcn::ActionListener,
gcn::Slider *mScrollRadiusSlider;
gcn::TextField *mScrollRadiusField;
+ int mOverlayDetail;
+ gcn::Slider *mOverlayDetailSlider;
+ gcn::Label *mOverlayDetailField;
+
void
updateSliders(bool originalValues);