finalise code
This commit is contained in:
parent
b959a6b047
commit
657fb6bb3b
|
|
@ -11,32 +11,30 @@ for (let elementName in elements) {
|
|||
}
|
||||
}
|
||||
|
||||
runAfterLoad(function() {
|
||||
let modDescriptions = {};
|
||||
let modDescriptions = {};
|
||||
|
||||
let fetchPromises = enabledMods.map(mod => {
|
||||
return fetch(mod)
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
console.log(`Loaded mod: ${mod}`);
|
||||
modDescriptions[mod] = data;
|
||||
})
|
||||
.catch(error => console.error('Error fetching the mod file: ', error));
|
||||
});
|
||||
let fetchPromises = enabledMods.map(mod => {
|
||||
return fetch(mod)
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
console.log(`Loaded mod: ${mod}`);
|
||||
modDescriptions[mod] = data;
|
||||
})
|
||||
.catch(error => console.error('Error fetching the mod file: ', error));
|
||||
});
|
||||
|
||||
Promise.all(fetchPromises).then(() => {
|
||||
Object.keys(elements).forEach(function(elementName) {
|
||||
let element = elements[elementName];
|
||||
|
||||
for (let mod of enabledMods) {
|
||||
if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') {
|
||||
if (!element.desc.includes("This Element is from")) {
|
||||
element.desc += `\nThis Element is from ${mod}`;
|
||||
}
|
||||
} else {
|
||||
element.desc = `This Element is from ${mod}`;
|
||||
Promise.all(fetchPromises).then(() => {
|
||||
Object.keys(elements).forEach(function(elementName) {
|
||||
let element = elements[elementName];
|
||||
|
||||
for (let mod of enabledMods) {
|
||||
if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') {
|
||||
if (!element.desc.includes("This Element is from")) {
|
||||
element.desc += `\nThis Element is from ${mod}`;
|
||||
}
|
||||
} else {
|
||||
element.desc = `This Element is from ${mod}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue