mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-15 11:45:48 +00:00
made keybd_subdir optional
This commit is contained in:
parent
74dcd03ac6
commit
f46d551f13
@ -1176,6 +1176,8 @@ EX void initConfig() {
|
||||
param_i(vid.faraway_highlight_color, "faraway_highlight_color", 50)
|
||||
-> editable(0, 100, 10, "faraway highlight color", "0 = monster color, 100 = red-light oscillation", 'c');
|
||||
|
||||
param_b(keybd_subdir_enabled, "keybd_subdir_enabled", 0)->editable("control the pushing direction with TAB", 'P')->help("If set, you control the off-hepetagon pushing direction with TAB. Otherwise, you control it by rotating the screen.");
|
||||
|
||||
param_enum(glyphsortorder, parameter_names("glyph_sort", "glyph sort order"), glyphsortorder)
|
||||
->editable({
|
||||
{"first on top", ""},
|
||||
|
@ -142,6 +142,9 @@ EX hyperpoint move_destination_vec(int d) {
|
||||
else return cspin(0, 2, d * 45._deg) * smalltangent();
|
||||
}
|
||||
|
||||
EX int keybd_subdir = 1;
|
||||
EX bool keybd_subdir_enabled = 0;
|
||||
|
||||
EX void movepckeydir(int d) {
|
||||
DEBB(DF_GRAPH, ("movepckeydir\n"));
|
||||
// EUCLIDEAN
|
||||
@ -149,7 +152,7 @@ EX void movepckeydir(int d) {
|
||||
if(protect_memory()) return;
|
||||
|
||||
movedir md = vectodir(move_destination_vec(d));
|
||||
md.subdir = keybd_subdir ? 1 : -1;
|
||||
if(keybd_subdir_enabled) md.subdir = keybd_subdir;
|
||||
|
||||
if(!canmove) movepcto(md), remission(); else movepcto(md);
|
||||
}
|
||||
@ -620,7 +623,8 @@ EX void handleKeyNormal(int sym, int uni) {
|
||||
}
|
||||
|
||||
if(sym == SDLK_TAB) {
|
||||
keybd_subdir = !keybd_subdir;
|
||||
keybd_subdir_enabled = !anyshiftclick;
|
||||
keybd_subdir *= -1;
|
||||
}
|
||||
|
||||
if(sym == SDLK_ESCAPE) {
|
||||
|
@ -3597,9 +3597,8 @@ EX transmatrix applyDowndir(cell *c, const cellfunction& cf) {
|
||||
return ddspin180(c, patterns::downdir(c, cf));
|
||||
}
|
||||
|
||||
EX bool keybd_subdir;
|
||||
|
||||
void draw_movement_arrows(cell *c, const transmatrix& V, int df) {
|
||||
|
||||
if(viewdists) return;
|
||||
|
||||
string keylist = "";
|
||||
@ -3629,7 +3628,8 @@ void draw_movement_arrows(cell *c, const transmatrix& V, int df) {
|
||||
|
||||
if((c->type & 1) && (isStunnable(c->monst) || isPushable(c->wall))) {
|
||||
transmatrix Centered = rgpushxto0(unshift(tC0(cwtV)));
|
||||
int sd = keybd_subdir ? 1 : -1;
|
||||
int sd = md.subdir;
|
||||
if(keybd_subdir_enabled) sd = keybd_subdir;
|
||||
|
||||
transmatrix T = iso_inverse(Centered) * rgpushxto0(Centered * tC0(V)) * lrspintox(Centered*tC0(V)) * spin(-sd * M_PI/S7) * xpush(0.2);
|
||||
|
||||
|
2
help.cpp
2
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 "
|
||||
"by clicking left or right half of the heptagon.", p);
|
||||
#if !ISMOBILE
|
||||
s += XLAT(" With the keyboard, you can press Tab to invert the way the pushing direction leans.");
|
||||
s += XLAT(" With the keyboard, you can press Tab to invert the way the pushing direction leans, or Shift+Tab to decide based on how the view is rotated.");
|
||||
#endif
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user