Skip to content
Merged

Deploy #1719

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 @@ -2,6 +2,7 @@
import { QuestStatus } from '@/enums/quest-status';
import { uiIcons } from '@/shared/icons';
import { userState } from '@/user-home/state/user';
import { toNiceNumber } from '@/utils/formatting/to-nice-number';
import type { CharacterProps } from '@/types/props';

import IconifyIcon from '@/shared/components/images/IconifyIcon.svelte';
Expand Down Expand Up @@ -42,7 +43,10 @@
<IconifyIcon icon={uiIcons.question} scale="0.75" /> -->
{:else if charChore?.status === QuestStatus.InProgress}
<span class="status-shrug">
{charChore.progressCurrent} / {charChore.progressTotal}
{toNiceNumber(charChore.progressCurrent, 0)} / {toNiceNumber(
charChore.progressTotal,
0
)}
</span>
{:else if charChore?.status === QuestStatus.NotStarted}
<IconifyIcon icon={uiIcons.starEmpty} extraClass="status-fail" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
.flex-wrapper {
--image-margin-top: -4px;

align-items: stretch;
align-items: center;
justify-content: start;

&:not(:last-child) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import type { StaticDataProfession } from '@/shared/stores/static/types';

import Sidebar from '@/shared/components/sub-sidebar/SubSidebar.svelte';
import CheckboxInput from '@/shared/components/forms/CheckboxInput.svelte';
import { browserState } from '@/shared/state/browser.svelte';

let { sortedProfessions }: { sortedProfessions: StaticDataProfession[] } = $props();

Expand All @@ -23,4 +25,13 @@
] as SidebarItem[]);
</script>

<Sidebar baseUrl="/professions/patron-orders" items={categories} width="10rem"></Sidebar>
<Sidebar baseUrl="/professions/patron-orders" items={categories} width="10rem">
<svelt:fragment slot="after">
<CheckboxInput
name="patron_unknown"
bind:value={browserState.current.professions.patronOrdersUnknown}
>
Unknown recipes
</CheckboxInput>
</svelt:fragment>
</Sidebar>
40 changes: 20 additions & 20 deletions apps/frontend/components/professions/patron-orders/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
import TableCell from './TableCell.svelte';
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';

export let commodities: CommodityData;
export let profession: StaticDataProfession;
export let slug: string = undefined;
type Props = {
commodities: CommodityData;
profession?: StaticDataProfession;
slug?: string;
};
let { commodities, profession, slug }: Props = $props();

let filterFunc: (char: Character) => boolean;
$: {
if (profession) {
filterFunc = (char) =>
profession &&
!!char.professions?.[profession.id] &&
char.patronOrders?.[profession.id] !== undefined &&
(slug !== 'collectors' ||
settingsState.value.professions.collectingCharactersV2[profession.id]?.includes(
char.id
));
} else {
filterFunc = () => false;
}
}
let filterFunc: (char: Character) => boolean = $derived.by(() =>
profession
? (char) =>
profession &&
!!char.professions?.[profession.id] &&
char.patronOrders?.[profession.id] !== undefined &&
(slug !== 'collectors' ||
settingsState.value.professions.collectingCharactersV2[
profession.id
]?.includes(char.id))
: () => false
);
</script>

