From 17c673c46bf3ad203eba73f9818933e307ded6d3 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 23 Jul 2009 20:30:37 +0000 Subject: Apply my previous two commits to trunk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10390 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cio.cc | 7 +++++++ crawl-ref/source/macro.cc | 26 ++++++++++---------------- crawl-ref/source/spl-cast.cc | 5 ++--- crawl-ref/source/tilepick.cc | 2 +- crawl-ref/source/view.cc | 3 ++- 5 files changed, 22 insertions(+), 21 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc index f657204f88..b9ff80c25f 100644 --- a/crawl-ref/source/cio.cc +++ b/crawl-ref/source/cio.cc @@ -22,6 +22,13 @@ extern int unixcurses_get_vi_key(int keyin); static keycode_type _numpad2vi(keycode_type key) { + switch(key) + { + case CK_UP: key = 'k'; break; + case CK_DOWN: key = 'j'; break; + case CK_LEFT: key = 'h'; break; + case CK_RIGHT: key = 'l'; break; + } if (key >= '1' && key <= '9') { const char *vikeys = "bjnh.lyku"; diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 61070cf855..44f4c8b7a3 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -11,8 +11,8 @@ * - For generic game code, #define getch() getchm(). * - getchm() works by reading characters from an internal * buffer. If none are available, new characters are read into - * the buffer with getch_mul(). - * - getch_mul() reads at least one character, but will read more + * the buffer with _getch_mul(). + * - _getch_mul() reads at least one character, but will read more * if available (determined using kbhit(), which should be defined * in the platform specific libraries). * - Before adding the characters read into the buffer, any macros @@ -624,7 +624,7 @@ void macro_save() * Reads as many keypresses as are available (waiting for at least one), * and returns them as a single keyseq. */ -static keyseq getch_mul( int (*rgetch)() = NULL ) +static keyseq _getch_mul( int (*rgetch)() = NULL ) { keyseq keys; int a; @@ -633,7 +633,7 @@ static keyseq getch_mul( int (*rgetch)() = NULL ) // get new keys from the user. if (crawl_state.is_replaying_keys()) { - mpr("(Key replay ran out of keys)"); + mpr("(Key replay ran out of keys)", MSGCH_ERROR); crawl_state.cancel_cmd_repeat(); crawl_state.cancel_cmd_again(); } @@ -646,9 +646,7 @@ static keyseq getch_mul( int (*rgetch)() = NULL ) // The a == 0 test is legacy code that I don't dare to remove. I // have a vague recollection of it being a kludge for conio support. while (kbhit() || a == 0) - { keys.push_back( a = rgetch() ); - } return (keys); } @@ -672,7 +670,7 @@ int getchm(KeymapContext mc, int (*rgetch)()) return (a); // Read some keys... - keyseq keys = getch_mul(rgetch); + keyseq keys = _getch_mul(rgetch); if (mc == KMC_NONE) macro_buf_add(keys); else @@ -690,7 +688,7 @@ int getch_with_command_macros( void ) if (Buffer.size() == 0) { // Read some keys... - keyseq keys = getch_mul(); + keyseq keys = _getch_mul(); // ... and add them into the buffer (apply keymaps) macro_buf_add_long( keys ); @@ -805,7 +803,7 @@ void macro_add_query( void ) keyseq key; mouse_control mc(MOUSE_MODE_MACRO); - key = getch_mul(); + key = _getch_mul(); cprintf( "%s" EOL, (vtostr( key )).c_str() ); // echo key to screen @@ -832,22 +830,18 @@ void macro_add_query( void ) mpr( "Input Macro Action: ", MSGCH_PROMPT ); - // Using getch_mul() here isn't very useful... We'd like the + // Using _getch_mul() here isn't very useful... We'd like the // flexibility to define multicharacter macros without having // to resort to editing files and restarting the game. -- bwr - // keyseq act = getch_mul(); + // keyseq act = _getch_mul(); char buff[4096]; get_input_line(buff, sizeof buff); if (Options.macro_meta_entry) - { macro_add( mapref, key, parse_keyseq(buff) ); - } else - { macro_add( mapref, key, buff ); - } redraw_screen(); } @@ -1039,7 +1033,7 @@ void init_keybindings() int i; for (i = 0; _command_name_list[i].cmd != CMD_NO_CMD - && _command_name_list[i].name != NULL; i++) + && _command_name_list[i].name != NULL; i++) { command_name &data = _command_name_list[i]; diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 2735db6f9a..8dfbd94993 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2352,9 +2352,8 @@ std::string spell_range_string(spell_type spell) return "N/A"; else { - return std::string("@") + std::string(range, '.') - + "" + std::string(maxrange - range, '.') - + ""; + return std::string("@") + std::string(range - 1, '-') + + std::string(">") + std::string(maxrange - range, '.'); } } diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index ea9afe434c..0fc0ce24e8 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -2666,7 +2666,7 @@ void tileidx_unseen(unsigned int &fg, unsigned int &bg, int ch, case '[': case ']': fg = TILE_UNSEEN_ARMOUR; break; case '\\': fg = TILE_STAFF_OFFSET; break; - case '^': bg = TILE_DNGN_TRAP_ZOT; break; + case '^': bg = TILE_DNGN_TRAP_ARROW; break; case '_': case 220: case 131: fg = TILE_UNSEEN_ALTAR; break; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 77ab5a2618..007f76a9ea 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3930,7 +3930,8 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, clear_envmap_grid(*ri); #ifdef USE_TILE - if (!wizard_map && is_terrain_known(*ri)) + if (!wizard_map && is_terrain_known(*ri) + && !(env.map(*ri).flags & MAP_MAGIC_MAPPED_FLAG)) { // Can't use set_envmap_obj because that would // overwrite the gmap. -- cgit v1.2.3-54-g00ecf