enhanced interactive role selection (trunk only)

[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.
This commit is contained in:
nethack.rankin
2009-03-22 00:23:57 +00:00
parent c35d7f42be
commit 44cc716fe4
13 changed files with 693 additions and 373 deletions

View File

@@ -1965,14 +1965,16 @@ E boolean FDECL(ok_gend, (int, int, int, int));
E int FDECL(pick_gend, (int, int, int, int));
E boolean FDECL(ok_align, (int, int, int, int));
E int FDECL(pick_align, (int, int, int, int));
E void NDECL(role_init);
E void NDECL(rigid_role_checks);
E boolean FDECL(setrolefilter, (char *));
E char *FDECL(build_plselection_prompt, (char *,int,int,int,int,int));
E char *FDECL(root_plselection_prompt, (char *,int,int,int,int,int));
E void NDECL(plnamesuffix);
E void FDECL(role_selection_prolog, (int,winid));
E void FDECL(role_menu_extra, (int,winid));
E void NDECL(role_init);
E const char *FDECL(Hello, (struct monst *));
E const char *NDECL(Goodbye);
E char *FDECL(build_plselection_prompt, (char *, int, int, int, int, int));
E char *FDECL(root_plselection_prompt, (char *, int, int, int, int, int));
E boolean FDECL(setrolefilter, (char *));
/* ### rumors.c ### */

View File

@@ -182,6 +182,8 @@ struct instance_flags {
boolean menu_tab_sep; /* Use tabs to separate option menu fields */
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
* on some non-move commands */
boolean renameallowed; /* can change hero name during role selection */
boolean renameinprogress; /* we are changing hero name */
boolean zerocomp; /* write zero-compressed save files */
boolean rlecomp; /* run-length comp of levels when writing savefile */
uchar num_pad_mode;

View File

@@ -254,4 +254,12 @@ struct wc_Opt {
unsigned long wc_bit;
};
/* role selection by player_selection(); this ought to be in the core... */
#define RS_NAME 0
#define RS_ROLE 1
#define RS_RACE 2
#define RS_GENDER 3
#define RS_ALGNMNT 4
#define RS_menu_arg(x) (ROLE_RANDOM - ((x) + 1)) /* 0..4 -> -3..-7 */
#endif /* WINPROCS_H */