diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-28 20:58:32 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-28 20:58:32 +0000 |
commit | 0f8c8527e5a685509462e0990a7b6ec6595e445a (patch) | |
tree | b1a13e1c22e1823a6e0ef688995970e71c75dacb | |
parent | 07302a78473785135251a28e5ac6c3bb6508ca78 (diff) | |
download | crawl-ref-0f8c8527e5a685509462e0990a7b6ec6595e445a.tar.gz crawl-ref-0f8c8527e5a685509462e0990a7b6ec6595e445a.zip |
Trunk->0.4 r6707: Fix HUD updates overwriting dgl message indicator, changed indicator from (msg) to (Hit _).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6708 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/acr.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/output.cc | 14 |
2 files changed, 19 insertions, 6 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 0f53e43075..ab1102eb24 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1370,6 +1370,12 @@ static bool _cmd_is_repeatable(command_type cmd, bool is_again = false) // Used to determine whether to apply the berserk penalty at end of round. bool apply_berserk_penalty = false; +static void _center_cursor() +{ + const coord_def cwhere = grid2view(you.pos()); + cgotoxy(cwhere.x, cwhere.y); +} + // // This function handles the player's input. It's called from main(), // from inside an endless loop. @@ -1473,8 +1479,7 @@ static void _input() handle_delay(); - const coord_def cwhere = grid2view(you.pos()); - cgotoxy(cwhere.x, cwhere.y); + _center_cursor(); if (you_are_delayed()) { @@ -3369,6 +3374,8 @@ static void _check_messages() { _announce_messages(); update_message_status(); + // Recenter the cursor on the player. + _center_cursor(); } } #endif diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 059ef8c7d6..1f3568775c 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -203,13 +203,17 @@ static int _dur_colour( int running_out_color, bool running_out ) #ifdef DGL_SIMPLE_MESSAGING void update_message_status() { + static const char *msg = "(Hit _)"; + static const int len = strlen(msg); + static const std::string spc(len, ' '); + textcolor(LIGHTBLUE); - cgotoxy(36, 1, GOTO_STAT); + cgotoxy(crawl_view.hudsz.x - len + 1, 1, GOTO_STAT); if (SysEnv.have_messages) - cprintf("(msg)"); + cprintf(msg); else - cprintf(" "); + cprintf(spc.c_str()); textcolor(LIGHTGREY); } #endif @@ -959,7 +963,9 @@ void redraw_skill(const std::string &your_name, const std::string &class_name) cgotoxy(1 + crawl_view.hudsz.x-9, 1, GOTO_STAT); cprintf(" *WIZARD*"); } - clear_to_end_of_line(); +#ifdef DGL_SIMPLE_MESSAGING + update_message_status(); +#endif // Line 2: // Level N Minotaur [of God] |