Skip to content
Merged

Deploy #1818

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
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
propsFunc: () => ({
datas: data.datas,
descriptionText: data.descriptionText,
haveIndexes: data.haveIndexes,
iconOverride: data.icon,
nameOverride: data.nameOverride,
showCurrencies: [] as number[],
statuses: data.statuses,
character,
group,
}),
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/components/items/guild-banks/Tab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@

<style lang="scss">
.collection-v2-section {
width: calc((46px * 14) + (0.04rem * 13) + (0.75rem * 2));
width: calc((48px * 14) + (0.04rem * 13) + (0.75rem * 2));
}
.collection-objects {
--item-empty-border: var(--border-color);

flex-flow: column wrap;
gap: 0.04rem;
height: calc((46px * 7) + (0.04rem * 6));
height: calc((48px * 7) + (0.04rem * 6));
}
</style>

Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/components/progress/ProgressTableBody.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
propsFunc: () => ({
datas: progressData.datas,
descriptionText: progressData.descriptionText,
haveIndexes: progressData.haveIndexes,
iconOverride: progressData.icon,
nameOverride: progressData.nameOverride,
showCurrencies: [progressData.showCurrency],
statuses: progressData.statuses,
character,
group,
}),
Expand Down
168 changes: 92 additions & 76 deletions apps/frontend/components/tooltips/progress/TooltipProgress.svelte
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
<script lang="ts">
import { covenantFeatureCost } from '@/data/covenant';
// import { covenantFeatureCost } from '@/data/covenant';
import { Faction } from '@/enums/faction';
import { ProgressDataType } from '@/enums/progress-data-type';
import { wowthingData } from '@/shared/stores/data';
import { userAchievementStore } from '@/stores';
import { QuestStatus } from '@/enums/quest-status';
// import { wowthingData } from '@/shared/stores/data';
// import { userAchievementStore } from '@/stores';
import { getNameForFaction } from '@/utils/get-name-for-faction';
import type { Character } from '@/types';
import type { ManualDataProgressData, ManualDataProgressGroup } from '@/types/data/manual';
import type { CharacterProps } from '@/types/props';

import ParsedText from '@/shared/components/parsed-text/ParsedText.svelte';
import QuestStatusIcon from '@/shared/components/icons/QuestStatusIcon.svelte';
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';
import YesNoIcon from '@/shared/components/icons/YesNoIcon.svelte';

export let character: Character;
export let datas: ManualDataProgressData[];
export let descriptionText: Record<number, string>;
export let group: ManualDataProgressGroup;
export let haveIndexes: number[];
export let iconOverride: string;
export let nameOverride: Record<number, string>;
export let showCurrencies: number[] = [];

