Last active
December 27, 2022 10:44
-
-
Save SagiriHimoto/7d9555c3044eaa2c7a9eb9832beb77d7 to your computer and use it in GitHub Desktop.
Allows you to export pony town toy textures with ease
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Download Function */ | |
const downloadURI = (uri, name) => { | |
const link = document.createElement("a"); | |
link.download = name; | |
link.href = uri; | |
document.body.appendChild(link); | |
link.click(); | |
document.body.removeChild(link); | |
} | |
/* Locate toy and download function */ | |
function GetToyURIDownload(toynomber) { | |
const childnumber = toynomber + 2 | |
var sourceCanvas = document.querySelector("body > modal-container > div.modal-dialog.undefined > div > toys-modal > div.modal-body > div.selection-container > div > div > div > div:nth-child("+childnumber+") > toy-canvas > canvas"); | |
sourceImageData = sourceCanvas.toDataURL("image/png"); | |
downloadURI(""+sourceImageData+"", "Toy "+toynomber+""); | |
} | |
/* Put toy nomber in brackets */ | |
/* If you are missing some toys in the list, then subtract the amount of missing toys from the toy number */ | |
GetToyURIDownload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment