Merge pull request #69 from VE-FORBRYDERNE/lua

Lua compatibility enhancements
This commit is contained in:
henk717
2022-01-22 23:23:47 +01:00
committed by GitHub
2 changed files with 38 additions and 8 deletions

View File

@ -3232,6 +3232,7 @@ def update_story_chunk(idx: Union[int, str]):
# prompt might not have been shown yet (with a "Generating story..."
# message instead).
refresh_story()
setgamesaved(False)
return
idx = (vars.actions.get_last_key() if len(vars.actions) else 0) + 1
@ -3249,7 +3250,9 @@ def update_story_chunk(idx: Union[int, str]):
chunk_text = f'<chunk n="{idx}" id="n{idx}" tabindex="-1">{formatforhtml(item)}</chunk>'
emit('from_server', {'cmd': 'updatechunk', 'data': {'index': idx, 'html': chunk_text}}, broadcast=True)
setgamesaved(False)
#If we've set the auto save flag, we'll now save the file
if vars.autosave and (".json" in vars.savedir):
save()
@ -3260,6 +3263,7 @@ def update_story_chunk(idx: Union[int, str]):
#==================================================================#
def remove_story_chunk(idx: int):
emit('from_server', {'cmd': 'removechunk', 'data': idx}, broadcast=True)
setgamesaved(False)
#==================================================================#