From a5da670c5d3b3af541bec06b7cd75df65e3e7ed8 Mon Sep 17 00:00:00 2001 From: marcustyphoon Date: Sat, 3 Jan 2026 13:16:52 -0800 Subject: [PATCH 1/3] feat: Add captain's affix --- locales/en/translation.json | 1 + .../url-state/schema/SchemaDicts.js | 1 + src/utils/gw2-data.ts | 107 +++++++++++++++++- wasm_module/src/data/affix.rs | 2 + 4 files changed, 110 insertions(+), 1 deletion(-) diff --git a/locales/en/translation.json b/locales/en/translation.json index cb1ce5975..69625e93a 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -240,6 +240,7 @@ "affix_Berserker": "Berserker", "affix_BerserkerValkyrie": "BerserkerValkyrie", "affix_Bringer": "Bringer", + "affix_Captain": "Captain", "affix_Carrion": "Carrion", "affix_Cavalier": "Cavalier", "affix_Celestial": "Celestial", diff --git a/src/components/url-state/schema/SchemaDicts.js b/src/components/url-state/schema/SchemaDicts.js index c3c757cfb..ee919979e 100644 --- a/src/components/url-state/schema/SchemaDicts.js +++ b/src/components/url-state/schema/SchemaDicts.js @@ -42,6 +42,7 @@ export const gearDict = [ 'RabidApothecary', 'DireRabid', 'Demolisher', + 'Captain', ]; export const professionDict = [ diff --git a/src/utils/gw2-data.ts b/src/utils/gw2-data.ts index 838f0a2bc..9229aeca4 100644 --- a/src/utils/gw2-data.ts +++ b/src/utils/gw2-data.ts @@ -49,11 +49,12 @@ export type AffixName = | 'BerserkerValkyrie' | 'RabidApothecary' | 'DireRabid' + | 'Captain' | 'Custom'; export type AffixDataEntry = | { - type: 'triple' | 'quadruple'; + type: 'triple' | 'quadruple' | 'tripleTrinketsOnly'; category: string; bonuses: { major: GearAttributeName[]; @@ -510,6 +511,14 @@ export const Affix: Record = { jewelMinor: ['Toughness', 'Precision'], }, }, + Captain: { + type: 'tripleTrinketsOnly', + category: 'Power Survivability', + bonuses: { + major: ['Precision'], + minor: ['Power', 'Toughness'], + }, + }, }; export const exoticStats = { @@ -532,6 +541,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, SHOULDERS: { triple: { @@ -552,6 +565,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, CHEST: { triple: { @@ -572,6 +589,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, GLOVES: { triple: { @@ -592,6 +613,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, LEGGINGS: { triple: { @@ -612,6 +637,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, BOOTS: { triple: { @@ -632,6 +661,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, AMULET: { triple: { @@ -652,6 +685,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, RING: { triple: { @@ -672,6 +709,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, ACCESSORY: { triple: { @@ -692,6 +733,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, BACK_ITEM: { triple: { @@ -712,6 +757,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, ONEHANDED_WEAPON: { triple: { @@ -732,6 +781,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, TWOHANDED_WEAPON: { triple: { @@ -752,6 +805,10 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, }; @@ -775,6 +832,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, SHOULDERS: { triple: { @@ -795,6 +856,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, CHEST: { triple: { @@ -815,6 +880,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, GLOVES: { triple: { @@ -835,6 +904,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, LEGGINGS: { triple: { @@ -855,6 +928,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, BOOTS: { triple: { @@ -875,6 +952,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, AMULET: { triple: { @@ -895,6 +976,10 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, + tripleTrinketsOnly: { + major: 157, + minor: 108, + }, }, RING: { triple: { @@ -915,6 +1000,10 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, + tripleTrinketsOnly: { + major: 126, + minor: 85, + }, }, ACCESSORY: { triple: { @@ -935,6 +1024,10 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, + tripleTrinketsOnly: { + major: 110, + minor: 74, + }, }, BACK_ITEM: { triple: { @@ -955,6 +1048,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 63, + minor: 40, + }, }, ONEHANDED_WEAPON: { triple: { @@ -975,6 +1072,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, TWOHANDED_WEAPON: { triple: { @@ -995,6 +1096,10 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, + tripleTrinketsOnly: { + major: 0, + minor: 0, + }, }, }; diff --git a/wasm_module/src/data/affix.rs b/wasm_module/src/data/affix.rs index 3df8903df..74fc7ab62 100644 --- a/wasm_module/src/data/affix.rs +++ b/wasm_module/src/data/affix.rs @@ -47,6 +47,7 @@ pub enum Affix { RabidApothecary = 40, DireRabid = 41, Demolisher = 42, + Captain = 43, #[default] None = 255, } @@ -97,6 +98,7 @@ impl Affix { Affix::RabidApothecary => "RabidApothecary".to_string(), Affix::DireRabid => "DireRabid".to_string(), Affix::Demolisher => "Demolisher".to_string(), + Affix::Captain => "Captain".to_string(), Affix::None => "".to_string(), } } From ac02ceeb873db59aed497d59e306e7ffb2482a86 Mon Sep 17 00:00:00 2001 From: marcustyphoon Date: Sun, 4 Jan 2026 14:23:55 -0800 Subject: [PATCH 2/3] refactor --- src/utils/gw2-data.ts | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/utils/gw2-data.ts b/src/utils/gw2-data.ts index 9229aeca4..c74cdf0bf 100644 --- a/src/utils/gw2-data.ts +++ b/src/utils/gw2-data.ts @@ -54,7 +54,7 @@ export type AffixName = export type AffixDataEntry = | { - type: 'triple' | 'quadruple' | 'tripleTrinketsOnly'; + type: 'triple' | 'quadruple' | 'trinketsBackOnly'; category: string; bonuses: { major: GearAttributeName[]; @@ -512,7 +512,7 @@ export const Affix: Record = { }, }, Captain: { - type: 'tripleTrinketsOnly', + type: 'trinketsBackOnly', category: 'Power Survivability', bonuses: { major: ['Precision'], @@ -541,7 +541,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -565,7 +565,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -589,7 +589,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -613,7 +613,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -637,7 +637,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -661,7 +661,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -685,7 +685,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -709,7 +709,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -733,7 +733,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -757,7 +757,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -781,7 +781,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -805,7 +805,7 @@ export const exoticStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -832,7 +832,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -856,7 +856,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -880,7 +880,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -904,7 +904,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -928,7 +928,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -952,7 +952,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -976,7 +976,7 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 157, minor: 108, }, @@ -1000,7 +1000,7 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 126, minor: 85, }, @@ -1024,7 +1024,7 @@ export const ascendedStats = { jewelMajor: 32, jewelMinor: 18, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 110, minor: 74, }, @@ -1048,7 +1048,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 63, minor: 40, }, @@ -1072,7 +1072,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, @@ -1096,7 +1096,7 @@ export const ascendedStats = { jewelMajor: 0, jewelMinor: 0, }, - tripleTrinketsOnly: { + trinketsBackOnly: { major: 0, minor: 0, }, From 8c03ab9f813357ac4b4f111d9e0510d2c83a27c4 Mon Sep 17 00:00:00 2001 From: marcustyphoon Date: Sun, 4 Jan 2026 14:24:18 -0800 Subject: [PATCH 3/3] add labels --- .../baseComponents/AffixesSelect.tsx | 59 +++++++++++-------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/src/components/baseComponents/AffixesSelect.tsx b/src/components/baseComponents/AffixesSelect.tsx index 436749919..1ae9fce0e 100644 --- a/src/components/baseComponents/AffixesSelect.tsx +++ b/src/components/baseComponents/AffixesSelect.tsx @@ -5,18 +5,24 @@ import Autocomplete from '@mui/material/Autocomplete'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { makeStyles } from 'tss-react/mui'; -import type { AffixName } from '../../utils/gw2-data'; +import type { AffixDataEntry, AffixName } from '../../utils/gw2-data'; import { Affix } from '../../utils/gw2-data'; import { objectKeys } from '../../utils/usefulFunctions'; const mistBandId = 80793; +const subLabels: Partial> = { + ascendedMismatchedTrinket: '(trinkets only)', + trinketsBackOnly: '(trinkets/back only)', +}; + const createOptions = (array: (AffixName | null)[]) => array .filter((affix) => !!affix) .map((affix) => ({ label: affix, category: Affix[affix].category, + subLabel: subLabels[Affix[affix].type], })); const order = [ 'Hybrid', @@ -126,30 +132,33 @@ const AffixesSelect = ({ name, multiple, onChange, value: selected }: AffixesSel )} - {option.label === 'Custom' || /[a-z][A-Z]/.test(option.label) ? ( - - ) : ( - - )} + + {option.label === 'Custom' || /[a-z][A-Z]/.test(option.label) ? ( + + ) : ( + + )} + {option.subLabel && {option.subLabel}} + )} renderTags={(value, getTagProps) =>