mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2025-12-09 01:27:02 +00:00
Revert to poe1 tier numbering
Switches back to poe1 tier numbering as per 0.2.1
This commit is contained in:
@@ -9,7 +9,6 @@ import type {
|
||||
RuneSingleValue,
|
||||
Stat,
|
||||
StatMatcher,
|
||||
TierLookup,
|
||||
TranslationDict,
|
||||
} from "./interfaces";
|
||||
import { loadClientStrings } from "../client-string-loader";
|
||||
@@ -25,7 +24,6 @@ export let RUNE_SINGLE_VALUE: RuneSingleValue;
|
||||
export let RUNE_DATA_BY_RUNE: RuneDataByRune;
|
||||
export let RUNE_DATA_BY_TRADE_ID: RuneDataByTradeId;
|
||||
export let ITEM_CATEGORY_TO_EMPTY_PREFIX: ItemCategoryToEmptyPrefix;
|
||||
export let MAX_TIER_LOOKUP: TierLookup;
|
||||
|
||||
export let RUNE_LIST: BaseType[];
|
||||
export const HIGH_VALUE_RUNES_HARDCODED = new Set<string>([]);
|
||||
@@ -269,10 +267,6 @@ export async function init(lang: string, isTest = false) {
|
||||
await fetch(`${import.meta.env.BASE_URL}data/pseudo-empty-prefix.json`)
|
||||
).json();
|
||||
|
||||
MAX_TIER_LOOKUP = await (
|
||||
await fetch(`${import.meta.env.BASE_URL}data/tiers.json`)
|
||||
).json();
|
||||
|
||||
await loadForLang(lang, isTest);
|
||||
|
||||
let failed = false;
|
||||
|
||||
@@ -49,12 +49,6 @@ export interface Stat {
|
||||
};
|
||||
}
|
||||
|
||||
export interface TierLookup {
|
||||
[ref: string]: {
|
||||
[itemClass: string]: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DropEntry {
|
||||
query: string[];
|
||||
items: string[];
|
||||
|
||||
@@ -38,7 +38,6 @@ import {
|
||||
ADDED_RUNE_LINE,
|
||||
} from "./advanced-mod-desc";
|
||||
import { calcPropPercentile, QUALITY_STATS } from "./calc-q20";
|
||||
import { getMaxTier } from "./mod-tiers";
|
||||
|
||||
type SectionParseResult =
|
||||
| "SECTION_PARSED"
|
||||
@@ -973,17 +972,7 @@ function parseModifiers(section: string[], item: ParsedItem) {
|
||||
) {
|
||||
modInfo.type = ModifierType.Sanctum;
|
||||
}
|
||||
|
||||
const modifier: ParsedModifier = { info: modInfo, stats: [] };
|
||||
parseStatsFromMod(lines, item, modifier);
|
||||
|
||||
if (modInfo.tierNew && item.category) {
|
||||
const refLines = [];
|
||||
for (const stat of modifier.stats) {
|
||||
refLines.push(stat.stat.ref);
|
||||
}
|
||||
parseRealTierFromMod(refLines, modInfo, item.category);
|
||||
}
|
||||
parseStatsFromMod(lines, item, { info: modInfo, stats: [] });
|
||||
|
||||
if (modType === ModifierType.Veiled) {
|
||||
item.isVeiled = true;
|
||||
@@ -1398,19 +1387,6 @@ function markupConditionParser(text: string) {
|
||||
return text;
|
||||
}
|
||||
|
||||
function parseRealTierFromMod(
|
||||
lines: string[],
|
||||
modInfo: ModifierInfo,
|
||||
category: ItemCategory,
|
||||
): void {
|
||||
if (!modInfo.tierNew) return;
|
||||
const joinedLines = lines.join("\n");
|
||||
const maxPossibleTier = getMaxTier(joinedLines, category);
|
||||
if (maxPossibleTier) {
|
||||
modInfo.tier = maxPossibleTier - modInfo.tierNew + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function parseStatsFromMod(
|
||||
lines: string[],
|
||||
item: ParsedItem,
|
||||
|
||||
@@ -22,7 +22,6 @@ export interface ModifierInfo {
|
||||
name?: string;
|
||||
tier?: number;
|
||||
rank?: number;
|
||||
tierNew?: number;
|
||||
tags: string[];
|
||||
rollIncr?: number;
|
||||
hybridWithRef?: Set<string>;
|
||||
@@ -39,7 +38,7 @@ export function parseModInfoLine(
|
||||
|
||||
let generation: ModifierInfo["generation"];
|
||||
let name: ModifierInfo["name"];
|
||||
let tierNew: ModifierInfo["tierNew"];
|
||||
let tier: ModifierInfo["tier"];
|
||||
let rank: ModifierInfo["rank"];
|
||||
|
||||
if (_$.EATER_IMPLICIT.test(modText) || _$.EXARCH_IMPLICIT.test(modText)) {
|
||||
@@ -87,7 +86,7 @@ export function parseModInfoLine(
|
||||
}
|
||||
|
||||
name = match.groups!.name || undefined;
|
||||
tierNew = Number(match.groups!.tier) || undefined;
|
||||
tier = Number(match.groups!.tier) || undefined;
|
||||
rank = Number(match.groups!.rank) || undefined;
|
||||
}
|
||||
|
||||
@@ -110,7 +109,7 @@ export function parseModInfoLine(
|
||||
: undefined;
|
||||
}
|
||||
|
||||
return { type, generation, name, tierNew, rank, tags, rollIncr };
|
||||
return { type, generation, name, tier, rank, tags, rollIncr };
|
||||
}
|
||||
|
||||
export function isModInfoLine(line: string): boolean {
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import { MAX_TIER_LOOKUP, StatTierMod } from "@/assets/data";
|
||||
import { ItemCategory } from "./meta";
|
||||
|
||||
export function mapItemCategoryToKeys(itemCategory: ItemCategory): string[] {
|
||||
const categoryMap: Record<ItemCategory, string[]> = {
|
||||
[ItemCategory.OneHandedSword]: ["sword", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.TwoHandedSword]: ["sword", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.Staff]: ["staff", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.Ring]: ["ring"],
|
||||
[ItemCategory.Quiver]: ["quiver", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.Map]: [""],
|
||||
[ItemCategory.CapturedBeast]: [""],
|
||||
[ItemCategory.MetamorphSample]: [""],
|
||||
[ItemCategory.Helmet]: ["helmet", "armour"],
|
||||
[ItemCategory.BodyArmour]: ["body_armour", "armour"],
|
||||
[ItemCategory.Gloves]: ["gloves", "armour"],
|
||||
[ItemCategory.Boots]: ["boots", "armour"],
|
||||
[ItemCategory.Shield]: ["shield", "armour"],
|
||||
[ItemCategory.Amulet]: ["amulet"],
|
||||
[ItemCategory.Belt]: ["belt"],
|
||||
[ItemCategory.Flask]: ["flask"],
|
||||
[ItemCategory.AbyssJewel]: ["jewel"],
|
||||
[ItemCategory.Jewel]: ["jewel"],
|
||||
[ItemCategory.Claw]: ["claw", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.Bow]: ["bow", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.Sceptre]: ["sceptre", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.Wand]: ["wand", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.FishingRod]: ["weapon"],
|
||||
[ItemCategory.Warstaff]: ["warstaff", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.Dagger]: ["dagger", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.RuneDagger]: ["rune_dagger", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.OneHandedAxe]: ["axe", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.TwoHandedAxe]: ["axe", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.OneHandedMace]: ["mace", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.TwoHandedMace]: ["mace", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.ClusterJewel]: ["jewel"],
|
||||
[ItemCategory.HeistBlueprint]: [""],
|
||||
[ItemCategory.HeistContract]: [""],
|
||||
[ItemCategory.HeistTool]: [""],
|
||||
[ItemCategory.HeistBrooch]: [""],
|
||||
[ItemCategory.HeistGear]: [""],
|
||||
[ItemCategory.HeistCloak]: [""],
|
||||
[ItemCategory.Trinket]: [""],
|
||||
[ItemCategory.Invitation]: [""],
|
||||
[ItemCategory.Gem]: ["gem"],
|
||||
[ItemCategory.Currency]: [""],
|
||||
[ItemCategory.DivinationCard]: [""],
|
||||
[ItemCategory.Voidstone]: [""],
|
||||
[ItemCategory.Sentinel]: [""],
|
||||
[ItemCategory.MemoryLine]: [""],
|
||||
[ItemCategory.SanctumRelic]: [""],
|
||||
[ItemCategory.Tincture]: [""],
|
||||
[ItemCategory.Charm]: [""],
|
||||
[ItemCategory.Crossbow]: ["crossbow", "two_hand_weapon", "weapon"],
|
||||
[ItemCategory.SkillGem]: [""],
|
||||
[ItemCategory.SupportGem]: [""],
|
||||
[ItemCategory.MetaGem]: [""],
|
||||
[ItemCategory.Focus]: ["focus", "armour"],
|
||||
[ItemCategory.Waystone]: [""],
|
||||
[ItemCategory.Relic]: [""],
|
||||
[ItemCategory.Tablet]: [""],
|
||||
[ItemCategory.TowerAugment]: [""],
|
||||
[ItemCategory.Spear]: ["spear", "one_hand_weapon", "weapon"],
|
||||
[ItemCategory.Flail]: ["flail", "one_hand_weapon", "weapon"],
|
||||
};
|
||||
|
||||
return categoryMap[itemCategory] || [itemCategory.toLowerCase()];
|
||||
}
|
||||
|
||||
export function getMaxTier(
|
||||
lookUpRef: string,
|
||||
category: ItemCategory,
|
||||
): number | undefined {
|
||||
const tierLookup = MAX_TIER_LOOKUP[lookUpRef];
|
||||
if (!tierLookup) return;
|
||||
const categoryList = mapItemCategoryToKeys(category);
|
||||
for (const categoryKey of categoryList) {
|
||||
if (categoryKey in tierLookup) {
|
||||
return tierLookup[categoryKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function findCategoryMatch(
|
||||
itemCategory: ItemCategory,
|
||||
tierArray: StatTierMod[],
|
||||
searchLevels: string[] = [],
|
||||
): { match: StatTierMod | null; level: string | null } {
|
||||
let matchedTiers: StatTierMod[] = [];
|
||||
let matchingLevel = null;
|
||||
|
||||
for (const level of searchLevels) {
|
||||
// Filter tiers that match the current search level
|
||||
matchedTiers = tierArray.filter((mod) => mod.items[level] !== undefined);
|
||||
|
||||
if (matchedTiers.length > 0) {
|
||||
matchingLevel = level;
|
||||
|
||||
// If only one match is found, stop searching
|
||||
if (matchedTiers.length === 1) {
|
||||
return { match: matchedTiers[0], level: matchingLevel };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If multiple matches exist after all levels, return the first
|
||||
return { match: matchedTiers[0] || null, level: matchingLevel };
|
||||
}
|
||||
@@ -523,9 +523,6 @@ function upgradeConfig(_config: Config): Config {
|
||||
(w) => w.wmType === "price-check",
|
||||
)!.autoFillEmptyRuneSockets = false;
|
||||
|
||||
config.widgets.find((w) => w.wmType === "price-check")!.tierNumbering =
|
||||
"poe2";
|
||||
|
||||
config.tipsFrequency = TipsFrequency.Normal;
|
||||
|
||||
config.configVersion = 22;
|
||||
|
||||
@@ -55,7 +55,6 @@ export interface PriceCheckWidget extends Widget {
|
||||
defaultAllSelected: boolean;
|
||||
itemHoverTooltip: "off" | "keybind" | "always";
|
||||
autoFillEmptyRuneSockets: "Iron Rune" | false;
|
||||
tierNumbering: "poe1" | "poe2";
|
||||
alwaysShowTier: boolean;
|
||||
rememberRatio: boolean;
|
||||
openItemEditorAbove: boolean;
|
||||
|
||||
@@ -229,7 +229,6 @@ export default defineComponent({
|
||||
defaultAllSelected: false,
|
||||
itemHoverTooltip: "keybind",
|
||||
autoFillEmptyRuneSockets: false,
|
||||
tierNumbering: "poe2",
|
||||
alwaysShowTier: false,
|
||||
rememberRatio: false,
|
||||
openItemEditorAbove: false,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
class="flex items-center text-xs leading-none gap-x-1"
|
||||
>
|
||||
<span v-for="tag of tags" :class="$style[tag.type]">{{
|
||||
t(tierOption == "poe2" ? "filters.tier" : "filters.grade", [tag.tier])
|
||||
t("filters.tier", [tag.tier])
|
||||
}}</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -13,15 +13,11 @@
|
||||
import { defineComponent, PropType, computed } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { ItemCategory, ParsedItem } from "@/parser";
|
||||
import UiPopover from "@/web/ui/Popover.vue";
|
||||
import { FilterTag, StatFilter } from "./interfaces";
|
||||
import ItemModifierText from "../../ui/ItemModifierText.vue";
|
||||
import { AppConfig } from "@/web/Config";
|
||||
import { PriceCheckWidget } from "@/web/overlay/widgets";
|
||||
import { StatSource } from "@/parser/modifiers";
|
||||
|
||||
export default defineComponent({
|
||||
components: { ItemModifierText, UiPopover },
|
||||
props: {
|
||||
filter: {
|
||||
type: Object as PropType<StatFilter>,
|
||||
@@ -33,27 +29,15 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const tierOption = computed(
|
||||
() => AppConfig<PriceCheckWidget>("price-check")!.tierNumbering,
|
||||
);
|
||||
const alwaysShowTier = computed(
|
||||
() => AppConfig<PriceCheckWidget>("price-check")!.alwaysShowTier,
|
||||
);
|
||||
|
||||
const tags = computed(() => {
|
||||
const { filter, item } = props;
|
||||
const out: Array<{
|
||||
type: string;
|
||||
tier: number | string;
|
||||
realTier: number;
|
||||
source: StatSource;
|
||||
}> = [];
|
||||
const out: Array<{ type: string; tier: number }> = [];
|
||||
for (const source of filter.sources) {
|
||||
const tier = source.modifier.info.tier;
|
||||
const tierNew = source.modifier.info.tierNew;
|
||||
if (!tier || !tierNew) continue;
|
||||
const usedTier: number | string =
|
||||
tierOption.value === "poe1" ? tier : tierNew;
|
||||
if (!tier) continue;
|
||||
|
||||
if (
|
||||
(filter.tag === FilterTag.Explicit ||
|
||||
@@ -63,46 +47,21 @@ export default defineComponent({
|
||||
item.category !== ItemCategory.ClusterJewel &&
|
||||
item.category !== ItemCategory.MemoryLine
|
||||
) {
|
||||
if (tier === 1)
|
||||
out.push({
|
||||
type: "tier-1",
|
||||
tier: usedTier,
|
||||
realTier: tier,
|
||||
source,
|
||||
});
|
||||
else if (tier === 2)
|
||||
out.push({
|
||||
type: "tier-2",
|
||||
tier: usedTier,
|
||||
realTier: tier,
|
||||
source,
|
||||
});
|
||||
if (tier === 1) out.push({ type: "tier-1", tier });
|
||||
else if (tier === 2) out.push({ type: "tier-2", tier });
|
||||
else if (alwaysShowTier.value)
|
||||
out.push({
|
||||
type: "not-tier-1",
|
||||
tier:
|
||||
tierOption.value === "poe1"
|
||||
? tier
|
||||
: tierNew.toString() + ` [${tierNew + tier - 1}]`,
|
||||
realTier: tier,
|
||||
source,
|
||||
});
|
||||
out.push({ type: "tier-3-plus", tier });
|
||||
} else if (tier >= 2) {
|
||||
// fractured, explicit-* filters
|
||||
out.push({
|
||||
type: "tier-other",
|
||||
tier: usedTier,
|
||||
realTier: tier,
|
||||
source,
|
||||
});
|
||||
out.push({ type: "not-tier-1", tier });
|
||||
}
|
||||
}
|
||||
out.sort((a, b) => a.realTier - b.realTier);
|
||||
out.sort((a, b) => a.tier - b.tier);
|
||||
return out;
|
||||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
return { t, tags, tierOption, filter: props.filter };
|
||||
return { t, tags };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -111,7 +70,7 @@ export default defineComponent({
|
||||
.tier-1,
|
||||
.tier-2,
|
||||
.not-tier-1,
|
||||
.tier-other {
|
||||
.tier-3-plus {
|
||||
@apply rounded px-1;
|
||||
}
|
||||
|
||||
@@ -121,13 +80,10 @@ export default defineComponent({
|
||||
.tier-2 {
|
||||
@apply border -my-px border-yellow-500 text-yellow-500;
|
||||
}
|
||||
.tier-other {
|
||||
@apply bg-gray-700 text-black border -my-px border-black;
|
||||
}
|
||||
.not-tier-1 {
|
||||
.tier-3-plus {
|
||||
@apply bg-gray-700 text-black;
|
||||
}
|
||||
.is-maybe-hybrid {
|
||||
@apply line-through;
|
||||
.not-tier-1 {
|
||||
@apply bg-gray-700 text-black border -my-px border-black;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,12 +26,6 @@ import type { StatCalculated } from "@/parser/modifiers";
|
||||
import type { StatFilter } from "./interfaces";
|
||||
|
||||
import ItemModifierText from "@/web/ui/ItemModifierText.vue";
|
||||
import { AppConfig } from "@/web/Config";
|
||||
import { PriceCheckWidget } from "@/web/overlay/widgets";
|
||||
|
||||
const tierOption = computed(
|
||||
() => AppConfig<PriceCheckWidget>("price-check")!.tierNumbering,
|
||||
);
|
||||
|
||||
const props = defineProps<{
|
||||
source: StatCalculated["sources"][number];
|
||||
@@ -48,11 +42,7 @@ const modText = computed(() => {
|
||||
text += ` "${info.name}"`;
|
||||
}
|
||||
if (info.tier != null || info.rank != null) {
|
||||
if (tierOption.value === "poe1") {
|
||||
text += ` (${t("item.mod_grade", [info.tier])})`;
|
||||
} else {
|
||||
text += ` (${t("item.mod_tier", [info.tierNew])} [${info.tier! + info.tierNew! - 1}])`;
|
||||
}
|
||||
text += ` (${t("item.mod_tier", [info.tier])})`;
|
||||
}
|
||||
if (info.rank != null) {
|
||||
text += ` (${t("item.mod_rank", [info.rank])})`;
|
||||
@@ -60,17 +50,6 @@ const modText = computed(() => {
|
||||
return text;
|
||||
});
|
||||
|
||||
/*
|
||||
1 +(5–8) to Intelligence (Tier: 1[8]) (Grade: 8)
|
||||
11 +(9–12) to Intelligence (Tier: 2[8]) (Grade: 7)
|
||||
22 +(13–16) to Intelligence (Tier: 3[8]) (Grade: 6)
|
||||
33 +(17–20) to Intelligence (Tier: 4[8]) (Grade: 5)
|
||||
44 +(21–24) to Intelligence (Tier: 5[8]) (Grade: 4)
|
||||
55 +(25–27) to Intelligence (Tier: 6[8]) (Grade: 3)
|
||||
66 +(28–30) to Intelligence (Tier: 7[8]) (Grade: 2)
|
||||
74 +(31–33) to Intelligence (Tier: 8[8]) (Grade: 1)
|
||||
*/
|
||||
|
||||
const stats = computed(() => {
|
||||
const { stats } = props.source.modifier;
|
||||
const { stat: contribStat } = props.source.stat;
|
||||
|
||||
@@ -82,20 +82,6 @@
|
||||
}}</ui-radio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<div class="flex-1 mb-1">{{ t(":tier_numbering") }}</div>
|
||||
<div class="mb-1 flex">
|
||||
<ui-radio v-model="tierNumbering" value="poe1" class="mr-4">{{
|
||||
t(":tier_numbering_poe1")
|
||||
}}</ui-radio>
|
||||
<ui-radio v-model="tierNumbering" value="poe2" class="mr-4">{{
|
||||
t(":tier_numbering_poe2")
|
||||
}}</ui-radio>
|
||||
</div>
|
||||
<div class="mb-4 italic text-gray-500">
|
||||
{{ t(":tier_numbering_help") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ui-checkbox class="mb-4" v-model="rememberCurrency">{{
|
||||
t(":remember_currency")
|
||||
@@ -325,10 +311,6 @@ export default defineComponent({
|
||||
() => configWidget.value,
|
||||
"autoFillEmptyRuneSockets",
|
||||
),
|
||||
tierNumbering: configModelValue(
|
||||
() => configWidget.value,
|
||||
"tierNumbering",
|
||||
),
|
||||
alwaysShowTier: configModelValue(
|
||||
() => configWidget.value,
|
||||
"alwaysShowTier",
|
||||
|
||||
Reference in New Issue
Block a user