summaryrefslogtreecommitdiff
path: root/src/guiMainMenu.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-02 12:50:21 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-02 12:50:21 +0200
commit0c20973c17771155f40b6eaf9caba81204702e4e (patch)
tree82cfb25a61c2e3b8e1923c1500a5546fd711758c /src/guiMainMenu.cpp
parentf65d157786d09a4756a52ec52f821c02a5f0efad (diff)
downloadminetest-0c20973c17771155f40b6eaf9caba81204702e4e.tar.gz
minetest-0c20973c17771155f40b6eaf9caba81204702e4e.tar.bz2
minetest-0c20973c17771155f40b6eaf9caba81204702e4e.zip
Add 3d cloud checkbox in main menu (and rename setting from enable_2d_clouds to enable_3d_clouds)
Diffstat (limited to 'src/guiMainMenu.cpp')
-rw-r--r--src/guiMainMenu.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp
index cf9b8eda4..a0a23828a 100644
--- a/src/guiMainMenu.cpp
+++ b/src/guiMainMenu.cpp
@@ -80,6 +80,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
bool enable_damage;
bool fancy_trees;
bool smooth_lighting;
+ bool clouds_3d;
// Client options
{
@@ -117,6 +118,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
else
smooth_lighting = m_data->smooth_lighting;
}
+ {
+ gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
+ else
+ clouds_3d = m_data->clouds_3d;
+ }
// Server options
{
@@ -242,10 +250,16 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
}
{
core::rect<s32> rect(0, 0, 250, 30);
- rect += topleft_client + v2s32(35, 150+30);
+ rect += topleft_client + v2s32(35, 150+20);
Environment->addCheckBox(smooth_lighting, rect, this, GUI_ID_SMOOTH_LIGHTING_CB,
wgettext("Smooth Lighting"));
}
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += topleft_client + v2s32(35, 150+40);
+ Environment->addCheckBox(clouds_3d, rect, this, GUI_ID_3D_CLOUDS_CB,
+ wgettext("3D Clouds"));
+ }
// Start game button
{
core::rect<s32> rect(0, 0, 180, 30);
@@ -363,6 +377,11 @@ void GUIMainMenu::acceptInput()
m_data->enable_damage = ((gui::IGUICheckBox*)e)->isChecked();
}
{
+ gui::IGUIElement *e = getElementFromId(GUI_ID_3D_CLOUDS_CB);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ m_data->clouds_3d = ((gui::IGUICheckBox*)e)->isChecked();
+ }
+ {
gui::IGUIElement *e = getElementFromId(GUI_ID_SMOOTH_LIGHTING_CB);
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
m_data->smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked();