1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

reg3:: the new variations can be selected from the menu

This commit is contained in:
Zeno Rogue 2021-07-09 14:01:55 +02:00
parent f300d0f8e9
commit 479b2eaf3c
4 changed files with 85 additions and 4 deletions

View File

@ -630,7 +630,7 @@ EX void select_quotient() {
EX string full_geometry_name() {
string qstring = ginf[geometry].quotient_name;
bool variable =
!(prod || hybri || bt::in() || WDIM == 3 || kite::in() || arb::in());
!(prod || hybri || bt::in() || (WDIM == 3 && !reg3::in()) || kite::in() || arb::in());
string fgname = XLAT(ginf[geometry].tiling_name);
if(qstring != "none") fgname += " " + XLAT(qstring);
@ -644,6 +644,9 @@ void action_change_variation() {
#if CAP_ARCM
else if(arcm::in()) arcm::next_variation();
#endif
#if MAXMDIM >= 4
else if(reg3::in()) reg3::configure_variation();
#endif
else if(euc::in(2,4) || !CAP_GP) dialog::do_if_confirmed([] {
set_variation(PURE ? eVariation::bitruncated : eVariation::pure);
start_game();
@ -968,7 +971,7 @@ EX void showEuclideanMenu() {
else if(nil) {
menuitem_nilwidth('v');
}
else if(WDIM == 3 || kite::in() || arb::in()) dialog::addBreak(100);
else if((WDIM == 3 || kite::in() || arb::in()) && !reg3::in()) dialog::addBreak(100);
else
menuitem_change_variation('v');

View File

@ -1079,7 +1079,13 @@ EX namespace gp {
else if(GOLDBERG && param == loc(3, 0) && S3 == 3)
return XLAT("2x bitruncated");
else if(variation == eVariation::subcubes)
return XLAT("subcube") + "(" + its(reg3::subcube_count) + ")";
return XLAT("subcubed") + "(" + its(reg3::subcube_count) + ")";
else if(variation == eVariation::dual_subcubes)
return XLAT("dual-subcubed") + "(" + its(reg3::subcube_count) + ")";
else if(variation == eVariation::bch)
return XLAT("bitruncated-subcubed") + "(" + its(reg3::subcube_count) + ")";
else if(variation == eVariation::coxeter)
return XLAT("subdivided") + "(" + its(reg3::coxeter_param) + ")";
else {
auto p = human_representation(param);
string s = "GP(" + its(p.first) + "," + its(p.second) + ")";

View File

@ -2286,6 +2286,76 @@ EX void construct_relations() {
}
}
eVariation target_variation;
flagtype target_coxeter;
int target_subcube_count;
EX void edit_variation() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
dialog::init(XLAT("variations"));
dialog::addBoolItem(XLAT("pure"), target_variation == eVariation::pure, 'p');
dialog::add_action([] { target_variation = eVariation::pure; });
dialog::addBoolItem(XLAT("symmetric subdivision"), target_variation == eVariation::coxeter, 't');
dialog::add_action([] { target_variation = eVariation::coxeter; });
if(S7 == 6) {
dialog::addBoolItem(XLAT("sub-cubes"), target_variation == eVariation::subcubes, 'c');
dialog::add_action([] { target_variation = eVariation::subcubes; });
if(!(cgflags & qIDEAL)) {
dialog::addBoolItem(XLAT("dual sub-cubes"), target_variation == eVariation::dual_subcubes, 'd');
dialog::add_action([] { target_variation = eVariation::dual_subcubes; });
dialog::addBoolItem(XLAT("bitruncated sub-cubes"), target_variation == eVariation::bch, 'b');
dialog::add_action([] { target_variation = eVariation::bch; });
}
}
else
dialog::addInfo(XLAT("note: more choices in cubic honeycombs"));
if(is_subcube_based(target_variation)) {
dialog::addBreak(100);
dialog::addSelItem(XLAT("subdivision"), its(target_subcube_count), 'z');
dialog::add_action([] {
dialog::editNumber(target_subcube_count, 1, 8, 1, 2, XLAT("subdivision"), "");
dialog::bound_low(1);
});
}
if(target_variation == eVariation::coxeter) {
dialog::addBreak(100);
dialog::addBoolItem(XLAT("split by original faces"), target_coxeter & cox_othercell, 'f');
dialog::add_action([] { target_coxeter ^= cox_othercell; });
dialog::addBoolItem(XLAT("split by vertex axes"), target_coxeter & cox_vertices, 'v');
dialog::add_action([] { target_coxeter ^= cox_vertices; });
dialog::addBoolItem(XLAT("split by midedges"), target_coxeter & cox_midedges, 'm');
dialog::add_action([] { target_coxeter ^= cox_midedges; });
}
dialog::addBreak(100);
dialog::addItem(XLAT("activate"), 'x');
dialog::add_action([] {
stop_game();
set_variation(target_variation);
subcube_count = target_subcube_count;
coxeter_param = target_coxeter;
start_game();
});
dialog::addBack();
dialog::display();
}
EX void configure_variation() {
target_variation = variation;
target_subcube_count = subcube_count;
target_coxeter = coxeter_param;
pushScreen(edit_variation);
}
EX }
#endif

View File

@ -1387,7 +1387,9 @@ EX void set_variation(eVariation target) {
variation = target;
return;
}
if(bt::in() || sol || kite::in() || WDIM == 3) if(!prod) geometry = gNormal;
if(target != eVariation::pure) {
if(bt::in() || sol || kite::in() || WDIM == 3) if(!prod) geometry = gNormal;
}
auto& cd = ginf[gCrystal];
if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) {
cd.vertex = 3;