[See cvs log for src/role.c for a much longer description.]
When picking role, race, and so forth, new menu entries allow you to
pick any of the other items before the one currently being handled. After
picking all four of race, role, gender, and alignment (or if you answered
'y' to "shall I pick for you?"), there is a followup prompt to confirm the
choices. It's a menu which also provides a chance to rename the character.
This has only been implemented in win/tty's player_selection(), with
some support code in the core that might be useful to other interfaces.
And so far, the chance to rename is only presented as a menu choice if
you've given an answer to "who are you?" prompt earlier during startup.
Also, ports that use pcmain.c aren't able to perform hero renaming yet.
40 lines
846 B
C
40 lines
846 B
C
/* SCCS Id: @(#)macunix.c 3.5 1994/11/07 */
|
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
/* This file collects some Unix dependencies */
|
|
|
|
#include "hack.h"
|
|
|
|
void
|
|
regularize(char *s)
|
|
{
|
|
register char *lp;
|
|
|
|
for (lp = s; *lp; lp++) {
|
|
if (*lp == '.' || *lp == ':')
|
|
*lp = '_';
|
|
}
|
|
}
|
|
|
|
void
|
|
getlock(void)
|
|
{
|
|
int fd;
|
|
int pid = getpid(); /* Process ID */
|
|
|
|
Sprintf(lock, "%d%s", getuid(), plname);
|
|
set_levelfile_name (lock, 0);
|
|
|
|
if ((fd = open (lock, O_RDWR | O_EXCL | O_CREAT, LEVL_TYPE)) == -1) {
|
|
raw_printf ("Could not lock the game %s.", lock);
|
|
panic ("Another game in progress?");
|
|
}
|
|
|
|
if (write (fd, (char *)&pid, sizeof (pid)) != sizeof (pid)) {
|
|
raw_printf ("Could not lock the game %s.", lock);
|
|
panic("Disk locked?");
|
|
}
|
|
close (fd);
|
|
}
|