From ad93e77bcc9e8a4eabe33f1627d0d0fbec5de8ae Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 21 Apr 2018 17:57:30 +0200 Subject: [PATCH] canvas_invisible option --- commandline.cpp | 4 +++- hyper.h | 1 + landgen.cpp | 2 ++ pattern2.cpp | 9 +++++++++ system.cpp | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/commandline.cpp b/commandline.cpp index 5cf34234..2300ff43 100644 --- a/commandline.cpp +++ b/commandline.cpp @@ -109,8 +109,10 @@ int arg::readCommon() { PHASE(2); firstland = specialland = laCanvas; shift(); - if(args().size() == 1) patterns::whichCanvas = args()[0]; + if(args() == "i") canvas_invisible = !canvas_invisible; + else if(args().size() == 1) patterns::whichCanvas = args()[0]; else patterns::canvasback = arghex(); + if(curphase == 3) restartGame(); } else if(argis("-noplayer")) mapeditor::drawplayer = !mapeditor::drawplayer; diff --git a/hyper.h b/hyper.h index 575c9d1a..a7087d84 100644 --- a/hyper.h +++ b/hyper.h @@ -3264,3 +3264,4 @@ ld master_to_c7_angle(); extern int mutantphase; void resize_screen_to(int x, int y); +extern bool canvas_invisible; diff --git a/landgen.cpp b/landgen.cpp index b67c8f92..79db977a 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -2343,6 +2343,8 @@ void setdist(cell *c, int d, cell *from) { if(d == BARLEV && c->land == laCanvas) { c->landparam = patterns::generateCanvas(c); + if(canvas_invisible) + c->wall = waInvisibleFloor; } if(d >= BARLEV-1 && c->land == laPrairie) diff --git a/pattern2.cpp b/pattern2.cpp index f2383f04..6757f292 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1283,6 +1283,9 @@ namespace patterns { dialog::addSelItem(XLAT("field pattern S"), "field", 'S'); } + dialog::addBreak(100); + dialog::addBoolItem(XLATN(winf[waInvisibleFloor].name), canvas_invisible, 'i'); + dialog::display(); keyhandler = [] (int sym, int uni) { @@ -1301,6 +1304,12 @@ namespace patterns { restartGame(0, false, true); }; } + else if(uni == 'i') { + canvas_invisible = !canvas_invisible; + firstland = specialland = laCanvas; + randomPatternsMode = false; + restartGame(0, false, true); + } else if((uni >= 'a' && uni <= 'z') || (uni >= 'A' && uni <= 'Z')) { whichCanvas = uni; subcanvas = rand(); diff --git a/system.cpp b/system.cpp index 3fc37814..c89b07ac 100644 --- a/system.cpp +++ b/system.cpp @@ -6,6 +6,7 @@ bool cblind; bool autocheat; +bool canvas_invisible; int truelotus; int gamecount;