mapeditor:: canvas_default_wall can be set now

This commit is contained in:
Zeno Rogue 2020-01-28 16:42:07 +01:00
parent fa64573971
commit 27e19ca5ca
4 changed files with 16 additions and 8 deletions

View File

@ -2704,8 +2704,7 @@ EX void setdist(cell *c, int d, cell *from) {
if(d == BARLEV && c->land == laCanvas) {
color_t col = patterns::generateCanvas(c);
c->landparam = col;
if(canvas_invisible)
c->wall = waInvisibleFloor;
c->wall = canvas_default_wall;
if(WDIM == 3 && (col & 0x1000000)) c->wall = waWaxWall;
}

View File

@ -277,6 +277,7 @@ namespace mapstream {
f.write(patterns::subpattern_flags);
f.write(patterns::whichCanvas);
f.write(patterns::displaycodes);
f.write(canvas_default_wall);
f.write(mapeditor::drawplayer);
if(patterns::whichCanvas == 'f') f.write(patterns::color_formula);
@ -404,6 +405,8 @@ namespace mapstream {
f.read(patterns::subpattern_flags);
f.read(patterns::whichCanvas);
f.read(patterns::displaycodes);
if(VERNUM_HEX >= 0xA816)
f.read(canvas_default_wall);
f.read(mapeditor::drawplayer);
if(patterns::whichCanvas == 'f') f.read(patterns::color_formula);

View File

@ -1919,7 +1919,7 @@ EX namespace patterns {
dialog::addBoolItem(XLAT("display only heptagons"), (whichShape == '7'), '7');
dialog::addBoolItem(XLAT("display the triheptagonal grid"), (whichShape == '8'), '8');
dialog::addBoolItem(XLAT("display full floors"), (whichShape == '9'), '9');
dialog::addBoolItem(XLATN(winf[waInvisibleFloor].name), canvas_invisible, 'i');
dialog::addSelItem(XLAT("floor type"), XLATN(winf[canvas_default_wall].name), 'i');
dialog::addItem(XLAT("line patterns"), 'L');
@ -1950,14 +1950,20 @@ EX namespace patterns {
};
}
else if(uni == 'i') {
if(instant) {
if(instant)
stop_game();
canvas_invisible = !canvas_invisible;
vector<eWall> choices = {waNone, waInvisibleFloor, waChasm, waEternalFire, waStone, waSea, waBarrier, waCavewall};
for(int i=0; i<isize(choices); i++)
if(canvas_default_wall == choices[i]) {
canvas_default_wall = choices[(i+1) % isize(choices)];
break;
}
if(instant) {
firstland = specialland = laCanvas;
randomPatternsMode = false;
start_game();
}
else canvas_invisible = !canvas_invisible;
}
else if(uni == '6' || uni == '7' || uni == '8' || uni == '9') {
@ -2966,7 +2972,7 @@ int read_pattern_args() {
stop_game();
firstland = specialland = laCanvas;
shift();
if(args() == "i") canvas_invisible = !canvas_invisible;
if(args() == "i") canvas_default_wall = waInvisibleFloor;
else if(args().size() == 1) patterns::whichCanvas = args()[0];
else patterns::canvasback = arghex();
stop_game_and_switch_mode(rg::nothing);

View File

@ -40,7 +40,7 @@ EX bool game_active;
EX bool cblind;
EX bool autocheat;
EX bool canvas_invisible;
EX eWall canvas_default_wall = waNone;
EX int truelotus;
EX int gamecount;