mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2024-12-27 08:42:53 +01:00
Broadcast updatechunk and removechunk
This commit is contained in:
parent
62ad2f0228
commit
09030573e5
@ -1344,14 +1344,14 @@ def update_story_chunk(idx: Union[int, Literal['last']]):
|
|||||||
text = vars.actions[idx - 1]
|
text = vars.actions[idx - 1]
|
||||||
|
|
||||||
chunk_text = f'<chunk n="{idx}" id="n{idx}">{formatforhtml(html.escape(text))}</chunk>'
|
chunk_text = f'<chunk n="{idx}" id="n{idx}">{formatforhtml(html.escape(text))}</chunk>'
|
||||||
emit('from_server', {'cmd': 'updatechunk', 'data': {'index': idx, 'html': chunk_text, 'last': (idx == len(vars.actions))}})
|
emit('from_server', {'cmd': 'updatechunk', 'data': {'index': idx, 'html': chunk_text, 'last': (idx == len(vars.actions))}}, broadcast=True)
|
||||||
|
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
# Signals the Game Screen to remove one of the chunks
|
# Signals the Game Screen to remove one of the chunks
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def remove_story_chunk(idx: int):
|
def remove_story_chunk(idx: int):
|
||||||
emit('from_server', {'cmd': 'removechunk', 'data': idx})
|
emit('from_server', {'cmd': 'removechunk', 'data': idx}, broadcast=True)
|
||||||
|
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
|
Loading…
Reference in New Issue
Block a user