From 7dec7bfcd0385e72a7136c69895d019d9f0e86ac Mon Sep 17 00:00:00 2001
From: An Orbit <68935009+orbit-loona@users.noreply.github.com>
Date: Tue, 18 Apr 2023 09:14:22 -0400
Subject: [PATCH] quickload pause toggle
---
mods/save_loading.js | 46 +++++++++++++++++++++++++++++---------------
1 file changed, 31 insertions(+), 15 deletions(-)
diff --git a/mods/save_loading.js b/mods/save_loading.js
index 7430c584..55732a54 100644
--- a/mods/save_loading.js
+++ b/mods/save_loading.js
@@ -192,6 +192,9 @@ try {
if(pause) {
paused = true;
document.getElementById("pauseButton").setAttribute("on","true");
+ } else {
+ paused = false;
+ document.getElementById("pauseButton").setAttribute("on","false");
};
return true;
};
@@ -378,22 +381,22 @@ try {
return true;
};
- var saveLoaderDescription = `
`;
elements.save_loader = {
behavior: behaviors.SELFDELETE,
@@ -433,6 +436,7 @@ try {
statsDiv.innerHTML = stats;
}
+ quickloadIsPaused = true;
//Element-based quicksave toggle has proven impossible due to numerous irreparable illogic incidents, so have some buttons instead
var qsb = document.createElement("button");
qsb.setAttribute("id","quicksaveButton");
@@ -442,9 +446,21 @@ try {
qsb.after(document.createTextNode(String.fromCharCode(160)));
var qlb = document.createElement("button");
qlb.setAttribute("id","quickloadButton");
- qlb.setAttribute("onclick","clearAll(); quickload()");
+ qlb.setAttribute("onclick","clearAll(); quickload(quickloadIsPaused ?? true)");
qlb.innerText = "Quickload";
document.getElementById("gameDiv").before(qlb);
+ qlb.after(document.createTextNode(String.fromCharCode(160,160)));
+ var qpc = document.createElement("input");
+ qpc.setAttribute("type","checkbox");
+ qpc.setAttribute("id","quickloadPausedInput");
+ qpc.setAttribute("onchange","quickloadIsPaused = this.checked;");
+ qpc.checked = true;
+ var qpcd = document.createElement("span");
+ qpcd.setAttribute("id","quickloadPausedInputLabel");
+ qpcd.innerText = "Pause after quickloading?";
+ document.getElementById("gameDiv").before(qpc);
+ qpc.after(document.createTextNode(String.fromCharCode(160)));
+ document.getElementById("gameDiv").before(qpcd);
document.getElementById("gameDiv").before(document.createElement("br"));
quickSlDetectorLastKeys = [];