Skip to content

Commit

Permalink
Minor css change to fix alignment bug. Updated module.json. (#94)
Browse files Browse the repository at this point in the history
* Minor css change to fix alignment bug. Updated module.json.

* Fixed deprecation errors
  • Loading branch information
ddbrown30 authored Jun 4, 2024
1 parent 494c7a6 commit 039e958
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 30 deletions.
6 changes: 3 additions & 3 deletions succ/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "<p>A module to change status icons in the SWADE system on Foundry VTT.</p><p><a href=\"https://ko-fi.com/salieric\">Please consider donating.</a></p>",
"compatibility": {
"minimum": "11",
"verified": "11.315"
"verified": "12.325"
},
"version": "3.3.1",
"version": "3.3.2",
"relationships": {
"systems": [
{
Expand All @@ -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"
}
}
]
Expand Down
22 changes: 11 additions & 11 deletions succ/modules/enhanced-conditions/condition-lab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -742,7 +742,7 @@ export class ConditionLab extends FormApplication {
icon: `<i class="fa fa-check"></i>`,
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]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions succ/modules/enhanced-conditions/enhanced-conditions-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions succ/modules/enhanced-conditions/enhanced-conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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 : {};
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions succ/modules/enhanced-conditions/enhanced-effect-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion succ/modules/token-display-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions succ/styles/succ.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 039e958

Please sign in to comment.