v2f playerpos_2d(playerpos.X,playerpos.Z);
v2f objectpos_2d(m_position.X,m_position.Z);
- if(fabs(objectpos_2d.Y - playerpos_2d.Y) < 2.0*BS &&
+ if(fabs(m_position.Y - playerpos.Y) < 3.0*BS &&
objectpos_2d.getDistanceFrom(playerpos_2d) < 1.0*BS)
{
if(m_attack_interval.step(dtime, 0.5))
std::wstring text_port;
bool creative_mode;
bool enable_damage;
-
+ bool fancy_trees;
+ bool smooth_lighting;
+
+ // Client options
{
gui::IGUIElement *e = getElementFromId(258);
if(e != NULL)
else
text_port = m_data->port;
}
+ {
+ gui::IGUIElement *e = getElementFromId(263);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
+ else
+ fancy_trees = m_data->fancy_trees;
+ }
+ {
+ gui::IGUIElement *e = getElementFromId(262);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked();
+ else
+ smooth_lighting = m_data->smooth_lighting;
+ }
+
+ // Server options
{
gui::IGUIElement *e = getElementFromId(259);
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
const wchar_t *text = L"Leave address blank to start a local server.";
Environment->addStaticText(text, rect, false, true, this, -1);
}
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += topleft_client + v2s32(40, 150);
+ Environment->addCheckBox(fancy_trees, rect, this, 263,
+ L"Fancy trees");
+ }
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += topleft_client + v2s32(40, 150+30);
+ Environment->addCheckBox(smooth_lighting, rect, this, 262,
+ L"Smooth Lighting");
+ }
// Start game button
{
core::rect<s32> rect(0, 0, 180, 30);
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
m_data->enable_damage = ((gui::IGUICheckBox*)e)->isChecked();
}
+ {
+ gui::IGUIElement *e = getElementFromId(262);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ m_data->smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked();
+ }
+ {
+ gui::IGUIElement *e = getElementFromId(263);
+ if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked();
+ }
m_accepted = true;
}
menudata.address = narrow_to_wide(address);\r
menudata.name = narrow_to_wide(playername);\r
menudata.port = narrow_to_wide(itos(port));\r
+ menudata.fancy_trees = g_settings.getBool("new_style_leaves");\r
+ menudata.smooth_lighting = g_settings.getBool("smooth_lighting");\r
menudata.creative_mode = g_settings.getBool("creative_mode");\r
menudata.enable_damage = g_settings.getBool("enable_damage");\r
\r
int newport = stoi(wide_to_narrow(menudata.port));\r
if(newport != 0)\r
port = newport;\r
+ g_settings.set("new_style_leaves", itos(menudata.fancy_trees));\r
+ g_settings.set("smooth_lighting", itos(menudata.smooth_lighting));\r
g_settings.set("creative_mode", itos(menudata.creative_mode));\r
g_settings.set("enable_damage", itos(menudata.enable_damage));\r
\r
if(device->run() == false)\r
break;\r
\r
+ // Initialize mapnode again to enable changed graphics settings\r
+ init_mapnode();\r
+\r
/*\r
Run game\r
*/\r