diff --git a/src/App.vue b/src/App.vue index d86af66..ee4e813 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,7 +20,8 @@ + @toggle-variant="toggleVariant" @reset-variants="resetVariants" + @toggle-station="toggleStation" @reset-stations="resetStations" /> @@ -73,6 +74,8 @@ const { resetEnchantments, toggleVariant, resetVariants, + toggleStation, + resetStations, } = useFilters() // Profit calculation diff --git a/src/components/filters/FilterBar.vue b/src/components/filters/FilterBar.vue index 4a057f1..5d8aefc 100644 --- a/src/components/filters/FilterBar.vue +++ b/src/components/filters/FilterBar.vue @@ -131,6 +131,20 @@ + +
+ Station +
+ + +
+
+ {{ resultCount }} results @@ -142,8 +156,8 @@ import { ref, computed, onMounted, onUnmounted } from 'vue' import { tierStyle, enchantStyle } from '../../utils/formatting' import type { FilterState, VariantType } from '../../types/filters' -import { ALL_VARIANTS } from '../../types/filters' -import type { Tier, Enchantment } from '../../types/crafting' +import { ALL_VARIANTS, ALL_STATIONS } from '../../types/filters' +import type { Tier, Enchantment, JournalType } from '../../types/crafting' import { TIERS, ENCHANTMENTS } from '../../data/constants' import { ITEM_TREE, ALL_ITEM_NAMES, getLeaves } from '../../data/itemTree' import type { TreeNode } from '../../data/itemTree' @@ -161,6 +175,8 @@ const emit = defineEmits<{ 'reset-enchantments': [] 'toggle-variant': [v: VariantType] 'reset-variants': [] + 'toggle-station': [s: JournalType] + 'reset-stations': [] }>() // ─── Category tree ──────────────────────────────────────────────────────────── @@ -287,6 +303,23 @@ function isVariantActive(v: VariantType): boolean { return s === null || s.has(v) } +// ─── Station helpers ────────────────────────────────────────────────────────── + +const STATION_LABEL: Record = { + warrior: 'Warrior', hunter: 'Hunter', mage: 'Mage', toolmaker: 'Toolmaker', +} + +const STATION_ACTIVE_CLASS: Record = { + warrior: 'bg-red-900/60 text-red-300', + hunter: 'bg-green-900/60 text-green-300', + mage: 'bg-blue-900/60 text-blue-300', + toolmaker: 'bg-orange-900/60 text-orange-300', +} + +function isStationActive(s: JournalType): boolean { + return props.filters.stations === null || props.filters.stations.has(s) +} + // ─── Dropdown open states ───────────────────────────────────────────────────── diff --git a/src/components/table/ProfitRow.vue b/src/components/table/ProfitRow.vue index ddae3ea..9677bc9 100644 --- a/src/components/table/ProfitRow.vue +++ b/src/components/table/ProfitRow.vue @@ -26,10 +26,17 @@ class="w-12 h-12 -my-2 rounded flex-shrink-0" /> {{ result.recipe.displayName.replace(/^T\d+\.\d+\s/, '') }} - {{ result.recipe.category }} + + + + {{ STATION[result.recipe.journalType].label }} + + + - +
@@ -251,7 +258,7 @@