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

shiftclick in mapeditor now deletes stuff

This commit is contained in:
Zeno Rogue 2022-10-26 00:19:22 +02:00
parent 60a3f21b9f
commit e653f4eaeb
2 changed files with 18 additions and 4 deletions

View File

@ -1138,7 +1138,7 @@ EX void handle_event(SDL_Event& ev) {
if(ev.button.button == SDL_BUTTON_LEFT) { if(ev.button.button == SDL_BUTTON_LEFT) {
if(ISPANDORA ? pandora_rightclick : lctrlclick) if(ISPANDORA ? pandora_rightclick : lctrlclick)
ev.button.button = SDL_BUTTON_MIDDLE; ev.button.button = SDL_BUTTON_MIDDLE;
else if((ISPANDORA ? pandora_leftclick : lshiftclick) && !(vid.shifttarget&1)) else if((ISPANDORA ? pandora_leftclick : lshiftclick) && !(vid.shifttarget&1) && !(cmode & sm::MAP))
ev.button.button = SDL_BUTTON_RIGHT; ev.button.button = SDL_BUTTON_RIGHT;
} }

View File

@ -1238,6 +1238,7 @@ EX namespace mapeditor {
#if CAP_EDIT #if CAP_EDIT
int paintwhat = 0; int paintwhat = 0;
int paintwhat_alt_wall = 0;
int painttype = 0; int painttype = 0;
int paintstatueid = 0; int paintstatueid = 0;
int radius = 0; int radius = 0;
@ -1387,6 +1388,13 @@ EX namespace mapeditor {
getcstat = '-'; getcstat = '-';
if(anyshiftclick) {
displayfr(8, 8 + fs, 2, vid.fsize,
(painttype == 6 && (GDIM == 3)) ? "wall" :
painttype == 3 ? XLATN(winf[paintwhat_alt_wall].name) : "clear",
forecolor, 0);
}
else
displayfr(8, 8 + fs, 2, vid.fsize, paintwhat_str, forecolor, 0); displayfr(8, 8 + fs, 2, vid.fsize, paintwhat_str, forecolor, 0);
displayfr(8, 8+fs*2, 2, vid.fsize, XLAT("use at your own risk!"), 0x800000, 0); displayfr(8, 8+fs*2, 2, vid.fsize, XLAT("use at your own risk!"), 0x800000, 0);
@ -1402,6 +1410,8 @@ EX namespace mapeditor {
displayButton(8, 8+fs*12, XLAT("f = flip %1", ONOFF(copysource.mirrored)), 'u', 0); displayButton(8, 8+fs*12, XLAT("f = flip %1", ONOFF(copysource.mirrored)), 'u', 0);
displayButton(8, 8+fs*13, XLAT("r = regular"), 'r', 0); displayButton(8, 8+fs*13, XLAT("r = regular"), 'r', 0);
displayButton(8, 8+fs*14, XLAT("p = paint"), 'p', 0); displayButton(8, 8+fs*14, XLAT("p = paint"), 'p', 0);
if(painttype == 3)
displayButton(8, 8+fs*15, XLAT("z = set Shift+click"), 'z', 0);
displayFunctionKeys(); displayFunctionKeys();
displayButton(8, vid.yres-8-fs*4, XLAT("F8 = settings"), SDLK_F8, 0); displayButton(8, vid.yres-8-fs*4, XLAT("F8 = settings"), SDLK_F8, 0);
@ -1443,6 +1453,7 @@ EX namespace mapeditor {
saveUndo(c); saveUndo(c);
switch(painttype) { switch(painttype) {
case 0: { case 0: {
if(anyshiftclick) { c->monst = moNone; mirror::destroyKilled(); break; }
eMonster last = c->monst; eMonster last = c->monst;
c->monst = eMonster(paintwhat); c->monst = eMonster(paintwhat);
c->hitpoints = 3; c->hitpoints = 3;
@ -1473,6 +1484,7 @@ EX namespace mapeditor {
break; break;
} }
case 1: { case 1: {
if(anyshiftclick) { c->item = itNone; break; }
eItem last = c->item; eItem last = c->item;
c->item = eItem(paintwhat); c->item = eItem(paintwhat);
if(c->item == itBabyTortoise) if(c->item == itBabyTortoise)
@ -1480,6 +1492,7 @@ EX namespace mapeditor {
break; break;
} }
case 2: { case 2: {
if(anyshiftclick) { c->land = laNone; c->wall = waNone; break; }
eLand last = c->land; eLand last = c->land;
c->land = eLand(paintwhat); c->land = eLand(paintwhat);
if(isIcyLand(c) && isIcyLand(last)) if(isIcyLand(c) && isIcyLand(last))
@ -1496,7 +1509,7 @@ EX namespace mapeditor {
} }
case 3: { case 3: {
eWall last = c->wall; eWall last = c->wall;
c->wall = eWall(paintwhat); c->wall = eWall(anyshiftclick ? paintwhat_alt_wall : paintwhat);
if(last != c->wall) { if(last != c->wall) {
if(hasTimeout(c)) if(hasTimeout(c))
@ -1528,7 +1541,7 @@ EX namespace mapeditor {
break; break;
case 6: case 6:
c->land = laCanvas; c->land = laCanvas;
c->wall = GDIM == 3 ? waWaxWall : waNone; c->wall = ((GDIM == 3) ^ anyshiftclick) ? waWaxWall : waNone;
c->landparam = paintwhat >> 8; c->landparam = paintwhat >> 8;
break; break;
case 4: { case 4: {
@ -1764,6 +1777,7 @@ EX namespace mapeditor {
else if(uni == 'i') pushScreen(showList), painttype = 1, dialog::infix = ""; else if(uni == 'i') pushScreen(showList), painttype = 1, dialog::infix = "";
else if(uni == 'l') pushScreen(showList), painttype = 2, dialog::infix = ""; else if(uni == 'l') pushScreen(showList), painttype = 2, dialog::infix = "";
else if(uni == 'w') pushScreen(showList), painttype = 3, dialog::infix = ""; else if(uni == 'w') pushScreen(showList), painttype = 3, dialog::infix = "";
else if(uni == 'z' && painttype == 3) paintwhat_alt_wall = paintwhat;
else if(uni == 'r') pushScreen(patterns::showPattern); else if(uni == 'r') pushScreen(patterns::showPattern);
else if(uni == 't' && mouseover) { else if(uni == 't' && mouseover) {
playermoved = true; playermoved = true;