mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
[Feature] DualityDice DiceSoNice Animations (#1722)
* . * Fixed translation * Remove fieldset * DiceSoNice Animation Overrides (#1726) * . * . * Fixed hope/fear animation input * Visual tweaks to general tab * Move general tab to top * Fixed localizaiton --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
parent
6c7937a9ff
commit
8172e8baa7
19 changed files with 492 additions and 150 deletions
55
module/data/settings/GlobalOverrides.mjs
Normal file
55
module/data/settings/GlobalOverrides.mjs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import DhAppearance from './Appearance.mjs';
|
||||
|
||||
/**
|
||||
* A setting to handle cases where we want to allow the GM to set a global default for client settings.
|
||||
*/
|
||||
export default class DhGlobalOverrides extends foundry.abstract.DataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
diceSoNice: new fields.SchemaField({
|
||||
sfx: new fields.SchemaField({
|
||||
overrideEnabled: new fields.BooleanField(),
|
||||
global: new fields.SchemaField({
|
||||
critical: DhAppearance.sfxSchema()
|
||||
}),
|
||||
hope: new fields.SchemaField({
|
||||
higher: DhAppearance.sfxSchema()
|
||||
}),
|
||||
fear: new fields.SchemaField({
|
||||
higher: DhAppearance.sfxSchema()
|
||||
})
|
||||
})
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
async diceSoNiceSFXUpdate(appearanceSettings, enabled) {
|
||||
if (!game.user.isGM) return;
|
||||
|
||||
const newEnabled = enabled !== undefined ? enabled : this.diceSoNice.sfx.overrideEnabled;
|
||||
if (newEnabled) {
|
||||
const newOverrides = foundry.utils.mergeObject(this.toObject(), {
|
||||
diceSoNice: {
|
||||
sfx: {
|
||||
overrideEnabled: true,
|
||||
global: appearanceSettings.diceSoNice.sfx,
|
||||
hope: appearanceSettings.diceSoNice.hope.sfx,
|
||||
fear: appearanceSettings.diceSoNice.fear.sfx
|
||||
}
|
||||
}
|
||||
});
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides, newOverrides);
|
||||
} else {
|
||||
const newOverrides = {
|
||||
...this.toObject(),
|
||||
diceSoNice: {
|
||||
sfx: {
|
||||
overrideEnabled: false
|
||||
}
|
||||
}
|
||||
};
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.GlobalOverrides, newOverrides);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue