Changes needed in various ports due to globals changes.
This commit is contained in:
@@ -1713,7 +1713,7 @@ Cardinal *num_params;
|
||||
nhUse(num_params);
|
||||
|
||||
nh_XtPopdown(w);
|
||||
(void) strcpy(plname, "Mumbles"); /* give them a name... ;-) */
|
||||
(void) strcpy(g.plname, "Mumbles"); /* give them a name... ;-) */
|
||||
exit_x_event = TRUE;
|
||||
}
|
||||
|
||||
@@ -1741,11 +1741,11 @@ XtPointer call_data;
|
||||
}
|
||||
|
||||
/* Truncate name if necessary */
|
||||
if (len >= sizeof plname - 1)
|
||||
len = sizeof plname - 1;
|
||||
if (len >= sizeof g.plname - 1)
|
||||
len = sizeof g.plname - 1;
|
||||
|
||||
(void) strncpy(plname, s, len);
|
||||
plname[len] = '\0';
|
||||
(void) strncpy(g.plname, s, len);
|
||||
g.plname[len] = '\0';
|
||||
XtFree(s);
|
||||
|
||||
nh_XtPopdown(XtParent(dialog));
|
||||
@@ -1778,7 +1778,7 @@ X11_askname()
|
||||
(XtCallbackProc) 0);
|
||||
|
||||
SetDialogPrompt(dialog, nhStr("What is your name?")); /* set prompt */
|
||||
SetDialogResponse(dialog, plname, PL_NSIZ); /* set default answer */
|
||||
SetDialogResponse(dialog, g.plname, PL_NSIZ); /* set default answer */
|
||||
|
||||
XtRealizeWidget(popup);
|
||||
positionpopup(popup, TRUE); /* center,bottom */
|
||||
|
||||
@@ -358,11 +358,11 @@ plsel_dialog_acceptvalues()
|
||||
XtSetArg(args[0], nhStr(XtNstring), &s);
|
||||
XtGetValues(plsel_name_input, args, ONE);
|
||||
|
||||
(void) strncpy(plname, (char *) s, sizeof plname - 1);
|
||||
plname[sizeof plname - 1] = '\0';
|
||||
(void) mungspaces(plname);
|
||||
if (strlen(plname) < 1)
|
||||
(void) strcpy(plname, "Mumbles");
|
||||
(void) strncpy(g.plname, (char *) s, sizeof g.plname - 1);
|
||||
g.plname[sizeof g.plname - 1] = '\0';
|
||||
(void) mungspaces(g.plname);
|
||||
if (strlen(g.plname) < 1)
|
||||
(void) strcpy(g.plname, "Mumbles");
|
||||
iflags.renameinprogress = FALSE;
|
||||
}
|
||||
|
||||
@@ -829,8 +829,8 @@ Widget form;
|
||||
XtSetArg(args[num_args], nhStr(XtNeditType),
|
||||
!plsel_ask_name ? XawtextRead : XawtextEdit); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNresize), XawtextResizeWidth); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNstring), plname); num_args++;
|
||||
XtSetArg(args[num_args], XtNinsertPosition, strlen(plname)); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNstring), g.plname); num_args++;
|
||||
XtSetArg(args[num_args], XtNinsertPosition, strlen(g.plname)); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNaccelerators),
|
||||
XtParseAcceleratorTable(plsel_input_accelerators)); num_args++;
|
||||
plsel_name_input = XtCreateManagedWidget("name_input",
|
||||
@@ -1564,15 +1564,15 @@ void
|
||||
X11_player_selection()
|
||||
{
|
||||
if (iflags.wc_player_selection == VIA_DIALOG) {
|
||||
if (!*plname) {
|
||||
if (!*g.plname) {
|
||||
#ifdef UNIX
|
||||
char *defplname = get_login_name();
|
||||
#else
|
||||
char *defplname = (char *)0;
|
||||
#endif
|
||||
(void) strncpy(plname, defplname ? defplname : "Mumbles",
|
||||
sizeof plname - 1);
|
||||
plname[sizeof plname - 1] = '\0';
|
||||
(void) strncpy(g.plname, defplname ? defplname : "Mumbles",
|
||||
sizeof g.plname - 1);
|
||||
g.plname[sizeof g.plname - 1] = '\0';
|
||||
iflags.renameinprogress = TRUE;
|
||||
}
|
||||
X11_player_selection_dialog();
|
||||
|
||||
@@ -1060,7 +1060,7 @@ long new_value;
|
||||
|
||||
if (attr_rec->type == SV_LABEL) {
|
||||
if (attr_rec == &shown_stats[F_NAME]) {
|
||||
Strcpy(buf, plname);
|
||||
Strcpy(buf, g.plname);
|
||||
buf[0] = highc(buf[0]);
|
||||
Strcat(buf, " the ");
|
||||
if (Upolyd) {
|
||||
|
||||
@@ -492,7 +492,7 @@ calculate_rip_text(int how, time_t when)
|
||||
long year;
|
||||
|
||||
/* Put name on stone */
|
||||
Sprintf(rip_line[NAME_LINE], "%s", plname);
|
||||
Sprintf(rip_line[NAME_LINE], "%s", g.plname);
|
||||
|
||||
/* Put $ on stone */
|
||||
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
|
||||
|
||||
Reference in New Issue
Block a user