1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

CLI option -geo recognizes menu_displayed_names

This commit is contained in:
Zeno Rogue 2019-03-06 16:32:38 +01:00
parent 845c777cd6
commit 76f3df1320

View File

@ -763,6 +763,18 @@ void runGeometryExperiments() {
} }
#if CAP_COMMANDLINE #if CAP_COMMANDLINE
eGeometry readGeo(const string& ss) {
bool numeric = true;
for(char c: ss) if(c < '0' || c > '9') numeric = false;
if(numeric) return eGeometry(atoi(ss.c_str()));
for(int i=0; i<isize(ginf); i++) if(appears(ginf[i].menu_displayed_name, ss)) {
return eGeometry(i);
break;
}
return gNormal;
}
int read_geom_args() { int read_geom_args() {
using namespace arg; using namespace arg;
if(0) ; if(0) ;
@ -824,7 +836,7 @@ int read_geom_args() {
else if(argis("-geo")) { else if(argis("-geo")) {
PHASEFROM(2); PHASEFROM(2);
shift(); shift();
set_geometry((eGeometry) argi()); set_geometry(readGeo(args()));
} }
#if CAP_GP #if CAP_GP
else if(argis("-gp")) { else if(argis("-gp")) {