diff --git a/aiserver.py b/aiserver.py index 7222943e..0a520b66 100644 --- a/aiserver.py +++ b/aiserver.py @@ -4716,7 +4716,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False, if(len(koboldai_vars.prompt.strip()) == 0): koboldai_vars.prompt = data else: - koboldai_vars.actions.append_submission(data) + koboldai_vars.actions.append(data, submission=True) update_story_chunk('last') send_debug() diff --git a/gensettings.py b/gensettings.py index 6af24f21..892fea9c 100644 --- a/gensettings.py +++ b/gensettings.py @@ -113,7 +113,6 @@ gensettingstf = [ "ui_level": 1 }, { - "UI_V2_Only": True, "uitype": "slider", "unit": "float", "label": "Repetition Penalty", diff --git a/koboldai_settings.py b/koboldai_settings.py index 1001b3d3..33625ec5 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1400,16 +1400,15 @@ class KoboldStoryRegister(object): ignore = self.koboldai_vars.calc_ai_text() self.set_game_saved() self.gen_all_audio() - - def append_submission(self, text, action_id_offset=0, recalc=True): - self._append(text, action_id_offset=action_id_offset, recalc=recalc) - self.submission_id = self.action_count + action_id_offset - def append(self, text, action_id_offset=0, recalc=True): - self._append(text, action_id_offset=action_id_offset, recalc=recalc) - self.submission_id = 0 + def append(self, text, action_id_offset=0, recalc=True, submission=False): + """Create a new action and append it to the table of actions. - def _append(self, text, action_id_offset=0, recalc=True): + text: The text of the action. + action_id_offset: An optional offset added to action_count when assiging an action_id. + recalc: If True, recalculate the context and generate audio. + submission: If True, mark this action as a user submission. + """ if self.koboldai_vars.remove_double_space: while " " in text: text = text.replace(" ", " ") @@ -1441,7 +1440,12 @@ class KoboldStoryRegister(object): "Probabilities": [], "Time": int(time.time()), } - + + if submission: + self.submission_id = action_id + else: + self.submission_id = 0 + if self.story_settings is not None: self.story_settings.assign_world_info_to_actions(action_id=action_id, no_transmit=True) process_variable_changes(self.socketio, "story", 'actions', {"id": action_id, 'action': self.actions[action_id]}, None) diff --git a/static/koboldai.css b/static/koboldai.css index 63ecfa57..74dea16c 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -1331,9 +1331,10 @@ body { margin: auto auto auto auto; display: flex; flex-direction: column; + color: var(--flyout_text); } -.delete_option_icon { +.option_icon { font-size: 1.2em !important; } diff --git a/static/koboldai.js b/static/koboldai.js index 948b7c79..6d6b1b76 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -282,6 +282,30 @@ function create_options(action) { while (option_chunk.firstChild) { option_chunk.removeChild(option_chunk.firstChild); } + + //Let's check if we only have a single redo option. In that case we din't show as the user can use the redo button + seen_prev_selection = false; + show_options = false; + console.log(action.action.Options); + for (item of action.action.Options) { + if (!(item['Previous Selection'])) { + console.log(item); + show_options = true; + break; + } else if (item['Previous Selection']) { + if (seen_prev_selection) { + show_options = true; + break; + } else { + seen_prev_selection = true; + } + } + } + console.log("seen_prev_selection: "+seen_prev_selection+" show_options: "+show_options); + if (!(show_options)) { + return; + } + var table = document.createElement("div"); table.classList.add("sequences"); //Add Redo options @@ -302,10 +326,12 @@ function create_options(action) { iconcell.classList.add("sequnce_icon"); var icon = document.createElement("span"); icon.id = "Pin_"+i; - icon.classList.add("oi"); - icon.setAttribute('data-glyph', "loop-circular"); + icon.classList.add("material-icons-outlined"); + icon.classList.add("option_icon"); + icon.classList.add("cursor"); + icon.textContent = "cached"; iconcell.append(icon); - delete_icon = $e("span", iconcell, {"classes": ["material-icons-outlined", "cursor", 'delete_option_icon'], + delete_icon = $e("span", iconcell, {"classes": ["material-icons-outlined", "cursor", 'option_icon'], "tooltip": "Delete Option", 'option_id': i, 'option_chunk': action.id, 'textContent': 'delete'}); delete_icon.onclick = function () { @@ -338,8 +364,10 @@ function create_options(action) { iconcell.classList.add("sequnce_icon"); var icon = document.createElement("span"); icon.id = "Pin_"+i; - icon.classList.add("oi"); - icon.setAttribute('data-glyph', "pin"); + icon.classList.add("material-icons-outlined"); + icon.classList.add("option_icon"); + icon.classList.add("cursor"); + icon.textContent = "push_pin"; if (!(item.Pinned)) { icon.setAttribute('style', "filter: brightness(50%);"); } diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 8dcfcf52..db031fe0 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -285,7 +285,7 @@ -
+
Game Text Size: help_icon