Ask the user for a player name. */
| 314 | |
| 315 | /* Ask the user for a player name. */ |
| 316 | void |
| 317 | curses_askname(void) |
| 318 | { |
| 319 | #ifdef SELECTSAVED |
| 320 | if (iflags.wc2_selectsaved && !iflags.renameinprogress) |
| 321 | switch (restore_menu(MAP_WIN)) { |
| 322 | case -1: /* quit */ |
| 323 | goto bail; |
| 324 | case 0: /* new game */ |
| 325 | break; |
| 326 | case 1: /* picked a save file to restore and set plname[] for it */ |
| 327 | return; |
| 328 | } |
| 329 | #endif /* SELECTSAVED */ |
| 330 | |
| 331 | curses_line_input_dialog("Who are you?", svp.plname, PL_NSIZ); |
| 332 | (void) mungspaces(svp.plname); |
| 333 | if (!svp.plname[0] || svp.plname[0] == '\033') |
| 334 | goto bail; |
| 335 | |
| 336 | iflags.renameallowed = TRUE; /* tty uses this, we don't [yet?] */ |
| 337 | return; |
| 338 | |
| 339 | bail: |
| 340 | /* message is delivered via raw_print() */ |
| 341 | curses_bail("\nUntil next time then...\n"); |
| 342 | /*NOTREACHED*/ |
| 343 | } |
| 344 | |
| 345 | |
| 346 | /* Does window event processing (e.g. exposure events). |
nothing calls this directly
no test coverage detected