mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
* Create new actions classes * actions types - attack roll * fixes before merge * First PR * Add daggerheart.css to gitignore * Update ToDo * Remove console log * Fixed chat /dr roll * Remove jQuery * Fixed so the different chat themes work again * Fixed duality roll buttons * Fix to advantage/disadvantage shortcut * Extand action to other item types * Roll fixes * Fixes to adversary rolls * resources * Fixed adversary dice --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
73 lines
2.2 KiB
JavaScript
73 lines
2.2 KiB
JavaScript
import DhAppearance from '../../data/settings/Appearance.mjs';
|
|
|
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
|
|
|
export default class DHAppearanceSettings extends HandlebarsApplicationMixin(ApplicationV2) {
|
|
constructor() {
|
|
super({});
|
|
|
|
this.settings = new DhAppearance(
|
|
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).toObject()
|
|
);
|
|
}
|
|
|
|
get title() {
|
|
return game.i18n.localize('DAGGERHEART.Settings.Menu.Appearance.name');
|
|
}
|
|
|
|
static DEFAULT_OPTIONS = {
|
|
tag: 'form',
|
|
id: 'daggerheart-appearance-settings',
|
|
classes: ['daggerheart', 'setting', 'dh-style'],
|
|
position: { width: '600', height: 'auto' },
|
|
actions: {
|
|
reset: this.reset,
|
|
save: this.save
|
|
},
|
|
form: { handler: this.updateData, submitOnChange: true }
|
|
};
|
|
|
|
static PARTS = {
|
|
main: {
|
|
template: 'systems/daggerheart/templates/settings/appearance-settings.hbs'
|
|
}
|
|
};
|
|
|
|
async _prepareContext(_options) {
|
|
const context = await super._prepareContext(_options);
|
|
context.settingFields = this.settings;
|
|
|
|
return context;
|
|
}
|
|
|
|
static async updateData(event, element, formData) {
|
|
const updatedSettings = foundry.utils.expandObject(formData.object);
|
|
|
|
await this.settings.updateSource(updatedSettings);
|
|
this.render();
|
|
}
|
|
|
|
static async reset() {
|
|
this.settings = new DhAppearance();
|
|
this.render();
|
|
}
|
|
|
|
static async save() {
|
|
await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, this.settings.toObject());
|
|
const reload = await foundry.applications.api.DialogV2.confirm({
|
|
id: 'reload-world-confirm',
|
|
modal: true,
|
|
rejectClose: false,
|
|
window: { title: 'SETTINGS.ReloadPromptTitle' },
|
|
position: { width: 400 },
|
|
content: `<p>${game.i18n.localize('SETTINGS.ReloadPromptBody')}</p>`
|
|
});
|
|
|
|
if (reload) {
|
|
await game.socket.emit('reload');
|
|
foundry.utils.debouncedReload();
|
|
}
|
|
|
|
this.close();
|
|
}
|
|
}
|