some other twists
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user