Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0a71086
fix extcmd entry in curses interface.
NHTangles Apr 22, 2017
14f89be
Add #ifndef on VAR_PLAYGROUND so it can be defined in makefile.
NHTangles Apr 22, 2017
9ce64c1
Curses - fix MSGTYPE=STOP
NHTangles Apr 23, 2017
edf261b
curses - splashscrens for dnh and grunt.
NHTangles Apr 25, 2017
71eea73
curses - fix msgtype-related hang at endgame.
NHTangles Apr 25, 2017
7aa8af1
Curses - handle long #extcmd entry gracefully.
NHTangles Apr 27, 2017
94628a4
curses darkgray fixes
NHTangles Apr 30, 2017
1087a2f
fix use_darkgray option handling properly
NHTangles Apr 30, 2017
9842329
.gitignore add dlb and nhdat
NHTangles May 1, 2017
0d6ecc4
curses - Display items in inventory list
k21971 May 1, 2017
af37b9c
curses - Display items in inventory list
NHTangles May 1, 2017
7e3effe
Simplify stat highlight timer logic
FredrIQ May 6, 2017
a946098
Remove a lot of copy/paste from curses_update_stats
FredrIQ May 6, 2017
e6ed6f6
Change code formatting of the Curses interface
FredrIQ May 6, 2017
5ecf25e
curses - fix text attr, and menu width
NHTangles May 6, 2017
ae56166
Remove blank lines between function prototype declarations
FredrIQ May 6, 2017
6a3184e
curses - non-popup version of getline()
NHTangles May 8, 2017
9810b6b
curses - getline sometimes alloc too few lines
NHTangles May 8, 2017
cb8b368
Rewrite statusbar handling from scratch
FredrIQ May 9, 2017
0eb76f9
Curses - handle long #extcmd entry gracefully.
NHTangles Apr 27, 2017
42c7c76
curses - statuscolors fixes (not currently used)
NHTangles May 9, 2017
e98aab0
Fix statuscolors
FredrIQ May 9, 2017
4a23580
curses - fix issues from grunt merge.
NHTangles May 10, 2017
508b055
Simplify window position initialization
FredrIQ May 10, 2017
4c1b23b
Avoid the new set_window_position returning negative widths, give a s…
FredrIQ May 10, 2017
6d5623d
Fix windows not aligning properly on align_status:top align_statusbot…
FredrIQ May 10, 2017
2e36dbd
curses - respect menu_glyphs option
NHTangles May 11, 2017
3675129
Split out drawing of statuses so that both horizontal/vertical can us…
FredrIQ May 11, 2017
46079f7
Simplify status bar initialization
FredrIQ May 11, 2017
6f74a83
Remove some unused variables
FredrIQ May 11, 2017
1ad6993
Remove some code duplication
FredrIQ May 11, 2017
be14b5e
Remove some more cruft leftover from old cursstat code
FredrIQ May 11, 2017
8838d1c
Remove the feature that allowed a label and statuscolor config to not…
FredrIQ May 11, 2017
c13e485
Prev(hp|mhp|pow|mhp) is no longer used
FredrIQ May 11, 2017
90e88c6
Remove a redundant curses_update_status
FredrIQ May 11, 2017
8d158b8
Remove a redundant function
FredrIQ May 11, 2017
e65c7ba
Add inventory sidebar if perm_invent is enabled
FredrIQ May 12, 2017
3d41078
Add "Inventory:" title to inventory sidebar and "Not carrying anythin…
FredrIQ May 12, 2017
1cf4490
If the perm_invent option changes between the save and the file, hand…
FredrIQ May 12, 2017
62d522f
perm_invent is implemented, remove from TODO
FredrIQ May 12, 2017
d3b0252
Make the msgbuffer redraw the entire message history if redrawn, inst…
FredrIQ May 12, 2017
9a46f15
Fix various perm_invent bugs, including a crash bug
FredrIQ May 12, 2017
c8a5a78
curses - remove grunt-specifics frm recent merge.
NHTangles May 13, 2017
991c47f
curses - Add some missing hpbar logic from grunt.
NHTangles May 13, 2017
28619d3
Fix Strength not showing correctly above 18
FredrIQ May 13, 2017
4df2527
Add classic_status, defaults to TRUE. If set to false, it will draw a…
FredrIQ May 14, 2017
feed1f7
Fix Buffer overflow in curses_num_lines()
NHTangles May 15, 2017
ae74866
fixup: ACTUALLY fix buffer overflow in curses_num_lines
NHTangles May 15, 2017
2eab2ed
display splash in map area
NHTangles May 15, 2017
551bda9
Better handling of failure to open dump file.
NHTangles May 16, 2017
4773290
Fix a minor XP display bug in NH4status
FredrIQ May 16, 2017
f1a7b04
Fix number of args to dump_screen() dump fix
NHTangles May 16, 2017
29d0efa
fix #ifdef on chmod() in dump_init()
NHTangles May 17, 2017
129da49
Replace wclrtoeols with a single werase at the start of statusbar upd…
FredrIQ May 17, 2017
cf185c6
curses - fix typo in colour initialisation
NHTangles May 19, 2017
006f9a1
Fix a bug where menuglyphs would screw up sidebar colors if menucolor…
FredrIQ Jun 11, 2017
c5c9e65
Fix a mistake in last commit
FredrIQ Jun 12, 2017
7735834
curses - fix EXP_ON_BOTL code block
NHTangles Jul 8, 2017
457b991
curses - attempt to fix lag.
NHTangles Jul 9, 2017
08c65c6
curses - remove some more lag
NHTangles Jul 10, 2017
e39828e
curses - more wrefresh() tweakage
NHTangles Jul 10, 2017
812dd5a
curses - add inventory window to "all main windows" operations.
NHTangles Jul 10, 2017
6ce781c
curses - remove code commented out in earlier commits.
NHTangles Jul 10, 2017
9853fe8
Fix crash bug in tty menus
NHTangles Sep 13, 2018
f59d9b7
msgtype=stop/alert improvememnts.
NHTangles May 12, 2018
bd50d24
curses - change some panics to impossibles.
NHTangles Jul 25, 2018
0fd8610
'curses_display_nhmenu' should return a value
nhmall Dec 2, 2018
0ddf663
Merge branch 'cursesfixes' into 3.4.3-nao
NHTangles Mar 6, 2019
a5ed71f
curses - fix logic reversal that was preventing msgwin scrolling
NHTangles Jun 11, 2019
4ea6cea
Merge branch 'cursesfixes' into 3.4.3-nao
NHTangles Jun 11, 2019
a3f20b2
Fix: bounds checking on thrown object
k21971 May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dat/*.lev
dat/data
dat/dungeon
dat/dungeon.pdf
dat/nhdat
dat/options
dat/oracles
dat/quest.dat
Expand All @@ -28,6 +29,7 @@ src/vis_tab.c
util/dgn_comp
util/dgn_lex.c
util/dgn_yacc.c
util/dlb
util/lev_comp
util/lev_lex.c
util/lev_yacc.c
Expand Down
1 change: 1 addition & 0 deletions include/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ E struct _plinemsg *pline_msg;
#define MSGTYP_NOREP 1
#define MSGTYP_NOSHOW 2
#define MSGTYP_STOP 3
#define MSGTYP_ALERT 4


/* FIXME: These should be integrated into objclass and permonst structs,
Expand Down
1 change: 1 addition & 0 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ E void FDECL(make_grave, (int,int,const char *));

/* ### exper.c ### */

