element origin mod

This commit is contained in:
sq 2024-09-22 19:31:30 +08:00 committed by GitHub
parent 9dd16f3fb1
commit 15aa16af65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 29 additions and 0 deletions

29
mods/elementOrigin.js Normal file
View File

@ -0,0 +1,29 @@
// created by SquareScreamYT
for (let elementName in elements) {
let element = elements[elementName];
if (!element.desc.includes("This Element is from")) {
element.desc += "\nThis Element is from Sandboxels (Vanilla)";
}
}
runAfterLoad(function() {
for (let i = 0; i < enabledMods.length; i++) {
let mod = enabledMods[i];
fetch(mod)
.then(response => response.text())
.then(data => {
console.log(`Loaded mod: ${mod}`);
Object.keys(elements).forEach(function(elementName) {
let element = elements[elementName];
if (!element.desc.includes("This Element is from")) {
element.desc += `\nThis Element is from ${mod}`;
}
});
})
.catch(error => console.error('Error fetching the mod file: ', error));
}
});