add editor type selection

This commit is contained in:
kvan7
2026-06-20 09:08:16 -05:00
parent 03ef8dd4eb
commit b8fddf4976
3 changed files with 25 additions and 21 deletions
-6
View File
@@ -124,12 +124,6 @@ export const ACCESSORY = new Set([
// ItemCategory.Quiver
]);
export const CASTER = new Set([
ItemCategory.Wand,
ItemCategory.Sceptre,
ItemCategory.Staff,
]);
export const GRANTS_REAL_SKILL = new Set([
ItemCategory.Staff,
ItemCategory.Wand,
+2 -12
View File
@@ -1,11 +1,5 @@
import { ItemRarity, ParsedItem } from "@/parser";
import {
ARMOUR,
CASTER,
ItemCategory,
ItemEditorType,
MARTIAL_WEAPON,
} from "@/parser/meta";
import { ARMOUR, ItemCategory, ItemEditorType, WEAPON } from "@/parser/meta";
function decimalPlaces(value: number, dp: number | boolean): number {
if (typeof dp === "number") {
@@ -60,11 +54,7 @@ export function getItemEditorType(item: ParsedItem): ItemEditorType {
item.category === ItemCategory.Amulet
) {
return ItemEditorType.Catalyst;
} else if (
MARTIAL_WEAPON.has(item.category) ||
ARMOUR.has(item.category) ||
CASTER.has(item.category)
) {
} else if (WEAPON.has(item.category) || ARMOUR.has(item.category)) {
return ItemEditorType.Augment;
} else {
return ItemEditorType.None;
@@ -1,15 +1,26 @@
<template>
<div class="bg-gray-800">
<augment-editor :item="item" />
<quality-editor :item="item" />
<augment-editor
v-if="itemEditorType === ItemEditorType.Augment"
:item="item"
/>
<quality-editor
v-else-if="itemEditorType === ItemEditorType.Catalyst"
:item="item"
/>
<div v-else-if="itemEditorType === ItemEditorType.AugmentAndCatalyst">
AAAAA DO BOTH NEED TO ADD IT STILL
</div>
</div>
</template>
<script lang="ts">
import { ParsedItem } from "@/parser";
import { defineComponent, PropType } from "vue";
import { computed, defineComponent, PropType } from "vue";
import AugmentEditor from "./AugmentEditor.vue";
import QualityEditor from "./QualityEditor.vue";
import { getItemEditorType } from "../filters/util";
import { ItemEditorType } from "@/parser/meta";
export default defineComponent({
props: {
@@ -22,6 +33,15 @@ export default defineComponent({
AugmentEditor,
QualityEditor,
},
setup(props) {
const itemEditorType = computed(() => getItemEditorType(props.item));
return {
itemEditorType,
ItemEditorType,
};
},
});
</script>