mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-16 13:48:04 +00:00
Add a setting to preserve wparam and landparam when changing walls and lands with the map editor
This commit is contained in:
@@ -1334,6 +1334,7 @@ EX namespace mapeditor {
|
||||
int paintstatueid = 0;
|
||||
int radius = 0;
|
||||
string paintwhat_str = "clear monster";
|
||||
bool preserveparams = false;
|
||||
|
||||
cellwalker copysource;
|
||||
|
||||
@@ -1748,7 +1749,10 @@ EX namespace mapeditor {
|
||||
if(anyshiftclick) { c->land = laNone; c->wall = waNone; map_version++; break; }
|
||||
eLand last = c->land;
|
||||
c->land = eLand(paintwhat);
|
||||
if(isIcyLand(c) && isIcyLand(last))
|
||||
if(preserveparams) {
|
||||
// do nothing
|
||||
}
|
||||
else if(isIcyLand(c) && isIcyLand(last))
|
||||
HEAT(c) += spillinc() / 100.;
|
||||
else if(last == laDryForest && c->land == laDryForest)
|
||||
c->landparam += spillinc();
|
||||
@@ -1765,7 +1769,10 @@ EX namespace mapeditor {
|
||||
c->wall = eWall(anyshiftclick ? paintwhat_alt_wall : paintwhat);
|
||||
map_version++;
|
||||
|
||||
if(last != c->wall) {
|
||||
if(preserveparams) {
|
||||
// do nothing
|
||||
}
|
||||
else if(last != c->wall) {
|
||||
if(hasTimeout(c))
|
||||
c->wparam = 10;
|
||||
else if(c->wall == waWaxWall)
|
||||
@@ -1775,7 +1782,7 @@ EX namespace mapeditor {
|
||||
c->wparam += spillinc();
|
||||
|
||||
if(c->wall == waEditStatue) {
|
||||
c->wparam = paintstatueid;
|
||||
if(!preserveparams) c->wparam = paintstatueid;
|
||||
c->mondir = cdir;
|
||||
}
|
||||
|
||||
@@ -3382,6 +3389,9 @@ EX namespace mapeditor {
|
||||
dialog::addItem(XLAT("change the pattern/color of new Canvas cells"), 'c');
|
||||
dialog::add_action_push(patterns::showPrePatternNoninstant);
|
||||
|
||||
dialog::addBoolItem_action(XLAT("preserve parameters when editing walls and lands"), preserveparams, 'P');
|
||||
dialog::addInfo(XLAT("(unexpected parameter values may cause undesired behavior)"));
|
||||
|
||||
dialog::addItem(XLAT("configure WFC"), 'W');
|
||||
dialog::add_action_push(wfc::wfc_menu);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user