Skip to content

Tie equipment loadouts to active deck#9599

Open
vanja-ivancevic wants to merge 3 commits intoCard-Forge:masterfrom
vanja-ivancevic:feature/deck-equipment-loadouts
Open

Tie equipment loadouts to active deck#9599
vanja-ivancevic wants to merge 3 commits intoCard-Forge:masterfrom
vanja-ivancevic:feature/deck-equipment-loadouts

Conversation

@vanja-ivancevic
Copy link
Contributor

@vanja-ivancevic vanja-ivancevic commented Jan 22, 2026

  • Equipment loadouts are now tied to each deck
  • Switching decks automatically saves current equipment and restores the new deck's loadout
  • Backward compatible with existing saves (loadouts start empty, get populated on first deck switch)

Works well so far in testing.

@vanja-ivancevic vanja-ivancevic force-pushed the feature/deck-equipment-loadouts branch from f0b8cad to e2e7781 Compare January 22, 2026 18:20
@Jetz72 Jetz72 added Enhancement New feature or request Adventure For the Adventure Module labels Jan 22, 2026
@Jetz72
Copy link
Contributor

Jetz72 commented Jan 22, 2026

Seems like the kind of feature that should have to be enabled by a setting. There are users who keep 10+ decks, and if one of those people gets a better set of boots, it'll be a bit annoying having to go through and update the loadout for each of them. Having it default to off would also ensure the user understands that equipment is now tied to their active deck. Otherwise I suspect we'd encounter plenty of users that load up a game, switch decks, wander into battle without realizing all their equipment fell off, then file a bug report because they don't understand why it happened.

@vanja-ivancevic
Copy link
Contributor Author

vanja-ivancevic commented Jan 22, 2026

Great point! I will update it as a setting, default "off".

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

This PR has not been updated in a while nad has been marked on stale. Stale PRs will be auto closed

@vanja-ivancevic
Copy link
Contributor Author

Hey, any chance we could revisit this? Thanks a lot :)

@Jetz72
Copy link
Contributor

Jetz72 commented Mar 9, 2026

Got a merge conflict to resolve.

Should it clear the stored loadout when the corresponding deck is deleted? Or copy it when a deck is copied?

Equipment is now automatically saved/restored when switching decks.
Each deck remembers its own equipment configuration.

- Add deckLoadouts HashMap to store per-deck equipment
- Save/restore loadouts on deck switch in setSelectedDeckSlot()
- Persist loadouts in save/load methods
- Backward compatible with existing saves
Use ArrayList instead of HashMap for deckLoadouts to mirror the decks
list, so index shifting on deletion is handled automatically. Clear
stale loadouts on game reload. Copy loadouts when copying decks.
@vanja-ivancevic vanja-ivancevic force-pushed the feature/deck-equipment-loadouts branch from 25685d7 to 08b0596 Compare March 10, 2026 00:55
@vanja-ivancevic
Copy link
Contributor Author

vanja-ivancevic commented Mar 10, 2026

Got a merge conflict to resolve.

Should it clear the stored loadout when the corresponding deck is deleted? Or copy it when a deck is copied?

Rebased onto master and resolved the merge conflict in SettingsScene.java (just needed both disableCrackedItems and bindEquipmentLoadoutsToDecks checkboxes).

Also added a new commit to handle deck loadouts on delete, copy, and clear:

  • delete deck: clears the stored loadout for that deck (index shifting handled automatically)
  • Copy deck: copies the source deck's loadout to the new slot
  • Clear deck: clears the stored loadout
  • Fixed a bug where deckLoadouts wasn't cleared on game reload, which would cause stale loadout data to accumulate

Switched deckLoadouts from HashMap<Integer, ...> to ArrayList that mirrors the decks list, which keeps the two in sync naturally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Adventure For the Adventure Module Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants