Skip to content

Commit cb97572

Browse files
author
Freddie
committed
Show calculated item level in auctions
1 parent ac401bf commit cb97572

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

apps/frontend/auctions/components/results/Selected.svelte

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import { Region } from '@/enums/region';
66
import { wowthingData } from '@/shared/stores/data';
77
import { leftPad } from '@/utils/formatting';
8+
import { applyBonusIds } from '@/utils/items/apply-bonus-ids';
89
910
import IconifyWrapper from '@/shared/components/images/IconifyWrapper.svelte';
1011
@@ -41,7 +42,11 @@
4142
}
4243
.quantity {
4344
text-align: right;
44-
width: 5.5rem;
45+
width: 3.5rem;
46+
}
47+
.level {
48+
text-align: right;
49+
width: 3rem;
4550
}
4651
.price {
4752
text-align: right;
@@ -54,7 +59,8 @@
5459
<thead>
5560
<tr>
5661
<th>Realm</th>
57-
<th>Lvl/Qty</th>
62+
<th>Qty</th>
63+
<th>Lvl</th>
5864
<!-- {#if auctions[0]?.connectedRealmId < 100000}
5965
<th>Bid</th>
6066
{/if} -->
@@ -66,6 +72,7 @@
6672
<tr>
6773
<td class="realm">L O A D I N G . . .</td>
6874
<td class="quantity"></td>
75+
<td class="level"></td>
6976
<td class="price"></td>
7077
</tr>
7178
{:then auctions}
@@ -89,12 +96,24 @@
8996
{realm.displayText}
9097
</td>
9198
<td class="quantity">
99+
{auction.quantity.toLocaleString()}
100+
</td>
101+
<td class="level">
92102
{#if auction.petSpeciesId}
93103
<span class="quality{auction.petQuality}">
94104
{auction.petLevel}
95105
</span>
96106
{:else}
97-
{auction.quantity.toLocaleString()}
107+
{@const item = wowthingData.items.items[auction.itemId]}
108+
{#if item}
109+
{@const { itemLevel, quality } = applyBonusIds(
110+
auction.bonusIds,
111+
{ itemLevel: item.itemLevel, quality: item.quality }
112+
)}
113+
<span class="quality{quality}">
114+
{itemLevel}
115+
</span>
116+
{/if}
98117
{/if}
99118
</td>
100119
<!-- {#if auctions[0]?.connectedRealmId < 100000}

apps/frontend/auctions/stores/specific.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SpecificStore {
1010

1111
async search(
1212
auctionAppState: AuctionsAppState,
13-
groupKey: string,
13+
groupKey: string
1414
): Promise<UserAuctionDataAuction[]> {
1515
let things: UserAuctionDataAuction[] = [];
1616

@@ -51,7 +51,7 @@ class SpecificStore {
5151
const responseData = (await response.json()) as UserAuctionDataAuctionArray[];
5252

5353
things = responseData.map(
54-
(auctionArray) => new UserAuctionDataAuction(...auctionArray),
54+
(auctionArray) => new UserAuctionDataAuction(...auctionArray)
5555
);
5656
things.sort((a, b) => a.buyoutPrice - b.buyoutPrice);
5757

apps/frontend/shared/components/currencies/Currency.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script lang="ts">
2+
import { currencyIconOverride } from '@/data/currencies';
23
import { timeState } from '@/shared/state/time.svelte';
34
import { getCurrencyData } from '@/utils/characters/get-currency-data';
45
import type { StaticDataCurrency } from '@/shared/stores/static/types';
56
import type { CharacterProps } from '@/types/props';
67
78
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';
8-
import { currencyIconOverride } from '@/data/currencies';
99
1010
type Props = CharacterProps & {
1111
currency: StaticDataCurrency;

0 commit comments

Comments
 (0)