Skip to content

Commit

Permalink
Merge pull request #25 from dragoni7/LoadoutEquipping
Browse files Browse the repository at this point in the history
Loadout equipping
  • Loading branch information
dragoni7 authored Aug 25, 2024
2 parents 31162f8 + c5f5ebf commit 19fcf7b
Show file tree
Hide file tree
Showing 17 changed files with 755 additions and 911 deletions.
76 changes: 44 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions src/app/routes/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import { updateProfileData } from '../../store/ProfileReducer';
import { useDispatch, useSelector } from 'react-redux';
import { generatePermutations } from '../../features/armor-optimization/generate-permutations';
import { filterPermutations } from '../../features/armor-optimization/filter-permutations';
import { DestinyArmor, Character, FilteredPermutation, DamageType } from '../../types/d2l-types';
import {
DestinyArmor,
Character,
FilteredPermutation,
DamageType,
SubclassConfig,
} from '../../types/d2l-types';
import StatsTable from '../../features/armor-optimization/StatsTable';
import { RootState } from '../../store';
import HeaderComponent from '../../components/HeaderComponent';
Expand All @@ -20,7 +26,7 @@ import ArmorCustomization from '../../features/armor/components/ArmorCustomizati
import { resetLoadout, updateLoadoutCharacter, updateSubclass } from '../../store/LoadoutReducer';
import { ManifestSubclass } from '../../types/manifest-types';
import SubclassCustomizationWrapper from '../../features/subclass/SubclassCustomizationWrapper';
import { updateManifest } from '../../lib/bungie_api/Manifest';
import { updateManifest } from '../../lib/bungie_api/manifest';

const PageContainer = styled('div')({
display: 'flex',
Expand Down Expand Up @@ -199,11 +205,11 @@ export const Dashboard: React.FC = () => {

const handleSubclassSelect = (subclass: ManifestSubclass) => {
setSelectedSubclass(subclass);
if (selectedCharacter) {

if (selectedCharacter && subclass.damageType in selectedCharacter.subclasses) {
dispatch(
updateSubclass({
damageType: subclass.damageType as DamageType,
subclass: selectedCharacter.subclasses[subclass.damageType],
subclass: selectedCharacter.subclasses[subclass.damageType]?.subclass,
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/armor-optimization/NumberBoxes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { styled } from '@mui/material/styles';
import { Box, Paper, Grid, ButtonBase } from '@mui/material';
import { STATS } from '../../lib/bungie_api/Constants';
import { STATS } from '../../lib/bungie_api/constants';

const ContainerWithBorder = styled(Paper)(({ theme }) => ({
border: `1px solid ${theme.palette.divider}`,
Expand Down
2 changes: 1 addition & 1 deletion src/features/armor-optimization/StatsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
updateRequiredStatMods,
} from '../../store/LoadoutReducer';
import ArmorIcon from '../../components/ArmorIcon';
import { STAT_MOD_HASHES, STATS } from '../../lib/bungie_api/Constants';
import { STAT_MOD_HASHES, STATS } from '../../lib/bungie_api/constants';
import { db } from '../../store/db';
import { ManifestArmorStatMod } from '../../types/manifest-types';

Expand Down
3 changes: 2 additions & 1 deletion src/features/armor/components/LoadoutArmor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ const LoadoutArmor: React.FC = () => {
<Box width={81} height={81}>
Required Mods:
</Box>
{requiredMods.map((mod) => (
{requiredMods.map((mod, index) => (
<Box
className="armor-mod-slot"
key={index}
style={{
backgroundImage: `url(${mod.icon})`,
}}
Expand Down
Loading

0 comments on commit 19fcf7b

Please sign in to comment.