E long FDECL(newuexp, (int));
E int FDECL(experience, (struct monst *,int));
E void FDECL(more_experienced, (int,int));
E void FDECL(losexp, (const char *));
Expand Down
6 changes: 5 additions & 1 deletion include/flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ struct flag {
struct instance_flags {
boolean cbreak; /* in cbreak mode, rogue format */
#ifdef CURSES_GRAPHICS
boolean cursesgraphics; /* Use portable curses extended characters */
boolean classic_status; /* What kind of horizontal statusbar to use */
boolean cursesgraphics; /* Use portable curses extended characters */
#endif
boolean DECgraphics; /* use DEC VT-xxx extended character set */
boolean echo; /* 1 to echo characters */
Expand Down Expand Up @@ -342,6 +343,9 @@ struct instance_flags {
#ifdef REALTIME_ON_BOTL
boolean showrealtime; /* show actual elapsed time */
#endif
boolean msg_is_alert; /* suggest windowport should grab player's attention
* and request <TAB> acknowlegement */

};

/*
Expand Down
3 changes: 2 additions & 1 deletion include/unixconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@
* If you want the static parts of your playground on a read-only file
* system, define VAR_PLAYGROUND to be where the variable parts are kept.
*/
#ifndef VAR_PLAYGROUND
#define VAR_PLAYGROUND "/nh343/var"

#endif

/*
* Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
Expand Down
26 changes: 21 additions & 5 deletions include/wincurs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ boolean counting; /* Count window is active */
#define NONE -1
#define KEY_ESC 0x1b
#define DIALOG_BORDER_COLOR CLR_MAGENTA
#define ALERT_BORDER_COLOR CLR_RED
#define SCROLLBAR_COLOR CLR_MAGENTA
#define SCROLLBAR_BACK_COLOR CLR_BLACK
#define HIGHLIGHT_COLOR CLR_WHITE
Expand All @@ -30,7 +31,8 @@ boolean counting; /* Count window is active */
#define MESSAGE_WIN 1
#define STATUS_WIN 2
#define MAP_WIN 3
#define NHWIN_MAX 4
#define INV_WIN 4
#define NHWIN_MAX 5
#define MESG_HISTORY_MAX 200
#if !defined(__APPLE__) || !defined(NCURSES_VERSION)
# define USE_DARKGRAY /* Allow "bright" black; delete if not visible */
Expand Down Expand Up @@ -178,6 +180,10 @@ extern void curses_puts(winid wid, int attr, const char *text);

extern void curses_clear_nhwin(winid wid);

extern void curses_alert_win_border(winid wid, boolean onoff);

extern void curses_alert_main_borders(boolean onoff);

extern void curses_draw_map(int sx, int sy, int ex, int ey);

extern boolean curses_map_borders(int *sx, int *sy, int *ex, int *ey,
Expand Down Expand Up @@ -237,8 +243,10 @@ extern int curses_character_input_dialog(const char *prompt, const char *choices
extern int curses_ext_cmd(void);

extern void curses_create_nhmenu(winid wid);

extern void curses_add_nhmenu_item(winid wid, const ANY_P *identifier,
#ifdef MENU_COLOR
extern boolean get_menu_coloring(char *, int *, int *);
#endif
extern void curses_add_nhmenu_item(winid wid, int glyph, const ANY_P *identifier,
CHAR_P accelerator, CHAR_P group_accel, int attr, const char *str,
BOOLEAN_P presel);

Expand All @@ -253,10 +261,14 @@ extern void curses_del_menu(winid wid);

/* cursstat.c */

extern void curses_update_stats(boolean redraw);

extern attr_t curses_color_attr(int nh_color, int bg_color);
extern void curses_update_stats(void);
extern void curses_decrement_highlight(void);

/* cursinvt.c */

extern void curses_update_inv(void);
extern void curses_add_inv(int, int, CHAR_P, attr_t, const char *);

/* cursinit.c */

Expand All @@ -279,10 +291,14 @@ extern void curses_cleanup(void);

extern void curses_message_win_puts(const char *message, boolean recursed);

extern int curses_block(boolean require_tab); /* for MSGTYPE=STOP */

extern int curses_more(void);

extern void curses_clear_unhighlight_message_window(void);

extern void curses_message_win_getline(const char *prompt, char *answer, int buffer);

extern void curses_last_messages(void);

extern void curses_init_mesg_history(void);
Expand Down
1 change: 1 addition & 0 deletions src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,7 @@ row_refresh(start,stop,y)
for (x = start; x <= stop; x++)
if (gbuf[y][x].glyph != cmap_to_glyph(S_stone))
print_glyph(WIN_MAP,x,y,gbuf[y][x].glyph);
display_nhwindow(WIN_MAP,FALSE);
}

void
Expand Down
37 changes: 20 additions & 17 deletions src/end.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ dump_init ()
char new_dump_fn[512];
Sprintf(new_dump_fn, "%s", dump_format_str(dump_fn));

dump_fp = fopen(new_dump_fn, "w");
#ifdef UNIX
chmod(new_dump_fn, dumpmode);
#endif
dump_fp = fopen (new_dump_fn, "w");
if (!dump_fp) {
pline("Can't open %s for output.", new_dump_fn);
pline("Dump file not created.");
return;
}
#if defined(UNIX)
chmod(new_dump_fn, dumpmode);
#endif
}
}

Expand Down Expand Up @@ -861,19 +862,21 @@ int how;
program_state.something_worth_saving = 0;
#ifdef DUMP_LOG
/* D: Grab screen dump right here */
if (dump_fn[0]) {
dump_init();
Sprintf(pbuf, "%s, %s %s %s %s", plname,
aligns[1 - u.ualign.type].adj,
genders[flags.female].adj,
urace.adj,
(flags.female && urole.name.f)?
urole.name.f : urole.name.m);
dump("", pbuf);
/* D: Add a line for clearance from the screen dump */
dump("", "");
dump_screen(0);
}
if (dump_fn[0]) {
dump_init();
if (dump_fp) {
Sprintf(pbuf, "%s, %s %s %s %s", plname,
aligns[1 - u.ualign.type].adj,
genders[flags.female].adj,
urace.adj,
(flags.female && urole.name.f)?
urole.name.f : urole.name.m);
dump("", pbuf);
/* D: Add a line for clearance from the screen dump */
dump("", "");
dump_screen(0);
}
}
#endif /* DUMP_LOG */

#ifdef WHEREIS_FILE
Expand Down
3 changes: 1 addition & 2 deletions src/exper.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

#include "hack.h"

STATIC_DCL long FDECL(newuexp, (int));
STATIC_DCL int FDECL(enermod, (int));

STATIC_OVL long
long
newuexp(lev)
int lev;
{
Expand Down
2 changes: 2 additions & 0 deletions src/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,8 @@ char *tmp_levels;
else if (!strcasecmp("noshow", msgtype)) typ = MSGTYP_NOSHOW;
else if (!strcasecmp("more", msgtype)) typ = MSGTYP_STOP;
else if (!strcasecmp("stop", msgtype)) typ = MSGTYP_STOP;
/* 'alert' will fallback to 'stop' behaviour if windowport does not support it */
else if (!strcasecmp("alert", msgtype)) typ = MSGTYP_ALERT;
if ((typ != MSGTYP_NORMAL) || !strcasecmp("show", msgtype)) {
msgpline_add(typ, pattern);
}
Expand Down
27 changes: 14 additions & 13 deletions src/mthrowu.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,22 @@ m_throw(mon, x, y, dx, dy, range, obj)
(void) drop_throw(singleobj, hitu, u.ux, u.uy);
break;
}
} else if (!range /* reached end of path */
/* missile hits edge of screen */
|| !isok(bhitpos.x+dx,bhitpos.y+dy)
/* missile hits the wall */
|| IS_ROCK(levl[bhitpos.x+dx][bhitpos.y+dy].typ)
/* missile hit closed door */
|| closed_door(bhitpos.x+dx, bhitpos.y+dy)
/* missile might hit iron bars */
|| (levl[bhitpos.x+dx][bhitpos.y+dy].typ == IRONBARS &&
hits_bars(&singleobj, bhitpos.x, bhitpos.y, !rn2(5), 0))
}
if (!range /* reached end of path */
/* missile hits edge of screen */
|| !isok(bhitpos.x+dx,bhitpos.y+dy)
/* missile hits the wall */
|| IS_ROCK(levl[bhitpos.x+dx][bhitpos.y+dy].typ)
/* missile hit closed door */
|| closed_door(bhitpos.x+dx, bhitpos.y+dy)
/* missile might hit iron bars */
|| (levl[bhitpos.x+dx][bhitpos.y+dy].typ == IRONBARS &&
hits_bars(&singleobj, bhitpos.x, bhitpos.y, !rn2(5), 0))
#ifdef SINKS
/* Thrown objects "sink" */
|| IS_SINK(levl[bhitpos.x][bhitpos.y].typ)
/* Thrown objects "sink" */
|| IS_SINK(levl[bhitpos.x][bhitpos.y].typ)
#endif
) {
) {
if (singleobj) /* hits_bars might have destroyed it */
(void) drop_throw(singleobj, 0, bhitpos.x, bhitpos.y);
break;
Expand Down
4 changes: 4 additions & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ static struct Bool_Opt
{"checkspace", &iflags.checkspace, TRUE, SET_IN_GAME},
#else
{"checkspace", (boolean *)0, FALSE, SET_IN_FILE},
#endif
#ifdef CURSES_GRAPHICS
{"classic_status", &iflags.classic_status, TRUE, SET_IN_FILE},
#endif
{"cmdassist", &iflags.cmdassist, TRUE, SET_IN_GAME},
# if defined(MICRO) || defined(WIN32) || defined(CURSES_GRAPHICS)
Expand Down Expand Up @@ -637,6 +640,7 @@ initoptions()
#ifdef SORTLOOT
iflags.sortloot = 'n';
#endif
iflags.msg_is_alert = FALSE;

/* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
(void)memcpy((genericptr_t)flags.inv_order,
Expand Down
10 changes: 9 additions & 1 deletion src/pline.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ pline VA_DECL(const char *, line)

putstr(WIN_MESSAGE, 0, line);
strncpy(prevmsg, line, BUFSZ);
if (typ == MSGTYP_STOP) display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
switch (typ) {
case MSGTYP_ALERT:
iflags.msg_is_alert = TRUE; /* <TAB> */
/* FT */
case MSGTYP_STOP:
display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
break;
}
iflags.msg_is_alert = FALSE;
}

/*VARARGS1*/
Expand Down
7 changes: 5 additions & 2 deletions sys/unix/Makefile.src
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ WINTTYOBJ = getline.o termcap.o topl.o wintty.o tile.o
WINCURSESSRC = ../win/curses/cursmain.c ../win/curses/curswins.c \
../win/curses/cursmisc.c ../win/curses/cursdial.c \
../win/curses/cursstat.c ../win/curses/cursinit.c \
../win/curses/cursmesg.c
../win/curses/cursmesg.c ../win/curses/cursinvt.c
WINCURSESOBJ = cursmain.o curswins.o cursmisc.o cursdial.o cursstat.o \
cursinit.o cursmesg.o
cursinit.o cursmesg.o cursinvt.o
#
#
# files for an X11 port
Expand Down Expand Up @@ -635,6 +635,9 @@ cursinit.o: ../win/curses/cursinit.c $(HACK_H) ../include/wincurs.h \
cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursmesg.h
$(CC) $(CFLAGS) -c ../win/curses/cursmesg.c
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinvt.h
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H)
$(CC) $(CFLAGS) -c ../win/X11/Window.c
Expand Down
Loading