1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-18 11:19:59 +00:00

help for formula parser

This commit is contained in:
Zeno Rogue 2018-11-07 01:03:27 +01:00
parent 077c7657b8
commit d1f6b1fff3
3 changed files with 12 additions and 1 deletions

View File

@ -626,7 +626,13 @@ namespace conformal {
dialog::add_action([m] () {
if(m == mdFormula) {
if(pmodel != m) basic_model = pmodel;
dialog::edit_string(formula, "formula", "");
dialog::edit_string(formula, "formula",
XLAT(
"This lets you specify the projection as a formula f. "
"The formula has access to the value 'z', which is a complex number corresponding to the x,y coordinates in the currently selected model; "
"the point z is mapped to f(z). For 3D models (or 2D models if you prefer) you can also use parameters cx, cy, cz."
) + "\n\n" + parser_help()
);
dialog::reaction_final = [] () {
pmodel = mdFormula;
};

View File

@ -4321,5 +4321,6 @@ bool in_smart_range(const transmatrix& T);
void curvepoint(const hyperpoint& H1);
dqi_poly& queuecurve(color_t linecol, color_t fillcol, PPR prio);
string parser_help();
}

View File

@ -223,4 +223,8 @@ ld parseld(const string& s) {
return real(ep.parse());
}
string parser_help() {
return XLAT("Functions available: %1",
"(a)sin(h), (a)cos(h), (a)tan(h), exp, log, abs, re, im, conj, let(t=...,...t...), e, i, pi");
}
}