diff --git a/renderer/public/images/divine.png b/renderer/public/images/divine.png new file mode 100644 index 00000000..aad38241 Binary files /dev/null and b/renderer/public/images/divine.png differ diff --git a/renderer/src/web/background/Prices.ts b/renderer/src/web/background/Prices.ts index 431a2e59..c60adab6 100644 --- a/renderer/src/web/background/Prices.ts +++ b/renderer/src/web/background/Prices.ts @@ -10,7 +10,7 @@ interface NinjaDenseInfo { variant?: string } -export const chaosExaRate = shallowRef(undefined) +export const xchgRate = shallowRef(undefined) type PriceDatabase = Array<{ ns: string, url: string, lines: string }> let PRICES_DB: PriceDatabase = [] @@ -31,9 +31,9 @@ async function load (force: boolean = false) { if (leagueAtStartOfLoad === selectedLeague.value) { PRICES_DB = splitJsonBlob(jsonBlob) - const exalted = findPriceByQuery({ ns: 'ITEM', name: 'Exalted Orb', variant: undefined }) - if (exalted && exalted.chaos >= 15) { - chaosExaRate.value = exalted.chaos + const divine = findPriceByQuery({ ns: 'ITEM', name: 'Divine Orb', variant: undefined }) + if (divine && divine.chaos >= 30) { + xchgRate.value = divine.chaos } lastUpdateTime = Date.now() @@ -143,29 +143,29 @@ export function findPriceByQuery (query: DbQuery) { return null } -export function autoCurrency (value: number, currency: 'chaos' | 'exa'): { min: number, max: number, currency: 'chaos' | 'exa' } { +export function autoCurrency (value: number, currency: 'chaos' | 'div'): { min: number, max: number, currency: 'chaos' | 'div' } { if (currency === 'chaos') { - if (value > ((chaosExaRate.value || 9999) * 0.94)) { - if (value < ((chaosExaRate.value || 9999) * 1.06)) { - return { min: 1, max: 1, currency: 'exa' } + if (value > ((xchgRate.value || 9999) * 0.94)) { + if (value < ((xchgRate.value || 9999) * 1.06)) { + return { min: 1, max: 1, currency: 'div' } } else { - return { min: chaosToExa(value), max: chaosToExa(value), currency: 'exa' } + return { min: chaosToStable(value), max: chaosToStable(value), currency: 'div' } } } - } else if (currency === 'exa') { + } else if (currency === 'div') { if (value < 1) { - return { min: exaToChaos(value), max: exaToChaos(value), currency: 'chaos' } + return { min: stableToChaos(value), max: stableToChaos(value), currency: 'chaos' } } } return { min: value, max: value, currency } } -function chaosToExa (count: number) { - return count / (chaosExaRate.value || 9999) +function chaosToStable (count: number) { + return count / (xchgRate.value || 9999) } -function exaToChaos (count: number) { - return count * (chaosExaRate.value || 9999) +function stableToChaos (count: number) { + return count * (xchgRate.value || 9999) } export function displayRounding (value: number, fraction: boolean = false): string { @@ -187,7 +187,7 @@ setInterval(() => { }, RETRY_TIME) watch(selectedLeague, () => { - chaosExaRate.value = undefined + xchgRate.value = undefined PRICES_DB = [] load(true) }) diff --git a/renderer/src/web/price-check/PriceCheckWindow.vue b/renderer/src/web/price-check/PriceCheckWindow.vue index ff62fa89..8342c2ec 100644 --- a/renderer/src/web/price-check/PriceCheckWindow.vue +++ b/renderer/src/web/price-check/PriceCheckWindow.vue @@ -11,17 +11,17 @@
- + @@ -71,7 +71,7 @@ import { useI18n } from 'vue-i18n' import CheckedItem from './CheckedItem.vue' import BackgroundInfo from './BackgroundInfo.vue' import { MainProcess } from '@/web/background/IPC' -import { chaosExaRate } from '../background/Prices' +import { xchgRate } from '../background/Prices' import { selected as league } from '@/web/background/Leagues' import { AppConfig } from '@/web/Config' import { ItemCategory, ItemRarity, parseClipboard, ParsedItem } from '@/parser' @@ -162,7 +162,7 @@ export default defineComponent({ }) const title = computed(() => league.value || 'Awakened PoE Trade') - const exaltedCost = computed(() => (chaosExaRate.value) ? Math.round(chaosExaRate.value) : null) + const stableOrbCost = computed(() => (xchgRate.value) ? Math.round(xchgRate.value) : null) const isBrowserShown = computed(() => props.config.wmFlags.includes('has-browser')) const overlayKey = computed(() => AppConfig().overlayKey) const showCheckPos = computed(() => wm.active.value && props.config.showCursor) @@ -227,7 +227,7 @@ export default defineComponent({ poeUiWidth: wm.poePanelWidth, closePriceCheck, title, - exaltedCost, + stableOrbCost, showCheckPos, checkPosition, item, diff --git a/renderer/src/web/price-check/price-prediction/FeedbackOption.vue b/renderer/src/web/price-check/price-prediction/FeedbackOption.vue index 62d99dea..9e428d61 100644 --- a/renderer/src/web/price-check/price-prediction/FeedbackOption.vue +++ b/renderer/src/web/price-check/price-prediction/FeedbackOption.vue @@ -31,7 +31,7 @@ export default defineComponent({ required: true }, prediction: { - type: Object as PropType<{ min: number, max: number, currency: 'chaos' | 'exa' }>, + type: Object as PropType<{ min: number, max: number, currency: 'chaos' | 'div' }>, required: true }, item: { @@ -60,7 +60,7 @@ export default defineComponent({ }, { min: props.prediction.min, max: props.prediction.max, - currency: (props.prediction.currency === 'exa') ? 'exalt' : 'chaos' + currency: (props.prediction.currency === 'div') ? 'divine' : 'chaos' }, props.item) } diff --git a/renderer/src/web/price-check/price-prediction/poeprices.ts b/renderer/src/web/price-check/price-prediction/poeprices.ts index baae01b8..7b8dc6c3 100644 --- a/renderer/src/web/price-check/price-prediction/poeprices.ts +++ b/renderer/src/web/price-check/price-prediction/poeprices.ts @@ -6,7 +6,7 @@ import { Cache } from '../trade/Cache' const cache = new Cache() interface PoepricesApiResponse { /* eslint-disable camelcase */ - currency: 'chaos' | 'exalt' + currency: 'chaos' | 'divine' error: number error_msg: string warning_msg: string @@ -20,7 +20,7 @@ export interface RareItemPrice { max: number min: number confidence: number - currency: 'chaos' | 'exa' + currency: 'chaos' | 'div' explanation: Array<{ name: string contrib: number @@ -50,8 +50,12 @@ export async function requestPoeprices (item: ParsedItem): Promise(query, data, 300) } + if (data.currency !== 'divine' && data.currency !== 'chaos') { + throw new Error('poeprices.info gave the price in Exalted Orbs.') + } + return { - currency: (data.currency === 'exalt') ? 'exa' : 'chaos', + currency: (data.currency === 'divine') ? 'div' : 'chaos', min: data.min, max: data.max, confidence: Math.round(data.pred_confidence_score), diff --git a/renderer/src/web/price-check/stack-value/StackValue.vue b/renderer/src/web/price-check/stack-value/StackValue.vue index b57270bd..759d6a0a 100644 --- a/renderer/src/web/price-check/stack-value/StackValue.vue +++ b/renderer/src/web/price-check/stack-value/StackValue.vue @@ -33,7 +33,7 @@ export default defineComponent({ function getPriceFor (n: number) { const one = findPriceByQuery(getDetailsId(props.item)!)! - const price = (props.item.info.refName === 'Exalted Orb') + const price = (props.item.info.refName === 'Divine Orb') ? { min: n * one.chaos, max: n * one.chaos, currency: 'chaos' as const } : autoCurrency(n * one.chaos, 'chaos') diff --git a/renderer/src/web/price-check/trade/TradeBulk.vue b/renderer/src/web/price-check/trade/TradeBulk.vue index 281156b9..5fc957d7 100644 --- a/renderer/src/web/price-check/trade/TradeBulk.vue +++ b/renderer/src/web/price-check/trade/TradeBulk.vue @@ -6,15 +6,15 @@ {{ t('Matched:') }} ...
- -
@@ -101,7 +101,7 @@ import TradeLinks from './TradeLinks.vue' const slowdown = artificialSlowdown(900) function useBulkApi () { - type BulkSearchExtended = Record<'exa' | 'chaos', { + type BulkSearchExtended = Record<'xchgChaos' | 'xchgStable', { listed: Ref listedLazy: ComputedRef }> @@ -120,17 +120,17 @@ function useBulkApi () { // override, because at league start many players set wrong price, and this breaks optimistic search const have = (item.info.refName === 'Chaos Orb') - ? ['exalted'] - : (item.info.refName === 'Exalted Orb') + ? ['divine'] + : (item.info.refName === 'Divine Orb') ? ['chaos'] - : ['exalted', 'chaos'] + : ['divine', 'chaos'] const optimisticSearch = await execBulkSearch( item, filters, have, { accountName: AppConfig().accountName }) if (_searchId === searchId) { result.value = { - exa: getResultsByHave(item, filters, optimisticSearch, 'exalted'), - chaos: getResultsByHave(item, filters, optimisticSearch, 'chaos') + xchgStable: getResultsByHave(item, filters, optimisticSearch, 'divine'), + xchgChaos: getResultsByHave(item, filters, optimisticSearch, 'chaos') } } } catch (err) { @@ -142,7 +142,7 @@ function useBulkApi () { item: ParsedItem, filters: ItemFilters, preloaded: Array, - have: 'exalted' | 'chaos' + have: 'divine' | 'chaos' ) { const _result = shallowRef( preloaded.some(res => res?.haveTag === have) @@ -160,9 +160,9 @@ function useBulkApi () { item, filters, [have], { accountName: AppConfig().accountName }))[0]! ) items.value = _result.value.listed - const otherHave = (have === 'exalted') - ? result.value?.chaos?.listed.value! - : result.value?.exa?.listed.value! + const otherHave = (have === 'divine') + ? result.value?.xchgChaos?.listed.value! + : result.value?.xchgStable?.listed.value! // fix best guess we did while making optimistic search otherHave.total -= _result.value.total } catch (err) { @@ -196,7 +196,7 @@ export default defineComponent({ const widget = computed(() => AppConfig('price-check')!) const { error, result, search } = useBulkApi() - const selectedCurr = shallowRef<'chaos' | 'exa'>('chaos') + const selectedCurr = shallowRef<'xchgChaos' | 'xchgStable'>('xchgChaos') watch(() => props.item, (item) => { slowdown.reset(item) @@ -212,14 +212,14 @@ export default defineComponent({ }) watch(result, () => { - const exaTotal = result.value?.exa.listed.value?.total - const chaosTotal = result.value?.chaos.listed.value?.total - if (exaTotal == null) { - selectedCurr.value = 'chaos' + const stableTotal = result.value?.xchgStable.listed.value?.total + const chaosTotal = result.value?.xchgChaos.listed.value?.total + if (stableTotal == null) { + selectedCurr.value = 'xchgChaos' } else if (chaosTotal == null) { - selectedCurr.value = 'exa' + selectedCurr.value = 'xchgStable' } else { - selectedCurr.value = (exaTotal > chaosTotal) ? 'exa' : 'chaos' + selectedCurr.value = (stableTotal > chaosTotal) ? 'xchgStable' : 'xchgChaos' } }) diff --git a/renderer/src/web/price-check/trade/pathofexile-bulk.ts b/renderer/src/web/price-check/trade/pathofexile-bulk.ts index 08f39311..70289a9c 100644 --- a/renderer/src/web/price-check/trade/pathofexile-bulk.ts +++ b/renderer/src/web/price-check/trade/pathofexile-bulk.ts @@ -170,7 +170,7 @@ export async function execBulkSearch ( .map(result => toPricingResult(result, opts, offer)) const chaosIsLoaded = ( - tradeTag === 'exalted' && + tradeTag === 'divine' && resultsTag.length < results.length && ((results.length - resultsTag.length) >= SHOW_RESULTS || query.total <= API_FETCH_LIMIT) ) diff --git a/renderer/src/web/price-check/trends/PriceTrend.vue b/renderer/src/web/price-check/trends/PriceTrend.vue index 518d1b1b..f867770a 100644 --- a/renderer/src/web/price-check/trends/PriceTrend.vue +++ b/renderer/src/web/price-check/trends/PriceTrend.vue @@ -87,7 +87,7 @@ export default defineComponent({ const trend = detailsId && findPriceByQuery(detailsId) if (!trend) return - const price = (props.item.info.refName === 'Exalted Orb') + const price = (props.item.info.refName === 'Divine Orb') ? { min: trend.chaos, max: trend.chaos, currency: 'chaos' as const } : autoCurrency(trend.chaos, 'chaos') diff --git a/renderer/src/web/ui/ItemQuickPrice.vue b/renderer/src/web/ui/ItemQuickPrice.vue index 58054663..64dde68d 100644 --- a/renderer/src/web/ui/ItemQuickPrice.vue +++ b/renderer/src/web/ui/ItemQuickPrice.vue @@ -8,14 +8,14 @@
~ - {{ minText }} + {{ minText }} ~ - {{ maxText }} - × -  {{ price.currency }} + {{ maxText }} + × +  {{ price.currency }}
- +
@@ -28,7 +28,7 @@ import { displayRounding } from '../background/Prices' export default defineComponent({ props: { price: { - type: Object as PropType<{ min: number, max: number, currency: 'exa' | 'chaos' }>, + type: Object as PropType<{ min: number, max: number, currency: 'div' | 'chaos' }>, default: undefined }, approx: { @@ -56,14 +56,14 @@ export default defineComponent({ minText, maxText, isRange: computed(() => { return minText.value !== maxText.value }), - isExa: computed(() => { return props.price?.currency === 'exa' }) + isValuable: computed(() => { return props.price?.currency !== 'chaos' }) } } })