Compare commits

...

4 Commits

Author SHA1 Message Date
kvan7
b874962614 Update poe2db to go to mods page 2025-09-24 20:13:52 -05:00
kvan7
3c0a533395 prevent undefined 2025-09-24 19:01:22 -05:00
kvan7
4297289951 Add filter by price and basetype 2025-09-24 18:57:43 -05:00
Kvan7
4af188c4c3 Merge pull request #721 from Kvan7:dev
v0.12.6
2025-09-23 22:01:11 -05:00
13 changed files with 159 additions and 14 deletions

View File

@@ -69,7 +69,9 @@
"rune_sockets": "插槽:{0}",
"sentinel_charge": "充能:{0}",
"find_in_stash": "在倉庫中尋找",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "解析物品時發生錯誤",
"parse_error_help": "這可能是一個錯誤,你可以在 GitHub 上報告。",
"unknown": "未知物品",

View File

@@ -69,7 +69,9 @@
"rune_sockets": "Fassungen: {0}",
"sentinel_charge": "Ladung: {0}",
"find_in_stash": "Im Versteck finden",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "Ein Fehler ist beim Parsen des Gegenstands aufgetreten",
"parse_error_help": "Dies ist wahrscheinlich ein Fehler. Du kannst ihn auf GitHub melden.",
"unknown": "Unbekannter Gegenstand",

View File

@@ -69,7 +69,10 @@
"rune_sockets": "Sockets: {0}",
"sentinel_charge": "Charge: {0}",
"find_in_stash": "Find in Stash",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"price_and_item": "Price and Item",
"parse_error": "An error occurred while parsing the item",
"parse_error_help": "This is probably a bug and you can report it on GitHub.",
"unknown": "Unknown Item",

View File

@@ -69,7 +69,9 @@
"rune_sockets": "Ranuras: {0}",
"sentinel_charge": "Carga: {0}",
"find_in_stash": "Encontrar en el alijo",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "Se produjo un error al analizar el objeto",
"parse_error_help": "Esto probablemente sea un error. Puedes informarlo en GitHub.",
"unknown": "Objeto desconocido",

View File

@@ -69,7 +69,9 @@
"rune_sockets": "ソケット: {0}",
"sentinel_charge": "チャージ: {0}",
"find_in_stash": "スタッシュで見つける",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "アイテムの解析中にエラーが発生しました",
"parse_error_help": "これはおそらくバグであり、GitHubで報告できます。",
"unknown": "不明なアイテム",

View File

@@ -66,7 +66,9 @@
"gem_level": "젬 레벨: {0}",
"sentinel_charge": "Charge: {0}",
"find_in_stash": "보관함에서 찾기",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "분석 중 오류 발생",
"parse_error_help": "버그일 수도 있습니다. GitHub에 버그 신고해주세요.",
"unknown": "알 수 없는 아이템",

View File

@@ -68,7 +68,9 @@
"rune_sockets": "Engastes: {0}",
"sentinel_charge": "Carga: {0}",
"find_in_stash": "Encontrar no baú",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "Ocorreu um erro ao analisar o item",
"parse_error_help": "Isso provavelmente é um erro. Você pode reportá-lo no GitHub.",
"unknown": "Item desconhecido",

View File

@@ -85,7 +85,9 @@
"gem_level": "Уровень: {0}",
"sentinel_charge": "Заряд: {0}",
"find_in_stash": "Найти в тайнике",
"find_same_price": "Filter by Price",
"find_same_price": "Filter by",
"find_same_price_type": "Filter by:",
"price": "Price Only",
"parse_error": "Произошла ошибка при парсинге предмета",
"parse_error_help": "Скорее всего, это ошибка, и вы можете сообщить о ней на GitHub.",
"unknown": "Неизвестный предмет",

View File

