Skip to content
Merged

Deploy #1760

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 @@ -5,11 +5,11 @@
import { timeState } from '@/shared/state/time.svelte';
import { componentTooltip } from '@/shared/utils/tooltips';
import { zoneMap } from '@/user-home/components/world-quests/data';
import { worldQuestStore } from '@/user-home/components/world-quests/store';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';
import { userState } from '@/user-home/state/user';
import { getNumberKeyedEntries } from '@/utils/get-number-keyed-entries';
import type { CharacterProps } from '@/types/props';
import type { ApiWorldQuest } from '@/user-home/components/world-quests/types';
import type { ApiWorldQuest } from '@/types/world-quests';

import Tooltip from '@/components/tooltips/GoldWorldQuests.svelte';

Expand Down Expand Up @@ -93,10 +93,10 @@

<td class="b-l">
{#if goldWorldQuests?.length > 0}
{#await worldQuestStore.fetch(character.realm.region)}
{#await dynamicDataStore.fetch(character.realm.region)}
...
{:then worldQuests}
{@const [count, active] = processQuests(worldQuests, questMap)}
{:then dynamicData}
{@const [count, active] = processQuests(dynamicData.worldQuests, questMap)}
<div
use:componentTooltip={{
component: Tooltip,
Expand Down
46 changes: 46 additions & 0 deletions apps/frontend/components/home/view-switcher/Delves.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script lang="ts">
import { delveMap } from '@/data/delve';
import { iconLibrary } from '@/shared/icons';
import { componentTooltip } from '@/shared/utils/tooltips';
import { userState } from '@/user-home/state/user';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';

import DelvesTooltip from './DelvesTooltip.svelte';
import IconifyWrapper from '@/shared/components/images/IconifyWrapper.svelte';

let delves = $derived(dynamicDataStore.getCached(userState.general.allRegions[0]).delves);
</script>

<style lang="scss">
.flex-wrapper {
--image-margin-top: -4px;

gap: var(--padding-size);
}
.delve {
+ .delve {
border-left: 1px solid var(--border-color);
padding-left: var(--padding-size);
}
}
</style>

<div
class="flex-wrapper"
use:componentTooltip={{
component: DelvesTooltip,
propsFunc: () => ({
delves,
}),
}}
>
<IconifyWrapper icon={iconLibrary.faDungeon} />
{#each delves as { poiId, story } (poiId)}
{@const delve = delveMap[poiId]}
{#if delve}
<div class="delve quality{delve.storyRanks[story] ?? 3}">
{delve.shortName}
</div>
{/if}
{/each}
</div>
37 changes: 37 additions & 0 deletions apps/frontend/components/home/view-switcher/DelvesTooltip.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script lang="ts">
import { delveMap } from '@/data/delve';

let { delves }: { delves: { poiId: number; story: string }[] } = $props();
</script>

<style lang="scss">
table {
width: 24rem;
}
td {
text-align: left;
}
.name {
width: 12rem;
}
.story {
width: 12rem;
}
</style>

<div class="wowthing-tooltip">
<h4>Bountiful Delves</h4>
<table class="table table-striped">
<tbody>
{#each delves as { poiId, story } (poiId)}
{@const delve = delveMap[poiId]}
{#if delve}
<tr>
<td class="name text-overflow">{delve.name}</td>
<td class="story quality{delve.storyRanks[story] ?? 3}">{story}</td>
</tr>
{/if}
{/each}
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { sharedState } from '@/shared/state/shared.svelte';
import { userState } from '@/user-home/state/user';

import Delves from './Delves.svelte';
import Holidays from './Holidays.svelte';
import IconifyWrapper from '@/shared/components/images/IconifyWrapper.svelte';
import ParagonQuests from '../table/paragon/ParagonQuests.svelte';
Expand Down Expand Up @@ -118,5 +119,7 @@
<ParagonQuests />

<Holidays />

<Delves />
</div>
</div>
10 changes: 7 additions & 3 deletions apps/frontend/components/zone-maps/ZoneMapsThing.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { FarmIdType } from '@/enums/farm-id-type';
import { FarmType } from '@/enums/farm-type';
import { Region } from '@/enums/region';
import { timeStore } from '@/shared/stores/time';
import { componentTooltip } from '@/shared/utils/tooltips';
import { userQuestStore } from '@/stores';
import { zoneMapState } from '@/stores/local-storage/zone-map';
import { worldQuestStore } from '@/user-home/components/world-quests/store';
import { userState } from '@/user-home/state/user';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';
import { getInstanceFarm } from '@/utils/get-instance-farm';
import { getFarmIcon } from '@/utils/zone-maps';
import type { FarmStatus } from '@/types';
Expand Down Expand Up @@ -73,7 +73,11 @@

worldQuestAvailable = 0;
if (farm.worldQuestId) {
if (worldQuestStore.getCached(Region.US)[farm.worldQuestId]) {
if (
dynamicDataStore.getCached(userState.general.allRegions[0]).worldQuests[
farm.worldQuestId
]
) {
classes.push('highlight');
worldQuestAvailable = 1;
} else {
Expand Down
98 changes: 98 additions & 0 deletions apps/frontend/data/delve.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
export type Delve = {
name: string;
shortName: string;
storyRanks: Record<string, number>;
};

export const delveMap: Record<number, Delve> = {
8426: {
name: 'Collegiate Calamity',
shortName: 'CC',
storyRanks: {
'Academy Under Siege': 4,
'Faculty of Fear': 3,
'Invasive Glow': 5,
},
},
8428: {
name: 'Parhelion Plaza',
shortName: 'PP',
storyRanks: {
'Bombing Run': 0,
'Holding the Line': 4,
'March of the Arcane Brigade': 0,
},
},
8430: {
name: 'Sunkiller Sanctum',
shortName: 'SS',
storyRanks: {
'Core of the Problem': 3,
'Not What I Expected': 3,
'The Gravitational Effect': 3,
},
},
8432: {
name: 'Shadowguard Point',
shortName: 'SP',
storyRanks: {
Calamitous: 3,
'Captured Wildlife': 0,
'Stolen Mana': 0,
},
},
8434: {
name: 'The Grudge Pit',
shortName: 'GP',
storyRanks: {
'Arena Champion': 3,
'Dastardly Rotstalk': 3,
'Lightbloom Invasion': 3,
},
},
8436: {
name: 'The Gulf of Memory',
shortName: 'GM',
storyRanks: {
'Alnmoth Munchies': 3,
'Descent of the Haranir': 3,
'Sporasaur Special': 4,
},
},
8438: {
name: 'The Shadow Enclave',
shortName: 'SE',
storyRanks: {
'Mirror Shine': 0,
'Shadowy Supplies': 3,
"Traitor's Due": 3,
},
},
8440: {
name: 'The Darkway',
shortName: 'DW',
storyRanks: {
'Focusers Under Pressure': 3,
'Leyline Technician': 3,
'Ogre Powered': 4,
},
},
8442: {
name: 'Twilight Crypts',
shortName: 'TC',
storyRanks: {
'Loosed Loa': 3,
'Party Crasher': 3,
'Trapped!': 3,
},
},
8444: {
name: "Atal'Aman",
shortName: 'AA',
storyRanks: {
'Ritual Interrupted': 3,
'Toadly Unbecoming': 3,
'Totem Annihilation': 3,
},
},
};
6 changes: 3 additions & 3 deletions apps/frontend/data/tasks/11-midnight/12-0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Constants } from '@/data/constants';
import { aliasedIcons, iconLibrary } from '@/shared/icons';
import { timeState } from '@/shared/state/time.svelte';
import { DbResetType } from '@/shared/stores/db/enums';
import { worldQuestStore } from '@/user-home/components/world-quests/store';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';
import type { Character } from '@/types';
import type { Chore, Task } from '@/types/tasks';

Expand Down Expand Up @@ -35,7 +35,7 @@ const specialAssignmentQuestToUnlock: Record<number, number> = Object.fromEntrie
const specialAssignmentFunc = (index: number, isQuest: boolean) => {
return (char: Character, chore: Chore) => {
const now = timeState.slowTime;
const allWorldQuests = worldQuestStore.getCachedQuests(char.region);
const allWorldQuests = dynamicDataStore.getCachedQuests(char.region);
const questIdIndexes = Object.fromEntries(
allWorldQuests
.filter((worldQuest) => worldQuest.expires > now)
Expand All @@ -60,7 +60,7 @@ const specialAssignmentFunc = (index: number, isQuest: boolean) => {
};

const specialAssignmentExpiry: Chore['customExpiryFunc'] = (char, scannedAt, questIds) => {
const allWorldQuests = worldQuestStore.getCachedQuests(char.region);
const allWorldQuests = dynamicDataStore.getCachedQuests(char.region);
const findQuestId = specialAssignmentQuestToUnlock[questIds[0]] || questIds[0];
const worldQuest = allWorldQuests.find((wq) => wq.questId === findQuestId);
return worldQuest?.expires || Constants.defaultTime;
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/shared/state/settings.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { router } from 'svelte-spa-router';
// WARNING: do NOT import any of the other stores!
import { Constants } from '@/data/constants';
import { expansionOrder } from '@/data/expansion';
import { professionCooldowns } from '@/data/professions/cooldowns';
import { professionCooldowns, professionWorkOrders } from '@/data/professions/cooldowns';
import { Language } from '@/enums/language';
import { sharedState } from '@/shared/state/shared.svelte';
import { getNumberKeyedEntries } from '@/utils/get-number-keyed-entries';
Expand Down Expand Up @@ -120,7 +120,7 @@ function createSettingsState() {
settingsHash = hashObject(newSettings, []);
}

for (const professionCooldown of professionCooldowns) {
for (const professionCooldown of [...professionCooldowns, ...professionWorkOrders]) {
if (newSettings.professions.cooldowns[professionCooldown.key] === undefined) {
newSettings.professions.cooldowns[professionCooldown.key] = true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import type { RewardType } from '@/enums/reward-type';
import type { DateTime } from 'luxon';

export interface ApiWorldQuestRaw {
jsonData: string;
questId: number;
region: number;
zoneId: number;
}

export interface ApiWorldQuestJson {
count: number;
expirations: Record<string, number>;
locations: Record<string, number>;
rewards: Record<string, Record<string, number>>;
}

export interface ApiWorldQuest {
expires: DateTime;
locationX: string;
Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/user-home/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import { timeStore } from '@/shared/stores/time';
import { delegateBasicTooltips } from '@/shared/utils/tooltips';
import { userAchievementStore, userQuestStore, userStore } from '@/stores';
import { worldQuestStore } from '@/user-home/components/world-quests/store';
import { userState } from '@/user-home/state/user';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';
import { hashObject } from '@/utils/hash-object.svelte';
import parseApiTime from '@/utils/parse-api-time';
import type { Settings } from '@/shared/stores/settings/types/settings';
Expand Down Expand Up @@ -41,8 +41,8 @@
userAchievementStore.fetch(),
userQuestStore.fetch(),
userStore.fetch(),
worldQuestStore.fetch(Region.US),
worldQuestStore.fetch(Region.EU),
dynamicDataStore.fetch(Region.US),
dynamicDataStore.fetch(Region.EU),
]);

userStore.setup(settingsState.value, $userStore);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { wowthingData } from '@/shared/stores/data';
import { leftPad } from '@/utils/formatting';
import type { ApiWorldQuest, WorldQuestZone } from './types';
import type { ApiWorldQuest, WorldQuestZone } from '@/types/world-quests';

import WorldQuest from './WorldQuest.svelte';

Expand Down
13 changes: 8 additions & 5 deletions apps/frontend/user-home/components/world-quests/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import find from 'lodash/find';

import { zoneData } from './data';
import { worldQuestStore } from './store';
import { browserState } from '@/shared/state/browser.svelte';
import { settingsState } from '@/shared/state/settings.svelte';
import { dynamicDataStore } from '@/user-home/stores/dynamicData';

import ContinentBox from './ContinentBox.svelte';
import Image from '@/shared/components/images/Image.svelte';
Expand Down Expand Up @@ -44,13 +44,16 @@
height={1000}
/>

{#await worldQuestStore.fetch(browserState.current.worldQuests.region)}
{#await dynamicDataStore.fetch(browserState.current.worldQuests.region)}
L O A D I N G . . .
{:then worldQuests}
{:then dynamicData}
{#each (zone.children || []).filter((zone) => zone?.continentPoint) as childZone (childZone.id)}
<ContinentBox zone={childZone} worldQuests={worldQuests[childZone.id]} />
<ContinentBox
zone={childZone}
worldQuests={dynamicData.worldQuests[childZone.id]}
/>
{:else}
{#each worldQuests[zone.id] || [] as worldQuest (worldQuest.questId)}
{#each dynamicData.worldQuests[zone.id] || [] as worldQuest (worldQuest.questId)}
<WorldQuest {worldQuest} />
{/each}
{/each}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { userState } from '@/user-home/state/user';
import { toNiceDuration } from '@/utils/formatting';
import type { Character } from '@/types/character';
import type { ApiWorldQuest } from '@/types/world-quests';

import { worldQuestPrereqs } from './data';
import type { ApiWorldQuest } from './types';

import ParsedText from '@/shared/components/parsed-text/ParsedText.svelte';
import FactionIcon from '@/shared/components/images/FactionIcon.svelte';
Expand Down
Loading
Loading