Skip to content

Commit

Permalink
fix WFRP Utility import
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Aug 28, 2022
1 parent bb23653 commit 1c88946
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
7 changes: 3 additions & 4 deletions modules/actor/actor-wfrp4e.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import WFRP_Utility from "../system/utility-wfrp4e.js";
import OpposedWFRP from "../system/opposed-wfrp4e.js";
import WFRP_Audio from "../system/audio-wfrp4e.js";
import RollDialog from "../apps/roll-dialog.js";
import EffectWfrp4e from "../system/effect-wfrp4e.js"
Expand Down Expand Up @@ -1859,7 +1858,7 @@ export default class ActorWfrp4e extends Actor {
}
}
}
catch (e) { WFRP_UTILITY.log("Sound Context Error: " + e, true) } // Ignore sound errors
catch (e) { WFRP_Utility.log("Sound Context Error: " + e, true) } // Ignore sound errors
}

let scriptArgs = { actor, opposedTest, totalWoundLoss, AP, damageType, updateMsg, messageElements, attacker }
Expand Down Expand Up @@ -2072,7 +2071,7 @@ export default class ActorWfrp4e extends Actor {
}
catch (error) {
ui.notifications.info(`${game.i18n.format("ERROR.Species", { name: this.details.species.value })}`)
WFRP_UTILITY.log("Could not find species " + this.details.species.value + ": " + error, true);
WFRP_Utility.log("Could not find species " + this.details.species.value + ": " + error, true);
throw error
}
// The Roll class used to randomly select skills
Expand Down Expand Up @@ -2118,7 +2117,7 @@ export default class ActorWfrp4e extends Actor {
}
catch (error) {
ui.notifications.info(`${game.i18n.format("ERROR.Species", { name: this.details.species.value })}`)
WFRP_UTILITY.log("Could not find species " + this.details.species.value + ": " + error, true);
WFRP_Utility.log("Could not find species " + this.details.species.value + ": " + error, true);
throw error
}
let talentSelector;
Expand Down
2 changes: 1 addition & 1 deletion modules/actor/sheet/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ export default class ActorSheetWfrp4e extends ActorSheet {
}
}
catch (error) {
WFRP_UTILITY.log("Could not randomize: " + error, true)
WFRP_Utility.log("Could not randomize: " + error, true)
}
}

Expand Down
6 changes: 5 additions & 1 deletion modules/system/audio-wfrp4e.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import WFRP_Utility from "./utility-wfrp4e.js";


export default class WFRP_Audio {
static PlayContextAudio(context) {
this.MatchContextAudio(context).then(sound => {
Expand All @@ -8,6 +11,7 @@ export default class WFRP_Audio {
game.wfrp4e.utility.log(`wfrp4e | Playing Sound: ${sound.file}`)
AudioHelper.play({ src: sound.file }, sound.global)
})

}

static FindContext(test) {
Expand Down Expand Up @@ -266,7 +270,7 @@ export default class WFRP_Audio {
return { file: files[(await new Roll(`1d${files.length}-1`).roll({ async: true })).total], global: globalSound }
}
catch (e) {
WFRP_UTILITY.log("Sound Context Error: " + e, true)
WFRP_Utility.log("Sound Context Error: " + e, true)
}
}
}
6 changes: 4 additions & 2 deletions modules/system/opposed-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import WFRP_Audio from "./audio-wfrp4e.js";
import WFRP_Utility from "./utility-wfrp4e.js";


export default class OpposedTest {
constructor(attackerTest = undefined, defenderTest = undefined, opposeResult = {}) {
Expand Down Expand Up @@ -212,7 +214,7 @@ export default class OpposedTest {
}
}
}
catch (e) { WFRP_UTILITY.log("Sound Context Error: " + e, true) } // Ignore sound errors
catch (e) { WFRP_Utility.log("Sound Context Error: " + e, true) } // Ignore sound errors
}
else // Defender won
{
Expand All @@ -238,7 +240,7 @@ export default class OpposedTest {
}
}
}
catch (e) { WFRP_UTILITY.log("Sound Context Error: " + e, true) } // Ignore sound errors
catch (e) { WFRP_Utility.log("Sound Context Error: " + e, true) } // Ignore sound errors


opposeResult.winner = "defender"
Expand Down
2 changes: 1 addition & 1 deletion modules/system/utility-wfrp4e.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class WFRP_Utility {

if (!characteristicFormulae) {
ui.notifications.info(`${game.i18n.format("ERROR.Species", { name: species })}`)
WFRP_UTILITY.log("Could not find species " + species + ": " + error, true);
WFRP_Utility.log("Could not find species " + species + ": " + error, true);
throw error
}

Expand Down

0 comments on commit 1c88946

Please sign in to comment.