Deactivate some checkboxes without advanced pipeline
This commit is contained in:
parent
be999895b4
commit
f1383d1a93
@ -333,7 +333,7 @@ void SpinnerWidget::setValue(const int new_value)
|
|||||||
std::string imagefile = file_manager->searchTexture(s);
|
std::string imagefile = file_manager->searchTexture(s);
|
||||||
((IGUIImage*)(m_children[1].m_element))->setImage(irr_driver->getTexture(imagefile));
|
((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 >= 0);
|
||||||
assert(new_value < (int)m_labels.size());
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -186,7 +186,7 @@ namespace GUIEngine
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
/** Override method from base class Widget */
|
/** Override method from base class Widget */
|
||||||
virtual void setActivated();
|
virtual void setActivated();
|
||||||
|
|
||||||
/** Override method from base class Widget */
|
/** Override method from base class Widget */
|
||||||
virtual void setDeactivated();
|
virtual void setDeactivated();
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float
|
|||||||
ModalDialog(w, h)
|
ModalDialog(w, h)
|
||||||
{
|
{
|
||||||
loadFromFile("custom_video_settings.stkgui");
|
loadFromFile("custom_video_settings.stkgui");
|
||||||
|
updateActivation();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@ -190,10 +191,41 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
|
|||||||
OptionsScreenVideo::getInstance()->updateGfxSlider();
|
OptionsScreenVideo::getInstance()->updateGfxSlider();
|
||||||
return GUIEngine::EVENT_BLOCK;
|
return GUIEngine::EVENT_BLOCK;
|
||||||
}
|
}
|
||||||
|
else if (eventSource == "dynamiclight")
|
||||||
|
{
|
||||||
|
updateActivation();
|
||||||
|
}
|
||||||
|
|
||||||
return GUIEngine::EVENT_LET;
|
return GUIEngine::EVENT_LET;
|
||||||
}
|
} // processEvent
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void CustomVideoSettingsDialog::updateActivation()
|
||||||
|
{
|
||||||
|
if(getWidget<CheckBoxWidget>("dynamiclight")->getState())
|
||||||
|
{
|
||||||
|
getWidget<CheckBoxWidget>("motionblur")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("dof")->setActivated();
|
||||||
|
getWidget<SpinnerWidget>("shadows")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("mlaa")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("ssao")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("lightshaft")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("global_illumination")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("glow")->setActivated();
|
||||||
|
getWidget<CheckBoxWidget>("bloom")->setActivated();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getWidget<CheckBoxWidget>("motionblur")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("dof")->setDeactivated();
|
||||||
|
getWidget<SpinnerWidget>("shadows")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("mlaa")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("ssao")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("lightshaft")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("global_illumination")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("glow")->setDeactivated();
|
||||||
|
getWidget<CheckBoxWidget>("bloom")->setDeactivated();
|
||||||
|
}
|
||||||
|
} // updateActivation
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ public:
|
|||||||
|
|
||||||
virtual void beforeAddingWidgets();
|
virtual void beforeAddingWidgets();
|
||||||
|
|
||||||
|
/** Updates the activation state of the advaced pipeline checkboxes. */
|
||||||
|
void updateActivation();
|
||||||
|
|
||||||
GUIEngine::EventPropagation processEvent(const std::string& eventSource);
|
GUIEngine::EventPropagation processEvent(const std::string& eventSource);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -36,8 +36,6 @@ class OptionsScreenVideo : public GUIEngine::Screen, public GUIEngine::ScreenSin
|
|||||||
OptionsScreenVideo();
|
OptionsScreenVideo();
|
||||||
bool m_inited;
|
bool m_inited;
|
||||||
|
|
||||||
std::vector<std::string> m_skins;
|
|
||||||
|
|
||||||
void updateTooltip();
|
void updateTooltip();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user