Skip to content

Commit

Permalink
#130 hotfix, option for pseudo mods
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvan7 committed Dec 20, 2024
1 parent 81f845d commit fd6c194
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 52 deletions.
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.1.2',
appVersion: '0.1.3',
github: {
releasesUrl: 'https://github.com/Kvan7/Exiled-Exchange-2/releases'
},
Expand Down
2 changes: 2 additions & 0 deletions docs/complex-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Hitting "Browser" from the error message will open in the built-in browser.
To open in your default browser, hit the arrow to the right of "trade" before searching the item. Selecting "Trade" will open the trade page in the built-in browser.

![tradeButton](/reference-images/tradeButton.png)

If there are further issues, or you don't want to use the builtin browser for auth, disable the "Use Pseudo" option in settings. (under Price Check)
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.1.2",
"version": "0.1.3",
"private": true,
"scripts": {
"dev": "node build/script.mjs",
Expand Down
1 change: 1 addition & 0 deletions renderer/public/data/en/app_i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"hotkey": "Auto-hide Mode",
"hotkey_locked": "Open without auto-hide",
"enable_browser": "Enable builtin browser",
"use_pseudo": "Use pseudo mods (disable if you have issues with auth)",
"builtin_browser_warning": "I am aware that future releases can potentially contain malicious code that can steal my POESESSID.",
"highlight_hint": "Your items will be highlighted even if this setting is off",
"show_seller": "Show seller",
Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const defaultConfig = (): Config => ({
lockedInitialSearch: true,
activateStockFilter: false,
builtinBrowser: false,
usePseudo: true,
hotkey: "D",
hotkeyHold: "Ctrl",
hotkeyLocked: "Ctrl + Alt + D",
Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/overlay/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface PriceCheckWidget extends Widget {
showCursor: boolean;
requestPricePrediction: boolean;
builtinBrowser: boolean;
usePseudo: boolean;
rememberCurrency: boolean;
}

Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/price-check/CheckedItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default defineComponent({
item.info.refName === prevItem.info.refName)
? prevCurrency
: undefined,
usePseudo: widget.value.usePseudo,
});
if (
Expand Down
1 change: 1 addition & 0 deletions renderer/src/web/price-check/filters/create-presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function createPresets(
activateStockFilter: boolean;
searchStatRange: number;
useEn: boolean;
usePseudo: boolean;
},
): { presets: FilterPreset[]; active: string } {
if (item.info.refName === "Expedition Logbook") {
Expand Down
3 changes: 2 additions & 1 deletion renderer/src/web/price-check/filters/create-stat-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function initUiModFilters(
item: ParsedItem,
opts: {
searchStatRange: number;
usePseudo: boolean;
},
): StatFilter[] {
const ctx: FiltersCreationContext = {
Expand All @@ -147,7 +148,7 @@ export function initUiModFilters(

if (item.info.refName !== "Split Personality") {
filterItemProp(ctx);
filterPseudo(ctx);
filterPseudo(ctx, opts.usePseudo);
if (item.info.refName === "Emperor's Vigilance") {
filterBasePercentile(ctx);
}
Expand Down
4 changes: 3 additions & 1 deletion renderer/src/web/price-check/filters/pseudo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ const PSEUDO_RULES: PseudoRule[] = [
// },
];

export function filterPseudo(ctx: FiltersCreationContext) {
export function filterPseudo(ctx: FiltersCreationContext, usePseudo: boolean) {
const filterByGroup = new Map<string, StatFilter[]>();

if (!usePseudo) return;

rulesLoop: for (const rule of PSEUDO_RULES) {
const sources = filterPseudoSources(ctx.statsByType, ({ stat }, source) => {
const info = rule.stats.find((info) => info.ref === stat.ref);
Expand Down
65 changes: 19 additions & 46 deletions renderer/src/web/settings/price-check.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
<div class="mb-2" v-if="!leagues.error.value">
<div class="flex-1 mb-1">
{{ t("league") }}
<button
class="btn"
@click="leagues.load"
:disabled="leagues.isLoading.value"
>
<button class="btn" @click="leagues.load" :disabled="leagues.isLoading.value">
{{ t("Refresh") }}
</button>
</div>
Expand All @@ -17,21 +13,13 @@
</div>
<template v-else-if="leagues.list.value.length">
<div class="mb-2 flex flex-col gap-1 items-start whitespace-nowrap">
<ui-radio
v-for="league of leagues.list.value"
:key="league.id"
v-model="leagueId"
:value="league.id"
>{{ league.id }}</ui-radio
>
<ui-radio v-for="league of leagues.list.value" :key="league.id" v-model="leagueId" :value="league.id">{{
league.id }}</ui-radio>
</div>
<div class="flex gap-x-2 mb-4">
<div class="text-gray-500">{{ t("settings.private_league") }}</div>
<input
v-model="customLeagueId"
placeholder="My League (PL12345)"
class="rounded bg-gray-900 px-1 mb-1 flex-1"
/>
<input v-model="customLeagueId" placeholder="My League (PL12345)"
class="rounded bg-gray-900 px-1 mb-1 flex-1" />
</div>
</template>
</div>
Expand All @@ -45,10 +33,7 @@
<div class="mb-2">
<div class="flex-1 mb-1">{{ t("settings.account_name") }}</div>
<div class="mb-4">
<input
v-model="accountName"
class="rounded bg-gray-900 px-1 block w-full mb-1 font-poe"
/>
<input v-model="accountName" class="rounded bg-gray-900 px-1 block w-full mb-1 font-poe" />
</div>
</div>
<div class="mb-2">
Expand All @@ -71,10 +56,8 @@
<div class="mb-4 flex">
<div class="flex mr-6">
<span class="mr-1">+-</span>
<input
v-model.number="searchStatRange"
class="rounded bg-gray-900 px-1 block w-16 mb-1 font-poe text-center"
/>
<input v-model.number="searchStatRange"
class="rounded bg-gray-900 px-1 block w-16 mb-1 font-poe text-center" />
<span class="ml-1">%</span>
</div>
<ui-radio v-model="searchStatRange" :value="0">{{
Expand All @@ -88,15 +71,14 @@
<ui-checkbox class="mb-4" v-model="activateStockFilter">{{
t(":select_stock")
}}</ui-checkbox>
<ui-checkbox class="mb-4" v-model="requestPricePrediction"
>{{ t(":show_prediction") }}
<span class="bg-gray-700 px-1 rounded"
>www.poeprices.info</span
></ui-checkbox
>
<ui-checkbox class="mb-4" v-model="requestPricePrediction">{{ t(":show_prediction") }}
<span class="bg-gray-700 px-1 rounded">www.poeprices.info</span></ui-checkbox>
<ui-checkbox class="mb-4" v-model="showCursor">{{
t(":cursor_pos")
}}</ui-checkbox>

<ui-checkbox class="mb-4" v-model="usePseudo">{{ t(":use_pseudo")
}}</ui-checkbox>
<div class="mb-4" :class="{ 'p-2 bg-orange-600 rounded': builtinBrowser }">
<ui-checkbox v-model="builtinBrowser">{{
t(":enable_browser")
Expand All @@ -107,20 +89,12 @@
</div>
<div class="border-2 rounded border-gray-700 mb-2">
<div class="bg-gray-700 p-2 mb-2">{{ t(":warn_expensive") }}</div>
<ui-checkbox
class="mb-4 mx-2"
:values="['app', 'api']"
v-model="collapseListings"
>{{ t(":accurate_collapsed") }}</ui-checkbox
>
<ui-checkbox class="mb-4 mx-2" :values="['app', 'api']" v-model="collapseListings">{{ t(":accurate_collapsed")
}}</ui-checkbox>
<div class="mb-2 mx-2">
<div class="flex-1 mb-1">{{ t(":auto_search") }}</div>
<div class="mb-4 flex">
<ui-toggle
v-if="hotkeyQuick"
v-model="smartInitialSearch"
class="mr-6"
>
<ui-toggle v-if="hotkeyQuick" v-model="smartInitialSearch" class="mr-6">
<span class="bg-gray-900 text-gray-500 rounded px-2">{{
hotkeyQuick
}}</span>
Expand All @@ -136,10 +110,8 @@
<div class="flex-1 mb-1">{{ t(":extra_delay") }}</div>
<div class="flex">
<div class="flex mr-6">
<input
v-model.number="apiLatencySeconds"
class="rounded bg-gray-900 px-1 block w-16 mb-1 font-poe text-center"
/>
<input v-model.number="apiLatencySeconds"
class="rounded bg-gray-900 px-1 block w-16 mb-1 font-poe text-center" />
<span class="ml-2">{{ t("seconds") }}</span>
</div>
</div>
Expand Down Expand Up @@ -196,6 +168,7 @@ export default defineComponent({
() => configWidget.value,
"builtinBrowser",
),
usePseudo: configModelValue(() => configWidget.value, "usePseudo"),
requestPricePrediction: configModelValue(
() => configWidget.value,
"requestPricePrediction",
Expand Down

0 comments on commit fd6c194

Please sign in to comment.