mirror of
https://github.com/theBowja/GenshinData-1.git
synced 2025-04-28 18:18:13 +09:00
abc
This commit is contained in:
parent
e36c41e24f
commit
e92ae623ef
@ -5,7 +5,7 @@ const xdescribe = getExcel('AnimalDescribeExcelConfigData');
|
||||
const xcapture = getExcel('CaptureExcelConfigData');
|
||||
|
||||
// FIX THIS EVERY VERSION
|
||||
const propCOUNTTYPE = "OCCLHPBCDGL";
|
||||
const propCOUNTTYPE = "FEBIEOGMDMF"; // AnimalCodexExcelConfigData
|
||||
|
||||
function collateAnimal(lang) {
|
||||
const language = getLanguage(lang);
|
||||
|
@ -53,7 +53,7 @@ function collateCharacter(lang) {
|
||||
data.element = language[extra.avatarVisionBeforTextMapHash];
|
||||
data.constellation = language[extra.avatarConstellationBeforTextMapHash];
|
||||
if(obj.id === 10000030) data.constellation = language[extra.avatarConstellationAfterTextMapHash]; // Zhongli exception
|
||||
data.title = language[extra.avatarTitleTextMapHash];
|
||||
data.title = language[extra.avatarTitleTextMapHash] || "";
|
||||
data.association = extra.avatarAssocType.slice(extra.avatarAssocType.indexOf('TYPE_')+5);
|
||||
if(associationToCityId[data.association] === undefined)
|
||||
console.log(`character missing cityId for association ${data.association}`);
|
||||
|
@ -129,7 +129,7 @@ function collateDomain(lang) {
|
||||
}
|
||||
});
|
||||
// if(obj.disorderoverride) data.disorder = obj.disorderoverride.map(d => language[d]); // fix not needed anymore
|
||||
data.disorder = xdisorder.filter(d => d.id+'' === Object.keys(obj.levelConfigMap)[0]).map(d => language[d.descTextMapHash]);
|
||||
data.disorder = xdisorder.filter(d => d.id+'' === Object.keys(obj.levelConfigMap)[0]).map(d => language[d.descTextMapHash]).filter(ele => ele !== '' && ele !== undefined);
|
||||
data.imagename = obj.entryPicPath;
|
||||
|
||||
let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]);
|
||||
|
@ -106,12 +106,12 @@ function collateMaterial(lang) {
|
||||
}, []);
|
||||
}
|
||||
const sourcelist = tmp.textList.concat(tmp.jumpList);
|
||||
data.source = sourcelist.map(ele => language[ele]).filter(ele => ele !== ''); // TextList/JumpList
|
||||
data.source = sourcelist.map(ele => language[ele]).filter(ele => ele !== '' && ele !== undefined); // TextList/JumpList
|
||||
|
||||
data.imagename = obj.icon;
|
||||
if(!data.imagename) console.log(data.name+' has no icon');
|
||||
|
||||
let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]);
|
||||
let filename = makeUniqueFileName(obj.nameTextMapHash, accum);
|
||||
if(filename === '') return accum;
|
||||
if(filename.includes('shrineofdepthskey')) return accum;
|
||||
accum[filename] = data;
|
||||
|
@ -15,7 +15,7 @@ function collateNamecard(lang) {
|
||||
data.sortorder = obj.id;
|
||||
|
||||
let sauce = xsource.find(ele => ele.id === obj.id);
|
||||
data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== '');
|
||||
data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== '' && ele !== undefined);
|
||||
|
||||
|
||||
data.nameicon = obj.icon;
|
||||
|
@ -5,9 +5,9 @@ const xavatar = getExcel('AvatarExcelConfigData');
|
||||
|
||||
// for AvatarCostumeExcelConfigData
|
||||
const propertyMap = {
|
||||
id: 'GMECDCKBFJM', // 200301
|
||||
avatarId: 'FMAJGGBGKKN', // 10000003
|
||||
iconName: 'FOINIGFDKIP' // UI_AvatarIcon_QinCostumeSea
|
||||
id: 'BDFMGMADMGC', // 200301
|
||||
avatarId: 'PDBPABLOMMA', // 10000003
|
||||
iconName: 'MKPEEANCLCO' // UI_AvatarIcon_QinCostumeSea
|
||||
}
|
||||
|
||||
// taken from collateCharacter.js
|
||||
@ -33,7 +33,7 @@ function collateOutfit(lang) {
|
||||
|
||||
if(obj.itemId) {
|
||||
let sauce = xsource.find(ele => ele.id === obj.itemId);
|
||||
data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== '');
|
||||
data.source = sauce.textList.map(ele => language[ele]).filter(ele => ele !== '' && ele !== undefined);
|
||||
|
||||
data.namecard = xmat.find(ele => ele.id === obj.itemId).icon;
|
||||
} else {
|
||||
|
@ -49,7 +49,7 @@ function collateTalent(lang) {
|
||||
// build the labels
|
||||
let attTalent = xpassive.find(tal => (tal.proudSkillGroupId === talent.proudSkillGroupId && tal.level === 1));
|
||||
for(let labelTextMap of attTalent.paramDescList) {
|
||||
if(language[labelTextMap] === "") continue;
|
||||
if(language[labelTextMap] === "" || language[labelTextMap] === undefined) continue;
|
||||
ref.labels.push(replaceLayout(language[labelTextMap]));
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,8 @@ function collateWeapon(lang) {
|
||||
|
||||
let data = {};
|
||||
data.id = obj.id;
|
||||
let filename = makeFileName(getLanguage('EN')[obj.nameTextMapHash]);
|
||||
let filename = makeUniqueFileName(obj.nameTextMapHash, accum);
|
||||
if(filename === "") return accum;
|
||||
if(accum[filename] !== undefined) console.log(filename+' IS NOT UNIQUE');
|
||||
|
||||
data.name = language[obj.nameTextMapHash];
|
||||
|
@ -34,7 +34,7 @@ global.capitalizeFirst = function(str) { return str[0].toUpperCase() + str.toLow
|
||||
global.replaceLayout = function(str) { return str.replace(/{LAYOUT_MOBILE#.*?}{LAYOUT_PC#(.*?)}{LAYOUT_PS#.*?}/gi,'$1').replace('#','').replaceAll('{NON_BREAK_SPACE}', ' '); }
|
||||
global.replaceNewline = function(str) { return str.replace(/\\n/gi, '\n'); }
|
||||
global.sanitizeDescription = function(str) { return replaceNewline(replaceLayout(stripHTML(convertBold(str || '')))); }
|
||||
global.getMatSourceText = function(id, textmap) { return getExcel('MaterialSourceDataExcelConfigData').find(e => e.id === id).textList.map(e => textmap[e]).filter(e => e !== ''); }
|
||||
global.getMatSourceText = function(id, textmap) { return getExcel('MaterialSourceDataExcelConfigData').find(e => e.id === id).textList.map(e => textmap[e]).filter(e => e !== '' && e !== undefined); }
|
||||
/* ======================================================================================= */
|
||||
|
||||
// object map that converts the genshin coded element into a TextMapHash
|
||||
@ -70,6 +70,20 @@ global.dayOfWeek = function(num) {
|
||||
return xmanualtext.find(ele => ele.textMapId === 'UI_ABYSSUS_DATE'+num).textMapContentTextMapHash;
|
||||
}
|
||||
|
||||
// if it isn't unique, then appends "a" to end. or "b". all the way to "z".
|
||||
global.makeUniqueFileName = function(textmaphash, map) {
|
||||
let name = getLanguage('EN')[textmaphash];
|
||||
if(name === "" || name === undefined) return "";
|
||||
let filename = makeFileName(name);
|
||||
if(map[filename] === undefined) return filename;
|
||||
|
||||
let charset = "abcdefghijklmnopqrstuvwxyz";
|
||||
let i = 0;
|
||||
while(map[filename+charset[i]] !== undefined) { i++; }
|
||||
if(i === 26) console.log("cannot make unique filename for " + name);
|
||||
else return filename+charset[i];
|
||||
}
|
||||
|
||||
const xcity = getExcel('CityConfigData');
|
||||
// adds Snezhnaya manually
|
||||
if(!xcity.find(ele => getLanguage('EN')[ele.cityNameTextMapHash] === 'Snezhnaya')) {
|
||||
@ -123,7 +137,7 @@ function exportData(folder, collateFunc, englishonly, skipwrite) {
|
||||
// exportData('characters', require('./collateCharacter.js'));
|
||||
// exportCurve('characters', 'AvatarCurveExcelConfigData');
|
||||
// exportData('constellations', require('./collateConstellation'));
|
||||
// exportData('talents', require('./collateTalent.js'));
|
||||
exportData('talents', require('./collateTalent.js'));
|
||||
// exportData('weapons', require('./collateWeapon.js'));
|
||||
// exportCurve('weapons', 'WeaponCurveExcelConfigData')
|
||||
// exportData('artifacts', require('./collateArtifact.js'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user