improvements to the mobile compass: can be used in modes other than MOVE (long click to switch mode to MOVE anyway); better arrow scaling

This commit is contained in:
Zeno Rogue 2018-07-22 15:54:44 +02:00
parent 5b41f5d157
commit b502b7025d
5 changed files with 9 additions and 8 deletions

View File

@ -878,8 +878,8 @@ void gmodekeys(int sym, int uni) {
}
bool haveMobileCompass() {
#if CAP_MOBILE
if(andmode || useRangedOrb) return false;
#if ISMOBILE
if(longclick) return false;
#else
if(forcetarget) return false;
#endif

View File

@ -5522,10 +5522,6 @@ void drawfullmap() {
profile_stop(2);
}
#ifdef ISMOBILE
int andmode;
#endif
void gamescreen(int _darken) {
if(ISMOBILE && (cmode & sm::SIDE)) {
@ -5566,7 +5562,7 @@ void gamescreen(int _darken) {
drawCircle(xfire, yb, rad/2, 0xFF0000FF);
}
else {
if(andmode != 0) displayabutton(-1, +1, XLAT("MOVE"), andmode == 0 ? BTON : BTOFF);
if(!haveMobileCompass()) displayabutton(-1, +1, XLAT(andmode == 0 && useRangedOrb ? "FIRE" : "MOVE"), andmode == 0 ? BTON : BTOFF);
displayabutton(+1, +1, rug::rugged ? "RUG" : XLAT(andmode == 1 ? "BACK" : "DRAG"), andmode == 1 ? BTON : BTOFF);
}
displayabutton(-1, -1, XLAT("INFO"), andmode == 12 ? BTON : BTOFF);

View File

@ -317,7 +317,7 @@ void drawMobileArrow(cell *c, transmatrix V) {
poly_outline = OUTLINE_DEFAULT;
// transmatrix m2 = Id;
ld scale = vid.mobilecompasssize * 7;
ld scale = vid.mobilecompasssize * 5;
// m2[0][0] = scale; m2[1][1] = scale; m2[2][2] = 1;
transmatrix Centered = rgpushxto0(tC0(cwtV * sphereflip));

View File

@ -1478,6 +1478,7 @@ extern bool timerghost;
#define displayfrZH dialog::zoom::displayfr_highlight
#else
#define displayfrZ displayfr
#define displayfrZH dialog::zoom::displayfr_highlight
#endif
namespace dialog {
@ -2225,6 +2226,8 @@ int gl_width(int size, const char *s);
#ifdef ISMOBILE
extern int andmode;
extern bool longclick;
extern bool useRangedOrb;
#endif
void addaura(const hyperpoint& h, int col, int fd);

View File

@ -109,6 +109,8 @@ string buildScoreDescription() {
#if ISMOBILE==1
int andmode;
bool lclicked = false, clicked = false;
string lmouseovers;
bool inmenu = false;