diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 2c95d3eb..301b4668 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -4295,6 +4295,20 @@ void editorinput() key.disabletextentry(); switch (ed.textmod) { + case TEXT_GOTOROOM: + { + std::vector coords = split(key.keybuffer, ','); + if (coords.size() != 2) + { + ed.note = "[ ERROR: Invalid format ]"; + ed.notedelay = 45; + break; + } + ed.levx = clamp(atoi(coords[0].c_str()) - 1, 0, ed.mapwidth - 1); + ed.levy = clamp(atoi(coords[1].c_str()) - 1, 0, ed.mapheight - 1); + graphics.backgrounddrawn = false; + break; + } case TEXT_LOAD: { std::string loadstring = ed.filename + ".vvvvvv"; @@ -4692,6 +4706,12 @@ void editorinput() ed.getlin(TEXT_ROOMNAME, "Enter new room name:", &(ed.level[ed.levx+(ed.levy*ed.maxwidth)].roomname)); game.mapheld=true; } + if (key.keymap[SDLK_g]) + { + ed.keydelay = 6; + ed.getlin(TEXT_GOTOROOM, "Enter room coordinates x,y:", NULL); + game.mapheld=true; + } //Save and load if(key.keymap[SDLK_s]) diff --git a/desktop_version/src/editor.h b/desktop_version/src/editor.h index 34c94fa2..7072a801 100644 --- a/desktop_version/src/editor.h +++ b/desktop_version/src/editor.h @@ -18,7 +18,8 @@ enum textmode { TEXT_ROOMNAME, TEXT_SCRIPT, TEXT_ROOMTEXT, - LAST_EDTEXT = TEXT_ROOMTEXT, + TEXT_GOTOROOM, + LAST_EDTEXT = TEXT_GOTOROOM, // Settings-mode text fields TEXT_TITLE,