Skip to content

Commit

Permalink
added image names for all foods
Browse files Browse the repository at this point in the history
  • Loading branch information
theBowja committed Sep 11, 2021
1 parent b6005fb commit f8e5840
Show file tree
Hide file tree
Showing 4 changed files with 415 additions and 139 deletions.
2 changes: 2 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,7 @@ const genshindb = require('genshin-db');
{ name: 'Shrimp Meat', count: 3 },
{ name: 'Matsutake', count: 3 }
],
images: { nameicon: 'UI_ItemIcon_108123' },
url: {
fandom: "https://genshin-impact.fandom.com/wiki/Adeptus'_Temptation"
}
Expand Down Expand Up @@ -2232,6 +2233,7 @@ const genshindb = require('genshin-db');
{ name: 'Small Lamp Grass', count: 1 },
{ name: 'Cheese', count: 1 }
],
images: { nameicon: 'UI_ItemIcon_108058' },
url: {
fandom: 'https://genshin-impact.fandom.com/wiki/"Once_Upon_a_Time_in_Mondstadt"'
}
Expand Down
10 changes: 7 additions & 3 deletions import.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function collateArtifact(existing, newdata) {
})
}

function collateFood(existing, newdata) {
function collateFood(existing, newdata, lang) {
clearObject(existing);
const copyover = ['name', 'rarity', 'foodtype', 'foodfilter', 'foodcategory',
'effect', 'description', 'suspicious', 'normal', 'delicious',
Expand All @@ -341,6 +341,10 @@ function collateFood(existing, newdata) {
if(newdata[prop] !== undefined) existing[prop] = newdata[prop];
}
existing.rarity = existing.rarity+"";
if(lang === 'English') {
newdata.images = {};
newdata.images.nameicon = newdata.imagename;
}
// console.log(newdata);
}

Expand Down Expand Up @@ -456,8 +460,8 @@ function importData(folder, collateFunc, dontwrite, deleteexisting, skipimagered
// importData('weapons', collateWeapon)
// importCurve('weapons');
// importData('artifacts', collateArtifact);
// importData('foods', collateFood);
importData('materials', collateMaterial, undefined, false, true);
importData('foods', collateFood);
// importData('materials', collateMaterial, undefined, false, true);
// importData('domains', collateDomain)

// getRedirectImages(); // separate. for talents
Expand Down
Loading

0 comments on commit f8e5840

Please sign in to comment.