This commit is contained in:
ebolam
2022-09-30 09:14:50 -04:00
parent e566a498ef
commit 8815f7e686

View File

@@ -1199,15 +1199,16 @@ class KoboldStoryRegister(object):
self.set_game_saved() self.set_game_saved()
def set_action_in_ai(self, action_id, used=True): def set_action_in_ai(self, action_id, used=True):
if 'In AI Input' in self.actions[action_id]: if action_id in self.actions:
old = self.actions[action_id]['In AI Input'] if 'In AI Input' in self.actions[action_id]:
else: old = self.actions[action_id]['In AI Input']
old = None else:
self.actions[action_id]['In AI Input'] = used old = None
if old != used: self.actions[action_id]['In AI Input'] = used
process_variable_changes(self.socketio, "story", 'actions', {"id": action_id, 'action': self.actions[action_id]}, None) if old != used:
if used: process_variable_changes(self.socketio, "story", 'actions', {"id": action_id, 'action': self.actions[action_id]}, None)
self.recalc_token_length(action_id) if used:
self.recalc_token_length(action_id)
def set_pin(self, action_step, option_number): def set_pin(self, action_step, option_number):
if action_step in self.actions: if action_step in self.actions: