mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-09-22 02:58:41 +00:00
further improved Deck controls
This commit is contained in:
+2
-2
@@ -1099,7 +1099,7 @@ EX void initConfig() {
|
|||||||
defaultjoy = false;
|
defaultjoy = false;
|
||||||
dialog::onscreen_keyboard = true;
|
dialog::onscreen_keyboard = true;
|
||||||
dialog::dialog_font_scale = 3;
|
dialog::dialog_font_scale = 3;
|
||||||
dialog::display_keys = 0;
|
dialog::display_keys = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1223,7 +1223,7 @@ EX void initConfig() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
param_enum(dialog::display_keys, "dialog_display_keys")
|
param_enum(dialog::display_keys, "dialog_display_keys")
|
||||||
->editable({{"never", ""}, {"when using keyboard", ""}, {"always", ""}}, "display keys in dialogs", 'K');
|
->editable({{"never", ""}, {"when using keyboard", ""}, {"always", ""}, {"SteamDeck controls", ""}}, "display keys in dialogs", 'K');
|
||||||
|
|
||||||
param_enum(vid.faraway_highlight, parameter_names("faraway_highlight", "highlight faraway monsters"), tlNoThreat)
|
param_enum(vid.faraway_highlight, parameter_names("faraway_highlight", "highlight faraway monsters"), tlNoThreat)
|
||||||
->editable({{"off", ""}, {"spam", ""}, {"normal monsters", ""}, {"high-threat monsters only", ""}}, "highlight faraway monsters", 'h');
|
->editable({{"off", ""}, {"spam", ""}, {"normal monsters", ""}, {"high-threat monsters only", ""}}, "highlight faraway monsters", 'h');
|
||||||
|
|||||||
+1
-1
@@ -623,7 +623,7 @@ EX void handleKeyNormal(int sym, int uni) {
|
|||||||
sym = 0; uni = 0;
|
sym = 0; uni = 0;
|
||||||
}
|
}
|
||||||
if(sym == 'f') bow::switch_fire_mode();
|
if(sym == 'f') bow::switch_fire_mode();
|
||||||
if(sym == SDLK_RETURN) {
|
if(sym == '`') {
|
||||||
flashMessages();
|
flashMessages();
|
||||||
movepcto(joydir);
|
movepcto(joydir);
|
||||||
joy_ignore_next = true;
|
joy_ignore_next = true;
|
||||||
|
|||||||
+2
-2
@@ -716,7 +716,7 @@ EX namespace dialog {
|
|||||||
EX int display_keys = 1;
|
EX int display_keys = 1;
|
||||||
|
|
||||||
EX bool actual_display_keys() {
|
EX bool actual_display_keys() {
|
||||||
if(display_keys > 1) return true;
|
if(display_keys == 2) return true;
|
||||||
if(display_keys == 1) return !mousing;
|
if(display_keys == 1) return !mousing;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -981,7 +981,7 @@ EX namespace dialog {
|
|||||||
highlight_text = "//missing";
|
highlight_text = "//missing";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(uni == '\n' || uni == '\r' || DIRECTIONKEY == SDLK_KP5) {
|
if(uni == '\n' || uni == '\r' || DIRECTIONKEY == SDLK_KP5 || uni == '`') {
|
||||||
for(int i=0; i<isize(items); i++)
|
for(int i=0; i<isize(items); i++)
|
||||||
if(isitem(items[i]))
|
if(isitem(items[i]))
|
||||||
if(is_highlight(items[i])) {
|
if(is_highlight(items[i])) {
|
||||||
|
|||||||
@@ -169,6 +169,14 @@ EX void buildHelpText() {
|
|||||||
"numbers displayed to get their meanings.\n"
|
"numbers displayed to get their meanings.\n"
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
|
if(DEFAULTCONTROL && dialog::display_keys == 3)
|
||||||
|
help += XLAT(
|
||||||
|
"To move, aim with the left joystick then press A. Press B for menu, X for keyboard, Y to center. R1 to highlight important things on the map.\n\n"
|
||||||
|
"For ranged attacks, use the DPad to aim, then push the left joystick to target an orb or the right joystick to target a ranged weapon. "
|
||||||
|
"Alternatively, you can also use the right trackpad.\n\n"
|
||||||
|
"Press L5 to drop a dead orb. R4/R5 to rotate the screen.\n\n"
|
||||||
|
);
|
||||||
|
else
|
||||||
if(DEFAULTCONTROL && !game_keys_scroll)
|
if(DEFAULTCONTROL && !game_keys_scroll)
|
||||||
help += XLAT(
|
help += XLAT(
|
||||||
"Move with mouse, num pad, qweadzxc, or hjklyubn. Wait by pressing 's' or '.'. Spin the world with arrows, PageUp/Down, and Space. "
|
"Move with mouse, num pad, qweadzxc, or hjklyubn. Wait by pressing 's' or '.'. Spin the world with arrows, PageUp/Down, and Space. "
|
||||||
|
|||||||
@@ -661,6 +661,10 @@ EX void handleKeyQuit(int sym, int uni) {
|
|||||||
scores::load();
|
scores::load();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CAP_TOUR
|
||||||
|
else if(tour::on && tour::handleKeyTour(sym, uni)) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
else if(doexiton(sym, uni) && !didsomething) {
|
else if(doexiton(sym, uni) && !didsomething) {
|
||||||
popScreen();
|
popScreen();
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ static constexpr flagtype NOTITLE = 256;
|
|||||||
static constexpr flagtype ALWAYS_TEXT = 256;
|
static constexpr flagtype ALWAYS_TEXT = 256;
|
||||||
/** \brief add a sidescreen to a normal screen */
|
/** \brief add a sidescreen to a normal screen */
|
||||||
static constexpr flagtype SIDE = 512;
|
static constexpr flagtype SIDE = 512;
|
||||||
|
/** \brief deck controls */
|
||||||
|
static constexpr flagtype DECK_CONTROLS = 1024;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EX vector<reaction_t> restorers;
|
EX vector<reaction_t> restorers;
|
||||||
@@ -226,11 +228,18 @@ string get_subname(const string& s, const string& folder) {
|
|||||||
EX void slidehelp() {
|
EX void slidehelp() {
|
||||||
if(!slides[currentslide].help[0]) return;
|
if(!slides[currentslide].help[0]) return;
|
||||||
string slidename = get_slidename(slides[currentslide].name);
|
string slidename = get_slidename(slides[currentslide].name);
|
||||||
gotoHelp(
|
|
||||||
help =
|
help =
|
||||||
helptitle(XLAT(slidename), 0xFF8000) +
|
helptitle(XLAT(slidename), 0xFF8000) +
|
||||||
XLAT(slides[currentslide].help)
|
XLAT(slides[currentslide].help);
|
||||||
);
|
|
||||||
|
if(dialog::display_keys == 3 && slides[currentslide].flags & DECK_CONTROLS)
|
||||||
|
help += "\n\n" + XLAT(
|
||||||
|
"This tour typically displays keys on the keyboard. "
|
||||||
|
"On the SteamDeck, you can press the Menu button to move to the next slide, "
|
||||||
|
"or the B button to see a menu with other options.");
|
||||||
|
|
||||||
|
gotoHelp(help);
|
||||||
presentation(pmHelpEx);
|
presentation(pmHelpEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,7 +281,7 @@ EX bool next_slide() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handleKeyTour(int sym, int uni) {
|
EX bool handleKeyTour(int sym, int uni) {
|
||||||
if(!tour::on) return false;
|
if(!tour::on) return false;
|
||||||
if(!(cmode & sm::DOTOUR)) return false;
|
if(!(cmode & sm::DOTOUR)) return false;
|
||||||
bool inhelp = cmode & sm::HELP;
|
bool inhelp = cmode & sm::HELP;
|
||||||
@@ -636,7 +645,7 @@ EX slide default_slides[] = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
{"Introduction", 10, LEGAL::NONE | QUICKSKIP,
|
{"Introduction", 10, LEGAL::NONE | QUICKSKIP | DECK_CONTROLS,
|
||||||
"This tour is mostly aimed to show what is "
|
"This tour is mostly aimed to show what is "
|
||||||
"special about the geometry used by HyperRogue. "
|
"special about the geometry used by HyperRogue. "
|
||||||
"It also shows the basics of gameplay, and "
|
"It also shows the basics of gameplay, and "
|
||||||
|
|||||||
Reference in New Issue
Block a user