Make sure editor changes are applied before submitting

(cherry picked from commit ae41ad298c)
This commit is contained in:
vfbd
2022-06-26 14:06:57 -04:00
parent ebba79fed6
commit 6576f5c01d

View File

@ -881,6 +881,7 @@ function dosubmit(disallow_abort) {
if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) { if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) {
return; return;
} }
chunkOnFocusOut("override");
input_text.val(""); input_text.val("");
hideMessage(); hideMessage();
hidegenseqs(); hidegenseqs();
@ -1861,7 +1862,7 @@ function chunkOnKeyDownSelectionChange(event) {
// This gets run when you defocus the editor by clicking // This gets run when you defocus the editor by clicking
// outside of the editor or by pressing escape or tab // outside of the editor or by pressing escape or tab
function chunkOnFocusOut(event) { function chunkOnFocusOut(event) {
if(!gametext_bound || !allowedit || event.target !== game_text[0]) { if(event !== "override" && (!gametext_bound || !allowedit || event.target !== game_text[0])) {
return; return;
} }
setTimeout(function() { setTimeout(function() {