Simplify wesnoth.show_message_dialog implementation

This commit is contained in:
Celtic Minstrel 2015-09-17 12:33:29 -04:00
parent 376020097f
commit e3fc258ce9
2 changed files with 6 additions and 6 deletions

View file

@ -31,6 +31,10 @@ Version 1.13.1+dev:
* Added wesnoth.set_dialog_focus function
* Added wesnoth.set_dialog_visible function
* Added wesnoth.show_message_dialog function
* Added wesnoth.show_popup_dialog function
* Added wesnoth.deselect_hex function
* Added wesnoth.skipping_replay function
* New parameter write_to_mods in wesnoth.add_modification
* Added wesnoth.random function
* helper.shuffle is now synced
* Music and sound effects:

View file

@ -43,6 +43,7 @@
#include "scripting/lua_api.hpp" // for luaW_toboolean, etc
#include "scripting/lua_common.hpp"
#include "scripting/lua_types.hpp" // for getunitKey, dlgclbkKey, etc
#include "scripting/push_check.hpp"
#include "serialization/string_utils.hpp"
#include "tstring.hpp"
#include "video.hpp"
@ -260,12 +261,7 @@ int show_message_dialog(lua_State *L, CVideo & video)
std::vector<std::string> options;
int chosen_option = -1;
if (!lua_isnoneornil(L, 2)) {
luaL_checktype(L, 2, LUA_TTABLE);
size_t n = lua_rawlen(L, 2);
for(size_t i = 1; i <= n; i++) {
lua_rawgeti(L, 2, i);
options.push_back(luaL_checkstring(L, -1));
}
options = lua_check<std::vector<std::string> >(L, 2);
}
const config& def_cfg = luaW_checkconfig(L, 1);