lets see if mr chad gbd can halp
This commit is contained in:
parent
89bab82944
commit
ca73a82f60
|
|
@ -13,6 +13,7 @@ for (let elementName in elements) {
|
||||||
|
|
||||||
runAfterLoad(function() {
|
runAfterLoad(function() {
|
||||||
let modDescriptions = {};
|
let modDescriptions = {};
|
||||||
|
let vanillaElements = Object.keys(elements);
|
||||||
|
|
||||||
let fetchPromises = enabledMods.map(mod => {
|
let fetchPromises = enabledMods.map(mod => {
|
||||||
return fetch(mod)
|
return fetch(mod)
|
||||||
|
|
@ -27,16 +28,20 @@ runAfterLoad(function() {
|
||||||
Promise.all(fetchPromises).then(() => {
|
Promise.all(fetchPromises).then(() => {
|
||||||
Object.keys(elements).forEach(function(elementName) {
|
Object.keys(elements).forEach(function(elementName) {
|
||||||
let element = elements[elementName];
|
let element = elements[elementName];
|
||||||
let elementMod = "Sandboxels (Vanilla)";
|
let elementMod = vanillaElements.includes(elementName) ? "Sandboxels (Vanilla)" : null;
|
||||||
|
|
||||||
for (let mod of enabledMods) {
|
if (!elementMod) {
|
||||||
if (modDescriptions[mod].includes(`elements.${elementName} =`) ||
|
for (let mod of enabledMods) {
|
||||||
modDescriptions[mod].includes(`elements["${elementName}"] =`)) {
|
if (modDescriptions[mod].includes(`elements.${elementName} =`) ||
|
||||||
elementMod = mod;
|
modDescriptions[mod].includes(`elements["${elementName}"] =`)) {
|
||||||
break;
|
elementMod = mod;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!elementMod) elementMod = "Unknown Mod";
|
||||||
|
|
||||||
if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') {
|
if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') {
|
||||||
if (!element.desc.includes("This Element is from")) {
|
if (!element.desc.includes("This Element is from")) {
|
||||||
element.desc += `\nThis Element is from ${elementMod}`;
|
element.desc += `\nThis Element is from ${elementMod}`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue