Add Memory box to Random Story dialog and "Random Story Persist"

This commit is contained in:
Gnome Ann
2021-12-29 23:15:59 -05:00
parent 756a7941f2
commit 7573f64bf2
6 changed files with 99 additions and 14 deletions

View File

@@ -1054,6 +1054,9 @@ function hideNewStoryPopup() {
function showRandomStoryPopup() {
rspopup.removeClass("hidden");
rspopup.addClass("flex");
if($("#setrngpersist").prop("checked")) {
$("#rngmemory").val(memorytext);
}
}
function hideRandomStoryPopup() {
@@ -2180,6 +2183,12 @@ $(document).ready(function(){
} else if(msg.cmd == "updatenopromptgen") {
// Update toggle state
$("#setnopromptgen").prop('checked', msg.data).change();
} else if(msg.cmd == "updaterngpersist") {
// Update toggle state
$("#setrngpersist").prop('checked', msg.data).change();
if(!$("#setrngpersist").prop("checked")) {
$("#rngmemory").val("");
}
} else if(msg.cmd == "runs_remotely") {
remote = true;
hide([button_savetofile, button_import, button_importwi]);
@@ -2435,7 +2444,7 @@ $(document).ready(function(){
rs_accept.on("click", function(ev) {
hideMessage();
socket.send({'cmd': 'rndgame', 'data': topic.val()});
socket.send({'cmd': 'rndgame', 'memory': $("#rngmemory").val(), 'data': topic.val()});
hideRandomStoryPopup();
});

View File

@@ -32,6 +32,22 @@ chunk.editing, chunk.editing * {
display: flex;
}
#topic {
margin-top: 20px;
resize: none;
overflow: auto;
background-color: #404040;
color: #ffffff;
}
#rngmemory {
height: 80px;
resize: none;
overflow:auto;
background-color: #404040;
color: #ffffff;
}
#chatname {
background-color: #404040;
color: #ffffff;
@@ -387,7 +403,7 @@ chunk.editing, chunk.editing * {
#rspopup {
width: 800px;
background-color: #262626;
margin-top: 200px;
margin-top: 150px;
}
/*================= Classes =================*/