unrelated to scripts but kinda neato autolayers option
This commit is contained in:
parent
fc0d6d136d
commit
464da36e2a
2 changed files with 19 additions and 0 deletions
|
@ -515,6 +515,10 @@ const _generate = async (endpoint, request, bb, options = {}) => {
|
||||||
ctx.drawImage(keepUnmaskCanvas, 0, 0);
|
ctx.drawImage(keepUnmaskCanvas, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (localStorage.getItem("openoutpaint/settings.autolayer") == "true") {
|
||||||
|
commands.runCommand("addLayer", "Added Layer", {});
|
||||||
|
}
|
||||||
|
|
||||||
commands.runCommand("drawImage", "Image Dream", {
|
commands.runCommand("drawImage", "Image Dream", {
|
||||||
x: bb.x,
|
x: bb.x,
|
||||||
y: bb.y,
|
y: bb.y,
|
||||||
|
|
|
@ -90,6 +90,10 @@
|
||||||
Lie to HRfix:
|
Lie to HRfix:
|
||||||
<input id="hrfix-liar" class="canvas-size-input" type="checkbox" />
|
<input id="hrfix-liar" class="canvas-size-input" type="checkbox" />
|
||||||
</label>
|
</label>
|
||||||
|
<label style="display: flex">
|
||||||
|
New Layer per Dream:
|
||||||
|
<input id="autolayer" class="canvas-size-input" type="checkbox" />
|
||||||
|
</label>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const canvasWidth = document.getElementById("canvas-width");
|
const canvasWidth = document.getElementById("canvas-width");
|
||||||
|
@ -98,6 +102,7 @@
|
||||||
const minCfg = document.getElementById("min-cfg");
|
const minCfg = document.getElementById("min-cfg");
|
||||||
const maxCfg = document.getElementById("max-cfg");
|
const maxCfg = document.getElementById("max-cfg");
|
||||||
const hrfixLiar = document.getElementById("hrfix-liar");
|
const hrfixLiar = document.getElementById("hrfix-liar");
|
||||||
|
const autolayer = document.getElementById("autolayer");
|
||||||
|
|
||||||
function writeToLocalStorage() {
|
function writeToLocalStorage() {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
|
@ -115,6 +120,10 @@
|
||||||
"openoutpaint/settings.hrfix-liar",
|
"openoutpaint/settings.hrfix-liar",
|
||||||
hrfixLiar.checked
|
hrfixLiar.checked
|
||||||
);
|
);
|
||||||
|
localStorage.setItem(
|
||||||
|
"openoutpaint/settings.autolayer",
|
||||||
|
autolayer.checked
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loads values from local storage
|
// Loads values from local storage
|
||||||
|
@ -133,6 +142,11 @@
|
||||||
? true
|
? true
|
||||||
: localStorage.getItem("openoutpaint/settings.hrfix-liar") === "true";
|
: localStorage.getItem("openoutpaint/settings.hrfix-liar") === "true";
|
||||||
hrfixLiar.checked = _enable_dishonesty;
|
hrfixLiar.checked = _enable_dishonesty;
|
||||||
|
let _enable_autolayers =
|
||||||
|
localStorage.getItem("openoutpaint/settings.autolayer") === null
|
||||||
|
? false
|
||||||
|
: localStorage.getItem("openoutpaint/settings.autolayer") === "true";
|
||||||
|
autolayer.checked = _enable_autolayers;
|
||||||
|
|
||||||
writeToLocalStorage();
|
writeToLocalStorage();
|
||||||
|
|
||||||
|
@ -142,6 +156,7 @@
|
||||||
minCfg.onchange = writeToLocalStorage;
|
minCfg.onchange = writeToLocalStorage;
|
||||||
maxCfg.onchange = writeToLocalStorage;
|
maxCfg.onchange = writeToLocalStorage;
|
||||||
hrfixLiar.onchange = writeToLocalStorage;
|
hrfixLiar.onchange = writeToLocalStorage;
|
||||||
|
autolayer.onchange = writeToLocalStorage;
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue