Fixed drag/drop of features for environments (#1488)

This commit is contained in:
WBHarry 2025-12-29 13:02:22 +01:00 committed by GitHub
parent c070c6cc2d
commit f6bd1430e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 52 additions and 7 deletions

View file

@ -49,6 +49,19 @@ export default class DHEnvironmentSettings extends DHBaseActorSettings {
}
};
async _prepareContext(options) {
const context = await super._prepareContext(options);
const featureForms = ['passive', 'action', 'reaction'];
context.features = context.document.system.features.sort((a, b) =>
a.system.featureForm !== b.system.featureForm
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
: a.sort - b.sort
);
return context;
}
/**
* Adds a new category entry to the actor.
* @type {ApplicationClickAction}