Global changes for qt, qt4, amiga, x11 and curses.

This commit is contained in:
Bart House
2018-12-24 21:28:44 -08:00
parent 8c1a4d9a97
commit 9069615861
13 changed files with 32 additions and 30 deletions

View File

@@ -313,7 +313,9 @@ const struct instance_globals g_init = {
0, /* wailmsg */
NULL, /* migrating_objs */
NULL, /* billobjs */
#if defined(MICRO) || defined(WIN32)
UNDEFINED_VALUES, /* hackdir */
#endif /* MICRO || WIN32 */
DUMMY, /* youmonst */
NULL, /* invent */

View File

@@ -2317,7 +2317,7 @@ register int x, y;
clipymax = saveymax;
clipxmax = savexmax;
#endif
if (on_level(&u.uz0, &u.uz) && !restoring && moves > 1)
if (on_level(&u.uz0, &u.uz) && !restoring && g.moves > 1)
(void) doredraw();
flush_glyph_buffer(amii_wins[WIN_MAP]->win);
}

View File

@@ -51,12 +51,12 @@ int fd;
#else
#if (defined(MICRO)) && !defined(NO_FSTAT)
if(fstat(fd, &buf)) {
if(moves > 1) pline("Cannot get status of saved level? ");
if(g.moves > 1) pline("Cannot get status of saved level? ");
else pline("Cannot get status of saved game.");
return(0);
}
if(comp_times(buf.st_mtime)) {
if(moves > 1) pline("Saved level is out of date.");
if(g.moves > 1) pline("Saved level is out of date.");
else pline("Saved game is out of date. ");
/* This problem occurs enough times we need to give the player
* some more information about what causes it, and how to fix.

View File

@@ -237,7 +237,7 @@ FormatStatusString(char *text, int format)
hp = 0;
(void) describe_level(nb = eos(nb));
Sprintf(nb = eos(nb), "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d",
showsyms[COIN_CLASS + SYM_OFF_O], money_cnt(invent), hp, hpmax,
showsyms[COIN_CLASS + SYM_OFF_O], money_cnt(g.invent), hp, hpmax,
u.uen, u.uenmax, u.uac);
if (Upolyd)
@@ -253,7 +253,7 @@ FormatStatusString(char *text, int format)
/* forth line */
if (flags.time)
Sprintf(nb = eos(nb), "T:%ld ", moves);
Sprintf(nb = eos(nb), "T:%ld ", g.moves);
if (strcmp(hu_stat[u.uhs], " ")) {
Strcat(text, hu_stat[u.uhs]);

View File

@@ -2558,7 +2558,7 @@ void NetHackQtStatusWindow::updateStats()
dlevel.setLabel(buf,(long)depth(&u.uz));
}
gold.setLabel("Au:", money_cnt(invent));
gold.setLabel("Au:", money_cnt(g.invent));
if (u.mtimedone) {
// You're a monster!
@@ -2592,7 +2592,7 @@ void NetHackQtStatusWindow::updateStats()
align.setLabel("Lawful");
}
if (::flags.time) time.setLabel("Time:",(long)moves);
if (::flags.time) time.setLabel("Time:",(long)g.moves);
else time.setLabel("");
#ifdef SCORE_ON_BOTL
if (::flags.showscore) {

View File

@@ -670,7 +670,7 @@ static char** rip_line=0;
snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
/* Put $ on stone */
snprintf(rip_line[GOLD_LINE], STONE_LINE_LEN+1, "%ld Au", money_cnt(invent));
snprintf(rip_line[GOLD_LINE], STONE_LINE_LEN+1, "%ld Au", money_cnt(g.invent));
/* Put together death description */
formatkiller(buf, sizeof buf, how, FALSE);

View File

@@ -445,7 +445,7 @@ void NetHackQtStatusWindow::updateStats()
dlevel.setLabel(buf,(long)::depth(&u.uz));
}
gold.setLabel("Au:", money_cnt(invent));
gold.setLabel("Au:", money_cnt(g.invent));
if (u.mtimedone) {
// You're a monster!
@@ -483,7 +483,7 @@ void NetHackQtStatusWindow::updateStats()
}
align.setLabel(text);
if (::flags.time) time.setLabel("Time:",(long)moves);
if (::flags.time) time.setLabel("Time:",(long)g.moves);
else time.setLabel("");
#ifdef SCORE_ON_BOTL
if (::flags.showscore) {

View File

@@ -1362,7 +1362,7 @@ int i;
val = (long) 0L;
break; /* special */
case F_GOLD:
val = money_cnt(invent);
val = money_cnt(g.invent);
if (val < 0L)
val = 0L; /* ought to issue impossible() and discard gold */
break;
@@ -1392,7 +1392,7 @@ int i;
val = (long) u.ualign.type;
break;
case F_TIME:
val = flags.time ? (long) moves : 0L;
val = flags.time ? (long) g.moves : 0L;
break;
case F_SCORE:
#ifdef SCORE_ON_BOTL

View File

@@ -174,7 +174,7 @@ curses_character_input_dialog(const char *prompt, const char *choices,
boolean any_choice = FALSE;
boolean accept_count = FALSE;
if (invent || (moves > 1)) {
if (g.invent || (g.moves > 1)) {
curses_get_window_size(MAP_WIN, &map_height, &map_width);
} else {
map_height = term_rows;
@@ -623,7 +623,7 @@ curses_display_nhmenu(winid wid, int how, MENU_ITEM_P ** _selected)
menu_determine_pages(current_menu);
/* Display pre and post-game menus centered */
if (((moves <= 1) && !invent) || program_state.gameover) {
if (((g.moves <= 1) && !g.invent) || program_state.gameover) {
win = curses_create_window(current_menu->width,
current_menu->height, CENTER);
} else { /* Display during-game menus on the right out of the way */

View File

@@ -55,7 +55,7 @@ curses_message_win_puts(const char *message, boolean recursed)
return;
}
if (suppress_turn == moves) {
if (suppress_turn == g.moves) {
return;
}
@@ -94,7 +94,7 @@ curses_message_win_puts(const char *message, boolean recursed)
/* Pause until key is hit - Esc suppresses any further
messages that turn */
if (curses_more() == '\033') {
suppress_turn = moves;
suppress_turn = g.moves;
return;
}
} else {
@@ -566,7 +566,7 @@ mesg_add_line(char *mline)
nhprev_mesg *current_mesg = malloc(sizeof (nhprev_mesg));
current_mesg->str = curses_copy_of(mline);
current_mesg->turn = moves;
current_mesg->turn = g.moves;
current_mesg->next_mesg = NULL;
if (num_messages == 0) {

View File

@@ -1182,7 +1182,7 @@ draw_horizontal(int x, int y, int hp, int hpmax)
wprintw(win, "%s", buf);
print_statdiff("$", &prevau, money_cnt(invent), STAT_GOLD);
print_statdiff("$", &prevau, money_cnt(g.invent), STAT_GOLD);
/* HP/Pw use special coloring rules */
attr_t hpattr, pwattr;
@@ -1220,7 +1220,7 @@ draw_horizontal(int x, int y, int hp, int hpmax)
print_statdiff(" Exp:", &prevlevel, u.ulevel, STAT_OTHER);
if (flags.time)
print_statdiff(" T:", &prevtime, moves, STAT_TIME);
print_statdiff(" T:", &prevtime, g.moves, STAT_TIME);
curses_add_statuses(win, FALSE, FALSE, NULL, NULL);
}
@@ -1293,7 +1293,7 @@ draw_horizontal_new(int x, int y, int hp, int hpmax)
wprintw(win, "Pw:");
draw_bar(FALSE, u.uen, u.uenmax, NULL);
print_statdiff(" $", &prevau, money_cnt(invent), STAT_GOLD);
print_statdiff(" $", &prevau, money_cnt(g.invent), STAT_GOLD);
#ifdef SCORE_ON_BOTL
if (flags.showscore)
@@ -1301,7 +1301,7 @@ draw_horizontal_new(int x, int y, int hp, int hpmax)
#endif /* SCORE_ON_BOTL */
if (flags.time)
print_statdiff(" T:", &prevtime, moves, STAT_TIME);
print_statdiff(" T:", &prevtime, g.moves, STAT_TIME);
curses_add_statuses(win, TRUE, FALSE, &x, &y);
@@ -1409,7 +1409,7 @@ draw_vertical(int x, int y, int hp, int hpmax)
wprintw(win, "%d", depth(&u.uz));
wmove(win, y++, x);
print_statdiff("Gold: ", &prevau, money_cnt(invent), STAT_GOLD);
print_statdiff("Gold: ", &prevau, money_cnt(g.invent), STAT_GOLD);
wmove(win, y++, x);
/* HP/Pw use special coloring rules */
@@ -1453,7 +1453,7 @@ draw_vertical(int x, int y, int hp, int hpmax)
wmove(win, y++, x);
if (flags.time) {
print_statdiff("Time: ", &prevtime, moves, STAT_TIME);
print_statdiff("Time: ", &prevtime, g.moves, STAT_TIME);
wmove(win, y++, x);
}

View File

@@ -58,7 +58,7 @@ curses_create_window(int width, int height, orient orientation)
if ((orientation == UP) || (orientation == DOWN) ||
(orientation == LEFT) || (orientation == RIGHT)) {
if (invent || (moves > 1)) {
if (g.invent || (g.moves > 1)) {
map_border = curses_window_has_border(MAP_WIN);
curses_get_window_xy(MAP_WIN, &mapx, &mapy);
curses_get_window_size(MAP_WIN, &maph, &mapw);
@@ -92,7 +92,7 @@ curses_create_window(int width, int height, orient orientation)
starty = (term_rows / 2) - (height / 2);
break;
case UP:
if (invent || (moves > 1)) {
if (g.invent || (g.moves > 1)) {
startx = (mapw / 2) - (width / 2) + mapx + mapb_offset;
} else {
startx = 0;
@@ -101,7 +101,7 @@ curses_create_window(int width, int height, orient orientation)
starty = mapy + mapb_offset;
break;
case DOWN:
if (invent || (moves > 1)) {
if (g.invent || (g.moves > 1)) {
startx = (mapw / 2) - (width / 2) + mapx + mapb_offset;
} else {
startx = 0;
@@ -117,7 +117,7 @@ curses_create_window(int width, int height, orient orientation)
starty = term_rows - height;
break;
case RIGHT:
if (invent || (moves > 1)) {
if (g.invent || (g.moves > 1)) {
startx = (mapw + mapx + (mapb_offset * 2)) - width;
} else {
startx = term_cols - width;
@@ -167,7 +167,7 @@ curses_refresh_nethack_windows()
map_window = curses_get_nhwin(MAP_WIN);
inv_window = curses_get_nhwin(INV_WIN);
if ((moves <= 1) && !invent) {
if ((g.moves <= 1) && !g.invent) {
/* Main windows not yet displayed; refresh base window instead */
touchwin(stdscr);
refresh();

View File

@@ -558,7 +558,7 @@ ghack_status_window_update_stats()
gtk_label_set(GTK_LABEL(chaLabel), buf);
/* Now do the non-pixmaped stats (gold and such) */
umoney = money_cnt(invent);
umoney = money_cnt(g.invent);
sprintf(buf, "Au:%ld", umoney);
if (lastAu < umoney && firstTime == FALSE) {
/* Ok, this changed so add it to the highlighing list */
@@ -662,7 +662,7 @@ ghack_status_window_update_stats()
}
if (flags.time) {
sprintf(buf, "Time:%ld", moves);
sprintf(buf, "Time:%ld", g.moves);
gtk_label_set(GTK_LABEL(timeLabel), buf);
} else
gtk_label_set(GTK_LABEL(timeLabel), "");