taseditor.setselection(table new_set)
| 5267 | |
| 5268 | // taseditor.setselection(table new_set) |
| 5269 | static int taseditor_setselection(lua_State *L) |
| 5270 | { |
| 5271 | #ifdef __WIN_DRIVER__ |
| 5272 | std::vector<int> cur_set; |
| 5273 | // retrieve new_set data from table to vector |
| 5274 | if (!lua_isnil(L, 1)) |
| 5275 | { |
| 5276 | luaL_checktype(L, 1, LUA_TTABLE); |
| 5277 | int max_index = luaL_getn(L, 1); |
| 5278 | int i = 1; |
| 5279 | while (i <= max_index) |
| 5280 | { |
| 5281 | lua_rawgeti(L, 1, i); |
| 5282 | cur_set.push_back(lua_tonumber(L, -1)); |
| 5283 | lua_pop(L, 1); |
| 5284 | i++; |
| 5285 | } |
| 5286 | } |
| 5287 | // and provide its reference to TAS Editor for changing selection |
| 5288 | taseditor_lua.setselection(cur_set); |
| 5289 | #endif |
| 5290 | return 0; |
| 5291 | } |
| 5292 | |
| 5293 | // int taseditor.getinput(int frame, int joypad) |
| 5294 | static int taseditor_getinput(lua_State *L) |
nothing calls this directly
no test coverage detected