Changed behavior of redo if there is only 1 option to just select it
This commit is contained in:
parent
06bbe429d9
commit
2278b7c103
10
aiserver.py
10
aiserver.py
|
@ -2590,6 +2590,16 @@ def actionredo():
|
||||||
genout = [{"generated_text": item['Text']} for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==True)]
|
genout = [{"generated_text": item['Text']} for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Previous Selection"]==True)]
|
||||||
genout = genout + [{"generated_text": item['Text']} for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Pinned"]==True) and (item["Previous Selection"]==False)]
|
genout = genout + [{"generated_text": item['Text']} for item in vars.actions_metadata[len(vars.actions)]['Alternative Text'] if (item["Pinned"]==True) and (item["Previous Selection"]==False)]
|
||||||
|
|
||||||
|
if len(genout) == 1:
|
||||||
|
vars.actions.append(genout[0])
|
||||||
|
if len(vars.actions) > len(vars.actions_metadata):
|
||||||
|
vars.actions_metadata.append({'Selected Text': genout[0], 'Alternative Text': []})
|
||||||
|
else:
|
||||||
|
vars.actions_metadata[len(vars.actions)-1]['Selected Text'] = genout[0]
|
||||||
|
update_story_chunk('last')
|
||||||
|
if(flash):
|
||||||
|
emit('from_server', {'cmd': 'texteffect', 'data': vars.actions.get_last_key() + 1 if len(vars.actions) else 0}, broadcast=True)
|
||||||
|
else:
|
||||||
# Store sequences in memory until selection is made
|
# Store sequences in memory until selection is made
|
||||||
vars.genseqs = genout
|
vars.genseqs = genout
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue