Skip to content
Merged

Deploy #1742

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
2 changes: 1 addition & 1 deletion apps/frontend/components/achievements/Category.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
>
</button>

{#if category && userState.achievements.categories[category.id].totalPoints}
{#if category && userState.achievements.categories[category.id]?.totalPoints}
<div class="progress-bar new-group">
<ProgressBar
title="Points"
Expand Down
18 changes: 15 additions & 3 deletions apps/frontend/components/achievements/CriteriaTree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,21 @@
description = criteriaTree.description;

if (achievement.isAccountWide) {
const maxCharacter =
criteriaCharacters?.[criteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
have = maxCharacter > 0 && maxCharacter >= criteriaTree.amount;
if (criteriaTree?.operator === CriteriaTreeOperator.Any) {
let anyCount = 0;
for (const childCriteriaTreeId of criteriaTree.children) {
const childCriteriaTree =
wowthingData.achievements.criteriaTreeById.get(childCriteriaTreeId);
const childMaxCharacter =
criteriaCharacters?.[childCriteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
anyCount += childMaxCharacter;
}
have = anyCount >= criteriaTree.amount;
} else {
const maxCharacter =
criteriaCharacters?.[criteriaTree?.criteriaId || -1]?.[0]?.[1] || 0;
have = maxCharacter > 0 && maxCharacter >= criteriaTree.amount;
}
} else {
let maybeCriteria: number[][];
maybeCriteria = criteriaCharacters[criteria?.id] || [[0, 0]];
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/components/achievements/get-account-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { UserQuestData } from '@/types/data';
import { CriteriaTreeOperator } from '@/enums/wow';
import { userState } from '@/user-home/state/user';

const debugId = 42315;
const debugId = 13638;

export function getAccountData(
achievementData: AchievementData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
import type { UserQuestData } from '@/types/data';
import type { AchievementStatus } from './types';

const debugId = 42315;
const debugId = 13638;

export function getAchievementStatus(
userAchievementData: UserAchievementData,
Expand Down
65 changes: 64 additions & 1 deletion apps/frontend/data/achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type ExtraAchievementCategory = {
targetSlug: string;

achievementIds?: (number | number[])[];
onlyAchievementIds?: boolean;
overrideName?: string;
overrideSlug?: string;
}[];
Expand Down Expand Up @@ -356,7 +357,45 @@ export const extraCategories: ExtraAchievementCategory[] = [
],
},
null,
{ targetSlug: 'expansion-features/skyriding', nameType: 2 },
{
targetSlug: 'expansion-features/skyriding',
nameType: 2,
onlyAchievementIds: true,
achievementIds: [
// Meta
19478,
// Glyph Hunter
16575, 16576, 16577, 16578, 17411,
// Waking Shores
15915, 15916, 15917, 15927, 15928, 15929, 17195, 17196, 17197,
// Ohn'ahran Plains
15918, 15919, 15920, 15930, 15931, 15932, 17198, 17199, 17200,
// Azure Span
15921, 15922, 15923, 15933, 15934, 15935, 17201, 17202, 17203,
// Thaldraszus
15924, 15925, 15926, 15936, 15937, 15938, 17204, 17205, 17206,
// Completionist
15939, 15940, 15941, 17330, 17331, 17332,
// Forbidden Reach
17279, 17280, 17281, 17284, 17286, 17287, 17288, 17289, 17290,
// Forbidden Reach Completionist
17294, 17296, 17298,
// Zaralek Cavern
17483, 17484, 17485, 17486, 17487, 17488, 17489, 17490, 17491,
// Zaralek Cavern Completionist
17492, 17493, 17494,
// Zaralek Cavern Glyph Hunter
18150,
// Challenge
18790, 18791, 18792,
// Emerald Dream
19109, 19110, 19111, 19112, 19113, 19114, 19115, 19116, 19117,
// Emerald Dream Completionist
19127, 19128, 19129,
// Emerald Dream Glyph Hunter
19306,
],
},
{
targetSlug: 'collections/dragon-isle-drake-cosmetics',
nameType: 3,
Expand Down Expand Up @@ -401,6 +440,30 @@ export const extraCategories: ExtraAchievementCategory[] = [
41597, // Glory of the Omega Raider
],
},
null,
{
targetSlug: 'expansion-features/skyriding',
nameType: 2,
onlyAchievementIds: true,
achievementIds: [
// Glyph Hunter
40702, 40166, 40703, 40704, 40705, 42727,
// Isle of Dorn
40316, 40317, 40318, 40139, 40320, 40321, 40322, 40323, 40324,
// Ringing Deeps
40325, 40326, 40327, 40328, 40329, 40330, 40331, 40332, 40333,
// Hallowfall
40334, 40335, 40336, 40337, 40338, 40339, 40340, 40341, 40342,
// Azj-Kahet
40343, 40344, 40345, 40346, 40347, 40348, 40349, 40350, 40351,
// Khaz Algar Completionist
40352, 40353, 40354,
// Undermine Skyrocketing
40936, 40937, 40938,
// Undermine Breaknecking
41081, 41083, 41084,
],
},
],
},
{
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export const currencyExtra: Record<number, number[]> = {
126411: [
3310, // Coffer Key Shards
3028, // Restored Coffer Key
3356, // Untainted Mana-Crystals
null,
3378, // Dawnlight Manaflux
3383, // Adventurer Dawncrest
Expand Down
65 changes: 44 additions & 21 deletions apps/frontend/data/tasks/11-midnight/delves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,42 @@ export const midDelves: Task = {
questReset: DbResetType.Weekly,
questIds: [93784],
},
{
key: 'repAmani',
name: 'Rep: {faction:2696}',
minimumLevel: 90,
accountWide: true,
alwaysStarted: true,
questReset: DbResetType.Weekly,
questIds: [93819],
},
{
key: 'repHarati',
name: 'Rep: {faction:2704}',
minimumLevel: 90,
accountWide: true,
alwaysStarted: true,
questReset: DbResetType.Weekly,
questIds: [93822],
},
{
key: 'repSilvermoon',
name: 'Rep: {faction:2710}',
minimumLevel: 90,
accountWide: true,
alwaysStarted: true,
questReset: DbResetType.Weekly,
questIds: [93821],
},
{
key: 'repSingularity',
name: 'Rep: {faction:2699}',
minimumLevel: 90,
accountWide: true,
alwaysStarted: true,
questReset: DbResetType.Weekly,
questIds: [93820],
},
null,
{
key: 'bounty',
Expand All @@ -31,19 +67,14 @@ export const midDelves: Task = {
questReset: DbResetType.Weekly,
questResetForced: true,
questIds: [86371],
// This seems wrong, I got no tracking quest for using the map or looting the box
// subChores: [
// {
// key: 'get',
// name: 'Get Bounty',
// questIds: [86371],
// },
// {
// key: 'use',
// name: 'Use Bounty',
// questIds: [92887],
// },
// ],
},
{
key: 'nullaeus',
name: 'Nullaeus Invasion',
minimumLevel: 90,
alwaysStarted: true,
questIds: [92887],
questReset: DbResetType.Weekly,
},
{
key: 'gilded',
Expand All @@ -65,13 +96,5 @@ export const midDelves: Task = {
},
],
},
// {
// key: 'nullaeus',
// name: "Nullaeus Invasion",
// minimumLevel: 90,
// alwaysStarted: true,
// questIds: [], // ??
// questReset: DbResetType.Weekly,
// },
],
};
35 changes: 23 additions & 12 deletions apps/frontend/shared/stores/data/achievements/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
childSlug = childSlugOverride;
}

const childAchievementIds = child.achievementIds || [];

category.children.push({
id: childCat2.id,
id: child.onlyAchievementIds ? categoryId++ : childCat2.id,
name: childName,
slug: childSlug,
achievementIds: (child.achievementIds || []).concat(childCat2.achievementIds),
achievementIds: child.onlyAchievementIds
? childAchievementIds
: childAchievementIds.concat(childCat2.achievementIds),
children: [],
});
} else {
Expand Down Expand Up @@ -712,7 +716,7 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
name: '[TWW] Worldsoul-Searching',
slug: 'worldsoul-searching',
achievementIds: [
19458, // Worldsoul-Searching
61451, // Worldsoul-Searching

40244, // Nerub-ar Palace
41222, // Liberation of Undermine
Expand Down Expand Up @@ -754,10 +758,10 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme
41133, // You Xal Not Pass > Isle Remember You

40231, // The War Within Pathfinder
20118, // The War Within Pathfinder > The Isle of Dorn
19560, // The War Within Pathfinder > The Ringing Deeps
20598, // The War Within Pathfinder > Hallowfall
19559, // The War Within Pathfinder > Azj-Kahet
// 20118, // The War Within Pathfinder > The Isle of Dorn
// 19560, // The War Within Pathfinder > The Ringing Deeps
// 20598, // The War Within Pathfinder > Hallowfall
// 19559, // The War Within Pathfinder > Azj-Kahet
40790, // The War Within Pathfinder > Khaz Algar Explorer

// Glory of the Delver
Expand Down Expand Up @@ -807,12 +811,19 @@ export function processAchievementsData(rawData: RawAchievements): DataAchieveme

for (const category of ret.categories.filter((cat) => cat?.id >= 100000)) {
for (const maybeArray of category.achievementIds) {
if (Array.isArray(maybeArray)) {
for (const achievementId of maybeArray) {
ret.achievementToCategory[achievementId] ||= category.id;
const achievementIds = Array.isArray(maybeArray) ? maybeArray : [maybeArray];
for (const achievementId of achievementIds) {
(ret.achievementToCategoryIds[achievementId] ||= []).push(category.id);
}
}

const validChildren = (category.children || []).filter((cat) => cat?.id > 100_000);
for (const child of validChildren) {
for (const maybeArray of child.achievementIds) {
const achievementIds = Array.isArray(maybeArray) ? maybeArray : [maybeArray];
for (const achievementId of achievementIds) {
(ret.achievementToCategoryIds[achievementId] ||= []).push(child.id);
}
} else {
ret.achievementToCategory[maybeArray] ||= category.id;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/shared/stores/data/achievements/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export class DataAchievements {
public criteriaTreeById = new Map<number, AchievementDataCriteriaTree>();
public isHidden: Record<number, boolean> = {};

public achievementToCategory: Record<number, number> = {};
public achievementToCategoryIds: Record<number, number[]> = {};
}
2 changes: 1 addition & 1 deletion apps/frontend/stores/lazy/achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class AchievementProcessor {
}
}

const debugId = 42315;
const debugId = 13638;

export function getAccountData(
achievementData: AchievementData,
Expand Down
6 changes: 4 additions & 2 deletions apps/frontend/stores/user-achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ export class UserAchievementDataStore extends WritableFancyStore<UserAchievement
}

const categoryIds = [achievement.categoryId];
if (wowthingData.achievements.achievementToCategory[achievement.id]) {
categoryIds.push(wowthingData.achievements.achievementToCategory[achievement.id]);
if (wowthingData.achievements.achievementToCategoryIds[achievement.id]) {
categoryIds.push(
...wowthingData.achievements.achievementToCategoryIds[achievement.id]
);
}

for (const categoryId of categoryIds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{ id: 'gold', name: 'Gold' },
{ id: 'itemlevel', name: 'Item level' },
{ id: 'level', name: 'Level' },
{ id: 'levelBand', name: 'Level Band (9x > 8x > 7x)' },
{ id: 'seen', name: 'Last seen' },
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
word-spacing: -0.2ch;
}
.percent-cell {
--width: 2.8rem;
--width: 3.4rem;

border-right: 1px solid var(--border-color);
text-align: right;
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend/user-home/state/activeViewTasks.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class ActiveViewTasks {
// Any task with required holidays needs at least one active
if (
task.requiredHolidays?.length > 0 &&
!task.requiredHolidays.some((holidayId) => !!activeHolidays.value[holidayId])
!task.requiredHolidays.some(
(holidayId) => activeHolidays.value[holidayId]?.soon === false
)
) {
continue;
}
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/user-home/state/lazy/achievements.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class AchievementProcessor {
}

console.timeEnd('AchievementProcessor.process');
// console.log(this.data);
return this.data;
}

Expand Down Expand Up @@ -318,7 +317,7 @@ class AchievementProcessor {
}
}

const debugId = 42315;
const debugId = 13638;

export function getAccountData(
achievementData: AchievementData,
Expand Down
9 changes: 7 additions & 2 deletions apps/frontend/user-home/state/user/achievements.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ export class DataUserAchievements {
}

const categoryIds = [achievement.categoryId];
if (wowthingData.achievements.achievementToCategory[achievement.id]) {
categoryIds.push(wowthingData.achievements.achievementToCategory[achievement.id]);
if (wowthingData.achievements.achievementToCategoryIds[achievement.id]) {
categoryIds.push(
...wowthingData.achievements.achievementToCategoryIds[achievement.id]
);
}

for (const categoryId of categoryIds) {
Expand Down Expand Up @@ -153,6 +155,9 @@ export class DataUserAchievements {

console.timeEnd('DataUserAchievements._derivedStats');

// console.log(cheevs);
// console.log(wowthingData.achievements.achievementToCategoryIds);

return {
categories: cheevs,
recent: all.slice(0, 100).map(([, id]) => id),
Expand Down
Loading
Loading