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

nicer help for number dialogs

This commit is contained in:
Zeno Rogue
2025-09-09 16:56:47 +02:00
parent ab9d7a404f
commit dbebf13465
6 changed files with 68 additions and 35 deletions

View File

@@ -1383,38 +1383,62 @@ EX namespace dialog {
init("number dialog help");
dialog::addBreak(100);
dialog::addHelp(XLAT("You can enter formulas in this dialog."));
dialog::addBreak(100);
dialog::addHelp(XLAT("Functions available:"));
addHelp(available_functions());
dialog::addBreak(100);
dialog::addHelp(XLAT("Constants and variables available:"));
addHelp(available_constants());
if(ptr && ptr->animatable) {
dialog::addBreak(100);
dialog::addHelp(XLAT("Animations:"));
dialog::addHelp(XLAT("a..b -- animate linearly from a to b"));
dialog::addHelp(XLAT("a..b..|c..d -- animate from a to b, then from c to d"));
dialog::addHelp(XLAT("a../x..b../y -- change smoothly, x and y are derivatives"));
}
/* "Most parameters can be animated simply by using '..' in their editing dialog. "
"For example, the value of a parameter set to 0..1 will grow linearly from 0 to 1. "
"You can also use functions (e.g. cos(0..2*pi)) and refer to other parameters."
)); */
dialog::addBreak(150);
dialog::addItem("functions and constants", 'f');
dialog::add_action_push([] {
init("functions and constants");
dialog::addHelp(XLAT("Functions available:"));
addHelp(available_functions());
dialog::addBreak(100);
dialog::addHelp(XLAT("Constants available:"));
addHelp(available_constants());
dialog::addBreak(100);
dialog::addBack();
dialog::display();
});
dialog::addItem("variables", 'v');
dialog::add_action_push([] {
init("variables");
addHelp(available_variables());
dialog::addBreak(100);
dialog::addBack();
dialog::display();
});
#if CAP_ANIMATIONS
dialog::addBreak(50);
auto f = find_edit(!ptr ? nullptr : ptr->intval ? (void*) ptr->intval : (void*) ptr->editwhat);
if(f)
dialog::addHelp(XLAT("Parameter names, e.g. '%1'", f->name));
dialog::addItem(XLAT("parameter names, e.g. '%1'", f->name), 'p');
else
dialog::addHelp(XLAT("Parameter names"));
dialog::addBreak(50);
for(auto& ap: anims::aps) {
dialog::addInfo(ap.par->name + " = " + ap.formula);
}
dialog::addItem(XLAT("parameter names"), 'p');
dialog::add_action_push([] {
init("parameter names");
for(auto& ap: anims::aps) {
dialog::addInfo(ap.par->name + " = " + ap.formula);
}
dialog::addBreak(100);
dialog::addBack();
dialog::display();
});
#endif
dialog::addBreak(50);
if(ptr && ptr->animatable) {
dialog::addItem("animations", 'a');
dialog::add_action_push([] {
init("Animations:");
dialog::addHelp(XLAT("a..b -- animate linearly from a to b"));
dialog::addHelp(XLAT("a..b..|c..d -- animate from a to b, then from c to d"));
dialog::addHelp(XLAT("a../x..b../y -- change smoothly, x and y are derivatives"));
dialog::addBreak(100);
dialog::addBack();
dialog::display();
});
}
dialog::addBreak(150);
dialog::addHelp(XLAT("These can be combined, e.g. %1", "projection*sin(0..2*pi)"));
display();
}

View File

@@ -8833,8 +8833,8 @@ S("Animations:", "Animace:")
S("a..b -- animate linearly from a to b", "a..b -- animovat lineárně od a do b")
S("a..b..|c..d -- animate from a to b, then from c to d", "a..b..|c..d -- animovat od a do b, potom od c do d")
S("a../x..b../y -- change smoothly, x and y are derivatives", "a../x..b../y -- hladká změna; x a y jsou derivace")
S("Parameter names, e.g. '%1'", "Názvy parametrů, např. '%1'")
S("Parameter names", "Názvy parametrů")
S("parameter names, e.g. '%1'", "názvy parametrů, např. '%1'")
S("parameter names", "názvy parametrů")
S("These can be combined, e.g. %1", "Je možné je kombinovat, např. %1")
// manifolds

View File

@@ -8447,8 +8447,8 @@ S("Animations:", "Animations : ")
S("a..b -- animate linearly from a to b", "a..b -- anime linéairement de a à b")
S("a..b..|c..d -- animate from a to b, then from c to d", "a..b..|c..d -- anime de a à b, puis de c à d")
S("a../x..b../y -- change smoothly, x and y are derivatives", "a../x..b../y -- change doucement, x et y sont dérivées")
S("Parameter names, e.g. '%1'", "Noms des paramètres, par exemple '%1'")
S("Parameter names", "Noms des paramètres")
S("parameter names, e.g. '%1'", "noms des paramètres, par exemple '%1'")
S("parameter names", "noms des paramètres")
S("These can be combined, e.g. %1", "Ceux là peuvent être combinés, par exemple %1")
// manifolds

View File

@@ -8557,8 +8557,8 @@ S("Animations:", "Animacje:")
S("a..b -- animate linearly from a to b", "a..b -- animuj liniowo od a do b")
S("a..b..|c..d -- animate from a to b, then from c to d", "a..b..|c..d -- animuj od a do b, potem od c do d")
S("a../x..b../y -- change smoothly, x and y are derivatives", "a../x..b../y -- gładka zmiana, x i y to pochodne")
S("Parameter names, e.g. '%1'", "Nazwy parametrów, np. '%1'")
S("Parameter names", "Nazwy parametrów")
S("parameter names, e.g. '%1'", "nazwy parametrów, np. '%1'")
S("parameter names", "nazwy parametrów")
S("These can be combined, e.g. %1", "Można łączyć, np. %1")
// manifolds

View File

@@ -7734,8 +7734,8 @@ S("Animations:", "动态化:")
S("a..b -- animate linearly from a to b", "a..b——从a至b线性动态化")
S("a..b..|c..d -- animate from a to b, then from c to d", "a..b..|c..d——从a至b然后从c至d动态化")
S("a../x..b../y -- change smoothly, x and y are derivatives", "a../x..b../y——平滑改变x与y为导数")
S("Parameter names, e.g. '%1'", "参数名称,如“%1”")
S("Parameter names", "参数名称")
S("parameter names, e.g. '%1'", "参数名称,如“%1”")
S("parameter names", "参数名称")
S("These can be combined, e.g. %1", "这些可以互相结合,如%1")
// manifolds

View File

@@ -721,7 +721,16 @@ EX string available_functions() {
EX string available_constants() {
return
"e, i, pi, s, ms, mousex, mousey, mousez, shot [1 if taking screenshot/animation]";
"e, i, pi, tau, phi, deg [degree]";
}
EX string available_variables() {
return
"Keyboard and mouse:\n\n"
"mousex, mousey, mousez, lshift, rshift, lctrl, rctrl, capslock, numlock, scrolllock, holdmouse, random, mousexs, mouseys\n\n"
"Time:\n\n"
"s [seconds], ms [milliseconds], turncount, framecount, gametime\n\n"
"Other:\n\nshot [1 if taking screenshot/animation], illegal_moves";
}
#if HDR