diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index 879549af3..50bbc56ce 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -333,7 +333,7 @@ void SpinnerWidget::setValue(const int new_value) std::string imagefile = file_manager->searchTexture(s); ((IGUIImage*)(m_children[1].m_element))->setImage(irr_driver->getTexture(imagefile)); } - else if (m_labels.size() > 0 && m_children.size() > 0) + else if (m_labels.size() > 0 && m_children.size() > 0 && !m_deactivated) { assert(new_value >= 0); assert(new_value < (int)m_labels.size()); @@ -386,7 +386,8 @@ void SpinnerWidget::setValue(irr::core::stringw new_value) } } - Log::fatal("SpinnerWidget::setValue", "Cannot find element named '%s'", irr::core::stringc(new_value.c_str()).c_str()); + Log::fatal("SpinnerWidget::setValue", "Cannot find element named '%s'", + irr::core::stringc(new_value.c_str()).c_str()); } // ----------------------------------------------------------------------------- diff --git a/src/guiengine/widgets/spinner_widget.hpp b/src/guiengine/widgets/spinner_widget.hpp index 12ae62a0f..09e5ea594 100644 --- a/src/guiengine/widgets/spinner_widget.hpp +++ b/src/guiengine/widgets/spinner_widget.hpp @@ -186,7 +186,7 @@ namespace GUIEngine // -------------------------------------------------------------------- /** Override method from base class Widget */ virtual void setActivated(); - + /** Override method from base class Widget */ virtual void setDeactivated(); diff --git a/src/states_screens/dialogs/custom_video_settings.cpp b/src/states_screens/dialogs/custom_video_settings.cpp index b30eeb740..b1d0d8b63 100644 --- a/src/states_screens/dialogs/custom_video_settings.cpp +++ b/src/states_screens/dialogs/custom_video_settings.cpp @@ -38,6 +38,7 @@ CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float ModalDialog(w, h) { loadFromFile("custom_video_settings.stkgui"); + updateActivation(); } // ----------------------------------------------------------------------------- @@ -190,10 +191,41 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s OptionsScreenVideo::getInstance()->updateGfxSlider(); return GUIEngine::EVENT_BLOCK; } + else if (eventSource == "dynamiclight") + { + updateActivation(); + } return GUIEngine::EVENT_LET; -} +} // processEvent // ----------------------------------------------------------------------------- +void CustomVideoSettingsDialog::updateActivation() +{ + if(getWidget("dynamiclight")->getState()) + { + getWidget("motionblur")->setActivated(); + getWidget("dof")->setActivated(); + getWidget("shadows")->setActivated(); + getWidget("mlaa")->setActivated(); + getWidget("ssao")->setActivated(); + getWidget("lightshaft")->setActivated(); + getWidget("global_illumination")->setActivated(); + getWidget("glow")->setActivated(); + getWidget("bloom")->setActivated(); + } + else + { + getWidget("motionblur")->setDeactivated(); + getWidget("dof")->setDeactivated(); + getWidget("shadows")->setDeactivated(); + getWidget("mlaa")->setDeactivated(); + getWidget("ssao")->setDeactivated(); + getWidget("lightshaft")->setDeactivated(); + getWidget("global_illumination")->setDeactivated(); + getWidget("glow")->setDeactivated(); + getWidget("bloom")->setDeactivated(); + } +} // updateActivation diff --git a/src/states_screens/dialogs/custom_video_settings.hpp b/src/states_screens/dialogs/custom_video_settings.hpp index 2948cd786..7ab896056 100644 --- a/src/states_screens/dialogs/custom_video_settings.hpp +++ b/src/states_screens/dialogs/custom_video_settings.hpp @@ -37,6 +37,9 @@ public: virtual void beforeAddingWidgets(); + /** Updates the activation state of the advaced pipeline checkboxes. */ + void updateActivation(); + GUIEngine::EventPropagation processEvent(const std::string& eventSource); }; diff --git a/src/states_screens/options_screen_video.hpp b/src/states_screens/options_screen_video.hpp index da868d35a..14c2dfca5 100644 --- a/src/states_screens/options_screen_video.hpp +++ b/src/states_screens/options_screen_video.hpp @@ -36,8 +36,6 @@ class OptionsScreenVideo : public GUIEngine::Screen, public GUIEngine::ScreenSin OptionsScreenVideo(); bool m_inited; - std::vector m_skins; - void updateTooltip(); public: