From: Pasi Kallinen Date: Wed, 13 Jan 2016 10:21:27 +0000 (+0200) Subject: Rename getpos_coord values to "compass" and "map" X-Git-Tag: NetHack-3.6.1_RC01~1028 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c49490dfd4bfb4e9a64359f13eaee86d6d92305c;p=nethack Rename getpos_coord values to "compass" and "map" --- diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 44dc33b29..bf9bc56bd 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -2129,7 +2129,7 @@ Cannot be set with the `O' command. Persistent. When using the `/' command to look around on the map with ``autodescribe'' on, display coordinates after the description. The value specified should be the first letter of one of the following: -absolute, cartesian, or none. Default is none. +compass, map, or none. Default is none. .lp "help " If more information is available for an object looked at with the `/' command, ask if you want to see it (default on). Turning help diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 88a9d8eb6..988367732 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2563,7 +2563,7 @@ Cannot be set with the `{\tt O}' command. Persistent. When using the `{\tt /}' command to look around on the map with ``{\tt autodescribe}'' on, display coordinates after the description. The value specified should be the first letter of one of the following: -absolute, cartesian, or none. Default is none. +compass, map, or none. Default is none. %.lp \item[\ib{help}] If more information is available for an object looked at diff --git a/include/flag.h b/include/flag.h index 298825660..ac175880b 100644 --- a/include/flag.h +++ b/include/flag.h @@ -168,9 +168,9 @@ struct sysflag { */ /* values for iflags.getpos_coords */ -#define GPCOORDS_NONE 'n' -#define GPCOORDS_ABSOLUTE 'a' -#define GPCOORDS_CARTESIAN 'c' +#define GPCOORDS_NONE 'n' +#define GPCOORDS_MAP 'm' +#define GPCOORDS_COMPASS 'c' struct instance_flags { /* stuff that really isn't option or platform related. They are diff --git a/src/do_name.c b/src/do_name.c index bd6d5e195..8f0768e3b 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -172,10 +172,9 @@ int dx, dy; if (dy) { if (abs(dy) > 9999) dy = sgn(dy) * 9999; - Sprintf(eos(buf), "%d%c", abs(dy), (dy > 0) ? 's' : 'n'); + Sprintf(eos(buf), "%d%c%s", abs(dy), (dy > 0) ? 's' : 'n', + dx ? "," : ""); } - if (dy && dx) - strkitten(buf, ','); if (dx) { if (abs(dx) > 9999) dx = sgn(dx) * 9999; @@ -201,12 +200,12 @@ int cx, cy; switch (iflags.getpos_coords) { default: break; - case GPCOORDS_CARTESIAN: + case GPCOORDS_COMPASS: dx = cc.x - u.ux; dy = cc.y - u.uy; Sprintf(tmpbuf, " (%s)", dxdy_to_dist_descr(dx, dy)); break; - case GPCOORDS_ABSOLUTE: + case GPCOORDS_MAP: Sprintf(tmpbuf, " (%d,%d)", cc.x, cc.y); break; } diff --git a/src/options.c b/src/options.c index 6ba023a3c..7d6ddc357 100644 --- a/src/options.c +++ b/src/options.c @@ -2343,8 +2343,8 @@ boolean tinitial, tfrom_file; return; } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { if (tolower(*op) == GPCOORDS_NONE - || tolower(*op) == GPCOORDS_CARTESIAN - || tolower(*op) == GPCOORDS_ABSOLUTE) { + || tolower(*op) == GPCOORDS_COMPASS + || tolower(*op) == GPCOORDS_MAP) { iflags.getpos_coords = tolower(*op); } else badoption(opts); @@ -4034,12 +4034,12 @@ boolean setinitial, setfromfile; tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); any = zeroany; - any.a_char = GPCOORDS_ABSOLUTE; - add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_ABSOLUTE, - 0, ATR_NONE, "absolute", MENU_UNSELECTED); - any.a_char = GPCOORDS_CARTESIAN; - add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_CARTESIAN, - 0, ATR_NONE, "cartesian", MENU_UNSELECTED); + any.a_char = GPCOORDS_COMPASS; + add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_COMPASS, + 0, ATR_NONE, "compass", MENU_UNSELECTED); + any.a_char = GPCOORDS_MAP; + add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_MAP, + 0, ATR_NONE, "map", MENU_UNSELECTED); any.a_char = GPCOORDS_NONE; add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_NONE, 0, ATR_NONE, "none", MENU_UNSELECTED); @@ -4798,8 +4798,8 @@ char *buf; Sprintf(buf, "%s", runmodes[flags.runmode]); } else if (!strcmp(optname, "getpos_coord")) { Sprintf(buf, "%s", - (iflags.getpos_coords == GPCOORDS_ABSOLUTE) ? "absolute" - : (iflags.getpos_coords == GPCOORDS_CARTESIAN) ? "cartesian" + (iflags.getpos_coords == GPCOORDS_MAP) ? "map" + : (iflags.getpos_coords == GPCOORDS_COMPASS) ? "compass" : "none"); } else if (!strcmp(optname, "scores")) { Sprintf(buf, "%d top/%d around%s", flags.end_top, flags.end_around,