int ModApiMainMenu::l_start(lua_State *L) { GUIEngine* engine = getGuiEngine(L); sanity_check(engine != NULL); //update c++ gamedata from lua table bool valid = false; MainMenuData *data = engine->m_data; data->selected_world = getIntegerData(L, "selected_world",valid) -1; data->simple_singleplayer_mode = getBoolData(L,"singleplayer",valid); data->do_reconnect = getBoolData(L, "do_reconnect", valid); if (!data->do_reconnect) { data->name = getTextData(L,"playername"); data->password = getTextData(L,"password"); data->address = getTextData(L,"address"); data->port = getTextData(L,"port"); } data->serverdescription = getTextData(L,"serverdescription"); data->servername = getTextData(L,"servername"); //close menu next time engine->m_startgame = true; return 0; }
int ModApiMainMenu::l_start(lua_State *L) { GUIEngine* engine = getGuiEngine(L); assert(engine != 0); //update c++ gamedata from lua table bool valid = false; engine->m_data->selected_world = getIntegerData(L, "selected_world",valid) -1; engine->m_data->simple_singleplayer_mode = getBoolData(L,"singleplayer",valid); engine->m_data->name = getTextData(L,"playername"); engine->m_data->password = getTextData(L,"password"); engine->m_data->address = getTextData(L,"address"); engine->m_data->port = getTextData(L,"port"); engine->m_data->serverdescription = getTextData(L,"serverdescription"); engine->m_data->servername = getTextData(L,"servername"); //close menu next time engine->m_startgame = true; return 0; }