mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-24 21:55:41 +00:00
@@ -28,6 +28,7 @@ export const PRICE_CHECK_CANCELED = 'MAIN->OVERLAY::price-check-canceled'
|
||||
export interface IpcPriceCheck {
|
||||
clipboard: string
|
||||
position: { x: number, y: number }
|
||||
lockedMode: boolean
|
||||
}
|
||||
|
||||
export const ITEM_CHECK = 'MAIN->OVERLAY::item-check'
|
||||
|
||||
+3
-1
@@ -139,7 +139,9 @@ export const defaultConfig: Config = {
|
||||
chaosPriceThreshold: 0.05,
|
||||
showRateLimitState: false,
|
||||
apiLatencySeconds: 2,
|
||||
collapseListings: 'api'
|
||||
collapseListings: 'api',
|
||||
smartInitialSearch: true,
|
||||
lockedInitialSearch: true
|
||||
} as PriceCheckWidget,
|
||||
{
|
||||
wmId: 3,
|
||||
|
||||
@@ -146,6 +146,11 @@ export const config = (() => {
|
||||
config.widgets.find(w => w.wmType === 'price-check')!
|
||||
.collapseListings = 'api'
|
||||
|
||||
config.widgets.find(w => w.wmType === 'price-check')!
|
||||
.smartInitialSearch = true
|
||||
config.widgets.find(w => w.wmType === 'price-check')!
|
||||
.lockedInitialSearch = true
|
||||
|
||||
config.configVersion = 9
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export function showWidget (opts: {
|
||||
}) {
|
||||
checkPressPosition = opts.hotkeyPressPosition
|
||||
|
||||
overlayWindow!.webContents.send(ipc.PRICE_CHECK, { clipboard: opts.clipboard, position: checkPressPosition } as ipc.IpcPriceCheck)
|
||||
overlayWindow!.webContents.send(ipc.PRICE_CHECK, { clipboard: opts.clipboard, position: checkPressPosition, lockedMode: opts.lockedMode } as ipc.IpcPriceCheck)
|
||||
|
||||
const poeBounds = PoeWindow.bounds!
|
||||
activeAreaRect = {
|
||||
|
||||
@@ -37,7 +37,7 @@ export default defineComponent({
|
||||
handleItemPaste (e: InputEvent) {
|
||||
const target = e.target as HTMLInputElement
|
||||
const text = target.value
|
||||
MainProcess.selfEmitPriceCheck({ clipboard: text, position: { x: window.screenX + 100, y: window.screenY + 100 } })
|
||||
MainProcess.selfEmitPriceCheck({ clipboard: text, position: { x: window.screenX + 100, y: window.screenY + 100 }, lockedMode: false })
|
||||
target.value = ''
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
|
||||
@@ -50,6 +50,8 @@ export interface PriceCheckWidget extends Widget {
|
||||
showRateLimitState: boolean
|
||||
apiLatencySeconds: number
|
||||
collapseListings: 'api' | 'app'
|
||||
smartInitialSearch: boolean
|
||||
lockedInitialSearch: boolean
|
||||
}
|
||||
|
||||
export interface ItemCheckWidget extends Widget {
|
||||
|
||||
@@ -60,6 +60,7 @@ import { Config } from '@/web/Config'
|
||||
import { ItemFilters, StatFilter } from './filters/interfaces'
|
||||
import { ModifierType } from '@/parser/modifiers'
|
||||
import { MainProcess } from '@/ipc/main-process-bindings'
|
||||
import { PriceCheckWidget } from '../overlay/interfaces'
|
||||
|
||||
let _showSupportLinksCounter = 0
|
||||
|
||||
@@ -78,9 +79,17 @@ export default defineComponent({
|
||||
item: {
|
||||
type: Object as PropType<ParsedItem>,
|
||||
required: true
|
||||
},
|
||||
advancedCheck: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
const widgetCfg = computed(() => {
|
||||
return Config.store.widgets.find(w => w.wmType === 'price-check') as PriceCheckWidget
|
||||
})
|
||||
|
||||
const itemFilters = ref<ItemFilters>(null!)
|
||||
const itemStats = ref<StatFilter[]>(null!)
|
||||
const interactedOnce = ref(false)
|
||||
@@ -96,13 +105,19 @@ export default defineComponent({
|
||||
watch(() => props.item, (item) => {
|
||||
itemFilters.value = createFilters(item)
|
||||
itemStats.value = initUiModFilters(item)
|
||||
interactedOnce.value = Boolean(
|
||||
(item.rarity === ItemRarity.Unique) ||
|
||||
(item.category === ItemCategory.Map) ||
|
||||
(!CATEGORY_TO_TRADE_ID.has(item.category!)) ||
|
||||
(item.isUnidentified) ||
|
||||
(item.extra.veiled)
|
||||
)
|
||||
|
||||
if ((!props.advancedCheck && !widgetCfg.smartInitialSearch) ||
|
||||
(props.advancedCheck && !widgetCfg.lockedInitialSearch)) {
|
||||
interactedOnce.value = false
|
||||
} else {
|
||||
interactedOnce.value = Boolean(
|
||||
(item.rarity === ItemRarity.Unique) ||
|
||||
(item.category === ItemCategory.Map) ||
|
||||
(!CATEGORY_TO_TRADE_ID.has(item.category!)) ||
|
||||
(item.isUnidentified) ||
|
||||
(item.extra.veiled)
|
||||
)
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
watch(() => [props.item, interactedOnce.value], () => {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
:position="checkPosition" style="z-index: -1;" />
|
||||
<unidentified-resolver :item="item" @identify="item = $event" />
|
||||
<checked-item v-if="isLeagueSelected && item"
|
||||
:item="item" />
|
||||
:item="item" :advanced-check="advancedCheck" />
|
||||
<div v-if="isBrowserShown" class="bg-gray-900 px-6 py-2 truncate">
|
||||
<i18n-t keypath="Press {0} to switch between browser and game." tag="div">
|
||||
<span class="bg-gray-400 text-gray-900 rounded px-1">{{ overlayKey }}</span>
|
||||
@@ -105,6 +105,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const item = shallowRef<ParsedItem | null>(null)
|
||||
const advancedCheck = shallowRef(false)
|
||||
const checkPosition = shallowRef({ x: 1, y: 1 })
|
||||
|
||||
MainProcess.addEventListener(PRICE_CHECK, (e) => {
|
||||
@@ -116,6 +117,7 @@ export default defineComponent({
|
||||
y: _e.position.y - window.screenY
|
||||
}
|
||||
item.value = parseClipboard(_e.clipboard)
|
||||
advancedCheck.value = _e.lockedMode
|
||||
})
|
||||
MainProcess.addEventListener(PRICE_CHECK_CANCELED, () => {
|
||||
wm.hide(props.config.wmId)
|
||||
@@ -178,6 +180,7 @@ export default defineComponent({
|
||||
showCheckPos,
|
||||
checkPosition,
|
||||
item,
|
||||
advancedCheck,
|
||||
overlayKey,
|
||||
isLeagueSelected
|
||||
}
|
||||
|
||||
@@ -50,6 +50,19 @@
|
||||
<ui-radio v-model="configWidget.collapseListings" value="app">{{ t('Yes') }}</ui-radio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2" >
|
||||
<div class="flex-1 mb-1">{{ t('Perform an auto search, when pressing') }}</div>
|
||||
<div class="mb-4 flex">
|
||||
<ui-toggle v-if="config.priceCheckKey"
|
||||
v-model="configWidget.smartInitialSearch" class="mr-6">
|
||||
<span class="bg-gray-900 text-gray-500 rounded px-2">{{ `${config.priceCheckKeyHold} + ${config.priceCheckKey}` }}</span>
|
||||
</ui-toggle>
|
||||
<ui-toggle v-if="config.priceCheckLocked"
|
||||
v-model="configWidget.lockedInitialSearch">
|
||||
<span class="bg-gray-900 text-gray-500 rounded px-2">{{ config.priceCheckLocked }}</span>
|
||||
</ui-toggle>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2 border p-2 border-gray-600 border-dashed">
|
||||
<div class="flex-1 mb-1">{{ t('Extra time to prevent spurious Rate limiting') }}</div>
|
||||
<div class="flex">
|
||||
@@ -132,7 +145,8 @@ export default defineComponent({
|
||||
"Extra time to prevent spurious Rate limiting": "Добавочное время для предотвращения ложного срабатывания ограничения на запросы",
|
||||
"seconds": "секунды",
|
||||
"Settings below are a compromise between increasing load on PoE website and convenient price checking / more accurate search.": "Настройки ниже являются компромиссом между увеличенной нагрузкой на сайт PoE и удобством проверки цен / более точным поиском.",
|
||||
"Show indication on collapsed listings": "Показывать индикацию на сгруппированных результатах"
|
||||
"Show indication on collapsed listings": "Показывать индикацию на сгруппированных результатах",
|
||||
"Perform an auto search, when pressing": "Выполнять автоматический поиск при нажатии"
|
||||
}
|
||||
}
|
||||
</i18n>
|
||||
|
||||
Reference in New Issue
Block a user