@@ -152,7 +152,7 @@ export interface Config {
}
export const defaultConfig = (): Config => ({
configVersion: 27,
configVersion: 28,
overlayKey: "Shift + Space",
overlayBackground: "rgba(129, 139, 149, 0.15)",
overlayBackgroundClose: true,
@@ -583,7 +583,16 @@ function upgradeConfig(_config: Config): Config {
config.configVersion = 27;
}
if (config.configVersion < 28) {
// NOTE: v0.12.7 || poe0.3.0c
const itemCheck = config.widgets.find(
(w) => w.wmType === "item-check",
) as ItemCheckWidget;
itemCheck.samePricedType = "both";
config.configVersion = 28;
}
return config as unknown as Config;
}

View File

@@ -34,6 +34,7 @@ export default {
craftOfExileKey: null,
stashSearchKey: null,
samePricedKey: null,
samePricedType: "both",
maps: {
profile: 1,
showNewStats: false,

View File

@@ -1,6 +1,8 @@
import { Host } from "@/web/background/IPC";
import { AppConfig } from "@/web/Config";
import { ParsedItem, parseClipboard } from "@/parser";
import { ItemRarity, ParsedItem, parseClipboard } from "@/parser";
import { ItemCheckWidget } from "./widget";
import { ARMOUR, ItemCategory } from "@/parser/meta";
const POEDB_LANGS = {
"en": "us",
@@ -13,6 +15,71 @@ const POEDB_LANGS = {
"pt": "pt",
};
const POE2DB_CONVERSIONS = new Map([
// One handed
[ItemCategory.Claw, "Claws"],
[ItemCategory.Dagger, "Daggers"],
[ItemCategory.Wand, "Wands"],
[ItemCategory.OneHandedSword, "One_Hand_Swords"],
[ItemCategory.OneHandedAxe, "One_Hand_Axes"],
[ItemCategory.OneHandedMace, "One_Hand_Maces"],
[ItemCategory.Sceptre, "Sceptres"],
[ItemCategory.Spear, "Spears"],
[ItemCategory.Flail, "Flails"],
// Two handed
[ItemCategory.Bow, "Bows"],
[ItemCategory.Staff, "Staves"],
[ItemCategory.TwoHandedSword, "Two_Hand_Swords"],
[ItemCategory.TwoHandedAxe, "Two_Hand_Axes"],
[ItemCategory.TwoHandedMace, "Two_Hand_Maces"],
[ItemCategory.Warstaff, "Quarterstaves"],
[ItemCategory.Crossbow, "Crossbows"],
// Jewelery
[ItemCategory.Amulet, "Amulets"],
[ItemCategory.Ring, "Rings"],
[ItemCategory.Belt, "Belts"],
// Armours
[ItemCategory.BodyArmour, "Body_Armours"],
[ItemCategory.Helmet, "Helmets"],
[ItemCategory.Gloves, "Gloves"],
[ItemCategory.Boots, "Boots"],
// offhand
[ItemCategory.Quiver, "Quivers"],
[ItemCategory.Shield, "Shields"],
[ItemCategory.Focus, "Foci"],
[ItemCategory.Buckler, "Bucklers"],
// Jewels
["Ruby", "Ruby"],
["Emerald", "Emerald"],
["Sapphire", "Sapphire"],
["Time-Lost Ruby", "Time-Lost_Ruby"],
["Time-Lost Emerald", "Time-Lost_Emerald"],
["Time-Lost Sapphire", "Time-Lost_Sapphire"],
// Flasks
["Life Flask", "Life_Flasks"],
["Mana Flask", "Mana_Flasks"],
["Charm", "Charms"],
// Relics
["Urn Relic", "Urn_Relic"],
["Amphora Relic", "Amphora_Relic"],
["Vase Relic", "Vase_Relic"],
["Seal Relic", "Seal_Relic"],
["Coffer Relic", "Coffer_Relic"],
["Tapestry Relic", "Tapestry_Relic"],
["Incense Relic", "Incense_Relic"],
// Tablet
["Breach Precursor Tablet", "Breach_Precursor_Tablet"],
["Expedition Precursor Tablet", "Expedition_Precursor_Tablet"],
["Delirium Precursor Tablet", "Delirium_Precursor_Tablet"],
["Ritual Precursor Tablet", "Ritual_Precursor_Tablet"],
["Precursor Tablet", "Precursor_Tablet"],
["Overseer Precursor Tablet", "Overseer_Precursor_Tablet"],
// Waystones
["Waystones(Low)", "Waystones_low_tier"],
["Waystones(Mid)", "Waystones_mid_tier"],
["Waystones(Top)", "Waystones_top_tier"],
]);
export function registerActions() {
Host.onEvent("MAIN->CLIENT::item-text", (e) => {
if (
@@ -47,9 +114,8 @@ export function openWiki(item: ParsedItem) {
window.open(`https://www.poe2wiki.net/wiki/${item.info.refName}`);
}
export function openPoedb(item: ParsedItem) {
window.open(
`https://poe2db.tw/${POEDB_LANGS[AppConfig().language]}/search?q=${item.info.refName}`,
);
const path = getPoe2dbPath(item);
window.open(`https://poe2db.tw/${POEDB_LANGS[AppConfig().language]}/${path}`);
}
export function openCoE(item: ParsedItem) {
const encodedClipboard = encodeURIComponent(item.rawText);
@@ -68,9 +134,51 @@ export function findSimilarItems(item: ParsedItem) {
export function findSamePricedItems(item: ParsedItem) {
if (!item.note) return;
const text = JSON.stringify(item.note);
const note = item.note ? JSON.stringify(item.note) : "";
const name = JSON.stringify(item.info.name);
const useName =
AppConfig<ItemCheckWidget>("item-check")!.samePricedType === "both";
const text =
useName && note.length + name.length < 51 ? `${note}${name}` : note;
Host.sendEvent({
name: "CLIENT->MAIN::user-action",
payload: { action: "stash-search", text },
});
}
function getPoe2dbPath(item: ParsedItem) {
const category = item.category;
const refName = item.info.refName;
if (!category) return;
if (item.rarity === ItemRarity.Unique) {
return `search?q=${refName}`;
}
if (POE2DB_CONVERSIONS.has(refName)) {
return POE2DB_CONVERSIONS.get(refName)! + "#ModifiersCalc";
}
if (!POE2DB_CONVERSIONS.has(category)) {
return `search?q=${refName}`;
}
let path = POE2DB_CONVERSIONS.get(category)!;
if (
ARMOUR.has(category) &&
!(category === ItemCategory.Buckler || category === ItemCategory.Focus)
) {
if (item.armourAR) {
path += "_str";
}
if (item.armourEV) {
path += "_dex";
}
if (item.armourES) {
path += "_int";
}
}
return path + "#ModifiersCalc";
}

View File

@@ -18,6 +18,10 @@
</div>
<div class="flex">
<label class="flex-1">{{ t("item.find_same_price") }}</label>
<select v-model="samePricedType" class="p-1 rounded bg-gray-700 w-32">
<option value="price">{{ t("item.price") }}</option>
<option value="both">{{ t("item.price_and_item") }}</option>
</select>
<hotkey-input v-model="samePricedKey" class="w-48" />
</div>
</div>
@@ -60,5 +64,10 @@ const samePricedKey = configModelValue(
() => findWidget<ItemCheckWidget>("item-check", props.config)!,
"samePricedKey",
);
const samePricedType = configModelValue(
() => findWidget<ItemCheckWidget>("item-check", props.config)!,
"samePricedType",
);
const { t } = useI18n();
</script>

View File

@@ -8,5 +8,6 @@ export interface ItemCheckWidget extends Widget {
craftOfExileKey: string | null;
stashSearchKey: string | null;
samePricedKey: string | null;
samePricedType: "price" | "both";
maps: MapCheckConfig;
}