+ }
+ changeCtype("");
+ // Address + port
+ {
+ core::rect<s32> rect(0, 0, 110, 20);
+ rect += m_topleft_client + v2s32(35+30, 75+6);
+ Environment->addStaticText(wgettext("Address/Port"),
+ rect, false, true, this, -1);
+ }
+ changeCtype("C");
+ {
+ core::rect<s32> rect(0, 0, 230, 30);
+ rect += m_topleft_client + v2s32(160+30, 75);
+ gui::IGUIElement *e =
+ Environment->addEditBox(m_data->address.c_str(), rect, true,
+ this, GUI_ID_ADDRESS_INPUT);
+ if(m_data->name != L"" && m_data->address == L"")
+ Environment->setFocus(e);
+ }
+ {
+ core::rect<s32> rect(0, 0, 120, 30);
+ rect += m_topleft_client + v2s32(m_size_client.X-60-100, 75);
+ Environment->addEditBox(m_data->port.c_str(), rect, true,
+ this, GUI_ID_PORT_INPUT);
+ }
+ changeCtype("");
+ {
+ core::rect<s32> rect(0, 0, 400, 20);
+ rect += m_topleft_client + v2s32(160+30, 75+35);
+ Environment->addStaticText(wgettext("Leave address blank to start a local server."),
+ rect, false, true, this, -1);
+ }
+ // Start game button
+ {
+ core::rect<s32> rect(0, 0, 180, 30);
+ rect += m_topleft_client + v2s32(m_size_client.X-180-30,
+ m_size_client.Y-30-20);
+ Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON,
+ wgettext("Start Game / Connect"));
+ }
+ /*
+ Server section
+ */
+ // SERVER
+ {
+ core::rect<s32> rect(0, 0, 10, m_size_server.Y);
+ rect += m_topleft_server + v2s32(15, 0);
+ const wchar_t *text = L"S\nE\nR\nV\nE\nR";
+ gui::IGUIStaticText *t =
+ Environment->addStaticText(text, rect, false, false, this, -1);
+ t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER);
+ }
+ // Server parameters
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += m_topleft_server + v2s32(30+20+250+20, 20);
+ Environment->addCheckBox(m_data->creative_mode, rect, this, GUI_ID_CREATIVE_CB,
+ wgettext("Creative Mode"));
+ }
+ {
+ core::rect<s32> rect(0, 0, 250, 30);
+ rect += m_topleft_server + v2s32(30+20+250+20, 40);
+ Environment->addCheckBox(m_data->enable_damage, rect, this, GUI_ID_DAMAGE_CB,
+ wgettext("Enable Damage"));
+ }
+ // Delete world button
+ {
+ core::rect<s32> rect(0, 0, 130, 30);
+ rect += m_topleft_server + v2s32(30+20+250+20, 90);
+ Environment->addButton(rect, this, GUI_ID_DELETE_WORLD_BUTTON,
+ wgettext("Delete world"));
+ }
+ // Create world button
+ {
+ core::rect<s32> rect(0, 0, 130, 30);
+ rect += m_topleft_server + v2s32(30+20+250+20+140, 90);
+ Environment->addButton(rect, this, GUI_ID_CREATE_WORLD_BUTTON,
+ wgettext("Create world"));
+ }
+ // World selection listbox
+ {
+ core::rect<s32> rect(0, 0, 250, 120);
+ rect += m_topleft_server + v2s32(30+20, 10);
+ gui::IGUIListBox *e = Environment->addListBox(rect, this,
+ GUI_ID_WORLD_LISTBOX);
+ e->setDrawBackground(true);
+ for(std::vector<WorldSpec>::const_iterator i = m_data->worlds.begin();
+ i != m_data->worlds.end(); i++){
+ e->addItem(narrow_to_wide(i->name+" ["+i->gameid+"]").c_str());
+ }
+ e->setSelected(m_data->selected_world);
+ }
+ changeCtype("C");