diff --git a/README.md b/README.md index 7a19f2ca..10cc0f01 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ![Perfect Jewelers Orb](./renderer/public/images/jeweler.png) Exiled Exchange 2 -![GitHub Downloads (specific asset, latest release)](https://img.shields.io/github/downloads/kvan7/exiled-exchange-2/latest/Exiled-Exchange-2-Setup-0.4.0.exe?style=plastic&link=https%3A%2F%2Ftooomm.github.io%2Fgithub-release-stats%2F%3Fusername%3Dkvan7%26repository%3DExiled-Exchange-2) +![GitHub Downloads (specific asset, latest release)](https://img.shields.io/github/downloads/kvan7/exiled-exchange-2/latest/Exiled-Exchange-2-Setup-0.4.1.exe?style=plastic&link=https%3A%2F%2Ftooomm.github.io%2Fgithub-release-stats%2F%3Fusername%3Dkvan7%26repository%3DExiled-Exchange-2) ![GitHub Tag](https://img.shields.io/github/v/tag/kvan7/exiled-exchange-2?style=plastic&label=latest%20version) ![GitHub commits since latest release (branch)](https://img.shields.io/github/commits-since/kvan7/exiled-exchange-2/latest/dev?style=plastic) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index f4820131..18dd5e0d 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -20,7 +20,7 @@ export default defineConfig({ }, themeConfig: { // logo: 'TODO', https://github.com/vuejs/vitepress/issues/1401 - appVersion: '0.4.0', + appVersion: '0.4.1', github: { releasesUrl: 'https://github.com/Kvan7/Exiled-Exchange-2/releases' }, diff --git a/main/package-lock.json b/main/package-lock.json index 365912c8..32ef337f 100644 --- a/main/package-lock.json +++ b/main/package-lock.json @@ -1,12 +1,12 @@ { "name": "exiled-exchange-2", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "exiled-exchange-2", - "version": "0.4.0", + "version": "0.4.1", "dependencies": { "electron-overlay-window": "3.3.0", "uiohook-napi": "1.5.x" diff --git a/main/package.json b/main/package.json index a9ecac34..58793c9c 100644 --- a/main/package.json +++ b/main/package.json @@ -1,6 +1,6 @@ { "name": "exiled-exchange-2", - "version": "0.4.0", + "version": "0.4.1", "private": true, "scripts": { "dev": "node build/script.mjs", diff --git a/renderer/src/web/price-check/filters/pseudo/index.ts b/renderer/src/web/price-check/filters/pseudo/index.ts index 17890105..8d1c1bff 100644 --- a/renderer/src/web/price-check/filters/pseudo/index.ts +++ b/renderer/src/web/price-check/filters/pseudo/index.ts @@ -325,6 +325,12 @@ const PSEUDO_RULES: PseudoRule[] = [ // }, ]; +export function filterInPseudo(filter: StatFilter) { + return PSEUDO_RULES.some((rule) => + rule.stats.some((stat) => stat.ref === filter.statRef), + ); +} + export function filterPseudo(ctx: FiltersCreationContext, usePseudo: boolean) { const filterByGroup = new Map(); diff --git a/renderer/src/web/price-check/trade/pathofexile-trade.ts b/renderer/src/web/price-check/trade/pathofexile-trade.ts index b56f067e..5b5fa6af 100644 --- a/renderer/src/web/price-check/trade/pathofexile-trade.ts +++ b/renderer/src/web/price-check/trade/pathofexile-trade.ts @@ -22,6 +22,7 @@ import { PSEUDO_ID_TO_TRADE_REQUEST, STAT_BY_REF } from "@/assets/data"; import { RateLimiter } from "./RateLimiter"; import { ModifierType } from "@/parser/modifiers"; import { Cache } from "./Cache"; +import { filterInPseudo } from "../filters/pseudo"; export const CATEGORY_TO_TRADE_ID = new Map([ [ItemCategory.Map, "map"], @@ -697,15 +698,21 @@ export function createTradeRequest( const qAnd = query.stats[0]; for (const stat of stats) { + let overrideDisabled = false; + if (weightGroups && filterInPseudo(stat)) { + overrideDisabled = true; + } if (stat.tradeId[0].startsWith("pseudo.")) { query.stats.push(pseudoPseudoToQuery(stat.tradeId[0], stat)); } else if (stat.tradeId.length === 1) { - qAnd.filters.push(tradeIdToQuery(stat.tradeId[0], stat)); + qAnd.filters.push( + tradeIdToQuery(stat.tradeId[0], stat, overrideDisabled), + ); } else { query.stats.push({ type: "count", value: { min: 1 }, - disabled: stat.disabled, + disabled: stat.disabled || overrideDisabled, filters: stat.tradeId.map((id) => tradeIdToQuery(id, stat)), }); } @@ -864,7 +871,11 @@ function getMinMax(roll: StatFilter["roll"]) { return !roll.tradeInvert ? { min: a, max: b } : { min: b, max: a }; } -function tradeIdToQuery(id: string, stat: StatFilter) { +function tradeIdToQuery( + id: string, + stat: StatFilter, + overrideDisabled: boolean = false, +) { // NOTE: if there will be too many overrides in the future, // consider moving them to stats.ndjson @@ -896,7 +907,7 @@ function tradeIdToQuery(id: string, stat: StatFilter) { ...getMinMax(roll), option: stat.option != null ? stat.option.value : undefined, }, - disabled: stat.disabled, + disabled: stat.disabled || overrideDisabled, }; }