diff --git a/src/scripts/magic-item-entry/AbstractMagicItemEntry.js b/src/scripts/magic-item-entry/AbstractMagicItemEntry.js index 5ed0c54..2fed6d3 100644 --- a/src/scripts/magic-item-entry/AbstractMagicItemEntry.js +++ b/src/scripts/magic-item-entry/AbstractMagicItemEntry.js @@ -1,5 +1,5 @@ import { warn } from "../lib/lib"; -import { MagiItemHelpers } from "../magic-item-helpers"; +import { MagicItemHelpers } from "../magic-item-helpers"; export class AbstractMagicItemEntry { constructor(data) { @@ -7,7 +7,7 @@ export class AbstractMagicItemEntry { } get displayName() { - return MagiItemHelpers.getEntityNameCompendiumWithBabele(this.pack, this.name); + return MagicItemHelpers.getEntityNameCompendiumWithBabele(this.pack, this.name); } async renderSheet() { diff --git a/src/scripts/magic-item-entry/MagicItemFeat.js b/src/scripts/magic-item-entry/MagicItemFeat.js index 6567cc8..1319be2 100644 --- a/src/scripts/magic-item-entry/MagicItemFeat.js +++ b/src/scripts/magic-item-entry/MagicItemFeat.js @@ -1,5 +1,5 @@ import { MAGICITEMS } from "../config"; -import { MagiItemHelpers } from "../magic-item-helpers"; +import { MagicItemHelpers } from "../magic-item-helpers"; import { AbstractMagicItemEntry } from "./AbstractMagicItemEntry"; export class MagicItemFeat extends AbstractMagicItemEntry { @@ -28,6 +28,6 @@ export class MagicItemFeat extends AbstractMagicItemEntry { } get effects() { - return MagiItemHelpers.localized(MAGICITEMS.effects); + return MagicItemHelpers.localized(MAGICITEMS.effects); } } diff --git a/src/scripts/magic-item-entry/MagicItemTable.js b/src/scripts/magic-item-entry/MagicItemTable.js index 39eedb1..b4c5335 100644 --- a/src/scripts/magic-item-entry/MagicItemTable.js +++ b/src/scripts/magic-item-entry/MagicItemTable.js @@ -1,5 +1,5 @@ import { MAGICITEMS } from "../config"; -import { MagiItemHelpers } from "../magic-item-helpers"; +import { MagicItemHelpers } from "../magic-item-helpers"; import { AbstractMagicItemEntry } from "./AbstractMagicItemEntry"; export class MagicItemTable extends AbstractMagicItemEntry { @@ -8,7 +8,7 @@ export class MagicItemTable extends AbstractMagicItemEntry { } get usages() { - return MagiItemHelpers.localized(MAGICITEMS.tableUsages); + return MagicItemHelpers.localized(MAGICITEMS.tableUsages); } async roll(actor) { diff --git a/src/scripts/magic-item-helpers.js b/src/scripts/magic-item-helpers.js index e1ae63d..04faee1 100644 --- a/src/scripts/magic-item-helpers.js +++ b/src/scripts/magic-item-helpers.js @@ -1,6 +1,6 @@ import { isRealNumber } from "./lib/lib"; -export class MagiItemHelpers { +export class MagicItemHelpers { static numeric = function (value, fallback) { // if ($.isNumeric(value)) { // return parseInt(value); @@ -61,7 +61,7 @@ export class MagiItemHelpers { } static sortByLevel(a, b) { - return a.level === b.level ? MagicItem.sortByName(a, b) : a.level - b.level; + return a.level === b.level ? MagicItemHelpers.sortByName(a, b) : a.level - b.level; } /** diff --git a/src/scripts/magic-item/MagicItem.js b/src/scripts/magic-item/MagicItem.js index 07dfd22..6888b43 100644 --- a/src/scripts/magic-item/MagicItem.js +++ b/src/scripts/magic-item/MagicItem.js @@ -2,7 +2,7 @@ import { MAGICITEMS } from "../config.js"; import { MagicItemFeat } from "../magic-item-entry/MagicItemFeat.js"; import { MagicItemSpell } from "../magic-item-entry/MagicItemSpell.js"; import { MagicItemTable } from "../magic-item-entry/MagicItemTable.js"; -import { MagiItemHelpers } from "../magic-item-helpers.js"; +import { MagicItemHelpers } from "../magic-item-helpers.js"; export class MagicItem { constructor(flags) { @@ -48,10 +48,10 @@ export class MagicItem { sort() { if (this.sorting === "a") { - this.spells = this.spells.sort(MagiItemHelpers.sortByName); + this.spells = this.spells.sort(MagicItemHelpers.sortByName); } if (this.sorting === "l") { - this.spells = this.spells.sort(MagiItemHelpers.sortByLevel); + this.spells = this.spells.sort(MagicItemHelpers.sortByLevel); } } @@ -113,23 +113,23 @@ export class MagicItem { } get chargeTypes() { - return MagiItemHelpers.localized(MAGICITEMS.chargeTypes); + return MagicItemHelpers.localized(MAGICITEMS.chargeTypes); } get destroyChecks() { - return MagiItemHelpers.localized(MAGICITEMS.destroyChecks); + return MagicItemHelpers.localized(MAGICITEMS.destroyChecks); } get destroyTypes() { - return MagiItemHelpers.localized(MAGICITEMS.destroyTypes); + return MagicItemHelpers.localized(MAGICITEMS.destroyTypes); } get rechargeUnits() { - return MagiItemHelpers.localized(MAGICITEMS.rechargeUnits); + return MagicItemHelpers.localized(MAGICITEMS.rechargeUnits); } get rechargeTypes() { - return MagiItemHelpers.localized(MAGICITEMS.rechargeTypes); + return MagicItemHelpers.localized(MAGICITEMS.rechargeTypes); } get rechargeText() { @@ -259,7 +259,7 @@ export class MagicItem { } addEntity(entity, pack) { - let name = MagiItemHelpers.getEntityNameWithBabele(entity); + let name = MagicItemHelpers.getEntityNameWithBabele(entity); if (entity.type === "spell") { this.addSpell({ uuid: entity.uuid, diff --git a/src/scripts/magic-item/OwnedMagicItem.js b/src/scripts/magic-item/OwnedMagicItem.js index ccd70ca..35f7912 100644 --- a/src/scripts/magic-item/OwnedMagicItem.js +++ b/src/scripts/magic-item/OwnedMagicItem.js @@ -1,7 +1,7 @@ import { MAGICITEMS } from "../config"; import CONSTANTS from "../constants/constants"; import { warn } from "../lib/lib"; -import { MagiItemHelpers } from "../magic-item-helpers"; +import { MagicItemHelpers } from "../magic-item-helpers"; import { OwnedMagicItemFeat } from "../magic-item-owned-entry/OwnedMagicItemFeat"; import { OwnedMagicItemSpell } from "../magic-item-owned-entry/OwnedMagicItemSpell"; import { OwnedMagicItemTable } from "../magic-item-owned-entry/OwnedMagicItemTable"; @@ -21,7 +21,7 @@ export class OwnedMagicItem extends MagicItem { this.rechargeableLabel = this.rechargeable ? `(${game.i18n.localize("MAGICITEMS.SheetRecharge")}: ${this.rechargeText} ${ - MagiItemHelpers.localized(MAGICITEMS.rechargeUnits)[this.rechargeUnit] + MagicItemHelpers.localized(MAGICITEMS.rechargeUnits)[this.rechargeUnit] } )` : game.i18n.localize("MAGICITEMS.SheetNoRecharge"); diff --git a/src/scripts/magicItemtab.js b/src/scripts/magicItemtab.js index 8cbb011..3784b23 100644 --- a/src/scripts/magicItemtab.js +++ b/src/scripts/magicItemtab.js @@ -1,6 +1,6 @@ import { MAGICITEMS } from "./config.js"; import CONSTANTS from "./constants/constants.js"; -import { MagiItemHelpers } from "./magic-item-helpers.js"; +import { MagicItemHelpers } from "./magic-item-helpers.js"; import { MagicItem } from "./magic-item/MagicItem.js"; const magicItemTabs = []; @@ -173,7 +173,7 @@ export class MagicItemTab { this.render(); }); this.html.find('input[name="flags.magicitems.charges"]').change((evt) => { - this.magicItem.charges = MagiItemHelpers.numeric(evt.target.value, this.magicItem.charges); + this.magicItem.charges = MagicItemHelpers.numeric(evt.target.value, this.magicItem.charges); this.render(); }); this.html.find('select[name="flags.magicitems.chargeType"]').change((evt) => { @@ -236,7 +236,7 @@ export class MagicItemTab { this.render(); }); this.html.find(`input[name="flags.magicitems.spells.${idx}.consumption"]`).change((evt) => { - spell.consumption = MagiItemHelpers.numeric(evt.target.value, spell.consumption); + spell.consumption = MagicItemHelpers.numeric(evt.target.value, spell.consumption); this.render(); }); this.html.find(`select[name="flags.magicitems.spells.${idx}.upcast"]`).change((evt) => { @@ -244,7 +244,7 @@ export class MagicItemTab { this.render(); }); this.html.find(`input[name="flags.magicitems.spells.${idx}.upcastCost"]`).change((evt) => { - spell.upcastCost = MagiItemHelpers.numeric(evt.target.value, spell.cost); + spell.upcastCost = MagicItemHelpers.numeric(evt.target.value, spell.cost); this.render(); }); this.html.find(`input[name="flags.magicitems.spells.${idx}.flatDc"]`).click((evt) => { @@ -265,7 +265,7 @@ export class MagicItemTab { this.render(); }); this.html.find(`input[name="flags.magicitems.feats.${idx}.consumption"]`).change((evt) => { - feat.consumption = MagiItemHelpers.numeric(evt.target.value, feat.consumption); + feat.consumption = MagicItemHelpers.numeric(evt.target.value, feat.consumption); this.render(); }); this.html.find(`a[data-feat-idx="${idx}"]`).click((evt) => { @@ -274,7 +274,7 @@ export class MagicItemTab { }); this.magicItem.tables.forEach((table, idx) => { this.html.find(`input[name="flags.magicitems.tables.${idx}.consumption"]`).change((evt) => { - table.consumption = MagiItemHelpers.numeric(evt.target.value, table.consumption); + table.consumption = MagicItemHelpers.numeric(evt.target.value, table.consumption); }); this.html.find(`a[data-table-idx="${idx}"]`).click((evt) => { table.renderSheet(); diff --git a/src/scripts/magicitemactor.js b/src/scripts/magicitemactor.js index b2888b1..43662a2 100644 --- a/src/scripts/magicitemactor.js +++ b/src/scripts/magicitemactor.js @@ -1,6 +1,6 @@ import { MAGICITEMS } from "./config.js"; import { warn } from "./lib/lib.js"; -import { MagiItemHelpers } from "./magic-item-helpers.js"; +import { MagicItemHelpers } from "./magic-item-helpers.js"; import { OwnedMagicItem } from "./magic-item/OwnedMagicItem.js"; /** diff --git a/src/scripts/magicitemsheet.js b/src/scripts/magicitemsheet.js index 4efdb81..e713cfb 100644 --- a/src/scripts/magicitemsheet.js +++ b/src/scripts/magicitemsheet.js @@ -1,6 +1,6 @@ import { MAGICITEMS } from "./config.js"; import CONSTANTS from "./constants/constants.js"; -import { MagiItemHelpers } from "./magic-item-helpers.js"; +import { MagicItemHelpers } from "./magic-item-helpers.js"; import { MagicItemActor } from "./magicitemactor.js"; const magicItemSheets = []; @@ -101,12 +101,12 @@ export class MagicItemSheet { this.html.find(".item h4.spell-name").click((evt) => this.onItemShow(evt)); this.actor.items.forEach((item) => { this.html.find(`input[data-item-id="magicitems.${item.id}.uses"]`).change((evt) => { - item.setUses(MagiItemHelpers.numeric(evt.currentTarget.value, item.uses)); + item.setUses(MagicItemHelpers.numeric(evt.currentTarget.value, item.uses)); item.update(); }); item.ownedEntries.forEach((entry) => { this.html.find(`input[data-item-id="magicitems.${item.id}.${entry.id}.uses"]`).change((evt) => { - entry.uses = MagiItemHelpers.numeric(evt.currentTarget.value, entry.uses); + entry.uses = MagicItemHelpers.numeric(evt.currentTarget.value, entry.uses); item.update(); }); }); @@ -146,7 +146,7 @@ export class MagicItemSheet { if (itemUuid) { uuid = itemUuid; } else { - uuid = MagiItemHelpers.retrieveUuid({ + uuid = MagicItemHelpers.retrieveUuid({ documentName: null, documentId: itemId, documentCollectionType: "Item",