Skip to content

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvan7 committed Jan 10, 2025
1 parent b1a8d15 commit 5e9b4f4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand Down
4 changes: 2 additions & 2 deletions main/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion main/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exiled-exchange-2",
"version": "0.4.0",
"version": "0.4.1",
"private": true,
"scripts": {
"dev": "node build/script.mjs",
Expand Down
6 changes: 6 additions & 0 deletions renderer/src/web/price-check/filters/pseudo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, StatFilter[]>();

Expand Down
19 changes: 15 additions & 4 deletions renderer/src/web/price-check/trade/pathofexile-trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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)),
});
}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
};
}

Expand Down

0 comments on commit 5e9b4f4

Please sign in to comment.