1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-19 20:38:09 +00:00

further improved Deck controls

This commit is contained in:
Zeno Rogue
2025-11-11 22:02:43 +01:00
parent e4269a8fda
commit e4d52d23d1
6 changed files with 33 additions and 12 deletions

View File

@@ -1099,7 +1099,7 @@ EX void initConfig() {
defaultjoy = false;
dialog::onscreen_keyboard = true;
dialog::dialog_font_scale = 3;
dialog::display_keys = 0;
dialog::display_keys = 3;
}
}
}
@@ -1223,7 +1223,7 @@ EX void initConfig() {
#endif
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)
->editable({{"off", ""}, {"spam", ""}, {"normal monsters", ""}, {"high-threat monsters only", ""}}, "highlight faraway monsters", 'h');

View File

@@ -623,7 +623,7 @@ EX void handleKeyNormal(int sym, int uni) {
sym = 0; uni = 0;
}
if(sym == 'f') bow::switch_fire_mode();
if(sym == SDLK_RETURN) {
if(sym == '`') {
flashMessages();
movepcto(joydir);
joy_ignore_next = true;

View File

@@ -716,7 +716,7 @@ EX namespace dialog {
EX int display_keys = 1;
EX bool actual_display_keys() {
if(display_keys > 1) return true;
if(display_keys == 2) return true;
if(display_keys == 1) return !mousing;
return false;
}
@@ -981,7 +981,7 @@ EX namespace dialog {
highlight_text = "//missing";
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++)
if(isitem(items[i]))
if(is_highlight(items[i])) {

View File

@@ -169,6 +169,14 @@ EX void buildHelpText() {
"numbers displayed to get their meanings.\n"
);
#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)
help += XLAT(
"Move with mouse, num pad, qweadzxc, or hjklyubn. Wait by pressing 's' or '.'. Spin the world with arrows, PageUp/Down, and Space. "

View File

@@ -662,6 +662,10 @@ EX void handleKeyQuit(int sym, int uni) {
}
#endif
#if CAP_TOUR
else if(tour::on && tour::handleKeyTour(sym, uni)) ;
#endif
else if(doexiton(sym, uni) && !didsomething) {
popScreen();
msgs.clear();

View File

@@ -78,6 +78,8 @@ static constexpr flagtype NOTITLE = 256;
static constexpr flagtype ALWAYS_TEXT = 256;
/** \brief add a sidescreen to a normal screen */
static constexpr flagtype SIDE = 512;
/** \brief deck controls */
static constexpr flagtype DECK_CONTROLS = 1024;
#endif
EX vector<reaction_t> restorers;
@@ -226,11 +228,18 @@ string get_subname(const string& s, const string& folder) {
EX void slidehelp() {
if(!slides[currentslide].help[0]) return;
string slidename = get_slidename(slides[currentslide].name);
gotoHelp(
help =
helptitle(XLAT(slidename), 0xFF8000) +
XLAT(slides[currentslide].help)
);
help =
helptitle(XLAT(slidename), 0xFF8000) +
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);
}
@@ -272,7 +281,7 @@ EX bool next_slide() {
return true;
}
bool handleKeyTour(int sym, int uni) {
EX bool handleKeyTour(int sym, int uni) {
if(!tour::on) return false;
if(!(cmode & sm::DOTOUR)) return false;
bool inhelp = cmode & sm::HELP;
@@ -636,7 +645,7 @@ EX slide default_slides[] = {
}
},
#endif
{"Introduction", 10, LEGAL::NONE | QUICKSKIP,
{"Introduction", 10, LEGAL::NONE | QUICKSKIP | DECK_CONTROLS,
"This tour is mostly aimed to show what is "
"special about the geometry used by HyperRogue. "
"It also shows the basics of gameplay, and "