mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-09-26 06:35:45 +00:00
feat: wiki
This commit is contained in:
@@ -26,6 +26,12 @@
|
||||
<hotkey-input v-model="config.priceCheckLocked" :forbidden="['C','V']" class="w-48" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-8">
|
||||
<div class="flex">
|
||||
<div class="flex-1">Open wiki</div>
|
||||
<hotkey-input v-model="config.wikiKey" :forbidden="['C','V']" class="w-48" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<div class="flex-1 mb-1">Custom commands</div>
|
||||
<div class="mb-4" v-for="(command, idx) in config.commands" :key="idx">
|
||||
|
||||
@@ -28,7 +28,7 @@ class PoeWindowClass extends EventEmitter {
|
||||
this.bounds = (await windowManager.getActiveWindowContentBounds())!
|
||||
this.pid = (await windowManager.getActiveWindowId())!
|
||||
}
|
||||
}, 1000)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { showWindow, lockWindow, poeUserInterfaceWidth } from './positioning'
|
||||
import { KeyCodeToName } from '@/components/settings/KeyToCode'
|
||||
import { config } from './config'
|
||||
import { PoeWindow } from './PoeWindow'
|
||||
import { openWiki } from './wiki'
|
||||
|
||||
export let isPollingClipboard = false
|
||||
export let checkPressPosition: Point | undefined
|
||||
@@ -14,7 +15,7 @@ export let checkPressPosition: Point | undefined
|
||||
function priceCheck (lockedMode: boolean) {
|
||||
if (!isPollingClipboard) {
|
||||
isPollingClipboard = true
|
||||
pollClipboard(32, 1000)
|
||||
pollClipboard(32, 500)
|
||||
.then(async (clipboard) => {
|
||||
win.webContents.send('price-check', clipboard)
|
||||
await showWindow()
|
||||
@@ -59,6 +60,9 @@ export function setupShortcuts () {
|
||||
priceCheck(false)
|
||||
} else if (pressed === config.get('priceCheckLocked')) {
|
||||
priceCheck(true)
|
||||
} else if (pressed === config.get('wikiKey')) {
|
||||
pollClipboard(32, 500).then(openWiki).catch(() => {})
|
||||
robotjs.keyTap('key_c', ['control'])
|
||||
} else {
|
||||
const command = config.get('commands').find(c => c.hotkey === pressed)
|
||||
if (command) {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { shell } from 'electron'
|
||||
import { parseClipboard, ItemRarity } from '../components/parser'
|
||||
|
||||
const WIKI_URL = 'https://pathofexile.gamepedia.com'
|
||||
|
||||
export function openWiki (clipboard: string) {
|
||||
const item = parseClipboard(clipboard)
|
||||
if (!item) return
|
||||
|
||||
const pageName = (item.rarity === ItemRarity.Unique)
|
||||
? item.name
|
||||
: item.baseType || item.name
|
||||
|
||||
shell.openExternal(`${WIKI_URL}/${pageName}`)
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export interface Config {
|
||||
priceCheckKey: string
|
||||
priceCheckKeyHold: string
|
||||
priceCheckLocked: string
|
||||
wikiKey: string
|
||||
commands: Array<{
|
||||
text: string
|
||||
hotkey: string
|
||||
@@ -19,6 +20,7 @@ export const defaultConfig: Config = {
|
||||
priceCheckKey: 'D',
|
||||
priceCheckKeyHold: 'Ctrl',
|
||||
priceCheckLocked: 'Ctrl + Alt + D',
|
||||
wikiKey: 'Alt + W',
|
||||
commands: [{
|
||||
text: '/hideout',
|
||||
hotkey: 'F5'
|
||||
|
||||
Reference in New Issue
Block a user