Merge branch 'master' into nhmall-booktribute

Conflicts:
	doc/fixes35.0
	include/extern.h
	src/mkobj.c
	src/mon.c
	src/objnam.c
	win/share/objects.txt
This commit is contained in:
nhmall
2015-04-12 10:02:17 -04:00
41 changed files with 16487 additions and 15871 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 winmenu.c $NHDT-Date: 1427881480 2015/04/01 09:44:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */
/* NetHack 3.5 winmenu.c $NHDT-Date: 1428828477 2015/04/12 08:47:57 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* NetHack 3.5 winmenu.c $Date: 2009/05/06 10:55:53 $ $Revision: 1.5 $ */
/* SCCS Id: @(#)winmenu.c 3.5 1996/08/15 */
/* Copyright (c) Dean Luick, 1992 */
@@ -249,9 +249,13 @@ menu_key(w, event, params, num_params)
return;
} else if (ch == MENU_SEARCH) { /* search */
if (menu_info->how == PICK_ANY || menu_info->how == PICK_ONE) {
char buf[BUFSZ];
X11_getlin("Search for:", buf);
if (!*buf || *buf == '\033') return;
char buf[BUFSZ+2], tmpbuf[BUFSZ];
X11_getlin("Search for:", tmpbuf);
if (!*tmpbuf || *tmpbuf == '\033') return;
/* convert "string" into "*string*" for use with pmatch() */
Sprintf(buf, "*%s*", tmpbuf);
if (menu_info->how == PICK_ANY) {
invert_match(wp, buf);
return;
@@ -395,10 +399,12 @@ menu_search(w, client_data, call_data)
{
struct xwindow *wp = (struct xwindow *) client_data;
struct menu_info_t *menu_info = wp->menu_information;
char buf[BUFSZ+2], tmpbuf[BUFSZ];
char buf[BUFSZ];
X11_getlin("Search for:", buf);
if (!*buf || *buf == '\033') return;
X11_getlin("Search for:", tmpbuf);
if (!*tmpbuf || *tmpbuf == '\033') return;
/* convert "string" into "*string*" for use with pmatch() */
Sprintf(buf, "*%s*", tmpbuf);
if (menu_info->how == PICK_ANY)
invert_match(wp, buf);
@@ -479,7 +485,7 @@ invert_all(wp)
static void
invert_match(wp, match)
struct xwindow *wp;
char *match;
char *match; /* wildcard pattern for pmatch() */
{
x11_menu_item *curr;
int count;
@@ -488,7 +494,7 @@ invert_match(wp, match)
reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
curr = curr->next, count++)
if (curr->identifier.a_void != 0 && strstri(curr->str, match)) {
if (curr->identifier.a_void != 0 && pmatchi(match, curr->str)) {
invert_line(wp, curr, count, -1L);
changed = TRUE;
}
@@ -503,7 +509,7 @@ invert_match(wp, match)
static void
select_match(wp, match)
struct xwindow *wp;
char *match;
char *match; /* wildcard pattern for pmatch() */
{
x11_menu_item *curr;
int count;
@@ -511,11 +517,12 @@ select_match(wp, match)
reset_menu_count(wp->menu_information);
for (count = 0, curr = wp->menu_information->curr_menu.base; curr;
curr = curr->next, count++)
if (curr->identifier.a_void != 0 && strstri(curr->str, match)) {
if (curr->identifier.a_void != 0 && pmatchi(match, curr->str)) {
if (!curr->selected) {
invert_line(wp, curr, count, -1L);
#ifndef USE_FWF
XawListChange(wp->w, wp->menu_information->curr_menu.list_pointer,
XawListChange(wp->w,
wp->menu_information->curr_menu.list_pointer,
0, 0, True);
#endif
}

File diff suppressed because it is too large Load Diff

87
win/share/renumtiles.pl Normal file
View File

@@ -0,0 +1,87 @@
#!/bin/perl
#
# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
# $Date: 2002/01/05 21:06:02 $ $Revision: 1.1 $
#
sub bail($);
use Getopt::Std;
# TODO: switch to Getopt::Long so we can parse normal arguments too
$Getopt::Std::STANDARD_HELP_VERSION = TRUE;
$main::VERSION = 1.0;
my %commands = (
'd' => 'debug mode; parse objects.txt to stdout instead of updating',
);
getopts(join('', keys(%commands)));
my $debug = (defined($opt_d) && $opt_d == 1);
my $tilecount = 0;
my $outfile = $debug ? "-" : "objects.txt";
my $infile = $debug ? "objects.txt" : "objects.bak";
unless ($debug) {
if (-e "$infile") { die "something didn't clean up objects.bak from last time; stopping\n"; }
rename($outfile,$infile) or die "couldn't move objects.txt to objects.bak; stopping\n";
}
open(INFILE, "<$infile") or bail("couldn't open $infile; bailing");
open(OUTFILE, ">$outfile") or bail("couldn't open $outfile; bailing");
while (my $line = <INFILE>)
{
if (my ($tiletext) = $line =~ /^# tile \d+ (.*)/)
{
$line = "# tile $tilecount $tiletext\n";
$tilecount++;
}
print OUTFILE $line;
}
close(INFILE);
close(OUTFILE);
unless ($debug) { unlink $infile; }
exit;
sub main::HELP_MESSAGE()
{
print <<"STARTHELP";
Usage: renumtiles.pl [OPTIONS] <textfile>
STARTHELP
foreach $cmd (keys(%commands)) {
printf("%10s %s\n", '-'.$cmd, $commands{$cmd});
}
print <<"ENDHELP";
\t--help display this help message and exit
\t--version display version and exit
ENDHELP
exit;
}
sub main::VERSION_MESSAGE()
{
my ($objglob, $optpackage, $ver, $switches) = @_;
print <<"STARTHELP";
renumtiles $ver -- tile-renumbering utility for NetHack
STARTHELP
}
sub bail($)
{
unless ($debug) {
unlink $outfile;
rename ($infile,$outfile);
}
shift;
die "$_\n";
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 wintty.c $NHDT-Date: 1428394244 2015/04/07 08:10:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.84 $ */
/* NetHack 3.5 wintty.c $NHDT-Date: 1428828474 2015/04/12 08:47:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.85 $ */
/* NetHack 3.5 wintty.c $Date: 2012/01/22 06:27:09 $ $Revision: 1.66 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -1664,20 +1664,24 @@ struct WinDesc *cw;
tty_nhbell();
break;
} else {
char searchbuf[BUFSZ], tmpbuf[BUFSZ];
char searchbuf[BUFSZ+2], tmpbuf[BUFSZ];
boolean on_curr_page = FALSE;
int lineno = 0;
tty_getlin("Search for:", tmpbuf);
if (!tmpbuf[0] || tmpbuf[0] == '\033') break;
Sprintf(searchbuf, "*%s*", tmpbuf);
for (curr = cw->mlist; curr; curr = curr->next) {
if (on_curr_page) lineno++;
if (curr == page_start)
on_curr_page = TRUE;
else if (curr == page_end)
on_curr_page = FALSE;
if (curr->identifier.a_void && pmatch(searchbuf, curr->str)) {
toggle_menu_curr(window, curr, lineno, on_curr_page, counting, count);
if (curr->identifier.a_void
&& pmatchi(searchbuf, curr->str)) {
toggle_menu_curr(window, curr, lineno,
on_curr_page, counting, count);
if (cw->how == PICK_ONE) {
finished = TRUE;
break;