From e74eeca2c32d5211931d73f4af4b26a2e9821d0c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 15 Sep 2020 20:12:13 +0200 Subject: [PATCH] the 'copy' button in the Map Editor works with the mouse now --- mapeditor.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mapeditor.cpp b/mapeditor.cpp index c2ac4dde..d7d4b3c1 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1110,7 +1110,7 @@ EX namespace mapeditor { displayButton(8, 8+fs*7, XLAT("w = walls"), 'w', 0); displayButton(8, 8+fs*8, XLAT("i = items"), 'i', 0); displayButton(8, 8+fs*9, XLAT("l = lands"), 'l', 0); - displayfr(8, 8+fs*10, 2, vid.fsize, XLAT("c = copy"), 0xC0C0C0, 0); + displayButton(8, 8+fs*10, XLAT("c = copy"), 'c', 0); displayButton(8, 8+fs*11, XLAT("u = undo"), 'u', 0); if(painttype == 4) displayButton(8, 8+fs*12, XLAT("f = flip %1", ONOFF(copysource.mirrored)), 'u', 0); @@ -1234,7 +1234,7 @@ EX namespace mapeditor { c->wall = GDIM == 3 ? waWaxWall : waNone; c->landparam = paintwhat >> 8; break; - case 4: + case 4: { cell *copywhat = where.second.at; c->wall = copywhat->wall; c->item = copywhat->item; @@ -1247,6 +1247,14 @@ EX namespace mapeditor { if(copywhat->mondir == NODIR) c->mondir = NODIR; else c->mondir = gmod((where.first.mirrored == where.second.mirrored ? 1 : -1) * (copywhat->mondir - where.second.spin) + cdir, c->type); break; + } + case 7: + if(c) { + copysource = c; + painttype = 4; + paintwhat_str = XLAT("copying"); + } + break; } checkUndo(); } @@ -1473,6 +1481,10 @@ EX namespace mapeditor { painttype = 4; paintwhat_str = XLAT("copying"); } + else if(uni == 'c') { + painttype = 7; + paintwhat_str = XLAT("select area to copy"); + } else if(uni == 'f') { copysource.mirrored = !copysource.mirrored; }