From ca0c640d0d9fd8edb7640ab315d0ce8ce4facc7f Mon Sep 17 00:00:00 2001 From: dragoni7 Date: Mon, 26 Aug 2024 17:53:38 -0700 Subject: [PATCH] Added equipping class armor --- src/features/armor/components/ArmorConfig.tsx | 17 ++++++----------- .../armor/components/ArmorModSelector.tsx | 2 +- src/features/armor/util.ts | 3 +-- .../loadouts/components/EquipLoadout.tsx | 7 ++++--- src/features/loadouts/constants/index.ts | 2 +- src/features/loadouts/types/index.ts | 9 +++++++-- src/store/LoadoutReducer.tsx | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/features/armor/components/ArmorConfig.tsx b/src/features/armor/components/ArmorConfig.tsx index ac7ca9c..4360d12 100644 --- a/src/features/armor/components/ArmorConfig.tsx +++ b/src/features/armor/components/ArmorConfig.tsx @@ -33,13 +33,8 @@ const ArmorConfig: React.FC = ({ armor, statMods, artificeMods ); }; - const onSelectMod = async ( - mod: ManifestArmorMod | ManifestArmorStatMod, - slot: number, - socketIndex: number - ) => { + const onSelectMod = async (mod: ManifestArmorMod | ManifestArmorStatMod, slot: number) => { let totalCost = mod.energyCost; - for (const key in selectedMods) { if (Number(key) !== slot) { let statEnergyCost = armorMods.find( @@ -79,28 +74,28 @@ const ArmorConfig: React.FC = ({ armor, statMods, artificeMods selected={selectedMods[0]} mods={statMods} onSelectMod={(mod: ManifestArmorMod) => { - onSelectMod(mod, 0, 0); + onSelectMod(mod, 0); }} /> { - onSelectMod(mod, 1, 1); + onSelectMod(mod, 1); }} /> { - onSelectMod(mod, 2, 2); + onSelectMod(mod, 2); }} /> { - onSelectMod(mod, 3, 3); + onSelectMod(mod, 3); }} /> {armor.artifice === true ? ( @@ -108,7 +103,7 @@ const ArmorConfig: React.FC = ({ armor, statMods, artificeMods selected={selectedMods[4]} mods={artificeMods} onSelectMod={(mod: ManifestArmorMod) => { - onSelectMod(mod, 4, 11); + onSelectMod(mod, 4); }} /> ) : ( diff --git a/src/features/armor/components/ArmorModSelector.tsx b/src/features/armor/components/ArmorModSelector.tsx index 10c29c1..b1ca77d 100644 --- a/src/features/armor/components/ArmorModSelector.tsx +++ b/src/features/armor/components/ArmorModSelector.tsx @@ -4,7 +4,7 @@ import { ManifestArmorMod, ManifestArmorStatMod } from '../../../types/manifest- interface ModSelectorProps { selected: ManifestArmorMod | ManifestArmorStatMod; mods: ManifestArmorMod[]; - onSelectMod: (mod: ManifestArmorMod) => void; + onSelectMod: (mod: ManifestArmorMod | ManifestArmorStatMod) => void; } const ArmorModSelector: React.FC = ({ selected, mods, onSelectMod }) => { diff --git a/src/features/armor/util.ts b/src/features/armor/util.ts index 0a5b7f5..54812f7 100644 --- a/src/features/armor/util.ts +++ b/src/features/armor/util.ts @@ -15,7 +15,7 @@ export async function getModsBySlot(slot: string): Promise { ? PLUG_CATEGORY_HASH.ARMOR_MODS.CHEST_ARMOR_MODS : slot === 'legs' ? PLUG_CATEGORY_HASH.ARMOR_MODS.LEG_ARMOR_MODS - : slot === 'classItem' + : slot === 'class' ? PLUG_CATEGORY_HASH.ARMOR_MODS.CLASS_ARMOR_MODS : 0 ) @@ -25,7 +25,6 @@ export async function getModsBySlot(slot: string): Promise { } export function getSelectedModsBySlot(slot: string): (ManifestArmorMod | ManifestArmorStatMod)[] { - console.log(slot); switch (slot) { case 'helmet': { return store.getState().loadoutConfig.loadout.helmetMods; diff --git a/src/features/loadouts/components/EquipLoadout.tsx b/src/features/loadouts/components/EquipLoadout.tsx index 96371fa..731e8cc 100644 --- a/src/features/loadouts/components/EquipLoadout.tsx +++ b/src/features/loadouts/components/EquipLoadout.tsx @@ -67,13 +67,14 @@ const EquipLoadout: React.FC = () => { lg={12} textAlign="center" sx={{ backgroundColor: 'rgba(48,48,48,0.8)' }} + height={'10%'} >

{equipStep}

)} - + {processing.map((item, index) => ( <> {results[index] !== undefined ? ( @@ -108,8 +109,8 @@ const EquipLoadout: React.FC = () => { ) => void; diff --git a/src/store/LoadoutReducer.tsx b/src/store/LoadoutReducer.tsx index a774371..4c99401 100644 --- a/src/store/LoadoutReducer.tsx +++ b/src/store/LoadoutReducer.tsx @@ -177,7 +177,7 @@ export const loadoutConfigSlice = createSlice({ state.loadout.legArmorMods[action.payload.slot] = action.payload.plug; break; } - case 'classItem': { + case 'class': { state.loadout.classArmorMods[action.payload.slot] = action.payload.plug; break; }