diff --git a/lang/en.json b/lang/en.json index ab109294..423f8c06 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2313,7 +2313,8 @@ "domainMaxReached": "You've reached the maximum domains for the class. Increase the limit in homebrew settings if desired.", "insufficientResources": "You have insufficient resources", "multiclassAlreadyPresent": "You already have a class and multiclass", - "subclassesAlreadyPresent": "You already have a class and multiclass subclass" + "subclassesAlreadyPresent": "You already have a class and multiclass subclass", + "noDiceSystem": "Your selected dice {system} does not have a {faces} dice" }, "Tooltip": { "disableEffect": "Disable Effect", diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index e5b624f8..bacae6f3 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -451,8 +451,20 @@ export const getDiceSoNicePresets = async (hopeFaces, fearFaces, advantageFaces const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); const getPreset = async (type, faces) => { const system = game.dice3d.DiceFactory.systems.get(type.system).dice.get(faces); - if (!system.modelLoaded) { + if (!system) { + ui.notifications.error( + game.i18n.format('DAGGERHEART.UI.Notifications.noDiceSystem', { + system: game.dice3d.DiceFactory.systems.get(type.system).name, + faces: faces + }) + ); + return; + } + + if (system.modelFile && !system.modelLoaded) { await system.loadModel(game.dice3d.DiceFactory.loaderGLTF); + } else { + await system.loadTextures(); } return {