let cls: string;
let dataChunks: [ManualDataProgressData, number][][];
$: {
cls = (datas || []).some((data, i) => {
const desc = descriptionText[i] || data.description;

type Props = CharacterProps & {
datas: ManualDataProgressData[];
descriptionText: Record<number, string>;
group: ManualDataProgressGroup;
iconOverride: string;
nameOverride: Record<number, string>;
statuses: QuestStatus[];
showCurrencies?: number[];
};

let {
character,
datas,
descriptionText: initialDescriptionText,
group,
iconOverride,
nameOverride,
statuses,
showCurrencies = [],
}: Props = $props();

let [cls, dataChunks, descriptionText] = $derived.by(() => {
let retCls: string;
let retDataChunks: [ManualDataProgressData, number][][] = [[]];
let retDescriptionText = initialDescriptionText;

retCls = (datas || []).some((data, i) => {
const desc = initialDescriptionText[i] || data.description;
if (desc && desc.length > 20) {
return true;
}
Expand All @@ -34,73 +49,76 @@
: 'short';

// Special cases
if (group.name === 'Valorous Appearances') {
const cheev = wowthingData.achievements.achievementById.get(datas[1].ids[0]);
const rootTree = wowthingData.achievements.criteriaTreeById.get(cheev.criteriaTreeId);
const charCheev = $userAchievementStore.addonAchievements[character.id]?.[cheev.id];
const newDesc = { ...descriptionText };
if (charCheev?.earned !== true) {
for (let childIndex = 0; childIndex < rootTree.children.length; childIndex++) {
const childTree = wowthingData.achievements.criteriaTreeById.get(
rootTree.children[childIndex]
);
newDesc[1] += `<br>${charCheev?.criteria?.[childIndex] > 0 ? '✔' : '❌'} ${childTree.description}`;
}
}
descriptionText = newDesc;
} else if (datas.length === 1 && datas[0].type === ProgressDataType.SlCovenant) {
const currentRank = parseInt(descriptionText[0].split(' ')[1].split('/')[0]);
const isSpecial = datas[0].value === 4;
const prices = covenantFeatureCost[datas[0].value];

const newDatas: ManualDataProgressData[] = [];
const newDescriptionText: Record<number, string> = {};
const newHaveIndexes: number[] = [];

for (let rank = 1; rank <= (isSpecial ? 5 : 3); rank++) {
newDatas.push({
...datas[0],
name: `Rank ${rank}`,
});

newDescriptionText[rank - 1] =
`{priceShort:${prices[rank - 1][0]}|1810}&nbsp;&nbsp;{priceShort:${prices[rank - 1][1]}|1813}`;

if (currentRank >= rank) {
newHaveIndexes.push(rank - 1);
}
}

cls = 'short';
datas = newDatas;
descriptionText = newDescriptionText;
haveIndexes = newHaveIndexes;
showCurrencies = [1810, 1813];
} else {
showCurrencies = group.currencies || [];
}
// TODO: fix this better elsewhere
// if (group.name === 'Valorous Appearances') {
// const cheev = wowthingData.achievements.achievementById.get(datas[1].ids[0]);
// const rootTree = wowthingData.achievements.criteriaTreeById.get(cheev.criteriaTreeId);
// const charCheev = $userAchievementStore.addonAchievements[character.id]?.[cheev.id];
// const newDesc = { ...initialDescriptionText };
// if (charCheev?.earned !== true) {
// for (let childIndex = 0; childIndex < rootTree.children.length; childIndex++) {
// const childTree = wowthingData.achievements.criteriaTreeById.get(
// rootTree.children[childIndex]
// );
// newDesc[1] += `<br>${charCheev?.criteria?.[childIndex] > 0 ? '✔' : '❌'} ${childTree.description}`;
// }
// }
// retDescriptionText = newDesc;
// } else if (datas.length === 1 && datas[0].type === ProgressDataType.SlCovenant) {
// const currentRank = parseInt(initialDescriptionText[0].split(' ')[1].split('/')[0]);
// const isSpecial = datas[0].value === 4;
// const prices = covenantFeatureCost[datas[0].value];

// const newDatas: ManualDataProgressData[] = [];
// const newDescriptionText: Record<number, string> = {};
// const newHaveIndexes: number[] = [];

// for (let rank = 1; rank <= (isSpecial ? 5 : 3); rank++) {
// newDatas.push({
// ...datas[0],
// name: `Rank ${rank}`,
// });

// newDescriptionText[rank - 1] =
// `{priceShort:${prices[rank - 1][0]}|1810}&nbsp;&nbsp;{priceShort:${prices[rank - 1][1]}|1813}`;

// if (currentRank >= rank) {
// newHaveIndexes.push(rank - 1);
// }
// }

// retCls = 'short';
// datas = newDatas;
// retDescriptionText = newDescriptionText;
// haveIndexes = newHaveIndexes;
// showCurrencies = [1810, 1813];
// } else {
// showCurrencies = group.currencies || [];
// }

// Split data
dataChunks = [[]];
for (let dataIndex = 0; dataIndex < datas.length; dataIndex++) {
const data = datas[dataIndex];
if (data.name === 'separator') {
dataChunks.push([]);
retDataChunks.push([]);
continue;
}

dataChunks[dataChunks.length - 1].push([data, dataIndex]);
retDataChunks[retDataChunks.length - 1].push([data, dataIndex]);
}

// if (group.name.startsWith('Sojourner')) {
// console.log({group, dataChunks, descriptionText, haveIndexes, nameOverride});
// }
}

$: groupName =
return [retCls, retDataChunks, retDescriptionText];
});

let groupName = $derived(
group.lookup === 'faction'
? `:${Faction[character.faction].toLocaleLowerCase()}: ${getNameForFaction(group.name, character.faction)}`
: group.name;
: group.name
);
</script>

<style lang="scss">
Expand Down Expand Up @@ -153,21 +171,19 @@
<tbody>
{#each dataChunk as [data, dataIndex]}
{@const description = descriptionText[dataIndex] || data.description}
{@const status = statuses[dataIndex]}
<tr>
<td class="progress">
{#if iconOverride}
<WowthingImage name={iconOverride} size={20} border={1} />
{:else}
<YesNoIcon
state={haveIndexes.indexOf(dataIndex) >= 0}
useStatusColors={true}
/>
<QuestStatusIcon {status} useStatusColors={true} />
{/if}
</td>
<td class="name">
<ParsedText text={nameOverride[dataIndex] || data.name} />

{#if description && (haveIndexes.indexOf(dataIndex) === -1 || group.type === 'dragon-racing' || datas[0].type === ProgressDataType.GarrisonTree)}
{#if description && (status !== QuestStatus.Completed || group.type === 'dragon-racing' || datas[0].type === ProgressDataType.GarrisonTree)}
{#if cls === 'short'}&ndash;{/if}
<ParsedText cls="description-{cls}" text={description} />
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
251: 'Hard Prey',
252: 'Nightmare Prey',
258: 'Purging the Vaults',
259: 'Labyrinth',
263: 'Labyrinth Boss',
};

function getRunCount(index: number): number {
Expand Down
3 changes: 3 additions & 0 deletions apps/frontend/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@ export const currencyItems: Record<number, number[]> = {
246951, // Stormarion Core
null,
267051, // Dark Particle
null,
285801, // Heroic Soul Fragment
285065, // Mythical Soul Fragment
],
// Midnight - Zones
283: [
Expand Down
5 changes: 5 additions & 0 deletions apps/frontend/data/tasks/07-battle-for-azeroth/nazjatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const bfaNazjatar: Task = {
name: 'Friend',
icon: iconLibrary.gameGoblinHead,
alwaysStarted: true,
questReset: DbResetType.Daily,
questResetForced: true,
subChores: [
{
key: 'choose',
Expand Down Expand Up @@ -50,20 +52,23 @@ export const bfaNazjatar: Task = {
icon: iconLibrary.gameTreeFace,
alwaysStarted: true,
questReset: DbResetType.Weekly,
questResetForced: true,
questIds: [57140],
},
{
key: 'mardivas',
name: 'Laboritory of Mardivas',
icon: iconLibrary.gameFizzingFlask,
questReset: DbResetType.Weekly,
questResetForced: true,
questIds: [55121],
},
{
key: 'worldBoss',
name: 'World Boss',
icon: iconLibrary.gameSpikedDragonHead,
questReset: DbResetType.Weekly,
questResetForced: true,
questIds: [
56056, // Wekemara
56057, // Ulmath, the Soulbinder
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/data/tasks/11-midnight/12-0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const midChores12_0: Task = {
name: 'Hope/Unity',
icon: aliasedIcons.planet,
questReset: DbResetType.Custom,
questResetForced: true,
showQuestName: true,
sumObjectives: true,
customExpiryFunc: (char, scannedAt) => customResetPeriod(char, scannedAt, 1079, 2),
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/data/tasks/11-midnight/12-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const midChores12_1: Task = {
icon: iconLibrary.mdiFootPrint,
minimumLevel: 90,
questReset: DbResetType.Custom,
questResetForced: true,
questIds: [98172],
customExpiryFunc: (char, scannedAt) => customResetPeriod(char, scannedAt, 1078, 2),
decorationFunc: twoWeekDecorator,
Expand Down
Loading
Loading