Skip to content

Commit 1365d10

Browse files
committed
v1.181.5
1 parent e11c31b commit 1365d10

11 files changed

+53
-30
lines changed

data/adventure/adventure-idrotf.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -15740,7 +15740,7 @@
1574015740
"type": "image",
1574115741
"href": {
1574215742
"type": "internal",
15743-
"path": "adventure/IDRotF/064-01-031.gang-the-verbeeg.png"
15743+
"path": "adventure/IDRotF/064-01-031.gahg-the-verbeeg.png"
1574415744
},
1574515745
"title": "Gahg the verbeeg has a basket of goodies for her beloved Duhg",
1574615746
"width": 1700,
@@ -23630,7 +23630,7 @@
2363023630
"type": "image",
2363123631
"href": {
2363223632
"type": "internal",
23633-
"path": "adventure/IDRotF/093-02-004.reindeer-hero.png"
23633+
"path": "adventure/IDRotF/093-02-004.reindeer-herd.png"
2363423634
},
2363523635
"title": "{@creature Reindeer|IDRotF} Herd",
2363623636
"width": 1700,
@@ -57141,7 +57141,6 @@
5714157141
}
5714257142
]
5714357143
}
57144-
5714557144
]
5714657145
},
5714757146
{

data/bestiary/fluff-bestiary-mm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9272,7 +9272,7 @@
92729272
{
92739273
"type": "quote",
92749274
"entries": [
9275-
"They invent their own gods ... the very definition of insanity."
9275+
"They invent their own gods... the very definition of insanity."
92769276
],
92779277
"by": "Sabal Mizzrym of Menzoberranzan"
92789278
}

data/changelog.json

+5
Original file line numberDiff line numberDiff line change
@@ -2441,5 +2441,10 @@
24412441
"ver": "1.181.4",
24422442
"date": "2023-06-14",
24432443
"txt": "- Added \"Equipment\" filter to Bestiary page\n- Overhauled Monster Manual fluff, reformatting and adding various missing chunks of text (notably quotes) (thanks @ Spappz)\n- Added \"Spell Level\" column to Classes page class table when in Spell Points mode\n- Fixed Classes page failing to correctly apply \"reprinted\" color styling in some cases\n- Added \"reprinted\" coloring support to Classes page outline view\n- Fixed DM Screen Initiative Tracker \"Spell DC\" additional column failing to auto-populate\n- (Brew) Added support for `\"_copy\"` on `\"baseitem\"`s\n- (Brew) Added support for `\"_copy\"` within `\"statblockInline\"`-type entries\n- (Brew) Fixed rare case where Creature Builder could output invalid creature types\n- (Fixed typos/added tags)"
2444+
},
2445+
{
2446+
"ver": "1.181.5",
2447+
"date": "2023-06-15",
2448+
"txt": "- Fixed DM Screen Clock/Calendar failing to load \n- (Brew) Fixed self-source-referencing `\"_copy\"`s within `\"statblockInline\"`-type entries failing to load\n- (Fixed typos/added tags)"
24442449
}
24452450
]

js/dmscreen-timetracker.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
"use strict";
22

