tty-style role selection for curses
Move the tty role/race/&c selection from wintty.c to role.c and remove its references to BASE_WINDOW. Have curses call the same routine now so that the player has the option to choose role, race, gender, and alignment in any order and to confirm or override random settings prior to starting play. Also if you went through "who are you?" then final confirmation includes an extra menu choice to rename the hero. It still has the quirk of sometimes remembering some of the previous aspects when you re-pick a new value for some aspect which already been selected. The menus pop up on top of the copyright screen and that looks a bit strange. I don't think core code has any way to erase that base window without erasing the entire screen so to fix the strangeness the window ports would need to do that before calling the selection routine. I didn't do that because the very first prompt, "Shall I pick ... for you? [ynaq]" shows up in that window rather than in a popup over it, and having it be all by itself on an otherwise blank screen seemed to be even stranger. X11 and Qt both have more sophisticated selection routines so I haven't tried to switch either of them to use this. They both use a fancy role-selection-specific menu with all the aspects present at once so this wouldn't fit without more work than I care to tackle.
This commit is contained in:
@@ -2417,6 +2417,8 @@ extern void role_init(void);
|
||||
extern const char *Hello(struct monst *);
|
||||
extern const char *Goodbye(void);
|
||||
extern const struct Race *character_race(short);
|
||||
extern void genl_player_selection(void);
|
||||
extern int genl_player_setup(void);
|
||||
|
||||
/* ### rumors.c ### */
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ extern int curses_read_char(void);
|
||||
extern void curses_toggle_color_attr(WINDOW *win, int color, int attr,
|
||||
int onoff);
|
||||
extern void curses_menu_color_attr(WINDOW *, int, int, int);
|
||||
extern void curses_bail(const char *mesg);
|
||||
ATTRNORETURN extern void curses_bail(const char *mesg) NORETURN;
|
||||
extern winid curses_get_wid(int type);
|
||||
extern char *curses_copy_of(const char *s);
|
||||
extern int curses_num_lines(const char *str, int width);
|
||||
|
||||
Reference in New Issue
Block a user