Added Persistence to the AbilityList #376

Merged
Lucraft merged 1 commit from BanditHelps/Palladium:26.1/ability-list-persistence into 26.1/dev 2026-10-14 18:44:28 +00:00
Contributor

Before, whenever a change in a player's powers were detected, (i.e power addition, power removal, or power dampening) the AbilityList would repopulate itself. This lead to the behavior where the player's currently selected power in the AbilityBar would change automatically without the player pressing the key bind. This behavior was due to the fact that only the "slot index" was being saved, and power additions/removals shift what is in those slots.

This PR makes it so that each list has a stable key instead of simply a slot index. Every time populate() is called, it will now use the key to remember the player's selected power list, and choose it if it still exists.

This prevents the Ability List from cycling during power changes, a QOL fix that makes it easier to use the powers.

Implements suggestion #371

Before, whenever a change in a player's powers were detected, (i.e power addition, power removal, or power dampening) the AbilityList would repopulate itself. This lead to the behavior where the player's currently selected power in the AbilityBar would change automatically without the player pressing the key bind. This behavior was due to the fact that only the "slot index" was being saved, and power additions/removals shift what is in those slots. This PR makes it so that each list has a stable key instead of simply a slot index. Every time `populate()` is called, it will now use the key to remember the player's selected power list, and choose it if it still exists. This prevents the Ability List from cycling during power changes, a QOL fix that makes it easier to use the powers. Implements suggestion #371
Lucraft merged commit ba8bfdd617 into 26.1/dev 2026-10-14 18:44:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ThreeTAG/Palladium!376
No description provided.