Anonymous

Module:GameData/doc: Difference between revisions

From Melvor Idle
Support shop purchases for data modifications, and suppress language data warnings
(Update for v1.1.2)
(Support shop purchases for data modifications, and suppress language data warnings)
Line 491: Line 491:
const modCat = modDataKeys[modCatID];
const modCat = modDataKeys[modCatID];
const catData = modData[modCat];
const catData = modData[modCat];
if (modCat === 'shopUpgradeChains') {
if ((modCat === 'shopUpgradeChains') || (modCat === 'shopPurchases')) {
// Modify the root upgrade ID of shop upgrade chains
// Modify the root upgrade ID of shop upgrade chains, and modify attributes of shop purchases
catData.forEach((modItem) => {
catData.forEach((modItem) => {
const modObjID = modItem.id;
const modObjID = modItem.id;
Line 843: Line 843:
}
}
}
}
const hasNoLangData = [
// Categories that contain no localized text. Supresses warnings about no lang data
'bankSortOrder',
'combatAreaDisplayOrder',
'combatEvents',
'dungeonDisplayOrder',
'golbinRaid',
'itemEffects',
'itemSynergies',
'itemUpgrades',
'itmMonsters',
'randomGems',
'randomSuperiorGems',
'slayerAreaDisplayOrder',
'shopCategoryOrder',
'shopDisplayOrder',
'spiderLairMonsters',
'stackingEffects'
];
const langKeys = {
const langKeys = {
ancientSpells: {
ancientSpells: {
Line 1,052: Line 1,071:
langKeyData = { _root: langKeys[nodeKey] };
langKeyData = { _root: langKeys[nodeKey] };
}
}
else {
else if (!hasNoLangData.includes(nodeKey)) {
console.warn('No lang key data found for ' + nodeKey);
console.warn('No lang key data found for ' + nodeKey);
}
}