Merge pull request 'Allow using _parent Ids to set prices for a group of items' (#6) from egbog/the-blacklist:main into main

Reviewed-on: #6
Reviewed-by: Platinum <platinum@noreply.dev.sp-tarkov.com>
This commit is contained in:
Platinum 2024-11-30 06:08:42 +00:00
commit 8f245bc6d6
2 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,11 @@
// You can manually add flea prices to items, set a multiplier to their existing price or blacklist them entirely. // You can manually add flea prices to items, set a multiplier to their existing price or blacklist them entirely.
"customItemConfigs": [ "customItemConfigs": [
{
// Headwear parent id. Affects all items under this parent. ie. Team Wendy Exfil, Airframe etc.,
"parentId": "5a341c4086f77401f2541505",
"priceMultiplier": 12.5
},
{ {
// .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive.", // .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive.",
"itemId": "5fc382a9d724d907e2077dab", "itemId": "5fc382a9d724d907e2077dab",

View File

@ -71,7 +71,7 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
const item = itemTable[handbookItem.Id]; const item = itemTable[handbookItem.Id];
const originalPrice = prices[item._id]; const originalPrice = prices[item._id];
const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id); const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id || conf.parentId === item._parent);
// We found a custom item config override to use. That's all we care about for this item. Move on to the next item. // We found a custom item config override to use. That's all we care about for this item. Move on to the next item.
if (customItemConfig && this.updateItemUsingCustomItemConfig(customItemConfig, item, prices, originalPrice, ragfairConfig)) { if (customItemConfig && this.updateItemUsingCustomItemConfig(customItemConfig, item, prices, originalPrice, ragfairConfig)) {