mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-01-07 11:04:50 +01:00
Fix todo bugs
This commit is contained in:
parent
e8581f8255
commit
5054f9d87f
3 changed files with 16 additions and 32 deletions
|
@ -390,7 +390,8 @@
|
||||||
"mora": "Mora (approximate ±40)",
|
"mora": "Mora (approximate ±40)",
|
||||||
"expWasted": "EXP Wasted",
|
"expWasted": "EXP Wasted",
|
||||||
"addToTodo": "Add to Todo List",
|
"addToTodo": "Add to Todo List",
|
||||||
"addedToTodo": "Added to Todo List"
|
"addedToTodo": "Added to Todo List",
|
||||||
|
"talent": ["Attack", "Skill", "Burst"]
|
||||||
},
|
},
|
||||||
"expTable": {
|
"expTable": {
|
||||||
"level": "Level",
|
"level": "Level",
|
||||||
|
|
|
@ -284,6 +284,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
moraNeeded = moraNeeded + talentMaterial.mora;
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateTalent() {
|
function calculateTalent() {
|
||||||
|
@ -407,6 +409,14 @@
|
||||||
calculateTalent();
|
calculateTalent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const [id, item] of Object.entries(talentMaterial.items)) {
|
||||||
|
if (ascensionResouce[id]) {
|
||||||
|
ascensionResouce[id].amount += item.amount;
|
||||||
|
} else {
|
||||||
|
ascensionResouce[id] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
changed = false;
|
changed = false;
|
||||||
|
@ -429,14 +439,6 @@
|
||||||
return prev;
|
return prev;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const talentRes = Object.keys(talentMaterial.items).reduce((prev, item) => {
|
|
||||||
if (talentMaterial.items[item].amount > 0) {
|
|
||||||
prev[item] = talentMaterial.items[item].amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
return prev;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
addTodo({
|
addTodo({
|
||||||
type: 'character',
|
type: 'character',
|
||||||
character: withAscension ? selectedCharacter : null,
|
character: withAscension ? selectedCharacter : null,
|
||||||
|
@ -445,13 +447,11 @@
|
||||||
mora: moraNeeded,
|
mora: moraNeeded,
|
||||||
...levelRes,
|
...levelRes,
|
||||||
...ascensionRes,
|
...ascensionRes,
|
||||||
...talentRes,
|
|
||||||
},
|
},
|
||||||
original: {
|
original: {
|
||||||
mora: moraNeeded,
|
mora: moraNeeded,
|
||||||
...levelRes,
|
...levelRes,
|
||||||
...ascensionRes,
|
...ascensionRes,
|
||||||
...talentRes,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -460,6 +460,7 @@
|
||||||
addedToTodo = false;
|
addedToTodo = false;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="bg-item rounded-xl p-4">
|
<div class="bg-item rounded-xl p-4">
|
||||||
|
@ -665,26 +666,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
{#each Object.entries(talentMaterial.items) as [id, item]}
|
|
||||||
{#if item.amount > 0}
|
|
||||||
<tr>
|
|
||||||
<td class="text-right border-b border-gray-700 py-1">
|
|
||||||
<span class="text-white mr-2 whitespace-no-wrap"
|
|
||||||
>{item.amount}
|
|
||||||
<Icon size={0.5} path={mdiClose} /></span
|
|
||||||
>
|
|
||||||
</td>
|
|
||||||
<td class="border-b border-gray-700 py-1">
|
|
||||||
<span class="text-white">
|
|
||||||
<span class="w-6 inline-block">
|
|
||||||
<img class="h-6 inline-block mr-1" src={`/images/items/${id}.png`} alt={item.name} />
|
|
||||||
</span>
|
|
||||||
{item.name}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/if}
|
|
||||||
{/each}
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right border-b border-gray-700 py-1">
|
<td class="text-right border-b border-gray-700 py-1">
|
||||||
<span class="text-white mr-2 whitespace-no-wrap"
|
<span class="text-white mr-2 whitespace-no-wrap"
|
||||||
|
|
|
@ -270,6 +270,7 @@
|
||||||
|
|
||||||
$: $todos, updateSummary();
|
$: $todos, updateSummary();
|
||||||
$: columnCount, updateId();
|
$: columnCount, updateId();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
@ -456,7 +457,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<table class="w-full">
|
<table class="w-full">
|
||||||
{#each Object.entries(todo.resources) as [id, amount]}
|
{#each Object.entries(todo.resources).sort((a, b) => b[1] - a[1]) as [id, amount]}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right border-b border-gray-700 py-1">
|
<td class="text-right border-b border-gray-700 py-1">
|
||||||
<span class={`${amount === 0 ? 'line-through text-gray-600' : 'text-white'} mr-2 whitespace-no-wrap`}>
|
<span class={`${amount === 0 ? 'line-through text-gray-600' : 'text-white'} mr-2 whitespace-no-wrap`}>
|
||||||
|
@ -496,4 +497,5 @@
|
||||||
@apply border-b-0;
|
@apply border-b-0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue