Skip to content

Commit

Permalink
Merge pull request #9973 from robojumper/lo-auto-mods-click-general-mod
Browse files Browse the repository at this point in the history
Don't open empty mods picker when clicking general auto-mod
  • Loading branch information
bhollis authored Oct 18, 2023
2 parents af270e4 + 0eed3a0 commit 59a9585
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/loadout-builder/LoadoutBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export default memo(function LoadoutBuilder({
modStatChanges={result.modStatChanges}
loadouts={loadouts}
armorEnergyRules={result.armorEnergyRules}
autoStatMods={autoStatMods}
isEditingExistingLoadout={isEditingExistingLoadout}
/>
) : (
Expand Down
3 changes: 3 additions & 0 deletions src/app/loadout-builder/generated-sets/GeneratedSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default memo(function GeneratedSet({
halfTierMods,
armorEnergyRules,
equippedHashes,
autoStatMods,
isEditingExistingLoadout,
}: {
originalLoadout: Loadout;
Expand All @@ -59,6 +60,7 @@ export default memo(function GeneratedSet({
halfTierMods: PluggableInventoryItemDefinition[];
armorEnergyRules: ArmorEnergyRules;
equippedHashes: Set<number>;
autoStatMods: boolean;
isEditingExistingLoadout: boolean;
}) {
const defs = useD2Definitions()!;
Expand Down Expand Up @@ -169,6 +171,7 @@ export default memo(function GeneratedSet({
pinned={pinnedItems[item.bucket.hash] === item}
lbDispatch={lbDispatch}
assignedMods={itemModAssignments[item.id]}
autoStatMods={autoStatMods}
automaticallyPickedMods={autoModsPerItem[item.id]}
energy={resultingItemEnergies[item.id]}
/>
Expand Down
7 changes: 6 additions & 1 deletion src/app/loadout-builder/generated-sets/GeneratedSetItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function GeneratedSetItem({
pinned,
itemOptions,
assignedMods,
autoStatMods,
automaticallyPickedMods,
energy,
lbDispatch,
Expand All @@ -63,6 +64,7 @@ export default function GeneratedSetItem({
pinned: boolean;
itemOptions: DimItem[];
assignedMods?: PluggableInventoryItemDefinition[];
autoStatMods: boolean;
automaticallyPickedMods?: number[];
energy: { energyCapacity: number; energyUsed: number };
lbDispatch: Dispatch<LoadoutBuilderAction>;
Expand Down Expand Up @@ -97,7 +99,10 @@ export default function GeneratedSetItem({
if (item.isExotic) {
lbDispatch({ type: 'lockExotic', lockedExoticHash: item.hash });
}
} else if (plugCategoryHash !== PlugCategoryHashes.EnhancementsArtifice) {
} else if (
plugCategoryHash !== PlugCategoryHashes.EnhancementsArtifice &&
(!autoStatMods || plugCategoryHash !== PlugCategoryHashes.EnhancementsV2General)
) {
lbDispatch({
type: 'openModPicker',
plugCategoryHashWhitelist,
Expand Down
3 changes: 3 additions & 0 deletions src/app/loadout-builder/generated-sets/GeneratedSets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function GeneratedSets({
lbDispatch,
armorEnergyRules,
loadout,
autoStatMods,
isEditingExistingLoadout,
}: {
selectedStore: DimStore;
Expand All @@ -47,6 +48,7 @@ export default function GeneratedSets({
lbDispatch: Dispatch<LoadoutBuilderAction>;
armorEnergyRules: ArmorEnergyRules;
loadout: Loadout;
autoStatMods: boolean;
isEditingExistingLoadout: boolean;
}) {
const params = loadout.parameters!;
Expand Down Expand Up @@ -92,6 +94,7 @@ export default function GeneratedSets({
armorEnergyRules={armorEnergyRules}
originalLoadout={loadout}
equippedHashes={equippedHashes}
autoStatMods={autoStatMods}
isEditingExistingLoadout={isEditingExistingLoadout}
/>
)}
Expand Down

0 comments on commit 59a9585

Please sign in to comment.