3+
const _TIME_TRACKER_MOON_SPRITE = new Image();
4+
const TIME_TRACKER_MOON_SPRITE_LOADER = new Promise(resolve => {
5+
_TIME_TRACKER_MOON_SPRITE.onload = resolve;
6+
_TIME_TRACKER_MOON_SPRITE.onerror = () => {
7+
_TIME_TRACKER_MOON_SPRITE.hasError = true;
8+
resolve();
9+
};
10+
});
11+
_TIME_TRACKER_MOON_SPRITE.src = "img/dmscreen/moon.png";
12+
313
class TimeTracker {
414
static $getTracker (board, state) {
515
const $wrpPanel = $(`<div class="w-100 h-100 dm-time__root dm__panel-bg dm__data-anchor"/>`) // root class used to identify for saving
@@ -421,9 +431,9 @@ class TimeTrackerBase extends TimeTrackerComponent {
421431
const ctx = c.getContext("2d");
422432

423433
// draw image
424-
if (!TIME_TRACKER_MOON_SPRITE.hasError) {
434+
if (!_TIME_TRACKER_MOON_SPRITE.hasError) {
425435
ctx.drawImage(
426-
TIME_TRACKER_MOON_SPRITE,
436+
_TIME_TRACKER_MOON_SPRITE,
427437
moonInfo.phaseIndex * TimeTrackerBase._MOON_RENDER_RES, // source x
428438
0, // source y
429439
TimeTrackerBase._MOON_RENDER_RES, // source w

js/dmscreen.js

-10
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ const PANEL_TYP_GENERIC_EMBED = 90;
3737
const PANEL_TYP_ERROR = 98;
3838
const PANEL_TYP_BLANK = 99;
3939

40-
const TIME_TRACKER_MOON_SPRITE = new Image();
41-
const TIME_TRACKER_MOON_SPRITE_LOADER = new Promise(resolve => {
42-
TIME_TRACKER_MOON_SPRITE.onload = resolve;
43-
TIME_TRACKER_MOON_SPRITE.onerror = () => {
44-
TIME_TRACKER_MOON_SPRITE.hasError = true;
45-
resolve();
46-
};
47-
});
48-
TIME_TRACKER_MOON_SPRITE.src = "img/dmscreen/moon.png";
49-
5040
class Board {
5141
constructor () {
5242
this.panels = {};

js/utils-brew.js

+7
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,13 @@ class _BrewUtil2Base {
441441

442442
/* -------------------------------------------- */
443443

444+
async pGetBrewBySource (source, {lockToken} = {}) {
445+
const brews = await this.pGetBrew({lockToken});
446+
return brews.find(brew => brew?.body?._meta?.sources?.some(src => src?.json === source));
447+
}
448+
449+
/* -------------------------------------------- */
450+
444451
async _pGetBrew_pGetLocalBrew ({lockToken} = {}) {
445452
if (this._cache_brewsLocal) return this._cache_brewsLocal;
446453
if (IS_VTT || IS_DEPLOYED || typeof window === "undefined") return this._cache_brewsLocal = [];

js/utils.js

+23-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// in deployment, `IS_DEPLOYED = "<version number>";` should be set below.
44
globalThis.IS_DEPLOYED = undefined;
5-
globalThis.VERSION_NUMBER = /* 5ETOOLS_VERSION__OPEN */"1.181.4"/* 5ETOOLS_VERSION__CLOSE */;
5+
globalThis.VERSION_NUMBER = /* 5ETOOLS_VERSION__OPEN */"1.181.5"/* 5ETOOLS_VERSION__CLOSE */;
66
globalThis.DEPLOYED_STATIC_ROOT = ""; // "https://static.5etools.com/"; // FIXME re-enable this when we have a CDN again
77
globalThis.DEPLOYED_IMG_ROOT = undefined;
88
// for the roll20 script to set
@@ -3655,7 +3655,7 @@ globalThis.DataUtil = {
36553655
const data = await DataUtil[prop].pLoadSingleSource(source);
36563656
if (data) return data;
36573657

3658-
return DataUtil._pLoadByMeta_pGetPrereleaseBrewUrl(source);
3658+
return DataUtil._pLoadByMeta_pGetPrereleaseBrew(source);
36593659
}
36603660
// endregion
36613661

@@ -3668,7 +3668,7 @@ globalThis.DataUtil = {
36683668
const index = await DataUtil.loadJSON(`${baseUrlPart}/${DataUtil._MULTI_SOURCE_PROP_TO_INDEX_NAME[prop]}`);
36693669
if (index[source]) return DataUtil.loadJSON(`${baseUrlPart}/${index[source]}`);
36703670

3671-
return DataUtil._pLoadByMeta_pGetPrereleaseBrewUrl(source);
3671+
return DataUtil._pLoadByMeta_pGetPrereleaseBrew(source);
36723672
}
36733673
// endregion
36743674

@@ -3678,12 +3678,12 @@ globalThis.DataUtil = {
36783678
case "baseitem": {
36793679
const data = await DataUtil.item.loadRawJSON();
36803680
if (data[prop] && data[prop].some(it => it.source === source)) return data;
3681-
return DataUtil._pLoadByMeta_pGetPrereleaseBrewUrl(source);
3681+
return DataUtil._pLoadByMeta_pGetPrereleaseBrew(source);
36823682
}
36833683
case "race": {
36843684
const data = await DataUtil.race.loadJSON({isAddBaseRaces: true});
36853685
if (data[prop] && data[prop].some(it => it.source === source)) return data;
3686-
return DataUtil._pLoadByMeta_pGetPrereleaseBrewUrl(source);
3686+
return DataUtil._pLoadByMeta_pGetPrereleaseBrew(source);
36873687
}
36883688
// endregion
36893689

@@ -3694,7 +3694,7 @@ globalThis.DataUtil = {
36943694
const data = await (impl.loadJSON ? impl.loadJSON() : DataUtil.loadJSON(impl.getDataUrl()));
36953695
if (data[prop] && data[prop].some(it => it.source === source)) return data;
36963696

3697-
return DataUtil._pLoadByMeta_pGetPrereleaseBrewUrl(source);
3697+
return DataUtil._pLoadByMeta_pGetPrereleaseBrew(source);
36983698
}
36993699

37003700
throw new Error(`Could not get loadable URL for \`${JSON.stringify({key: prop, value: source})}\``);
@@ -3703,7 +3703,7 @@ globalThis.DataUtil = {
37033703
}
37043704
},
37053705

3706-
async _pLoadByMeta_pGetPrereleaseBrewUrl (source) {
3706+
async _pLoadByMeta_pGetPrereleaseBrew (source) {
37073707
const fromPrerelease = await DataUtil.pLoadPrereleaseBySource(source);
37083708
if (fromPrerelease) return fromPrerelease;
37093709

@@ -3713,20 +3713,32 @@ globalThis.DataUtil = {
37133713
throw new Error(`Could not find prerelease/brew URL for source "${source}"`);
37143714
},
37153715

3716+
/* -------------------------------------------- */
3717+
37163718
async pLoadPrereleaseBySource (source) {
37173719
if (typeof PrereleaseUtil === "undefined") return null;
3718-
const url = await PrereleaseUtil.pGetSourceUrl(source);
3719-
if (!url) return null;
3720-
return DataUtil.loadJSON(url);
3720+
return this._pLoadPrereleaseBrewBySource({source, brewUtil: PrereleaseUtil});
37213721
},
37223722

37233723
async pLoadBrewBySource (source) {
37243724
if (typeof BrewUtil2 === "undefined") return null;
3725-
const url = await BrewUtil2.pGetSourceUrl(source);
3725+
return this._pLoadPrereleaseBrewBySource({source, brewUtil: BrewUtil2});
3726+
},
3727+
3728+
async _pLoadPrereleaseBrewBySource ({source, brewUtil}) {
3729+
// Load from existing first
3730+
const fromExisting = await brewUtil.pGetBrewBySource(source);
3731+
if (fromExisting) return MiscUtil.copyFast(fromExisting.body);
3732+
3733+
// Load from remote
3734+
const url = await brewUtil.pGetSourceUrl(source);
37263735
if (!url) return null;
3736+
37273737
return DataUtil.loadJSON(url);
37283738
},
37293739

3740+
/* -------------------------------------------- */
3741+
37303742
// region Dbg
37313743
dbg: {
37323744
isTrackCopied: false,

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "5etools",
33
"author": "TheGiddyLimit",
4-
"version": "1.181.4",
4+
"version": "1.181.5",
55
"license": "MIT",
66
"description": "A site dedicated to making playing games with your friends as easy as possible.",
77
"type": "module",

0 commit comments

Comments
 (0)