Basic implementation of Artifacts in loadouts#11851
Conversation
Still needed: mobile styling, better handling of the mod picker, better handling of unpicked/empty sockets, loadout csv
| const handleRemoveArtifactUnlock = useUpdater(removeArtifactUnlock); | ||
|
|
||
| const artifactTitle = artifactUnlocks | ||
| const handleSyncArtifactFromEquipped = useDefsStoreUpdater(setLoadoutArtifactFromEquipped); |
There was a problem hiding this comment.
Unsure on whether defsstoreupdater needed here
bhollis
left a comment
There was a problem hiding this comment.
Nice, logic looks good. Probably could have split this into a couple PRs just to reduce the diff by removing the artifactUnlocks stuff first.
| const RESET_SOCKET = 1383699646; | ||
| const excludedMods = [EMPTY_MOD, RESET_MOD]; | ||
|
|
||
| export default function ArtifactPlugDrawer({ |
There was a problem hiding this comment.
My plan for artifact, emotes, and weapon-perks was to use the item popup, let you configure the perks/mods, then click a "Save to Loadout" button. This avoids having to build a perk picker for every type of thing, and it cleans up the mod/perk handling on the item popup to boot. Not saying you can't create a special picker for this one, but that was the idea.
| const handleRemoveMod = useCallback( | ||
| (mod: ResolvedLoadoutMod) => onRemoveMod!(mod.originalModHash), | ||
| [onRemoveMod], | ||
| const artifactOverrides: ResolvedLoadoutMod[] = useMemo( |
There was a problem hiding this comment.
I can't quite tell if this is what this does, but it would be great if legacy artifact unlocks could be auto-mapped / upgraded to a real artifact item and socket overrides.
There was a problem hiding this comment.
This currently only lets the component display the legacy mods if they're in the loadout and if no modern artifact is present. The item defs for the perks in the modern artifacts seem to be the same as the old item defs (unless the old items were removed from the API entirely), so it might be possible, but would be pretty janky to implement.
Now shows all perks in one bucket and automatically disables them as they are no longer eligible to be selected
Co-authored-by: Ben Hollis <ben@benhollis.net>
|
There's still some odd-looking mobile UI but the rest of the feature works as intended as far as I've been testing, don't know if there's a logical way to split up the changes (maybe removal of legacy artifacts -> addition of new artifacts but that's iffy as well). Not sure if delaying for polish is needed or not. |

Still needed:
Changelog: Add basic handling for using Artifacts in loadouts