mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add option to set water opaque (mainly for stylistic choice)
This commit is contained in:
parent
f5995337e8
commit
d0fdfd44c5
5 changed files with 39 additions and 9 deletions
|
@ -81,6 +81,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||
bool fancy_trees;
|
||||
bool smooth_lighting;
|
||||
bool clouds_3d;
|
||||
bool opaque_water;
|
||||
|
||||
// Client options
|
||||
{
|
||||
|
@ -125,6 +126,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||
else
|
||||
clouds_3d = m_data->clouds_3d;
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_OPAQUE_WATER_CB);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
opaque_water = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
else
|
||||
opaque_water = m_data->opaque_water;
|
||||
}
|
||||
|
||||
// Server options
|
||||
{
|
||||
|
@ -260,6 +268,12 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||
Environment->addCheckBox(clouds_3d, rect, this, GUI_ID_3D_CLOUDS_CB,
|
||||
wgettext("3D Clouds"));
|
||||
}
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 250, 30);
|
||||
rect += topleft_client + v2s32(35, 150+60);
|
||||
Environment->addCheckBox(opaque_water, rect, this, GUI_ID_OPAQUE_WATER_CB,
|
||||
wgettext("Opaque water"));
|
||||
}
|
||||
// Start game button
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 180, 30);
|
||||
|
@ -377,9 +391,9 @@ void GUIMainMenu::acceptInput()
|
|||
m_data->enable_damage = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
m_data->clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_SMOOTH_LIGHTING_CB);
|
||||
|
@ -387,9 +401,14 @@ void GUIMainMenu::acceptInput()
|
|||
m_data->smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB);
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
m_data->clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_OPAQUE_WATER_CB);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
m_data->opaque_water = ((gui::IGUICheckBox*)e)->isChecked();
|
||||
}
|
||||
|
||||
m_accepted = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue