mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-25 06:05:54 +00:00
various
This commit is contained in:
@@ -46,6 +46,7 @@ export interface ParsedItem {
|
||||
category?: ItemCategory
|
||||
icon?: string
|
||||
rawText: string
|
||||
isAdvancedDesc: boolean
|
||||
}
|
||||
|
||||
export type HeistJob =
|
||||
|
||||
@@ -75,7 +75,10 @@ export function parseClipboard (clipboard: string) {
|
||||
if (!parsed) {
|
||||
return null
|
||||
}
|
||||
|
||||
sections.shift()
|
||||
parsed.rawText = clipboard
|
||||
parsed.isAdvancedDesc = isAdvancedDescription(lines)
|
||||
|
||||
// each section can be parsed at most by one parser
|
||||
for (const parser of parsers) {
|
||||
@@ -90,8 +93,6 @@ export function parseClipboard (clipboard: string) {
|
||||
}
|
||||
}
|
||||
|
||||
parsed.rawText = clipboard
|
||||
|
||||
return Object.freeze(parsed)
|
||||
}
|
||||
|
||||
@@ -200,7 +201,8 @@ function parseNamePlate (section: string[]) {
|
||||
influences: [],
|
||||
sockets: {},
|
||||
extra: {},
|
||||
rawText: undefined!
|
||||
rawText: undefined!,
|
||||
isAdvancedDesc: false
|
||||
}
|
||||
return item
|
||||
}
|
||||
@@ -683,3 +685,7 @@ function markupConditionParser (text: string) {
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
function isAdvancedDescription (lines: string[]): boolean {
|
||||
return lines.some(line => line.startsWith('{') && line.endsWith('}'))
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import { nameToDetailsId } from '../price-check/trends/getDetailsId'
|
||||
interface NinjaCurrencyInfo { /* eslint-disable camelcase */
|
||||
currencyTypeName: string
|
||||
receive?: {
|
||||
league_id: number
|
||||
pay_currency_id: number
|
||||
get_currency_id: number
|
||||
count: number
|
||||
value: number
|
||||
includes_secondary: boolean
|
||||
}
|
||||
pay?: {
|
||||
get_currency_id: number
|
||||
value: number
|
||||
}
|
||||
receiveSparkLine: {
|
||||
data: Array<number | null>
|
||||
@@ -142,7 +142,12 @@ async function load (force: boolean = false) {
|
||||
if (currency.receive.value >= 15) {
|
||||
chaosExaRate.value = currency.receive.value
|
||||
} else {
|
||||
chaosExaRate.value = undefined
|
||||
// fallback to sell price
|
||||
if (currency.pay?.value && (1 / currency.pay.value) >= 15) {
|
||||
chaosExaRate.value = (1 / currency.pay.value)
|
||||
} else {
|
||||
chaosExaRate.value = undefined
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user