1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-30 03:50:34 +00:00

improved keyboard help screen

This commit is contained in:
Zeno Rogue 2020-04-19 22:54:40 +02:00
parent 286f378c41
commit 001f9c6cf3

View File

@ -26,19 +26,25 @@ struct help_extension {
EX vector<help_extension> help_extensions; EX vector<help_extension> help_extensions;
vector<string> extra_keys = { vector<string> quick_keys = {
"1 = orthogonal/Gans model", "1 = orthogonal/Gans model/FPP",
"2 = small Poincare model/stereographic projection", "2 = small Poincare model/stereographic projection/SPP",
"3 = big Poincare model/stereographic projection", "3 = big Poincare model/stereographic projection/TPP",
"4 = Klein model/gnomonic projection", "4 = Klein model/gnomonic projection",
"5 = change wall display mode", "5 = change wall display mode",
"6 = change grid", "6 = change grid",
"7 = change heptagon marking", "7 = change heptagon marking",
// "8 = change background color", "8 = monster display mode"
// "9 = hyperboloid model", };
vector<string> normal_keys = {
"qweasdzxc, hjklyubn, numpad = move/skip turn", "qweasdzxc, hjklyubn, numpad = move/skip turn",
"arrows = panning", "g = drop a Dead Orb",
"o = world overview", "t = use a ranged Orb (target center of the screen)"
};
vector<string> extra_keys = {
"o = world overview (or another meaning in special modes)",
"v = menu", "v = menu",
"F1 = help", "F1 = help",
"F5 = restart game", "F5 = restart game",
@ -46,22 +52,37 @@ vector<string> extra_keys = {
"Esc = quest status", "Esc = quest status",
"Alt+Enter = full screen", "Alt+Enter = full screen",
"Alt = highlight interesting stuff", "Alt = highlight interesting stuff",
"t = use a ranged Orb (target center of the screen)",
"g = drop a Dead Orb",
"click left mouse button = move/skip", "click left mouse button = move/skip",
"shift+click left mouse button = use ranged Orb", "[shift+]click left mouse button = use ranged Orb (depending on mouse settings)",
"click right mouse button = context help", "click right mouse button = context help",
"mousewheel up = panning", "mousewheel up = panning",
"hold middle mouse button = panning", "hold middle mouse button = panning",
"lctrl + hold middle button = move the screen",
"mousewheel down = move/skip", "mousewheel down = move/skip",
"shift + mousewheel = change projection", "rshift + mousewheel = change projection",
"ctrl + mousewheel = change zoom", "lshift + mousewheel = change zoom (lctrl to keep center)",
"ctrl + shift + mousewheel = change both projection and zoom", "lctrl + mousewheel = reset the map center",
"ctrl + hold middle button = move the screen",
"shift + middle button = reset position",
"shift + F2 = disable the HUD", "shift + F2 = disable the HUD",
"shift + F3 = disable the FPS", "shift + F3 = disable the FPS",
"shift + F4 = disable the map" "shift + F4 = disable the map",
"space = recenter",
"ctrl + <key> = more precision"
};
vector<string> extra_keys_2d = {
"arrows = panning",
"PageUp/Down = rotate the screen",
};
vector<string> extra_keys_3d = {
"arrows = rotate the camera",
"rshift+arrows = strafe",
"lshift+arrows = rotate the model (in rug mode)",
"end = move camera forward",
"home = move camera backward",
"PageUp/Down = rotate the screen",
"shift+PageUp/Down = zoom",
"move mouse = rotate camera (in rug, only with lctrl)",
}; };
void buildHelpText() { void buildHelpText() {
@ -173,7 +194,18 @@ void buildHelpText() {
#if ISMOBILE == 0 #if ISMOBILE == 0
help_extensions.push_back(help_extension{'k', XLAT("advanced keyboard shortcuts"), [] () { help_extensions.push_back(help_extension{'k', XLAT("advanced keyboard shortcuts"), [] () {
help = ""; help = "";
for(string s: extra_keys) help += s, help += "\n\n"; for(string s: normal_keys) help += s, help += "\n";
for(string s: extra_keys) help += s, help += "\n";
help += "\n\nQuick keys:\n";
for(string s: quick_keys) help += s, help += "\n";
if(GDIM == 3 || rug::rugged) {
help += "\n\nIn 3D modes:\n";
for(string s: extra_keys_3d) help += s, help += "\n";
}
else {
help += "\n\nIn 2D modes:\n";
for(string s: extra_keys_2d) help += s, help += "\n";
}
}}); }});
#endif #endif
} }
@ -1030,6 +1062,13 @@ EX void gotoHelp(const string& h) {
#if CAP_RUG #if CAP_RUG
if(rug::rugged) { if(rug::rugged) {
help = rug::makehelp(); help = rug::makehelp();
help += "\n\n";
for(string s: extra_keys_3d) help += s, help += "\n";
help += "\n\n";
help_extensions.push_back(help_extension{'m', XLAT("Hypersian Rug menu"), [] () { popScreen(); rug::select(); }}); help_extensions.push_back(help_extension{'m', XLAT("Hypersian Rug menu"), [] () { popScreen(); rug::select(); }});
help_extensions.push_back(help_extension{'h', XLAT("HyperRogue help"), [] () { buildHelpText(); }}); help_extensions.push_back(help_extension{'h', XLAT("HyperRogue help"), [] () { buildHelpText(); }});
return; return;