diff --git a/succ/module.json b/succ/module.json index 8edf049..e576eec 100644 --- a/succ/module.json +++ b/succ/module.json @@ -4,9 +4,9 @@ "description": "

A module to change status icons in the SWADE system on Foundry VTT.

Please consider donating.

", "compatibility": { "minimum": "11", - "verified": "11.315" + "verified": "12.325" }, - "version": "3.3.1", + "version": "3.3.2", "relationships": { "systems": [ { @@ -15,7 +15,7 @@ "manifest": "https://gitlab.com/api/v4/projects/16269883/packages/generic/swade/latest/system.json", "compatibility": { "minimum": "3.3.8", - "verified": "3.3.8" + "verified": "4.0.0" } } ] diff --git a/succ/modules/enhanced-conditions/condition-lab.js b/succ/modules/enhanced-conditions/condition-lab.js index b3f399f..610ab00 100644 --- a/succ/modules/enhanced-conditions/condition-lab.js +++ b/succ/modules/enhanced-conditions/condition-lab.js @@ -28,7 +28,7 @@ export class ConditionLab extends FormApplication { * Get options for the form */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { id: BUTLER.DEFAULT_CONFIG.enhancedConditions.conditionLab.id, title: BUTLER.DEFAULT_CONFIG.enhancedConditions.conditionLab.title, template: BUTLER.DEFAULT_CONFIG.enhancedConditions.templates.conditionLab, @@ -64,7 +64,7 @@ export class ConditionLab extends FormApplication { const mapTypeChoices = BUTLER.DEFAULT_CONFIG.enhancedConditions.mapTypes; const mapType = this.mapType = (this.mapType || this.initialMapType || "other"); - let conditionMap = this.map ? this.map : (this.map = duplicate(this.initialMap)); + let conditionMap = this.map ? this.map : (this.map = foundry.utils.duplicate(this.initialMap)); const isDefault = this.mapType === Sidekick.getKeyByValue(BUTLER.DEFAULT_CONFIG.enhancedConditions.mapTypes, BUTLER.DEFAULT_CONFIG.enhancedConditions.mapTypes.default); const outputChatSetting = Sidekick.getSetting(BUTLER.SETTING_KEYS.enhancedConditions.outputChat); @@ -240,8 +240,8 @@ export class ConditionLab extends FormApplication { const tempMap = (this.mapType != otherMapType && EnhancedConditions.getMapForDefaultConditions(defaultConditions)) ? EnhancedConditions.getMapForDefaultConditions(defaultConditions) : []; // Loop over the old map and readd any conditions that were added by the user through the Condition Lab - const oldMap = duplicate(this.map); - this.map = duplicate(tempMap); + const oldMap = foundry.utils.duplicate(this.map); + this.map = foundry.utils.duplicate(tempMap); for (const oldCondition of oldMap) { if (oldCondition.addedByLab) { if (!removeConditionsAddedByLab) { @@ -327,7 +327,7 @@ export class ConditionLab extends FormApplication { if (mapType === defaultMapType) { const defaultMap = EnhancedConditions.getDefaultMap(); - newMap = mergeObject(newMap, defaultMap); + newMap = foundry.utils.mergeObject(newMap, defaultMap); } return this._saveMapping(newMap, mapType); @@ -366,7 +366,7 @@ export class ConditionLab extends FormApplication { * Exports the current map to JSON */ _exportToJSON() { - const map = duplicate(this.map); + const map = foundry.utils.duplicate(this.map); const data = { system: game.system.id, map @@ -644,8 +644,8 @@ export class ConditionLab extends FormApplication { if (!conditionEffect) return; - if (!hasProperty(conditionEffect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`)) { - setProperty(conditionEffect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`, conditionId); + if (!foundry.utils.hasProperty(conditionEffect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`)) { + foundry.utils.setProperty(conditionEffect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`, conditionId); } // Build a fake effect object for the ActiveEffectConfig sheet @@ -694,12 +694,12 @@ export class ConditionLab extends FormApplication { if (this.mapType === defaultMapType) { const defaultMap = EnhancedConditions.getDefaultMap(); - this.map = mergeObject(fdMap, defaultMap); + this.map = foundry.utils.mergeObject(fdMap, defaultMap); } else { this.map = fdMap; } - const newMap = duplicate(this.map); + const newMap = foundry.utils.duplicate(this.map); const exisitingIds = this.map.filter(c => c.id).map(c => c.id); const outputChatSetting = Sidekick.getSetting(BUTLER.SETTING_KEYS.enhancedConditions.outputChat); @@ -742,7 +742,7 @@ export class ConditionLab extends FormApplication { icon: ``, label: game.i18n.localize("WORDS._Yes"), callback: async event => { - const newMap = duplicate(this.map); + const newMap = foundry.utils.duplicate(this.map); if (!newMap[row].addedByLab) { this.deletedConditionsMap.push(newMap[row]); } diff --git a/succ/modules/enhanced-conditions/default-conditions-menu.js b/succ/modules/enhanced-conditions/default-conditions-menu.js index a0ab503..ba2dda8 100644 --- a/succ/modules/enhanced-conditions/default-conditions-menu.js +++ b/succ/modules/enhanced-conditions/default-conditions-menu.js @@ -16,7 +16,7 @@ export class DefaultConditionsMenu extends FormApplication { * Get options for the form */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { id: BUTLER.DEFAULT_CONFIG.enhancedConditions.defaultConditionsMenu.id, title: BUTLER.DEFAULT_CONFIG.enhancedConditions.defaultConditionsMenu.title, template: BUTLER.DEFAULT_CONFIG.enhancedConditions.templates.defaultConditionsMenu, diff --git a/succ/modules/enhanced-conditions/enhanced-conditions-api.js b/succ/modules/enhanced-conditions/enhanced-conditions-api.js index 35ec226..eb8f0e5 100644 --- a/succ/modules/enhanced-conditions/enhanced-conditions-api.js +++ b/succ/modules/enhanced-conditions/enhanced-conditions-api.js @@ -86,7 +86,7 @@ export class EnhancedConditionsAPI { } if (effectOptions) { - setProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.effectOptions}`, effectOptions); + foundry.utils.setProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.effectOptions}`, effectOptions); } } @@ -117,7 +117,7 @@ export class EnhancedConditionsAPI { continue; } - const conditionId = getProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`); + const conditionId = foundry.utils.getProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.conditionId}`); const matchedConditionEffects = existingConditionEffects.filter(e => e.getFlag(BUTLER.NAME, BUTLER.FLAGS.enhancedConditions.conditionId) === conditionId); // Scenario 2: if duplicates are allowed, and existing conditions should be replaced, add any existing conditions to update diff --git a/succ/modules/enhanced-conditions/enhanced-conditions.js b/succ/modules/enhanced-conditions/enhanced-conditions.js index 28cf023..f8672c0 100644 --- a/succ/modules/enhanced-conditions/enhanced-conditions.js +++ b/succ/modules/enhanced-conditions/enhanced-conditions.js @@ -319,7 +319,7 @@ export class EnhancedConditions { case "create": macros = condition.macros?.filter(m => m.type === "apply"); - const hasEffectOptions = hasProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.effectOptions}`); + const hasEffectOptions = foundry.utils.hasProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.effectOptions}`); if (hasEffectOptions && Object.keys(effect.flags.succ.effectOptions).length > 0) { EnhancedConditions.applyEffectOptions(effect, actor); } else { @@ -877,7 +877,7 @@ export class EnhancedConditions { // Iterate through the map validating/preparing the data for (let i = 0; i < conditionMap.length; i++) { - let condition = duplicate(conditionMap[i]); + let condition = foundry.utils.duplicate(conditionMap[i]); // Delete falsy values if (!condition) preparedMap.splice(i, 1); @@ -911,7 +911,7 @@ export class EnhancedConditions { * Duplicate the core status icons, freeze the duplicate then store a copy in settings */ static _backupCoreEffects() { - CONFIG.defaultStatusEffects = CONFIG.defaultStatusEffects || duplicate(CONFIG.statusEffects); + CONFIG.defaultStatusEffects = CONFIG.defaultStatusEffects || foundry.utils.duplicate(CONFIG.statusEffects); if (!Object.isFrozen(CONFIG.defaultStatusEffects)) { Object.freeze(CONFIG.defaultStatusEffects); } @@ -1003,8 +1003,8 @@ export class EnhancedConditions { const activeCondition = activeConditionMap.find(c => c.id === CONFIG.specialStatusEffects[key]); if (activeCondition) { //The name of this effect matches one of our effect. Check its options - if (hasProperty(activeCondition.options, optionName)) { - if (getProperty(activeCondition.options, optionName)) { + if (foundry.utils.hasProperty(activeCondition.options, optionName)) { + if (foundry.utils.getProperty(activeCondition.options, optionName)) { //This effect has the option enabled, so just leave it as is return; } @@ -1016,8 +1016,8 @@ export class EnhancedConditions { //Check our map to see if any of our conditions have this option enabled const configCondition = activeConditionMap.find(c => { - if (hasProperty(c.options, optionName)) { - const optionValue = getProperty(c.options, optionName); + if (foundry.utils.hasProperty(c.options, optionName)) { + const optionValue = foundry.utils.getProperty(c.options, optionName); return optionValue; } return false; @@ -1076,7 +1076,7 @@ export class EnhancedConditions { if (!effects) return; for (const effect of effects) { - const overlay = getProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.overlay}`); + const overlay = foundry.utils.getProperty(effect, `flags.${BUTLER.NAME}.${BUTLER.FLAGS.enhancedConditions.overlay}`); // If the parent Condition for the ActiveEffect defines it as an overlay, mark the ActiveEffect as an overlay if (overlay) { effect.flags.core = effect.flags.core ? effect.flags.core : {}; @@ -1230,7 +1230,7 @@ export class EnhancedConditions { const defaultCondition = defaultConditions.find(c => c === conditionConfig.id); const deletedCondition = deletedConditionsMap.find(c => c.id === conditionConfig.id); if (defaultCondition && !deletedCondition) { - conditionMap.push(duplicate(conditionConfig)); + conditionMap.push(foundry.utils.duplicate(conditionConfig)); } } else { if (!conditionConfig.activeEffect) { @@ -1282,7 +1282,7 @@ export class EnhancedConditions { } } - const oldDeletedConditionsMap = duplicate(deletedConditionsMap); + const oldDeletedConditionsMap = foundry.utils.duplicate(deletedConditionsMap); for (let deletedCondition of oldDeletedConditionsMap) { const newIdx = newMap.findIndex(c => c.id === deletedCondition.id); if (newIdx < 0) { diff --git a/succ/modules/enhanced-conditions/enhanced-effect-config.js b/succ/modules/enhanced-conditions/enhanced-effect-config.js index 20dda0c..6aef890 100644 --- a/succ/modules/enhanced-conditions/enhanced-effect-config.js +++ b/succ/modules/enhanced-conditions/enhanced-effect-config.js @@ -29,7 +29,7 @@ export default class EnhancedEffectConfig extends ActiveEffectConfig { * @override */ async _updateObject(event, formData) { - const conditionIdFlag = getProperty(this.object.flags, `${NAME}.${FLAGS.enhancedConditions.conditionId}`); + const conditionIdFlag = foundry.utils.getProperty(this.object.flags, `${NAME}.${FLAGS.enhancedConditions.conditionId}`); if (!conditionIdFlag) return; // find the matching condition row @@ -44,7 +44,7 @@ export default class EnhancedEffectConfig extends ActiveEffectConfig { // update the effect data - condition.activeEffect = condition.activeEffect ? mergeObject(condition.activeEffect, formData) : formData; + condition.activeEffect = condition.activeEffect ? foundry.utils.mergeObject(condition.activeEffect, formData) : formData; this.object.updateSource(formData); if (this._state == 2) await this.render(); diff --git a/succ/modules/token-display-settings.js b/succ/modules/token-display-settings.js index c435171..e65771a 100644 --- a/succ/modules/token-display-settings.js +++ b/succ/modules/token-display-settings.js @@ -4,7 +4,7 @@ import { Sidekick } from "./sidekick.js"; export class TokenDisplaySettings extends FormApplication { static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { id: BUTLER.DEFAULT_CONFIG.enhancedConditions.tokenDisplaySettingsMenu.id, title: BUTLER.DEFAULT_CONFIG.enhancedConditions.tokenDisplaySettingsMenu.title, template: BUTLER.DEFAULT_CONFIG.enhancedConditions.templates.tokenDisplaySettingsMenu, diff --git a/succ/styles/succ.css b/succ/styles/succ.css index 76d13f2..ae577e9 100644 --- a/succ/styles/succ.css +++ b/succ/styles/succ.css @@ -409,6 +409,7 @@ a.add-temporary { flex-direction: column; justify-content: flex-start; overflow: hidden auto; + align-items: normal; } .succ-default-conditions aside.sidebar nav.tabs .group-tab {