mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 13:07:16 +00:00
Merge pull request #381 from jlmjlm/tabsd
Select the keyboard push-subdirection with Tab.
This commit is contained in:
commit
74dcd03ac6
@ -149,6 +149,7 @@ EX void movepckeydir(int d) {
|
|||||||
if(protect_memory()) return;
|
if(protect_memory()) return;
|
||||||
|
|
||||||
movedir md = vectodir(move_destination_vec(d));
|
movedir md = vectodir(move_destination_vec(d));
|
||||||
|
md.subdir = keybd_subdir ? 1 : -1;
|
||||||
|
|
||||||
if(!canmove) movepcto(md), remission(); else movepcto(md);
|
if(!canmove) movepcto(md), remission(); else movepcto(md);
|
||||||
}
|
}
|
||||||
@ -618,6 +619,10 @@ EX void handleKeyNormal(int sym, int uni) {
|
|||||||
else restart_game();
|
else restart_game();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sym == SDLK_TAB) {
|
||||||
|
keybd_subdir = !keybd_subdir;
|
||||||
|
}
|
||||||
|
|
||||||
if(sym == SDLK_ESCAPE) {
|
if(sym == SDLK_ESCAPE) {
|
||||||
if(bow::fire_mode)
|
if(bow::fire_mode)
|
||||||
bow::switch_fire_mode();
|
bow::switch_fire_mode();
|
||||||
|
@ -3597,8 +3597,9 @@ EX transmatrix applyDowndir(cell *c, const cellfunction& cf) {
|
|||||||
return ddspin180(c, patterns::downdir(c, cf));
|
return ddspin180(c, patterns::downdir(c, cf));
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_movement_arrows(cell *c, const transmatrix& V, int df) {
|
EX bool keybd_subdir;
|
||||||
|
|
||||||
|
void draw_movement_arrows(cell *c, const transmatrix& V, int df) {
|
||||||
if(viewdists) return;
|
if(viewdists) return;
|
||||||
|
|
||||||
string keylist = "";
|
string keylist = "";
|
||||||
@ -3628,8 +3629,8 @@ void draw_movement_arrows(cell *c, const transmatrix& V, int df) {
|
|||||||
|
|
||||||
if((c->type & 1) && (isStunnable(c->monst) || isPushable(c->wall))) {
|
if((c->type & 1) && (isStunnable(c->monst) || isPushable(c->wall))) {
|
||||||
transmatrix Centered = rgpushxto0(unshift(tC0(cwtV)));
|
transmatrix Centered = rgpushxto0(unshift(tC0(cwtV)));
|
||||||
int sd = md.subdir;
|
int sd = keybd_subdir ? 1 : -1;
|
||||||
|
|
||||||
transmatrix T = iso_inverse(Centered) * rgpushxto0(Centered * tC0(V)) * lrspintox(Centered*tC0(V)) * spin(-sd * M_PI/S7) * xpush(0.2);
|
transmatrix T = iso_inverse(Centered) * rgpushxto0(Centered * tC0(V)) * lrspintox(Centered*tC0(V)) * spin(-sd * M_PI/S7) * xpush(0.2);
|
||||||
|
|
||||||
if(vid.axes >= 5)
|
if(vid.axes >= 5)
|
||||||
|
4
help.cpp
4
help.cpp
@ -259,7 +259,7 @@ string pushtext(stringpar p) {
|
|||||||
"\n\nNote: when pushing %the1 off a heptagonal cell, you can control the pushing direction "
|
"\n\nNote: when pushing %the1 off a heptagonal cell, you can control the pushing direction "
|
||||||
"by clicking left or right half of the heptagon.", p);
|
"by clicking left or right half of the heptagon.", p);
|
||||||
#if !ISMOBILE
|
#if !ISMOBILE
|
||||||
s += XLAT(" With the keyboard, you can rotate the view for a similar effect (Page Up/Down).");
|
s += XLAT(" With the keyboard, you can press Tab to invert the way the pushing direction leans.");
|
||||||
#endif
|
#endif
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
@ -678,7 +678,7 @@ EX string generateHelpForMonster(eMonster m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s += XLAT(minf[m].help);
|
s += XLAT(minf[m].help);
|
||||||
if(m == moPalace || m == moSkeleton)
|
if(isStunnable(m))
|
||||||
s += pushtext(m);
|
s += pushtext(m);
|
||||||
if(m == moTroll) s += XLAT(trollhelp2);
|
if(m == moTroll) s += XLAT(trollhelp2);
|
||||||
|
|
||||||
|
@ -275,7 +275,8 @@ EX bool movepcto(int d, int subdir IS(1), bool checkonly IS(false)) {
|
|||||||
checked_move_issue.type = miVALID;
|
checked_move_issue.type = miVALID;
|
||||||
pcmove pcm;
|
pcmove pcm;
|
||||||
pcm.checkonly = checkonly;
|
pcm.checkonly = checkonly;
|
||||||
pcm.d = d; pcm.subdir = subdir;
|
pcm.d = d;
|
||||||
|
pcm.subdir = subdir;
|
||||||
auto b = pcm.movepcto();
|
auto b = pcm.movepcto();
|
||||||
global_pushto = pcm.mip.t;
|
global_pushto = pcm.mip.t;
|
||||||
return b;
|
return b;
|
||||||
@ -1855,4 +1856,4 @@ EX void movecost(cell* from, cell *to, int phase) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user