diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-05-28 20:22:37 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-05-28 20:22:37 +0000 |
commit | 2dfd979ea4c0c1a1046461ac21213d8211175c36 (patch) | |
tree | 89dc6755031aa4ad3b5b794ae11958c5ab53b43a /src/gui/setup_video.cpp | |
parent | b4bf0aba860093121dff7f469d4cd19a578a9c09 (diff) | |
download | mana-2dfd979ea4c0c1a1046461ac21213d8211175c36.tar.gz mana-2dfd979ea4c0c1a1046461ac21213d8211175c36.tar.bz2 mana-2dfd979ea4c0c1a1046461ac21213d8211175c36.tar.xz mana-2dfd979ea4c0c1a1046461ac21213d8211175c36.zip |
Added slider for controlling particleEmitterSkip (overall quality of particle effects) to video setup menu.
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r-- | src/gui/setup_video.cpp | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index d0c3d5e3..33d9ad73 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -43,6 +43,7 @@ #include "../graphics.h" #include "../log.h" #include "../main.h" +#include "../particle.h" #include "../utils/tostring.h" @@ -124,7 +125,10 @@ Setup_Video::Setup_Video(): mScrollRadiusField(new TextField()), mOverlayDetail((int) config.getValue("OverlayDetail", 2)), mOverlayDetailSlider(new Slider(0, 2)), - mOverlayDetailField(new gcn::Label("")) + mOverlayDetailField(new gcn::Label("")), + mParticleDetail(3 - (int) config.getValue("particleEmitterSkip", 0)), + mParticleDetailSlider(new Slider(0, 3)), + mParticleDetailField(new gcn::Label("")) { setOpaque(false); @@ -168,6 +172,8 @@ Setup_Video::Setup_Video(): mScrollLazinessField->setActionEventId("scrolllazinessfield"); mOverlayDetailSlider->setActionEventId("overlaydetailslider"); mOverlayDetailField->setActionEventId("overlaydetailfield"); + mParticleDetailSlider->setActionEventId("particledetailslider"); + mParticleDetailField->setActionEventId("particledetailfield"); mCustomCursorCheckBox->addActionListener(this); mAlphaSlider->addActionListener(this); @@ -180,6 +186,8 @@ Setup_Video::Setup_Video(): mScrollLazinessField->addKeyListener(this); mOverlayDetailSlider->addActionListener(this); mOverlayDetailField->addKeyListener(this); + mParticleDetailSlider->addActionListener(this); + mParticleDetailField->addKeyListener(this); mScrollRadiusSlider->setDimension(gcn::Rectangle(10, 120, 75, 10)); gcn::Label *scrollRadiusLabel = new gcn::Label("Scroll radius"); @@ -216,6 +224,28 @@ Setup_Video::Setup_Video(): } mOverlayDetailSlider->setValue(mOverlayDetail); + mParticleDetailSlider->setDimension(gcn::Rectangle(10, 180, 75, 10)); + gcn::Label *particleDetailLabel = new gcn::Label("Particle Detail"); + particleDetailLabel->setPosition(90, 180); + mParticleDetailField->setPosition(180, 180); + mParticleDetailField->setWidth(60); + switch (mParticleDetail) + { + case 0: + mParticleDetailField->setCaption("low"); + break; + case 1: + mParticleDetailField->setCaption("medium"); + break; + case 2: + mParticleDetailField->setCaption("high"); + break; + case 3: + mParticleDetailField->setCaption("max"); + break; + } + mParticleDetailSlider->setValue(mParticleDetail); + add(scrollArea); add(mFsCheckBox); add(mOpenGLCheckBox); @@ -234,6 +264,9 @@ Setup_Video::Setup_Video(): add(mOverlayDetailSlider); add(overlayDetailLabel); add(mOverlayDetailField); + add(mParticleDetailSlider); + add(particleDetailLabel); + add(mParticleDetailField); } Setup_Video::~Setup_Video() @@ -319,6 +352,7 @@ void Setup_Video::cancel() mCustomCursorCheckBox->setSelected(mCustomCursorEnabled); mAlphaSlider->setValue(mOpacity); mOverlayDetailSlider->setValue(mOverlayDetail); + mParticleDetailSlider->setValue(mParticleDetail); mScrollRadiusField->setText(toString(mOriginalScrollRadius)); mScrollLazinessField->setText(toString(mOriginalScrollLaziness)); @@ -376,6 +410,27 @@ void Setup_Video::action(const gcn::ActionEvent &event) } config.setValue("OverlayDetail", val); } + else if (event.getId() == "particledetailslider") + { + int val = (int) mParticleDetailSlider->getValue(); + switch (val) + { + case 0: + mParticleDetailField->setCaption("low"); + break; + case 1: + mParticleDetailField->setCaption("medium"); + break; + case 2: + mParticleDetailField->setCaption("high"); + break; + case 3: + mParticleDetailField->setCaption("max"); + break; + } + config.setValue("particleEmitterSkip", 3 - val); + Particle::emitterSkip = 4 - val; + } else if (event.getId() == "fpslimitcheckbox") { if (mFpsCheckBox->isSelected()) |