str = getlin("What do you want to call this dungeon level?"); */
| 692 | str = getlin("What do you want to call this dungeon level?"); |
| 693 | */ |
| 694 | staticfn int |
| 695 | nhl_getlin(lua_State *L) |
| 696 | { |
| 697 | int argc = lua_gettop(L); |
| 698 | |
| 699 | if (argc == 1) { |
| 700 | const char *prompt = luaL_checkstring(L, 1); |
| 701 | char buf[BUFSZ]; |
| 702 | |
| 703 | getlin(prompt, buf); |
| 704 | lua_pushstring(L, buf); |
| 705 | return 1; |
| 706 | } |
| 707 | |
| 708 | nhl_error(L, "Wrong args"); |
| 709 | /*NOTREACHED*/ |
| 710 | return 0; |
| 711 | } |
| 712 | |
| 713 | /* |
| 714 | selected = menu("prompt",default,pickX,{"a"="option a", "b"="option b",...}) |