diff --git a/js/base-engine.js b/js/base-engine.js index 1484f17e..14f6a5a5 100644 --- a/js/base-engine.js +++ b/js/base-engine.js @@ -332,7 +332,7 @@ function d20plusEngine () { if ($dialog[0]) { const $pageTitle = $dialog.find(`.ui-dialog-title:visible`); d20plus.engine._preserveCustomOptions(page); - d20plus.engine._populateCustomOptions(page, $dialog.find(`.dialog .tab-content`)); + d20plus.engine._populatePageCustomOptions(page, $dialog.find(`.dialog .tab-content`)); if ($pageTitle[0] && !$(".ui-dialog-pagename:visible")[0]) { $pageTitle.after(`${page.get("name")}`); $saveBtn.off("click"); @@ -380,7 +380,7 @@ function d20plusEngine () { // page.save resets current dialog, so we need to restore status quo $(`.nav-tabs:visible [data-tab=${activeTab}]`).click(); $(`.ui-dialog-content:visible`).scrollTop(activeTabScroll); - d20plus.engine._populateCustomOptions(); + d20plus.engine._populatePageCustomOptions(); } } diff --git a/js/base-weather.js b/js/base-weather.js index fd420888..59d0cae0 100644 --- a/js/base-weather.js +++ b/js/base-weather.js @@ -32,6 +32,7 @@ function baseWeather () { "Waves": new Image(), "Ripples": new Image(), "Blood Rain": new Image(), + "Custom": new Image(), }; IMAGES.Rain.src = "https://i.imgur.com/lZrqiVk.png"; IMAGES.Snow.src = "https://i.imgur.com/uwLQjWY.png"; @@ -112,7 +113,6 @@ function baseWeather () { case "Waves": case "Ripples": case "Blood Rain": - IMAGES["Custom"] = null; return IMAGES[imageName]; case "Custom (see below)": if (!IMAGES["Custom"] || ( @@ -124,15 +124,14 @@ function baseWeather () { IMAGES["Custom"].onerror = () => { if (IMAGES["Custom"]._errorSrc == null) { IMAGES["Custom"]._errorSrc = page.get("bR20cfg_weatherTypeCustom1"); - alert(`Custom weather image "${IMAGES["Custom"].src}" failed to load!`); + console.log(`Custom weather image "${IMAGES["Custom"].src}" failed to load!`); } IMAGES["Custom"].src = IMAGES["Rain"].src; }; - IMAGES["Custom"].src = page.get("bR20cfg_weatherTypeCustom1"); + if (page.get("bR20cfg_weatherTypeCustom1")) IMAGES["Custom"].src = page.get("bR20cfg_weatherTypeCustom1"); } return IMAGES["Custom"]; default: - IMAGES["Custom"] = null; return null; } } diff --git a/js/templates/template-page-weather.js b/js/templates/template-page-weather.js index f6a66fbd..26fd829f 100644 --- a/js/templates/template-page-weather.js +++ b/js/templates/template-page-weather.js @@ -30,7 +30,7 @@ function initHTMLpageWeather () {