From 14ed4b7603946ab099a501887969f9809f9cf61c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 27 Mar 2022 19:12:10 +0200 Subject: [PATCH] display a hint when player hidden --- control.cpp | 3 +++ graph.cpp | 3 +++ intra.cpp | 3 +-- sysconfig.h | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/control.cpp b/control.cpp index d859792b..96c91cc9 100644 --- a/control.cpp +++ b/control.cpp @@ -597,6 +597,9 @@ EX void handleKeyNormal(int sym, int uni) { if(sym == PSEUDOKEY_MENU) pushScreen(showMainMenu); + if(sym == PSEUDOKEY_NOHINT) + no_find_player = true; + if(sym == '-' || sym == PSEUDOKEY_WHEELDOWN) { actonrelease = false; diff --git a/graph.cpp b/graph.cpp index 38557afd..89f589a6 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5427,6 +5427,9 @@ EX void normalscreen() { if(!playerfound && !anims::any_on() && !sphere && !no_find_player && mapeditor::drawplayer) displayButton(current_display->xcenter, current_display->ycenter, mousing ? XLAT("find the player") : XLAT("press SPACE to find the player"), ' ', 8); + if(!mapeditor::drawplayer && playermoved && !no_find_player) + displayButton(current_display->xcenter, current_display->ycenter, XLAT("move the camera with arrow keys and Home/End"), PSEUDOKEY_NOHINT, 8); + describeMouseover(); } diff --git a/intra.cpp b/intra.cpp index 9215ab43..8578d278 100644 --- a/intra.cpp +++ b/intra.cpp @@ -841,7 +841,7 @@ EX bool isFloor(cell *c) { } EX void handle() { - if(!on) return; + if(playermoved || !on) return; if(floor_dir == -1 || on_floor_of != centerover) { vector choices; @@ -977,7 +977,6 @@ EX void handle() { smooth(up, inverse(T) * direct_exp(dx / hypot_d(3, dx) * (eye_level + view_eps))) ); if(use_T) rotate_view(inverse(spin_T)); - playermoved = false; auto nat = tC0(inverse(View)); if(invalid_point(nat)) { diff --git a/sysconfig.h b/sysconfig.h index 0d9a8bf6..dac829aa 100644 --- a/sysconfig.h +++ b/sysconfig.h @@ -242,6 +242,7 @@ #define PSEUDOKEY_RELEASE 2503 #define PSEUDOKEY_EXIT 2504 #define PSEUDOKEY_MENU 2505 +#define PSEUDOKEY_NOHINT 2506 #ifndef CAP_PNG #define CAP_PNG (!ISMOBWEB)