Skip to content

Commit 1477238

Browse files
authored
Merge pull request #10327 from DestinyItemManager/itemValueVisibility
use itemValueVisibility to filter item rewards
2 parents c6c45cf + 5e50b06 commit 1477238

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Next
22

33
* Loadouts with only armor mods, or only fashion (shaders & ornaments), now display a symbol in the equip dropdown, and can be filtered from among other loadouts.
4+
* BRAVE bounties now display correct rewards instead of all possible rewards.
45

56
## 8.15.0 <span class="changelog-date">(2024-04-07)</span>
67

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
"@textcomplete/core": "^0.1.13",
209209
"@textcomplete/textarea": "^0.1.13",
210210
"@textcomplete/utils": "^0.1.13",
211-
"bungie-api-ts": "^5.0.0",
211+
"bungie-api-ts": "^5.1.0",
212212
"caniuse-lite": "^1.0.30001588",
213213
"clsx": "^2.1.0",
214214
"comlink": "^4.4.1",

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/inventory/store/d2-item-factory.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
DestinyItemTooltipNotification,
2929
DestinyObjectiveProgress,
3030
DestinyProfileResponse,
31+
DestinyVendorSaleItemComponent,
3132
DictionaryComponentResponse,
3233
ItemBindStatus,
3334
ItemLocation,
@@ -142,6 +143,8 @@ export function makeFakeItem(
142143
itemInstanceId = '0',
143144
quantity = 1,
144145
allowWishList = false,
146+
/** if available, this should be passed in from a vendor saleItem (DestinyVendorSaleItemComponent) */
147+
itemValueVisibility?: DestinyVendorSaleItemComponent['itemValueVisibility'],
145148
): DimItem | undefined {
146149
const item = makeItem(
147150
context,
@@ -153,7 +156,7 @@ export function makeFakeItem(
153156
location: ItemLocation.Vendor,
154157
bucketHash: 0,
155158
transferStatus: TransferStatuses.NotTransferrable,
156-
itemValueVisibility: [],
159+
itemValueVisibility,
157160
lockable: false,
158161
state: ItemState.None,
159162
isWrapper: false,
@@ -781,7 +784,12 @@ function buildPursuitInfo(
781784
item: DestinyItemComponent,
782785
itemDef: DestinyInventoryItemDefinition,
783786
) {
784-
const rewards = itemDef.value ? itemDef.value.itemValue.filter((v) => v.itemHash) : [];
787+
const rewards = itemDef.value
788+
? itemDef.value.itemValue.filter(
789+
(v, i) => v.itemHash && (item.itemValueVisibility?.[i] ?? true),
790+
)
791+
: [];
792+
785793
const questLine = getQuestLineInfo(itemDef);
786794
const expiration = getExpirationInfo(item, itemDef);
787795

src/app/vendors/vendor-item.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ function makeVendorItem(
111111
vendorItemDef ? vendorItemDef.quantity : 1,
112112
// vendor items are wish list enabled!
113113
true,
114+
saleItem?.itemValueVisibility,
114115
),
115116
};
116117

0 commit comments

Comments
 (0)