quickload pause toggle

This commit is contained in:
An Orbit 2023-04-18 09:14:22 -04:00 committed by GitHub
parent 3131472a3d
commit 7dec7bfcd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 15 deletions

View File

@ -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;
};
@ -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 = [];