Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-03-20 09:28:48 -04:00
7 changed files with 83 additions and 64 deletions

View File

@@ -134,7 +134,6 @@ curses_create_main_windows()
borders = FALSE;
}
if (borders) {
border_space = 2;
hspace -= border_space;
@@ -145,35 +144,44 @@ curses_create_main_windows()
}
/* Determine status window orientation */
if (!iflags.wc_align_status || (iflags.wc_align_status == ALIGN_TOP)
|| (iflags.wc_align_status == ALIGN_BOTTOM)) {
if (!iflags.wc_align_status) {
iflags.wc_align_status = ALIGN_BOTTOM;
}
if (!iflags.wc_align_status)
iflags.wc_align_status = ALIGN_BOTTOM;
if (iflags.wc_align_status == ALIGN_TOP
|| iflags.wc_align_status == ALIGN_BOTTOM) {
status_orientation = iflags.wc_align_status;
} else { /* left or right alignment */
/* Max space for player name and title horizontally */
if ((hspace >= 26) && (term_rows >= 24)) {
} else { /* left or right alignment */
/*
* Max space for player name and title horizontally.
* [Width of 26 gives enough room for a 24 character
* hitpoint bar (horizontal layout uses 30 for that) and
* can accommodate widest field ("Experience : 30/123456789")
* other than title without truncating anything.
* Height originally required at least 24 lines, but 21
* suffices and 20 can be made to work by suppressing score.]
*/
if (hspace >= 26 && term_rows >= 20) {
status_orientation = iflags.wc_align_status;
hspace -= (26 + border_space);
} else {
/* orientation won't match option setting, making 'O' command's
list of settings seem inaccurate; but leaving the requested
setting in iflags might allow it to take effect if the main
window gets resized */
status_orientation = ALIGN_BOTTOM;
}
}
/* Determine message window orientation */
if (!iflags.wc_align_message || (iflags.wc_align_message == ALIGN_TOP)
|| (iflags.wc_align_message == ALIGN_BOTTOM)) {
if (!iflags.wc_align_message) {
iflags.wc_align_message = ALIGN_TOP;
}
if (!iflags.wc_align_message)
iflags.wc_align_message = ALIGN_TOP;
if (iflags.wc_align_message == ALIGN_TOP
|| iflags.wc_align_message == ALIGN_BOTTOM) {
message_orientation = iflags.wc_align_message;
} else { /* left or right alignment */
} else { /* left or right alignment */
if ((hspace - border_space) >= 25) { /* Arbitrary */
message_orientation = iflags.wc_align_message;
} else {
/* orientation won't match option setting (see above) */
message_orientation = ALIGN_TOP;
}
}
@@ -192,7 +200,6 @@ curses_create_main_windows()
int inv_y = 0;
int map_x = 0;
int map_y = 0;
int message_height = 0;
int message_width = 0;
int status_height = 0;
@@ -201,20 +208,11 @@ curses_create_main_windows()
int inv_width = 0;
int map_height = (term_rows - border_space);
int map_width = (term_cols - border_space);
int statusheight = 3;
boolean status_vertical = FALSE;
boolean msg_vertical = FALSE;
if (status_orientation == ALIGN_LEFT ||
status_orientation == ALIGN_RIGHT)
status_vertical = TRUE;
if (message_orientation == ALIGN_LEFT ||
message_orientation == ALIGN_RIGHT)
msg_vertical = TRUE;
if (iflags.statuslines < 3)
statusheight = 2;
int statusheight = (iflags.statuslines < 3) ? 2 : 3;
boolean status_vertical = (status_orientation == ALIGN_LEFT
|| status_orientation == ALIGN_RIGHT);
boolean msg_vertical = (message_orientation == ALIGN_LEFT
|| message_orientation == ALIGN_RIGHT);
/* Vertical windows have priority. Otherwise, priotity is:
status > inv > msg */
@@ -227,9 +225,7 @@ curses_create_main_windows()
if (iflags.perm_invent) {
/* Take up all width unless msgbar is also vertical. */
int width = -25;
if (msg_vertical)
width = 25;
int width = msg_vertical ? 25 : -25;
set_window_position(&inv_x, &inv_y, &inv_width, &inv_height,
ALIGN_RIGHT, &map_x, &map_y,
@@ -261,7 +257,6 @@ curses_create_main_windows()
if (map_width > COLNO)
map_width = COLNO;
if (map_height > ROWNO)
map_height = ROWNO;
@@ -270,7 +265,6 @@ curses_create_main_windows()
curses_del_nhwin(MESSAGE_WIN);
curses_del_nhwin(MAP_WIN);
curses_del_nhwin(INV_WIN);
clear();
}