This commit is contained in:
TheGiddyLimit
2024-05-26 23:02:59 +01:00
parent d2f2daa34e
commit 0cd7a2a6fa
13 changed files with 105 additions and 78 deletions

View File

@@ -42044,7 +42044,7 @@
] ]
}, },
{ {
"area": "780", "area": "81a",
"points": [ "points": [
[ [
1833, 1833,

View File

@@ -2709,5 +2709,10 @@
"title": "Ruinous Power", "title": "Ruinous Power",
"titleAlt": "Adam of Riches", "titleAlt": "Adam of Riches",
"txt": "- Added Vecna: Eve of Ruin content\n- (Brew) Added `\"expectsLightBackground\"`/`\"expectsDarkBackground\"` for `\"image\"`-type entries, allowing a theme-dependent background to be rendered under the image\n- (Brew) Fixed crash when attempting to view subclass with multiple fluff images\n- (Fixed typos/added tags)" "txt": "- Added Vecna: Eve of Ruin content\n- (Brew) Added `\"expectsLightBackground\"`/`\"expectsDarkBackground\"` for `\"image\"`-type entries, allowing a theme-dependent background to be rendered under the image\n- (Brew) Fixed crash when attempting to view subclass with multiple fluff images\n- (Fixed typos/added tags)"
},
{
"ver": "1.207.1",
"date": "2024-05-26",
"txt": "- Fixed Classes page failing to show subclass info when enabling a subclass with the \"Info\" button active#\n- Fixed Search page `lucky` param redirecting to non-existent pages\n- (Brew) Added `\"isNoOutline\"` `\"data\"` flag for entries displayed in the Classes page\n- (Fixed typos/added tags)"
} }
] ]

File diff suppressed because one or more lines are too long

View File

@@ -895,6 +895,8 @@ class ClassesPage extends MixinComponentGlobalState(MixinBaseComponent(MixinProx
const isVisible = this._state[stateKey]; const isVisible = this._state[stateKey];
$(`[data-subclass-id="${stateKey}"]`).toggleVe(!!isVisible); $(`[data-subclass-id="${stateKey}"]`).toggleVe(!!isVisible);
$(`[data-subclass-id-fluff="${stateKey}"]`).toggleVe(!!isVisible && this._state.isShowFluff);
if (!isFirstRun) hkIsShowNamePrefixes(); if (!isFirstRun) hkIsShowNamePrefixes();
}; };
this._addHookBase(stateKey, hkDisplaySubclass); this._addHookBase(stateKey, hkDisplaySubclass);
@@ -1843,6 +1845,11 @@ class ClassesPage extends MixinComponentGlobalState(MixinBaseComponent(MixinProx
.appendTo($wrpBody); .appendTo($wrpBody);
} }
_render_renderOutline_isOutlineRenderable (depthEntry) {
return depthEntry.name
&& !depthEntry.data?.isNoOutline;
}
_render_renderOutline_renderFeature ( _render_renderOutline_renderFeature (
{ {
ixLvl, ixLvl,
@@ -1860,7 +1867,9 @@ class ClassesPage extends MixinComponentGlobalState(MixinBaseComponent(MixinProx
const depthData = MiscUtil.get(this._outlineData.classFeatures, ixLvl, ixFeature); const depthData = MiscUtil.get(this._outlineData.classFeatures, ixLvl, ixFeature);
if (!this._state.isHideFeatures && depthData) { if (!this._state.isHideFeatures && depthData) {
depthData.filter(it => it.name).forEach(it => { depthData
.filter(this._render_renderOutline_isOutlineRenderable.bind(this))
.forEach(it => {
const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses( const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses(
it, it,
{ {
@@ -1888,7 +1897,9 @@ class ClassesPage extends MixinComponentGlobalState(MixinBaseComponent(MixinProx
if (activeScStateKeys.length) { if (activeScStateKeys.length) {
// If we didn't render the intro for gaining a subclass feature, do so now // If we didn't render the intro for gaining a subclass feature, do so now
if (this._state.isHideFeatures && depthData) { if (this._state.isHideFeatures && depthData) {
depthData.filter(it => it.name).forEach(it => { depthData
.filter(this._render_renderOutline_isOutlineRenderable.bind(this))
.forEach(it => {
const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses( const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses(
it, it,
{ {
@@ -1917,7 +1928,9 @@ class ClassesPage extends MixinComponentGlobalState(MixinBaseComponent(MixinProx
scLvlFeatures.forEach((scFeature, ixScFeature) => { scLvlFeatures.forEach((scFeature, ixScFeature) => {
const depthData = MiscUtil.get(this._outlineData, stateKey, scFeature.level, ixScFeature); const depthData = MiscUtil.get(this._outlineData, stateKey, scFeature.level, ixScFeature);
depthData.filter(it => it.name).map(it => { depthData
.filter(this._render_renderOutline_isOutlineRenderable.bind(this))
.map(it => {
const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses( const additionalCssClassesRaw = UtilClassesPage.getColorStyleClasses(
it, it,
{ {

View File

@@ -1113,6 +1113,10 @@ Parser.spRangeTypeToFull = function (range) {
return Parser._parse_aToB(Parser.SP_RANGE_TYPE_TO_FULL, range); return Parser._parse_aToB(Parser.SP_RANGE_TYPE_TO_FULL, range);
}; };
Parser.UNT_LBS = "lbs";
Parser.UNT_TONS_IMPERIAL = "tns";
Parser.UNT_TONS_METRIC = "Mg";
Parser.UNT_FEET = "feet"; Parser.UNT_FEET = "feet";
Parser.UNT_YARDS = "yards"; Parser.UNT_YARDS = "yards";
Parser.UNT_MILES = "miles"; Parser.UNT_MILES = "miles";
@@ -3732,7 +3736,7 @@ Parser.metric = {
case "ft.": case "ft": case Parser.UNT_FEET: out = originalValue * Parser.metric.FEET_TO_METRES; break; case "ft.": case "ft": case Parser.UNT_FEET: out = originalValue * Parser.metric.FEET_TO_METRES; break;
case "yd.": case "yd": case Parser.UNT_YARDS: out = originalValue * Parser.metric.YARDS_TO_METRES; break; case "yd.": case "yd": case Parser.UNT_YARDS: out = originalValue * Parser.metric.YARDS_TO_METRES; break;
case "mi.": case "mi": case Parser.UNT_MILES: out = originalValue * Parser.metric.MILES_TO_KILOMETRES; break; case "mi.": case "mi": case Parser.UNT_MILES: out = originalValue * Parser.metric.MILES_TO_KILOMETRES; break;
case "lb.": case "lb": case "lbs": out = originalValue * Parser.metric.POUNDS_TO_KILOGRAMS; break; case "lb.": case "lb": case Parser.UNT_LBS: out = originalValue * Parser.metric.POUNDS_TO_KILOGRAMS; break;
default: return originalValue; default: return originalValue;
} }
if (toFixed != null) return NumberUtil.toFixedNumber(out, toFixed); if (toFixed != null) return NumberUtil.toFixedNumber(out, toFixed);
@@ -3744,7 +3748,7 @@ Parser.metric = {
case "ft.": case "ft": case Parser.UNT_FEET: return isShortForm ? "m" : `meter`[isPlural ? "toPlural" : "toString"](); case "ft.": case "ft": case Parser.UNT_FEET: return isShortForm ? "m" : `meter`[isPlural ? "toPlural" : "toString"]();
case "yd.": case "yd": case Parser.UNT_YARDS: return isShortForm ? "m" : `meter`[isPlural ? "toPlural" : "toString"](); case "yd.": case "yd": case Parser.UNT_YARDS: return isShortForm ? "m" : `meter`[isPlural ? "toPlural" : "toString"]();
case "mi.": case "mi": case Parser.UNT_MILES: return isShortForm ? "km" : `kilometre`[isPlural ? "toPlural" : "toString"](); case "mi.": case "mi": case Parser.UNT_MILES: return isShortForm ? "km" : `kilometre`[isPlural ? "toPlural" : "toString"]();
case "lb.": case "lb": case "lbs": return isShortForm ? "kg" : `kilogram`[isPlural ? "toPlural" : "toString"](); case "lb.": case "lb": case Parser.UNT_LBS: return isShortForm ? "kg" : `kilogram`[isPlural ? "toPlural" : "toString"]();
default: return originalUnit; default: return originalUnit;
} }
}, },

View File

@@ -182,10 +182,15 @@ class SearchPage {
} }
if (this._PARAM_LUCKY in params) { if (this._PARAM_LUCKY in params) {
const [result] = results; const [href] = results
window.location = `${Renderer.get().baseUrl}${Omnisearch.getResultHref(result.doc)}`; .map(res => Omnisearch.getResultHref(res.doc))
.filter(Boolean);
if (href) {
window.location = `${Renderer.get().baseUrl}${href}`;
return; return;
} }
}
SearchPage._rowMetas = results.map(result => { SearchPage._rowMetas = results.map(result => {
const r = result.doc; const r = result.doc;

View File

@@ -2,7 +2,7 @@
// in deployment, `IS_DEPLOYED = "<version number>";` should be set below. // in deployment, `IS_DEPLOYED = "<version number>";` should be set below.
globalThis.IS_DEPLOYED = undefined; globalThis.IS_DEPLOYED = undefined;
globalThis.VERSION_NUMBER = /* 5ETOOLS_VERSION__OPEN */"1.207.0"/* 5ETOOLS_VERSION__CLOSE */; globalThis.VERSION_NUMBER = /* 5ETOOLS_VERSION__OPEN */"1.207.1"/* 5ETOOLS_VERSION__CLOSE */;
globalThis.DEPLOYED_IMG_ROOT = undefined; globalThis.DEPLOYED_IMG_ROOT = undefined;
// for the roll20 script to set // for the roll20 script to set
globalThis.IS_VTT = false; globalThis.IS_VTT = false;

20
package-lock.json generated
View File

@@ -1,15 +1,15 @@
{ {
"name": "5etools", "name": "5etools",
"version": "1.207.0", "version": "1.207.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "5etools", "name": "5etools",
"version": "1.207.0", "version": "1.207.1",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"5etools-utils": "^0.11.2", "5etools-utils": "^0.12.2",
"ajv": "^8.12.0", "ajv": "^8.12.0",
"ajv-formats": "^2.1.1", "ajv-formats": "^2.1.1",
"commander": "^12.0.0", "commander": "^12.0.0",
@@ -3926,9 +3926,9 @@
"dev": true "dev": true
}, },
"node_modules/5etools-utils": { "node_modules/5etools-utils": {
"version": "0.11.2", "version": "0.12.2",
"resolved": "https://registry.npmjs.org/5etools-utils/-/5etools-utils-0.11.2.tgz", "resolved": "https://registry.npmjs.org/5etools-utils/-/5etools-utils-0.12.2.tgz",
"integrity": "sha512-79x7asL9VBerejHpSzkdS4vjZhHszaUnn12lhv7/bNIuQWyMqyPKIKM7/yVCzp1HG0/w3O2V3Mlkk2SJxYdG0w==", "integrity": "sha512-F/JhtSOuUo3yWvRVj2w/wUyBzVulLzwFbYhXbeAQU1hrGkGw95n0nSfr6QHC3UvBeB4+2WzZPeb5aMTRIbY0Uw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^8.12.0", "ajv": "^8.12.0",
@@ -3939,8 +3939,8 @@
"number-precision": "^1.6.0" "number-precision": "^1.6.0"
}, },
"bin": { "bin": {
"test-file-extensions": "bin/test-file-extensions.js",
"test-file-locations": "bin/test-file-locations.js", "test-file-locations": "bin/test-file-locations.js",
"test-file-names": "bin/test-file-names.js",
"test-json-brew": "bin/test-json-brew.js", "test-json-brew": "bin/test-json-brew.js",
"test-json-ua": "bin/test-json-ua.js" "test-json-ua": "bin/test-json-ua.js"
} }
@@ -14589,9 +14589,9 @@
"dev": true "dev": true
}, },
"5etools-utils": { "5etools-utils": {
"version": "0.11.2", "version": "0.12.2",
"resolved": "https://registry.npmjs.org/5etools-utils/-/5etools-utils-0.11.2.tgz", "resolved": "https://registry.npmjs.org/5etools-utils/-/5etools-utils-0.12.2.tgz",
"integrity": "sha512-79x7asL9VBerejHpSzkdS4vjZhHszaUnn12lhv7/bNIuQWyMqyPKIKM7/yVCzp1HG0/w3O2V3Mlkk2SJxYdG0w==", "integrity": "sha512-F/JhtSOuUo3yWvRVj2w/wUyBzVulLzwFbYhXbeAQU1hrGkGw95n0nSfr6QHC3UvBeB4+2WzZPeb5aMTRIbY0Uw==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^8.12.0", "ajv": "^8.12.0",

View File

@@ -1,7 +1,7 @@
{ {
"name": "5etools", "name": "5etools",
"author": "TheGiddyLimit", "author": "TheGiddyLimit",
"version": "1.207.0", "version": "1.207.1",
"license": "MIT", "license": "MIT",
"description": "A site dedicated to making playing games with your friends as easy as possible.", "description": "A site dedicated to making playing games with your friends as easy as possible.",
"type": "module", "type": "module",
@@ -46,7 +46,7 @@
"url": "git+https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git" "url": "git+https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git"
}, },
"devDependencies": { "devDependencies": {
"5etools-utils": "^0.11.2", "5etools-utils": "^0.12.2",
"ajv": "^8.12.0", "ajv": "^8.12.0",
"ajv-formats": "^2.1.1", "ajv-formats": "^2.1.1",
"commander": "^12.0.0", "commander": "^12.0.0",