summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-29 11:28:03 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-29 11:28:03 +0000
commit2304d9cd515a6061b14fa28885ea3e15fe0f7a59 (patch)
treefc7a709a3c639a3c93214804127a09c53ea105d2
parent77be5ae4a0b896e42f0169d880582f3842568c83 (diff)
downloadcrawl-ref-2304d9cd515a6061b14fa28885ea3e15fe0f7a59.tar.gz
crawl-ref-2304d9cd515a6061b14fa28885ea3e15fe0f7a59.zip
Moved monster descriptions in targeting from '?' to 'v'. Put targeting
help on '?'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@903 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/command.cc63
-rw-r--r--crawl-ref/source/command.h1
-rw-r--r--crawl-ref/source/direct.cc29
-rw-r--r--crawl-ref/source/enum.h1
5 files changed, 59 insertions, 38 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 7ead9ffbde..b66013059c 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1178,7 +1178,8 @@ void process_command( command_type cmd ) {
case CMD_LOOK_AROUND:
mpr("Move the cursor around to observe a square.", MSGCH_PROMPT);
- mpr("Press '?' for a monster description.", MSGCH_PROMPT);
+ mpr("Press 'v' for a monster description or '?' for help.",
+ MSGCH_PROMPT);
struct dist lmove; // will be initialized by direction()
direction(lmove, DIR_TARGET, TARG_ANY, true);
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 14263ce8e2..814c49e68e 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -596,19 +596,27 @@ static const char *level_map_help =
"<w>Ctrl-W</w> : set Waypoint\n"
"<w>Ctrl-C</w> : Clear level and main maps\n";
-static const char *targeting_help =
+static const char *targeting_help =
"<h>Targeting (like zapping wands/spells):\n"
- "<w>Esc</w> : stop targeting\n"
- "<w>Dir.</w> : shoots straight in that direction\n"
- "<w>p</w> : fires at Previous target (also <w>t</w>, <w>f</w>)\n"
+ "<w>Dir</w> : move in that direction\n"
+ "<w>Shift-Dir</w> : shoot straight-line beam\n"
+ "<w>Space</w> : cycle through beams\n"
+ "<w>:</w> : hide beam\n"
+ "<w>Esc</w> : cancel targeting\n"
+ "<w>Ctrl-F</w> : cycle monster cycle mode\n"
+ "<w>p</w> : fire at Previous target (also <w>t</w>, <w>f</w>)\n"
"<w>+</w> : cycle monsters forward (also <w>=</w>)\n"
"<w>-</w> : cycle monsters backward\n"
- "<w>.</w> : fires at target (also <w>Enter</w> or <w>Del</w>)\n"
- "<w>></w> : fires at target and stops there\n"
- "<w>Ctrl-F</w> : toggles cycle mode\n"
- "<w>*</w> : enter manual targeting (where <w>Dir.</w>\n"
- " moves the cursor and <w>.</w> etc. fire)\n"
- "<w>?</w> : describes monster under cursor\n";
+ "<w>.</w> : fire at target (also <w>Enter</w> or <w>Del</w>)\n"
+ "<w>!</w> : fire at target and stop there\n"
+ "<w>;</w> : cycle objects forward\n"
+ "<w>/</w> : cycle objects backward\n"
+ "<w>v</w> : describe monster under cursor\n"
+ "<w><<</w>/<w>></w> : cycle through up/down stairs\n"
+ "<w>^</w> : cycle through traps\n"
+ "<w>Tab</w> : cycle through shops and portals\n"
+ "<w>_</w> : cycle through altars\n"
+ "<w>?</w> : targeting help\n";
// Add the contents of the file fp to the scroller menu m.
// If first_hotkey is nonzero, that will be the hotkey for the
@@ -738,18 +746,28 @@ static void show_keyhelp_menu(const std::vector<formatted_string> &lines,
cmd_help.show();
}
-void show_levelmap_help()
+void show_specific_help( const char* help )
{
- std::vector<std::string> lines =
- split_string("\n", level_map_help, false, true);
+ std::vector<std::string> lines = split_string("\n", help, false, true);
std::vector<formatted_string> formatted_lines;
for (int i = 0, size = lines.size(); i < size; ++i)
formatted_lines.push_back(
- formatted_string::parse_string(
- lines[i], true, cmdhelp_textfilter));
+ formatted_string::parse_string(
+ lines[i], true, cmdhelp_textfilter));
show_keyhelp_menu(formatted_lines, false);
}
+void show_levelmap_help()
+{
+ show_specific_help( level_map_help );
+}
+
+void show_targeting_help()
+{
+ show_specific_help( targeting_help );
+}
+
+
void list_commands(bool wizard)
{
if (wizard)
@@ -938,21 +956,6 @@ void list_commands(bool wizard)
cols.add_formatted(
1,
- "<h>Examine Surroundings ('<w>x</w><h>' in main):\n"
- " <w>x</w> : back to map (also <w>Esc</w> and <w>Space</w>)\n"
- " <w>+</w> : cycle monsters forward (also <w>=</w>)\n"
- " <w>-</w> : cycle monsters backward\n"
- " <w>*</w> : cycle objects forward (also <w>'</w>)\n"
- " <w>/</w> : cycle objects backward (also <w>;</w>)\n"
- " <w>_</w> : cycle through altars\n"
- " <w>.</w> : travel to cursor (also <w>Enter</w>)\n"
- " <w>?</w> : describe monster under cursor\n"
- "<w><<</w>/<w>></w> : cycle through up/down stairs\n"
- "<w>Tab</w> : cycle dungeon features\n",
- true, true, cmdhelp_textfilter);
-
- cols.add_formatted(
- 1,
targeting_help,
true, true, cmdhelp_textfilter);
diff --git a/crawl-ref/source/command.h b/crawl-ref/source/command.h
index 0ae598360b..f33e79954a 100644
--- a/crawl-ref/source/command.h
+++ b/crawl-ref/source/command.h
@@ -60,6 +60,7 @@ void list_jewellery(void);
void swap_inv_slots(int slot1, int slot2, bool verbose);
void show_levelmap_help();
+void show_targeting_help();
void list_commands(bool wizard);
// Actually defined in acr.cc; we may want to move this to command.cc
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 8ec14540df..32c371f375 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -30,6 +30,7 @@
#include "externs.h"
+#include "command.h"
#include "debug.h"
#include "describe.h"
#include "itemname.h"
@@ -68,8 +69,6 @@ enum LOSSelect
LOS_NONE = 0xFFFF
};
-static const char *aim_prompt = "Aim (move cursor or -/+, change mode with CTRL-F, select with . or !)";
-
static void describe_feature(int mx, int my, bool oos);
static void describe_cell(int mx, int my);
@@ -107,7 +106,8 @@ static command_type read_direction_key()
{
case ESCAPE: return CMD_TARGET_CANCEL;
- case '?': return CMD_TARGET_DESCRIBE;
+ case 'v': return CMD_TARGET_DESCRIBE;
+ case '?': return CMD_TARGET_HELP;
case ' ': return CMD_TARGET_CYCLE_BEAM;
case ':': return CMD_TARGET_HIDE_BEAM;
case '.': return CMD_TARGET_SELECT;
@@ -124,8 +124,8 @@ static command_type read_direction_key()
case '-': return CMD_TARGET_CYCLE_BACK;
case '+': case '=': return CMD_TARGET_CYCLE_FORWARD;
- case ';': return CMD_TARGET_OBJ_CYCLE_BACK;
- case '/': return CMD_TARGET_OBJ_CYCLE_FORWARD;
+ case ';': case '/': return CMD_TARGET_OBJ_CYCLE_BACK;
+ case '*': return CMD_TARGET_OBJ_CYCLE_FORWARD;
case 'b': return CMD_TARGET_DOWN_LEFT;
case 'h': return CMD_TARGET_LEFT;
@@ -282,8 +282,10 @@ void direction(struct dist& moves, targeting_type restricts,
}
}
- // Prompts get scrolled off. Argh - another hack. XXX
- mpr(aim_prompt, (skip_iter ? MSGCH_PLAIN : MSGCH_PROMPT));
+ // Prompts might get scrolled off if you have too few lines available.
+ // We'll live with that.
+ if ( !just_looking )
+ mpr("Aim (press '?' for help.)", MSGCH_PROMPT);
while (1)
{
@@ -312,6 +314,7 @@ void direction(struct dist& moves, targeting_type restricts,
key_command = read_direction_key();
bool need_beam_redraw = false;
+ bool force_redraw = false;
bool loop_done = false;
const int old_tx = moves.tx + (skip_iter ? 500 : 0); // hmmm...hack
@@ -507,9 +510,18 @@ void direction(struct dist& moves, targeting_type restricts,
break;
#endif
describe_monsters(menv[mid].type, mid);
+ force_redraw = true;
+ redraw_screen();
+ mesclr(true);
+ break;
+
+ case CMD_TARGET_HELP:
+ show_targeting_help();
+ force_redraw = true;
redraw_screen();
mesclr(true);
break;
+
default:
break;
}
@@ -566,6 +578,9 @@ void direction(struct dist& moves, targeting_type restricts,
show_beam = show_beam &&
find_ray(you.x_pos, you.y_pos, moves.tx, moves.ty, true, ray);
}
+
+ if ( force_redraw )
+ have_moved = true;
if ( have_moved )
{
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index c9695b82bf..0d4abc977d 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -711,6 +711,7 @@ enum command_type
CMD_TARGET_FIND_DOWNSTAIR,
CMD_TARGET_FIND_YOU,
CMD_TARGET_DESCRIBE,
+ CMD_TARGET_HELP,
// [ds] Silently ignored, requests another round of input.
CMD_NEXT_CMD