<style lang="scss">
Expand All @@ -41,11 +41,11 @@
height: 1.5rem;
}
.header-spacer {
width: 27.7rem;
width: 27rem;
}
.rewards {
text-align: center;
width: 10.1rem;
width: 10.75rem;
}
.costs {
flex-grow: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import type { CommodityData } from './auction-store';

import Order from './Order.svelte';
import { browserState } from '@/shared/state/browser.svelte';

type Props = CharacterProps & {
commodities: CommodityData;
Expand All @@ -19,7 +20,12 @@
let activeOrders = $derived(
sortBy(
character.patronOrders?.[profession.id]?.filter(
(order) => order.expirationTime > now
(order) =>
order.expirationTime > now &&
(browserState.current.professions.patronOrdersUnknown ||
character.professions?.[profession.id]?.knownRecipes?.has(
order.skillLineAbilityId
))
) || [],
(order) => `${order.expirationTime}:${wowthingData.items.items[order.itemId]?.name}`
)
Expand All @@ -28,8 +34,11 @@

<style lang="scss">
td {
--padding: 0;

border-left: 1px solid var(--border-color);
padding: 0 0.3rem;
padding-bottom: 0;
padding-top: 0;
width: calc(5rem + 2.3rem + 20rem + 0.5rem);
}
</style>
Expand Down
61 changes: 34 additions & 27 deletions apps/frontend/components/professions/recipes/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,56 +1,63 @@
<script lang="ts">
import { isCraftingProfession } from '@/data/professions';
import { isSecondaryProfession } from '@/data/professions';
import { settingsState } from '@/shared/state/settings.svelte';
import { wowthingData } from '@/shared/stores/data';
import type { SidebarItem } from '@/shared/components/sub-sidebar/types';

import Sidebar from '@/shared/components/sub-sidebar/SubSidebar.svelte';

let categories: SidebarItem[];
$: {
const children: SidebarItem[] = [];
for (const profession of wowthingData.static.professionById.values()) {
if (!isCraftingProfession[profession.id]) {
continue;
}
let categories: SidebarItem[] = $derived.by(() => {
const ret: SidebarItem[] = [];

children.push({
name: `:profession-${profession.id}: ${profession.name.split('|')[0]}`,
slug: profession.slug,
});
}
children.sort((a, b) => a.slug.localeCompare(b.slug));
for (const expansion of settingsState.expansions) {
const children: SidebarItem[] = [];
for (const staticProfession of wowthingData.static.professionById.values()) {
if (isSecondaryProfession[staticProfession.id]) {
continue;
}

children.push(null);
const categoryChildren =
staticProfession.expansionCategory?.[
expansion.id
]?.children[0]?.children?.filter((cat) => cat.abilities.length > 0) || [];
if (categoryChildren.length > 0) {
children.push({
name: `:profession-${staticProfession.id}: ${staticProfession.name.split('|')[0]}`,
slug: staticProfession.slug,
});
}
}

const cooking = wowthingData.static.professionBySlug.get('cooking');
children.push({
name: `:profession-${cooking.id}: ${cooking.name.split('|')[0]}`,
slug: cooking.slug,
});
children.sort((a, b) => a.slug.localeCompare(b.slug));

categories = [];
for (const expansion of settingsState.expansions) {
const expansionChildren = children.slice();
children.push(null);

const cooking = wowthingData.static.professionBySlug.get('cooking');
children.push({
name: `:profession-${cooking.id}: ${cooking.name.split('|')[0]}`,
slug: cooking.slug,
});

const fishing = wowthingData.static.professionBySlug.get('fishing');
const categoryChildren = fishing.expansionCategory[
expansion.id
].children[0].children.filter((cat) => cat.abilities.length > 0);
if (categoryChildren.length > 0) {
expansionChildren.push({
children.push({
name: `:profession-${fishing.id}: ${fishing.name.split('|')[0]}`,
slug: fishing.slug,
});
}

categories.push({
ret.push({
name: expansion.name,
slug: expansion.slug,
children: expansionChildren,
children,
});
}
}

return ret;
});
</script>

<Sidebar
Expand Down
15 changes: 15 additions & 0 deletions apps/frontend/components/progress/ProgressTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
);

let filterFunc = $derived((char: Character) => {
if (char.hidden || char.ignored) {
return false;
}

if (minimumLevel > 0 && char.level < minimumLevel) {
return false;
}
Expand Down Expand Up @@ -86,6 +90,17 @@
);
}

if (categories[0]?.groups[0]?.lookup === 'class') {
const charClass = wowthingData.static.characterClassById.get(char.classId);
return categories
.filter((cat) => !!cat)
.some((cat) =>
cat.groups
.filter((group) => !!group)
.some((group) => Object.keys(group.data).includes(charClass.slug))
);
}

return true;
});

Expand Down
7 changes: 5 additions & 2 deletions apps/frontend/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ export const currencyExtra: Record<number, number[]> = {
3199, // Blacksmithing
3198, // Enchanting
3197, // Engineering
3196, // Herbalism
3195, // Inscription
3194, // Jewelcrafting
3193, // Leatherworking
3190, // Tailoring
3196, // Herbalism
3192, // Mining
3191, // Skinning
3190, // Tailoring
],
// Midnight - Season 1
126411: [
Expand Down Expand Up @@ -455,8 +455,11 @@ export const currencyItems: Record<number, number[]> = {
264: [
264882, // Finery Funds
255826, // Mysterious Skyshards
245345, // Fused Vitality
null,
242241, // Latent Arcana
246951, // Stormarion Core
null,
262636, // Anguish-Scribed Rune [hunts, uncommon]
262637, // Anguish-Infused Rune [hunts, rare]
262638, // Anguish-Permeated Rune [hunts, epic]
Expand Down
6 changes: 6 additions & 0 deletions apps/frontend/shared/state/browser.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ interface BrowserStateIdk {
xAxis: string[];
yAxis: string[];
};
professions: {
patronOrdersUnknown: boolean;
};
reputations: {
sortOrder: Record<string, number[]>;
};
Expand Down Expand Up @@ -263,6 +266,9 @@ const initialState: BrowserStateIdk = {
xAxis: [],
yAxis: [],
},
professions: {
patronOrdersUnknown: true,
},
reputations: {
sortOrder: {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
position: relative;
width: 50px;

svg {
filter: brightness(0.75);
}
:global(img) {
border-radius: 50%;
position: absolute;
Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/utils/formatting/to-nice-number.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export function toNiceNumber(n: number): string {
export function toNiceNumber(n: number, decimals: number = 1): string {
if (n >= 1000000 || n <= -100000) {
// 2597600 -> 25.976 (divide by 100000) -> 25 (floor) -> 2.5 (divide by 10) -> 2.5m
return `${(Math.floor(n / 100000) / 10).toFixed(1).toLocaleString()}m`;
return `${(Math.floor(n / 100000) / 10).toFixed(decimals).toLocaleString()}m`;
} else if (n >= 100000 || n <= -100000) {
return `${Math.floor(n / 1000).toLocaleString()}k`;
} else if (n >= 1000 || n <= -1000) {
// 25976 -> 259.76 (divide by 100) -> 259 (floor) -> 25.9 (divide by 10) -> 25.9k
return `${(Math.floor(n / 100) / 10).toFixed(1).toLocaleString()}k`;
return `${(Math.floor(n / 100) / 10).toFixed(decimals).toLocaleString()}k`;
} else {
return n.toString();
}
Expand Down
19 changes: 19 additions & 0 deletions apps/tool/Data/IgnoredSkillLineAbilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public static partial class Hardcoded
433607, // TWW ??
433608, // TWW ??
430610, // TWW ??
1230772, // Mid ??
1230871, // Mid ??
1230879, // Mid ??
1230880, // Mid ??
1230881, // Mid ??
1230882, // Mid ??
1230884, // Mid ??
1233131, // Mid ??
1233139, // Mid ??

// Blacksmithing
2671, // Rough Bronze Bracers
Expand Down Expand Up @@ -197,13 +206,18 @@ public static partial class Hardcoded
178242, // Gearspring Parts (dupe for max results?)
407170, // Inspired Order Recalibrator (temporary legendary craft)
473408, // Housing Crafting Test Recipe
1229918, // Mid ??
1229925, // Mid ??
1229929, // Mid ??
1261938, // Mid ??

// Inscription
130407, // MoP Mystery of the Mists
176513, // WoD Draenor Merchant Order
178550, // WoD Borrow Draenic Mortar
343687, // Shadowlands ??
422337, // Lydaria's Binding Rune (temporary legendary craft)
1230063, // Mid ??

// Jewelcrafting
25614, // Silver Rose Pendant
Expand Down Expand Up @@ -246,6 +260,11 @@ public static partial class Hardcoded
176314, // [A] Fearsome Battle Standard (garrison building craft)
176315, // [H] Inspiring Battle Standard (garrison building craft)
176316, // [H] Fearsome Battle Standard (garrison building craft)
1228435, // Mid ??
1228998, // Mid ??
1228999, // Mid ??
1230770, // Mid ??
1279126, // Mid ??

// Tailoring ranks?
3908,
Expand Down
Loading