From 3e747a2d9de5863142e82662e4910953d7581d64 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 3 Dec 2018 23:15:53 +0100 Subject: [PATCH] compass probability now can be changed from menu/commandline --- crystal.cpp | 14 ++++++++++++++ help.cpp | 5 ++++- hyper.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crystal.cpp b/crystal.cpp index 1befaa9c..41317912 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -898,6 +898,9 @@ int readArgs() { else if(argis("-cview")) { view_coordinates = true; } + else if(argis("-cprob")) { + PHASEFROM(2); shift_arg_formula(compass_probability); + } else if(argis("-crug")) { PHASE(3); if(rug::rugged) rug::close(); @@ -918,6 +921,15 @@ hrmap *new_map() { return new hrmap_crystal; } +string compass_help() { + return XLAT( + "Lands in this geometry are usually built on North-South or West-East axis. " + "Compasses always point North, and all the cardinal directions to the right from compass North are East (this is not " + "true in general, but it is true for the cells where compasses are generated). " + "North is the first coordinate, while East is the sum of other coordinates." + ); + } + void show() { cmode = sm::SIDE | sm::MAYDARK; gamescreen(0); @@ -934,6 +946,8 @@ void show() { dialog::addBreak(50); dialog::addBoolItem("view coordinates in the cheat mode", view_coordinates, 'v'); dialog::add_action([]() { view_coordinates = !view_coordinates; }); + dialog::addSelItem(XLAT("compass probability"), fts(compass_probability), 'p'); + dialog::add_action([]() { dialog::editNumber(compass_probability, 0, 1, 0.1, 1, XLAT("compass probability"), compass_help()); }); if(geometry == gCrystal) { dialog::addBoolItem("3D display", rug::rugged, 'r'); dialog::add_action([]() { pushScreen(rug::show); }); diff --git a/help.cpp b/help.cpp index 995584a8..44829dae 100644 --- a/help.cpp +++ b/help.cpp @@ -242,7 +242,10 @@ string generateHelpForItem(eItem it) { string help = helptitle(XLATN(iinf[it].name), iinf[it].color); - help += XLAT(iinf[it].help); + if(it == itCompass && geometry == gCrystal) + help += crystal::compass_help(); + else + help += XLAT(iinf[it].help); if(it == itSavedPrincess || it == itOrbLove) if(!inv::on) help += princessReviveHelp(); diff --git a/hyper.h b/hyper.h index ebed0b45..b94015f6 100644 --- a/hyper.h +++ b/hyper.h @@ -4160,6 +4160,7 @@ namespace crystal { string get_table_boundary(); bool pure(); ld compass_angle(); + string compass_help(); void may_place_compass(cell *c); }