| 164 | |
| 165 | /* the response for '?' help request in getpos() */ |
| 166 | staticfn void |
| 167 | getpos_help(boolean force, const char *goal) |
| 168 | { |
| 169 | static const char *const fastmovemode[2] = { "8 units at a time", |
| 170 | "skipping same glyphs" }; |
| 171 | char sbuf[BUFSZ]; |
| 172 | boolean doing_what_is; |
| 173 | winid tmpwin = create_nhwindow(NHW_MENU); |
| 174 | |
| 175 | Sprintf(sbuf, |
| 176 | "Use '%s', '%s', '%s', '%s' to move the cursor to %s.", /* hjkl */ |
| 177 | visctrl(cmd_from_func(do_move_west)), |
| 178 | visctrl(cmd_from_func(do_move_south)), |
| 179 | visctrl(cmd_from_func(do_move_north)), |
| 180 | visctrl(cmd_from_func(do_move_east)), goal); |
| 181 | putstr(tmpwin, 0, sbuf); |
| 182 | Sprintf(sbuf, |
| 183 | "Use '%s', '%s', '%s', '%s' to fast-move the cursor, %s.", |
| 184 | visctrl(cmd_from_func(do_run_west)), |
| 185 | visctrl(cmd_from_func(do_run_south)), |
| 186 | visctrl(cmd_from_func(do_run_north)), |
| 187 | visctrl(cmd_from_func(do_run_east)), |
| 188 | fastmovemode[iflags.getloc_moveskip]); |
| 189 | putstr(tmpwin, 0, sbuf); |
| 190 | Sprintf(sbuf, "(or prefix normal move with '%s' or '%s' to fast-move)", |
| 191 | visctrl(cmd_from_func(do_run)), |
| 192 | visctrl(cmd_from_func(do_rush))); |
| 193 | putstr(tmpwin, 0, sbuf); |
| 194 | putstr(tmpwin, 0, "Or enter a background symbol (ex. '<')."); |
| 195 | Sprintf(sbuf, "Use '%s' to move the cursor on yourself.", |
| 196 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_SELF])); |
| 197 | putstr(tmpwin, 0, sbuf); |
| 198 | if (!iflags.terrainmode || (iflags.terrainmode & TER_MON) != 0) { |
| 199 | getpos_help_keyxhelp(tmpwin, |
| 200 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_MON_NEXT]), |
| 201 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_MON_PREV]), |
| 202 | GLOC_MONS); |
| 203 | } |
| 204 | if (goal && !strcmp(goal, "a monster")) |
| 205 | goto skip_non_mons; |
| 206 | if (!iflags.terrainmode || (iflags.terrainmode & TER_OBJ) != 0) { |
| 207 | getpos_help_keyxhelp(tmpwin, |
| 208 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_OBJ_NEXT]), |
| 209 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_OBJ_PREV]), |
| 210 | GLOC_OBJS); |
| 211 | } |
| 212 | if (!iflags.terrainmode || (iflags.terrainmode & TER_MAP) != 0) { |
| 213 | /* these are primarily useful when choosing a travel |
| 214 | destination for the '_' command */ |
| 215 | getpos_help_keyxhelp(tmpwin, |
| 216 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_DOOR_NEXT]), |
| 217 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_DOOR_PREV]), |
| 218 | GLOC_DOOR); |
| 219 | getpos_help_keyxhelp(tmpwin, |
| 220 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_UNEX_NEXT]), |
| 221 | visctrl(gc.Cmd.spkeys[NHKF_GETPOS_UNEX_PREV]), |
| 222 | GLOC_EXPLORE); |
| 223 | getpos_help_keyxhelp(tmpwin, |
no test coverage detected