some other twists

This commit is contained in:
2023-02-06 02:59:27 +09:00
parent b709ca838f
commit 1ef2570f45
4 changed files with 261 additions and 75 deletions

View File

@@ -9,19 +9,16 @@
export let attackId: number | undefined;
let attackData;
$: {
if (myValue > 0 && myValue !== currentValue) {
invoke("search_move", { index: myValue }).then((r) => {
currentValue = myValue;
if (moveValue > 0) {
invoke("search_move", { index: moveValue }).then((r) => {
attackData = r;
console.log(attackData);
moveValue = undefined;
});
}
if (!!attackId) {
console.log(attackId);
invoke("search_move", { index: attackId }).then((r) => {
currentValue = myValue = attackId;
attackData = r;
console.log(attackData);
attackId = undefined;
});
}
@@ -44,6 +41,10 @@
(!!attackData && ![1, 2].includes(attackData.category))
) {
// display some message somewhere
total_max_damage = 0;
total_min_damage = 0;
total_max_damage_percentage = 0;
total_min_damage_percentage = 0;
console.log("skip");
return;
}
@@ -353,8 +354,7 @@
return [];
}
}
let myValue;
let currentValue = 0;
let moveValue;
</script>
<div class="calculator">
@@ -392,7 +392,7 @@
localFiltering={false}
labelFieldName="name"
valueFieldName="id"
bind:value={myValue}
bind:value={moveValue}
/>
</td>
<td>{ attackData ? attackData.name : "" }</td>