Performance increase for `refresh_story` on large stories
This commit is contained in:
parent
65ad0e01e3
commit
4cb3df5e7e
10
aiserver.py
10
aiserver.py
|
@ -1090,12 +1090,10 @@ def applyoutputformatting(txt):
|
||||||
# Sends the current story content to the Game Screen
|
# Sends the current story content to the Game Screen
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
def refresh_story():
|
def refresh_story():
|
||||||
txt = '<chunk n="0" id="n0">'+vars.prompt+'</chunk>'
|
text_parts = ['<chunk n="0" id="n0">', vars.prompt, '</chunk>']
|
||||||
i = 1
|
for idx, item in enumerate(vars.actions, start=1):
|
||||||
for item in vars.actions:
|
text_parts.extend(('<chunk n="', str(idx), '" id="n', str(idx), '">', item, '</chunk>'))
|
||||||
txt = txt + '<chunk n="'+str(i)+'" id="n'+str(i)+'">'+item+'</chunk>'
|
emit('from_server', {'cmd': 'updatescreen', 'data': formatforhtml(''.join(text_parts))})
|
||||||
i += 1
|
|
||||||
emit('from_server', {'cmd': 'updatescreen', 'data': formatforhtml(txt)})
|
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
# Sends the current generator settings to the Game Menu
|
# Sends the current generator settings to the Game Menu
|
||||||
|
|
Loading…
Reference in New Issue