teleport_region({ region = { x1,y1, x2,y2 } }); */ teleport_region({ region = { x1,y1, x2,y2 }, [ region_islev = 1, ] * exclude = { x1,y1, x2,y2 }, [ exclude_islen = 1, ] [ dir = "up" ] }); */ TODO: maybe allow using selection, with a new method "getextents()"? */
| 5440 | * exclude = { x1,y1, x2,y2 }, [ exclude_islen = 1, ] [ dir = "up" ] }); */ |
| 5441 | /* TODO: maybe allow using selection, with a new method "getextents()"? */ |
| 5442 | int |
| 5443 | lspo_teleport_region(lua_State *L) |
| 5444 | { |
| 5445 | static const char *const teledirs[] = { "both", "down", "up", NULL }; |
| 5446 | static const int teledirs2i[] = { LR_TELE, LR_DOWNTELE, LR_UPTELE, -1 }; |
| 5447 | lev_region tmplregion; |
| 5448 | |
| 5449 | create_des_coder(); |
| 5450 | lcheck_param_table(L); |
| 5451 | l_get_lregion(L, &tmplregion); |
| 5452 | tmplregion.rtype = teledirs2i[get_table_option(L, "dir", "both", |
| 5453 | teledirs)]; |
| 5454 | tmplregion.padding = 0; |
| 5455 | tmplregion.rname.str = NULL; |
| 5456 | |
| 5457 | levregion_add(&tmplregion); |
| 5458 | |
| 5459 | return 0; |
| 5460 | } |
| 5461 | |
| 5462 | /* TODO: FIXME |
| 5463 | from lev_comp SPO_LEVREGION was called as: |
nothing calls this directly
no test coverage detected