Rename getpos_coord values to "compass" and "map"

This commit is contained in:
Pasi Kallinen
2016-01-13 12:21:27 +02:00
parent ef3ce49dd4
commit c49490dfd4
5 changed files with 19 additions and 20 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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,