DIM
DIM copied to clipboard
[Loadouts][Enhancements] Copy and Edit Loadout
Background and Issue
- Related Issue: #10222
- Users were accidentally overwriting existing loadouts when attempting to make copies of the loadout. Adding a button to copy and edit would help circumvent this issue as described in the comments of the issue.
Proposed Changes
-
Add a button to the
LoadoutRow
that appears when it is not equipped to allow a user to create a copy of the selected/clicked onLoadoutRow
that will then appear in the Loadout popup on the bottom on the browser window like shown below -
This loadout will be unique from the copied loadout and will not overwrite the existing loadout, but will allow the user to save it like a new loadout.
-
NOTE I chose to put the button on the row rather than the popup since it'd be more obvious and accessible to users looking on the page.
Code Changes
- Add a button the the button cluster on the
LoadoutRow
that reads "Copy and Edit" - Add logic to the
loadout-drawer/loadout-events.ts
file alongside other functionality. - Add a line to
i18n
for the new string that will be shown
Testing
- pnpm test (may require an update via
pnpm test -- -u
) - manual testing on local DIM instance
Monitoring
- monitor events fired off from the
copyAndEdit
function - Watch for issues in the DIM Discord pertaining to this issue.
- Functionality can be reverted with no other side effects if required.