Wish input improvement

pull/1/head
Made Baruna 2021-04-30 09:13:59 +08:00
parent 55e4334848
commit ed7c514bcc
No known key found for this signature in database
GPG Key ID: 5AA5DA16AA5DCEAD
6 changed files with 52 additions and 9 deletions

View File

@ -31,6 +31,7 @@
onMount(() => {
if (!isEdit) return;
if (editType === 'unknown_3_star') return;
type = selectOptions.find((e) => e.value === editType);

View File

@ -25,7 +25,7 @@ export async function submitWishTally() {
const data = process(id);
if (data === null) continue;
// if (data.hasManualInput) continue;
if (data.hasManualInput) continue;
console.log('processing wish tally', id);
@ -38,6 +38,8 @@ export async function submitWishTally() {
if (total === 0) continue;
const pityCount = [...banner[i].pityCount].map((e) => e || 0);
if (pityCount.length > 90) continue;
const rarePity = banner[i].rarePity;
const legendaryCount = banner[i].legendary.length;
const rareCount = banner[i].rare.character.length + banner[i].rare.weapon.length;
@ -59,6 +61,7 @@ export async function submitWishTally() {
legendaryPulls.push(...includedRarePulls);
}
// console.log(pityCount);
// console.log(legendaryPulls);
// console.log(rarePity);
// console.log(legendaryCount, rareCount, total);

View File

@ -117,6 +117,10 @@
"manualButton": "Enable Manual Input",
"errorBanner": "Banner time missmatch! Please adjust your server on settings page. Still not working? please leave a message on Discord 😅",
"globalWishTally": "Global Wish Tally",
"pityTooltip": [
"Shows your current {rarity} pity",
"{count} pulls to guaranteed {rarity}"
],
"import": {
"title": "Import Wish History",
"faqsButton": "FAQ - READ FIRST",
@ -300,7 +304,8 @@
"totalThisBanner": "Total pull on this banner",
"worth": "Worth",
"loading": "Loading... (If this stuck, change your server on settings page)",
"guaranteed": "The next 5★ is guaranteed to be the promotional character or weapon"
"guaranteed": "The next 5★ is guaranteed to be the promotional character or weapon",
"unknown_3_star": "Unknown"
},
"tally": {
"title": "Wish Tally",
@ -576,4 +581,4 @@
"title": "Achievement",
"of": "of"
}
}
}

View File

@ -88,6 +88,10 @@
"manualButton": "Nyalakan Input Manual",
"errorBanner": "Waktu banner salah! Coba sesuaikan server di halaman settings. Masih gak bisa? tolong chat di Discord 😅",
"globalWishTally": "Perhitungan Pity Wish Global",
"pityTooltip": [
"Ini adalah pity {rarity} sekarang",
"{count}x wish lagi untuk dijamin {rarity}"
],
"import": {
"title": "Import Riwayat Wish",
"faqsButton": "FAQS - BACA DULU",

View File

@ -75,6 +75,11 @@
index: i,
...e,
});
} else if (e.type === 'unknown_3_star' && showRarity[2]) {
sorted.push({
index: i,
...e,
});
}
}
@ -228,6 +233,7 @@
id: 'unknown_3_star',
time: dayjs().unix(),
pity: 1,
manualInput: true,
})),
];
}
@ -278,7 +284,7 @@
<div
class={`${
isEdit ? 'bg-item flex-col py-2' : 'bg-background flex-row items-center justify-center mb-2 p-4'
} rounded-xl flex`}
} rounded-xl flex relative`}
>
<span class="text-gray-200 whitespace-no-wrap flex-1">
{$t('wish.lifetimePulls')}<br />
@ -294,9 +300,16 @@
<div
class={`${
isEdit ? 'bg-item flex-col py-2' : 'bg-background flex-row items-center justify-center mb-2 p-4'
} rounded-xl flex`}
title={`${legendaryPity - legendary} pulls to guaranteed 5 star`}
} rounded-xl flex group relative`}
>
{#if !isEdit}
<div class="group-hover:flex hidden absolute left-0 pl-2 items-center z-10" style="max-width: 80%;">
<div class="bg-gray-200 text-gray-900 px-4 py-2 rounded-xl text-sm md:text-base">
<p>{$t('wish.pityTooltip.0', { values: { rarity: '5★' } })}</p>
<p>{$t('wish.pityTooltip.1', { values: { count: legendaryPity - legendary, rarity: '5★' } })}</p>
</div>
</div>
{/if}
<span class="text-gray-200 whitespace-no-wrap flex-1">
5
<Icon path={mdiStar} size={0.75} className="mb-1" />
@ -310,9 +323,16 @@
<div
class={`${
isEdit ? 'bg-item flex-col py-2' : 'bg-background flex-row items-center justify-center mb-2 p-4'
} rounded-xl flex`}
title={`${10 - rare} pulls to guaranteed 4 star`}
} rounded-xl flex group relative`}
>
{#if !isEdit}
<div class="group-hover:flex hidden absolute left-0 pl-2 items-center z-10" style="max-width: 80%;">
<div class="bg-gray-200 text-gray-900 px-4 py-2 rounded-xl text-sm md:text-base">
<p>{$t('wish.pityTooltip.0', { values: { rarity: '4★' } })}</p>
<p>{$t('wish.pityTooltip.1', { values: { count: 10 - rare, rarity: '4★' } })}</p>
</div>
</div>
{/if}
<span class="text-gray-200 whitespace-no-wrap flex-1">
4
<Icon path={mdiStar} size={0.75} className="mb-1" />
@ -370,6 +390,9 @@
<button on:click={() => toggleShowRarity(2)} class={`pill normal ${showRarity[2] ? 'active' : ''}`}>
3 <Icon path={mdiStar} size={0.75} className="mb-1" />
</button>
<a href="/wish/{id}" class="pill normal">
<Icon path={mdiTableOfContents} color="white" />
</a>
</div>
<table class="w-full">
<tr>
@ -378,7 +401,11 @@
<th class="border-b border-gray-700 text-gray-400 font-display text-right">Pity</th>
</tr>
{#each sortedPull as pull}
<tr on:click={manualInput ? () => openEditModal(pull.index, pull.type, pull.id, pull.time, pull.pity) : () => {}}>
<tr
on:click={manualInput
? () => openEditModal(pull.index, pull.type, pull.id, pull.time, pull.pity)
: () => {}}
>
{#if pull.type === 'character'}
<td
class={`border-b border-gray-700 py-1 pl-2 font-semibold ${
@ -399,6 +426,8 @@
: 'text-primary'
}`}>{weaponList[pull.id].name}</td
>
{:else if pull.type === 'unknown_3_star'}
<td class="border-b border-gray-700 py-1 pl-2 font-semibold text-primary">Unknown</td>
{/if}
<td class="border-b border-gray-700 text-sm py-1 px-2 whitespace-no-wrap" style="font-family: monospace;"
>{dayjs.unix(pull.time).format('YYYY-MM-DD HH:mm:ss')}</td

View File

@ -54,6 +54,7 @@ module.exports = {
borderColor: ['responsive', 'hover', 'focus', 'focus-within', 'disabled'],
opacity: ['group-hover', 'responsive', 'hover', 'focus', 'disabled'],
borderWidth: ['responsive', 'last', 'hover', 'focus'],
display: ['responsive', 'group-hover'],
},
plugins: [],
future: {