Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/functions/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const bannerCategories = {
'weapon-event': 'Weapon Event',
standard: 'Standard',
beginners: "Beginners' Wish",
chronicled: 'Chronicled Wish',
};

async function createWorkbook() {
Expand Down
13 changes: 9 additions & 4 deletions src/routes/wish/_excelImport.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'weapon-event': 'Weapon Event',
standard: 'Standard',
beginners: "Beginners' Wish",
chronicled: 'Chronicled Wish',
};

let selectedType = 'default';
Expand Down Expand Up @@ -100,6 +101,7 @@
loading = true;

for (const id of Object.keys(bannerCategories)) {
if (!added[id]) continue;
const { path, data } = await readLocalData(id);
const { append, prepend } = added[id];

Expand Down Expand Up @@ -207,6 +209,7 @@
'weapon-event': 'Weapon Event',
standard: 'Standard',
beginners: "Beginners' Wish",
chronicled: 'Chronicled Wish',
};

const weapons = Object.values(weaponList);
Expand All @@ -217,6 +220,7 @@
if (id === 'beginners' && sheet === undefined) {
sheet = workbook.getWorksheet('Beginners Wish');
}
if (sheet === undefined) continue;

const wishes = [];
sheet.eachRow((row, index) => {
Expand Down Expand Up @@ -295,17 +299,18 @@
}
console.log(itemNames);

const bannerCategories = ['character-event', 'weapon-event', 'standard', 'beginners'];
const bannerCodes = ['301', '302', '200', '100'];
const bannerCategories = ['character-event', 'weapon-event', 'standard', 'beginners', 'chronicled'];
const bannerCodes = ['301', '302', '200', '100', '500'];

const weapons = Object.values(weaponList);
const chars = Object.values(characters);

const typeWeaponTranslate = $t('wish.detail.weapon');
const typeCharacterTranslate = $t('wish.detail.character');

for (let i = 0; i < 4; i++) {
for (let i = 0; i < bannerCategories.length; i++) {
const sheet = workbook.worksheets[i];
if (sheet === undefined) continue;
const id = bannerCategories[i];
let code = bannerCodes[i];
const wishes = [];
Expand Down Expand Up @@ -353,7 +358,7 @@
if (character === undefined) {
pushToast($t('wish.excel.errorUnknownItem') + ` [${id} ${type} ${index}: ${fullName}]`, 'error');
error = {
banner: category,
banner: id,
line: index,
name: fullName,
type,
Expand Down