1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00

Remove LINE_OFFSET and COL_OFFSET; rename COL_CENTER to WCENTER

This commit is contained in:
John Zaitseff 2011-07-20 15:53:53 +10:00
parent cbff5193d9
commit 46c7a55203
6 changed files with 53 additions and 82 deletions

View File

@ -65,7 +65,7 @@ void exchange_stock (void)
return; return;
} }
newtxwin(17, 80, LINE_OFFSET + 1, COL_CENTER(80), false, 0); newtxwin(17, WIN_COLS, 1, WCENTER(WIN_COLS), false, 0);
while (selection != SEL_EXIT) { while (selection != SEL_EXIT) {
selection = SEL_NONE; selection = SEL_NONE;
@ -125,8 +125,7 @@ void exchange_stock (void)
wrefresh(curwin); wrefresh(curwin);
// Show menu of choices for the player // Show menu of choices for the player
newtxwin(6, 80, LINE_OFFSET + 18, COL_CENTER(80), true, newtxwin(6, WIN_COLS, 18, WCENTER(WIN_COLS), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
wmove(curwin, 3, 2); wmove(curwin, 3, 2);
attrpr(curwin, ATTR_KEYCODE_STR, "<1>"); attrpr(curwin, ATTR_KEYCODE_STR, "<1>");
@ -252,7 +251,8 @@ void visit_bank (void)
} }
// Show the informational part of the Bank // Show the informational part of the Bank
newtxwin(10, 76, LINE_OFFSET + 5, COL_CENTER(76), true, ATTR_NORMAL_WINDOW); newtxwin(10, WIN_COLS - 4, 5, WCENTER(WIN_COLS - 4), true,
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Interstellar Trading Bank "); center(curwin, 1, ATTR_WINDOW_TITLE, " Interstellar Trading Bank ");
@ -274,7 +274,8 @@ void visit_bank (void)
wrefresh(curwin); wrefresh(curwin);
// Show menu of choices for the player // Show menu of choices for the player
newtxwin(7, 76, LINE_OFFSET + 15, COL_CENTER(76), true, ATTR_NORMAL_WINDOW); newtxwin(7, WIN_COLS - 4, 15, WCENTER(WIN_COLS - 4), true,
ATTR_NORMAL_WINDOW);
center2(curwin, 3, ATTR_KEYCODE_STR, ATTR_NORMAL_WINDOW, center2(curwin, 3, ATTR_KEYCODE_STR, ATTR_NORMAL_WINDOW,
"<1>", " Borrow money "); "<1>", " Borrow money ");
@ -323,8 +324,7 @@ void visit_bank (void)
case '1': case '1':
// Borrow money from the Bank // Borrow money from the Bank
if (credit_limit == 0.0) { if (credit_limit == 0.0) {
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Insufficient Credit Limit "); center(curwin, 1, ATTR_ERROR_TITLE, " Insufficient Credit Limit ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -374,8 +374,7 @@ void visit_bank (void)
case '2': case '2':
// Repay a debt // Repay a debt
if (player[current_player].debt == 0.0) { if (player[current_player].debt == 0.0) {
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
wbkgd(curwin, ATTR_ERROR_WINDOW); wbkgd(curwin, ATTR_ERROR_WINDOW);
box(curwin, 0, 0); box(curwin, 0, 0);
@ -386,8 +385,7 @@ void visit_bank (void)
wait_for_key(curwin, 5, ATTR_WAITERROR_STR); wait_for_key(curwin, 5, ATTR_WAITERROR_STR);
deltxwin(); deltxwin();
} else if (player[current_player].cash == 0.0) { } else if (player[current_player].cash == 0.0) {
newtxwin(7, 60, LINE_OFFSET + 8, COL_CENTER(60), true, newtxwin(7, 60, 8, WCENTER(60), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " No Cash "); center(curwin, 1, ATTR_ERROR_TITLE, " No Cash ");
center(curwin, 3, ATTR_ERROR_STR, "You have no cash with which to repay the debt!"); center(curwin, 3, ATTR_ERROR_STR, "You have no cash with which to repay the debt!");
@ -486,7 +484,8 @@ void trade_shares (int num, bool *bid_used)
company[num].stock_issued); company[num].stock_issued);
// Show the informational part of the trade window // Show the informational part of the trade window
newtxwin(9, 76, LINE_OFFSET + 5, COL_CENTER(76), true, ATTR_NORMAL_WINDOW); newtxwin(9, WIN_COLS - 4, 5, WCENTER(WIN_COLS - 4), true,
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Stock Transaction in %s ", center(curwin, 1, ATTR_WINDOW_TITLE, " Stock Transaction in %s ",
company[num].name); company[num].name);
@ -521,7 +520,8 @@ void trade_shares (int num, bool *bid_used)
wrefresh(curwin); wrefresh(curwin);
// Show menu of choices for the player // Show menu of choices for the player
newtxwin(7, 76, LINE_OFFSET + 14, COL_CENTER(76), true, ATTR_NORMAL_WINDOW); newtxwin(7, WIN_COLS - 4, 14, WCENTER(WIN_COLS - 4), true,
ATTR_NORMAL_WINDOW);
wmove(curwin, 3, 2); wmove(curwin, 3, 2);
attrpr(curwin, ATTR_KEYCODE_STR, "<1>"); attrpr(curwin, ATTR_KEYCODE_STR, "<1>");
@ -582,8 +582,7 @@ void trade_shares (int num, bool *bid_used)
maxshares = player[current_player].cash / company[num].share_price; maxshares = player[current_player].cash / company[num].share_price;
if (company[num].max_stock - company[num].stock_issued == 0) { if (company[num].max_stock - company[num].stock_issued == 0) {
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " No Shares Available "); center(curwin, 1, ATTR_ERROR_TITLE, " No Shares Available ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -593,8 +592,7 @@ void trade_shares (int num, bool *bid_used)
deltxwin(); deltxwin();
} else if (maxshares <= 0) { } else if (maxshares <= 0) {
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Insufficient Cash "); center(curwin, 1, ATTR_ERROR_TITLE, " Insufficient Cash ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -633,8 +631,7 @@ void trade_shares (int num, bool *bid_used)
// Sell stock back to company // Sell stock back to company
maxshares = player[current_player].stock_owned[num]; maxshares = player[current_player].stock_owned[num];
if (maxshares == 0) { if (maxshares == 0) {
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " No Shares "); center(curwin, 1, ATTR_ERROR_TITLE, " No Shares ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -677,8 +674,7 @@ void trade_shares (int num, bool *bid_used)
*bid_used = true; *bid_used = true;
if (maxshares == 0) { if (maxshares == 0) {
newtxwin(8, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(8, 50, 8, WCENTER(50), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " No Shares Issued "); center(curwin, 1, ATTR_ERROR_TITLE, " No Shares Issued ");
center(curwin, 3, ATTR_ERROR_STR, "%s", company[num].name); center(curwin, 3, ATTR_ERROR_STR, "%s", company[num].name);
@ -687,8 +683,7 @@ void trade_shares (int num, bool *bid_used)
wait_for_key(curwin, 6, ATTR_WAITERROR_STR); wait_for_key(curwin, 6, ATTR_WAITERROR_STR);
deltxwin(); deltxwin();
} else { } else {
newtxwin(8, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(8, 50, 8, WCENTER(50), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Shares Issued "); center(curwin, 1, ATTR_WINDOW_TITLE, " Shares Issued ");
center(curwin, 3, ATTR_HIGHLIGHT_STR, "%s", company[num].name); center(curwin, 3, ATTR_HIGHLIGHT_STR, "%s", company[num].name);

View File

@ -171,8 +171,7 @@ bool load_game (int num)
if (errno == ENOENT) { if (errno == ENOENT) {
// File not found // File not found
newtxwin(7, 40, LINE_OFFSET + 9, COL_CENTER(40), true, newtxwin(7, 40, 9, WCENTER(40), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Found "); center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Found ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -184,8 +183,7 @@ bool load_game (int num)
// Some other file error // Some other file error
saved_errno = errno; saved_errno = errno;
newtxwin(9, 70, LINE_OFFSET + 9, COL_CENTER(70), true, newtxwin(9, 70, 9, WCENTER(70), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Loaded "); center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Loaded ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -341,8 +339,7 @@ bool save_game (int num)
} else { } else {
// Data directory could not be created // Data directory could not be created
newtxwin(9, 70, LINE_OFFSET + 7, COL_CENTER(70), true, newtxwin(9, 70, 7, WCENTER(70), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Saved "); center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Saved ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,
@ -367,8 +364,7 @@ bool save_game (int num)
// File could not be opened for writing // File could not be opened for writing
saved_errno = errno; saved_errno = errno;
newtxwin(9, 70, LINE_OFFSET + 7, COL_CENTER(70), true, newtxwin(9, 70, 7, WCENTER(70), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Saved "); center(curwin, 1, ATTR_ERROR_TITLE, " Game Not Saved ");
center(curwin, 3, ATTR_ERROR_STR, center(curwin, 3, ATTR_ERROR_STR,

View File

@ -69,7 +69,7 @@ void init_game (void)
// Try to load an old game, if possible // Try to load an old game, if possible
if (game_num != 0) { if (game_num != 0) {
newtxwin(5, 30, LINE_OFFSET + 6, COL_CENTER(30), true, ATTR_STATUS_WINDOW); newtxwin(5, 30, 6, WCENTER(30), true, ATTR_STATUS_WINDOW);
center(curwin, 2, ATTR_STATUS_WINDOW, "Loading game %d... ", game_num); center(curwin, 2, ATTR_STATUS_WINDOW, "Loading game %d... ", game_num);
wrefresh(curwin); wrefresh(curwin);
@ -85,8 +85,7 @@ void init_game (void)
while (number_players == 0) { while (number_players == 0) {
// Ask for the number of players // Ask for the number of players
newtxwin(5, 62, LINE_OFFSET + 3, COL_CENTER(62), true, newtxwin(5, 62, 3, WCENTER(62), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
mvwaddstr(curwin, 2, 2, "Enter number of players "); mvwaddstr(curwin, 2, 2, "Enter number of players ");
waddstr(curwin, "["); waddstr(curwin, "[");
@ -133,8 +132,7 @@ void init_game (void)
} else { } else {
// Ask which game to load // Ask which game to load
newtxwin(5, 54, LINE_OFFSET + 6, COL_CENTER(54), true, newtxwin(5, 54, 6, WCENTER(54), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
mvwaddstr(curwin, 2, 2, "Enter game number "); mvwaddstr(curwin, 2, 2, "Enter game number ");
waddstr(curwin, "["); waddstr(curwin, "[");
@ -182,8 +180,7 @@ void init_game (void)
wechochar(curwin, key | A_BOLD); wechochar(curwin, key | A_BOLD);
// Try to load the game, if possible // Try to load the game, if possible
newtxwin(5, 30, LINE_OFFSET + 9, COL_CENTER(30), true, newtxwin(5, 30, 9, WCENTER(30), true, ATTR_STATUS_WINDOW);
ATTR_STATUS_WINDOW);
center(curwin, 2, ATTR_STATUS_WINDOW, center(curwin, 2, ATTR_STATUS_WINDOW,
"Loading game %d... ", game_num); "Loading game %d... ", game_num);
wrefresh(curwin); wrefresh(curwin);
@ -204,7 +201,7 @@ void init_game (void)
if (number_players == 1) { if (number_players == 1) {
// Ask for the player name // Ask for the player name
newtxwin(5, 76, LINE_OFFSET + 9, COL_CENTER(76), true, newtxwin(5, WIN_COLS - 4, 9, WCENTER(WIN_COLS - 4), true,
ATTR_NORMAL_WINDOW); ATTR_NORMAL_WINDOW);
mvwaddstr(curwin, 2, 2, "Please enter your name: "); mvwaddstr(curwin, 2, 2, "Please enter your name: ");
@ -220,8 +217,7 @@ void init_game (void)
} }
} while (! done); } while (! done);
newtxwin(5, 44, LINE_OFFSET + 6, COL_CENTER(44), true, newtxwin(5, 44, 6, WCENTER(44), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
mvwaddstr(curwin, 2, 2, "Do you need any instructions? "); mvwaddstr(curwin, 2, 2, "Do you need any instructions? ");
waddstr(curwin, "["); waddstr(curwin, "[");
@ -241,8 +237,8 @@ void init_game (void)
} else { } else {
// Ask for all of the player names // Ask for all of the player names
newtxwin(number_players + 5, 76, LINE_OFFSET + 9, newtxwin(number_players + 5, WIN_COLS - 4, 9,
COL_CENTER(76), true, ATTR_NORMAL_WINDOW); WCENTER(WIN_COLS - 4), true, ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Enter Player Names "); center(curwin, 1, ATTR_WINDOW_TITLE, " Enter Player Names ");
@ -321,8 +317,7 @@ void init_game (void)
} }
} }
newtxwin(5, 50, LINE_OFFSET + 6, COL_CENTER(50), true, newtxwin(5, 50, 6, WCENTER(50), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
mvwaddstr(curwin, 2, 2, "Does any player need instructions? "); mvwaddstr(curwin, 2, 2, "Does any player need instructions? ");
waddstr(curwin, "["); waddstr(curwin, "[");
@ -383,8 +378,7 @@ void init_game (void)
first_player = randi(number_players); first_player = randi(number_players);
current_player = first_player; current_player = first_player;
newtxwin(7, 50, LINE_OFFSET + 8, COL_CENTER(50), true, newtxwin(7, 50, 8, WCENTER(50), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
center(curwin, 2, ATTR_NORMAL_WINDOW, center(curwin, 2, ATTR_NORMAL_WINDOW,
"The first player to go is"); "The first player to go is");
@ -429,7 +423,7 @@ void end_game (void)
err_exit_nomem(); err_exit_nomem();
} }
newtxwin(7, 40, LINE_OFFSET + 9, COL_CENTER(40), true, ATTR_ERROR_WINDOW); newtxwin(7, 40, 9, WCENTER(40), true, ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Game Over "); center(curwin, 1, ATTR_ERROR_TITLE, " Game Over ");
center(curwin, 3, ATTR_ERROR_STR, "The game is over after %d turns", center(curwin, 3, ATTR_ERROR_STR, "The game is over after %d turns",
@ -445,8 +439,7 @@ void end_game (void)
if (number_players == 1) { if (number_players == 1) {
l_strfmon(buf, BUFSIZE, "%1n", total_value(0)); l_strfmon(buf, BUFSIZE, "%1n", total_value(0));
newtxwin(9, 60, LINE_OFFSET + 8, COL_CENTER(60), true, newtxwin(9, 60, 8, WCENTER(60), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Total Value "); center(curwin, 1, ATTR_WINDOW_TITLE, " Total Value ");
center2(curwin, 4, ATTR_NORMAL_WINDOW, ATTR_HIGHLIGHT_STR, center2(curwin, 4, ATTR_NORMAL_WINDOW, ATTR_HIGHLIGHT_STR,
@ -461,7 +454,7 @@ void end_game (void)
} }
qsort(player, number_players, sizeof(player_info_t), cmp_player); qsort(player, number_players, sizeof(player_info_t), cmp_player);
newtxwin(number_players + 10, 76, LINE_OFFSET + 3, COL_CENTER(76), newtxwin(number_players + 10, WIN_COLS - 4, 3, WCENTER(WIN_COLS - 4),
true, ATTR_NORMAL_WINDOW); true, ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Game Winner "); center(curwin, 1, ATTR_WINDOW_TITLE, " Game Winner ");
@ -515,8 +508,7 @@ void show_map (bool closewin)
int n, x, y; int n, x, y;
newtxwin(MAX_Y + 4, WIN_COLS, LINE_OFFSET + 1, COL_CENTER(WIN_COLS), newtxwin(MAX_Y + 4, WIN_COLS, 1, WCENTER(WIN_COLS), true, ATTR_MAP_WINDOW);
true, ATTR_MAP_WINDOW);
// Draw various borders // Draw various borders
@ -598,8 +590,8 @@ void show_map (bool closewin)
wrefresh(curwin); wrefresh(curwin);
newtxwin(WIN_LINES - MAX_Y - 5, WIN_COLS, LINE_OFFSET + MAX_Y + 5, newtxwin(WIN_LINES - MAX_Y - 5, WIN_COLS, MAX_Y + 5, WCENTER(WIN_COLS),
COL_CENTER(WIN_COLS), true, ATTR_NORMAL_WINDOW); true, ATTR_NORMAL_WINDOW);
wait_for_key(curwin, 2, ATTR_WAITNORMAL_STR); wait_for_key(curwin, 2, ATTR_WAITNORMAL_STR);
@ -628,7 +620,7 @@ void show_status (int num)
assert(num >= 0 && num < number_players); assert(num >= 0 && num < number_players);
newtxwin(MAX_COMPANIES + 15, 80, LINE_OFFSET + 1, COL_CENTER(80), true, newtxwin(MAX_COMPANIES + 15, WIN_COLS, 1, WCENTER(WIN_COLS), true,
ATTR_NORMAL_WINDOW); ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Stock Portfolio "); center(curwin, 1, ATTR_WINDOW_TITLE, " Stock Portfolio ");

View File

@ -170,8 +170,7 @@ void show_help (void)
if (numpages == 0) if (numpages == 0)
return; return;
newtxwin(WIN_LINES - 1, WIN_COLS, LINE_OFFSET + 1, COL_CENTER(WIN_COLS), newtxwin(WIN_LINES - 1, WIN_COLS, 1, WCENTER(WIN_COLS), false, 0);
false, 0);
while (! done) { while (! done) {
// Display a page of instructions // Display a page of instructions

View File

@ -93,9 +93,7 @@ typedef enum curs_type {
#define WIN_LINES MIN_LINES /* Number of lines in main windows */ #define WIN_LINES MIN_LINES /* Number of lines in main windows */
#define WIN_COLS MIN_COLS /* Number of columns in main windows */ #define WIN_COLS MIN_COLS /* Number of columns in main windows */
#define LINE_OFFSET (0) /* Window offsets */ #define WCENTER(x) ((COLS - (x)) / 2)
#define COL_OFFSET ((COLS - WIN_COLS) / 2)
#define COL_CENTER(x) ((COLS - (x)) / 2)
// Colour and non-colour attribute selection // Colour and non-colour attribute selection

View File

@ -165,7 +165,7 @@ selection_t get_move (void)
wrefresh(curwin); wrefresh(curwin);
// Show menu of choices for the player // Show menu of choices for the player
newtxwin(5, 80, LINE_OFFSET + 19, COL_CENTER(80), false, 0); newtxwin(5, WIN_COLS, 19, WCENTER(WIN_COLS), false, 0);
while (selection == SEL_NONE) { while (selection == SEL_NONE) {
wbkgd(curwin, ATTR_NORMAL_WINDOW); wbkgd(curwin, ATTR_NORMAL_WINDOW);
werase(curwin); werase(curwin);
@ -291,8 +291,7 @@ selection_t get_move (void)
if (game_loaded) { if (game_loaded) {
// Save the game to the same game number // Save the game to the same game number
newtxwin(5, 30, LINE_OFFSET + 7, COL_CENTER(30), true, newtxwin(5, 30, 7, WCENTER(30), true, ATTR_STATUS_WINDOW);
ATTR_STATUS_WINDOW);
center(curwin, 2, ATTR_STATUS_WINDOW, center(curwin, 2, ATTR_STATUS_WINDOW,
"Saving game %d... ", game_num); "Saving game %d... ", game_num);
wrefresh(curwin); wrefresh(curwin);
@ -308,8 +307,7 @@ selection_t get_move (void)
bool done; bool done;
// Ask which game to save // Ask which game to save
newtxwin(6, 54, LINE_OFFSET + 8, COL_CENTER(54), true, newtxwin(6, 54, 8, WCENTER(54), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Save Game "); center(curwin, 1, ATTR_WINDOW_TITLE, " Save Game ");
mvwaddstr(curwin, 3, 2, "Enter game number "); mvwaddstr(curwin, 3, 2, "Enter game number ");
@ -358,8 +356,7 @@ selection_t get_move (void)
wechochar(curwin, key | A_BOLD); wechochar(curwin, key | A_BOLD);
// Try to save the game, if possible // Try to save the game, if possible
newtxwin(5, 30, LINE_OFFSET + 7, COL_CENTER(30), true, newtxwin(5, 30, 7, WCENTER(30), true, ATTR_STATUS_WINDOW);
ATTR_STATUS_WINDOW);
center(curwin, 2, ATTR_STATUS_WINDOW, center(curwin, 2, ATTR_STATUS_WINDOW,
"Saving game %d... ", game_num); "Saving game %d... ", game_num);
wrefresh(curwin); wrefresh(curwin);
@ -598,11 +595,9 @@ void bankrupt_player (bool forced)
int longname = (strlen(player[current_player].name) > 20); int longname = (strlen(player[current_player].name) > 20);
if (forced) { if (forced) {
newtxwin((longname ? 9 : 8), 54, LINE_OFFSET + 7, COL_CENTER(54), newtxwin(longname ? 9 : 8, 54, 7, WCENTER(54), true, ATTR_ERROR_WINDOW);
true, ATTR_ERROR_WINDOW);
} else { } else {
newtxwin((longname ? 8 : 7), 50, LINE_OFFSET + 7, COL_CENTER(50), newtxwin(longname ? 8 : 7, 50, 7, WCENTER(50), true, ATTR_ERROR_WINDOW);
true, ATTR_ERROR_WINDOW);
} }
center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court "); center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court ");
@ -696,8 +691,7 @@ void try_start_new_company (int x, int y)
} else { } else {
// Create the new company // Create the new company
newtxwin(8, 50, LINE_OFFSET + 7, COL_CENTER(50), true, newtxwin(8, 50, 7, WCENTER(50), true, ATTR_NORMAL_WINDOW);
ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " New Company "); center(curwin, 1, ATTR_WINDOW_TITLE, " New Company ");
center(curwin, 3, ATTR_NORMAL_WINDOW, "A new company has been formed!"); center(curwin, 3, ATTR_NORMAL_WINDOW, "A new company has been formed!");
@ -768,8 +762,8 @@ void merge_companies (map_val_t a, map_val_t b)
// Display information about the merger // Display information about the merger
newtxwin(number_players + 14, 76, LINE_OFFSET + (9 - number_players), newtxwin(number_players + 14, WIN_COLS - 4, 9 - number_players,
COL_CENTER(76), true, ATTR_NORMAL_WINDOW); WCENTER(WIN_COLS - 4), true, ATTR_NORMAL_WINDOW);
center(curwin, 1, ATTR_WINDOW_TITLE, " Company Merger "); center(curwin, 1, ATTR_WINDOW_TITLE, " Company Merger ");
center3(curwin, 3, ATTR_HIGHLIGHT_STR, ATTR_HIGHLIGHT_STR, ATTR_NORMAL_WINDOW, center3(curwin, 3, ATTR_HIGHLIGHT_STR, ATTR_HIGHLIGHT_STR, ATTR_NORMAL_WINDOW,
@ -935,8 +929,7 @@ void adjust_values (void)
if (company[which].on_map) { if (company[which].on_map) {
if (randf() < ALL_ASSETS_TAKEN) { if (randf() < ALL_ASSETS_TAKEN) {
newtxwin(10, 60, LINE_OFFSET + 6, COL_CENTER(60), true, newtxwin(10, 60, 6, WCENTER(60), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court "); center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court ");
center(curwin, 3, ATTR_ERROR_STR, "%s has been declared", center(curwin, 3, ATTR_ERROR_STR, "%s has been declared",
@ -966,8 +959,7 @@ void adjust_values (void)
} }
} }
newtxwin(14, 60, LINE_OFFSET + 4, COL_CENTER(60), true, newtxwin(14, 60, 4, WCENTER(60), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court "); center(curwin, 1, ATTR_ERROR_TITLE, " Bankruptcy Court ");
center(curwin, 3, ATTR_ERROR_STR, "%s has been declared", center(curwin, 3, ATTR_ERROR_STR, "%s has been declared",
@ -1078,8 +1070,7 @@ void adjust_values (void)
impounded = MIN(player[current_player].cash, impounded = MIN(player[current_player].cash,
player[current_player].debt); player[current_player].debt);
newtxwin(8, 60, LINE_OFFSET + 7, COL_CENTER(60), true, newtxwin(8, 60, 7, WCENTER(60), true, ATTR_ERROR_WINDOW);
ATTR_ERROR_WINDOW);
center(curwin, 1, ATTR_ERROR_TITLE, " Interstellar Trading Bank "); center(curwin, 1, ATTR_ERROR_TITLE, " Interstellar Trading Bank ");