Fix and improve handling of cancelling roomtext/scripttext input

First, two bug fixes. Room text input mode wasn't properly unset
upon pressing Esc, making the prompt get stuck, requiring you to
add roomtext again and finish it to make it go away. Secondly,
escaping script text input would remove the wrong entity.

I also tweaked the handling slightly so that instead of deleting
the entity if it already existed if escaping from text input,
it merely reverts the change in script name/roomtext to what it
was previously.

I considered refactoring the editor text input handler entirely,
but figured such a change would be a bit too extensive for the
purpose of this repository.
This commit is contained in:
Fredrik Ljungdahl
2020-01-27 11:15:25 +01:00
parent 757fd49283
commit 3cfa7b0c60
2 changed files with 36 additions and 24 deletions

View File

@@ -173,11 +173,11 @@ class editorclass{
int entframe, entframedelay;
bool roomtextmod;
int roomtextent;
bool scripttextmod;
int scripttextent;
int textent;
int scripttexttype;
std::string oldenttext;
bool xmod, zmod, spacemod, warpmod, roomnamemod, textentry, savemod, loadmod;
bool titlemod, creatormod, desc1mod, desc2mod, desc3mod, websitemod;