Remove the button from the settings config list when the default attributes have been successfully removed & send a notification (closes #92)

This commit is contained in:
Oliver 2026-05-11 22:43:54 -06:00
parent 7603e79e42
commit d04985b5b7
2 changed files with 4 additions and 1 deletions

View file

@ -160,7 +160,8 @@
"migration-in-progress": "Applying data migrations for version {version}. Please do NOT refresh the window while this warning is present." "migration-in-progress": "Applying data migrations for version {version}. Please do NOT refresh the window while this warning is present."
}, },
"success": { "success": {
"saved-default-attributes": "Successfully saved default Actor attributes", "saved-default-attributes": "Successfully saved default Actor attributes.",
"removed-default-attributes": "The default attributes for Actors have been removed.",
"migration-successful": "Data migrations for version {version} were successful." "migration-successful": "Data migrations for version {version} were successful."
} }
} }

View file

@ -20,6 +20,8 @@ Hooks.on(`renderSettingsConfig`, (app, html) => {
button.innerHTML = _loc(`taf.settings.actorDefaultAttributes.label`); button.innerHTML = _loc(`taf.settings.actorDefaultAttributes.label`);
button.addEventListener(`click`, () => { button.addEventListener(`click`, () => {
game.settings.set(__ID__, `actorDefaultAttributes`, undefined); game.settings.set(__ID__, `actorDefaultAttributes`, undefined);
formGroup.remove();
ui.notifications.success(_loc(`taf.notifs.success.removed-default-attributes`));
}); });
const hint = document.createElement(`p`); const hint = document.createElement(`p`);