This commit is contained in:
TheGiddyLimit
2024-02-04 22:30:57 +00:00
parent 7c341dc1a7
commit d16f838683
100 changed files with 3332 additions and 88 deletions

View File

@@ -152,7 +152,7 @@ class CreatureParser extends BaseParser {
// name of monster
if (meta.ixToConvert === 0) {
// region
const mCr = /^(?<name>.*)\s+(?<cr>CR \d+(?:\/\d+)? .*$)/.exec(meta.curLine);
const mCr = /^(?<name>.*)\s+(?<cr>CR (?:\d+(?:\/\d+)?|[⅛¼½]) .*$)/.exec(meta.curLine);
if (mCr) {
meta.curLine = mCr.groups.name;
meta.toConvert.splice(meta.ixToConvert + 1, 0, mCr.groups.cr);
@@ -1772,6 +1772,10 @@ class CreatureParser extends BaseParser {
if (!line) return;
if (/^[⅛¼½]$/.test(line)) {
line = Parser.numberToCr(Parser.vulgarToNumber(line));
}
if (!/^(\d+\/\d+|\d+)$/.test(line)) {
cbWarning(`${stats.name ? `(${stats.name}) ` : ""}CR requires manual conversion "${line}"`);
return;

View File

@@ -1359,7 +1359,11 @@ class SpellcastingTraitConvert {
static _parseSpellcasting ({ent, isMarkdown, displayAs, actions, reactions}) {
let hasAnyHeader = false;
const spellcastingEntry = {"name": ent.name, "headerEntries": [this._parseToHit(ent.entries[0])]};
const spellcastingEntry = {
"name": ent.name,
"type": "spellcasting",
"headerEntries": [this._parseToHit(ent.entries[0])],
};
ent.entries.forEach((thisLine, i) => {
thisLine = thisLine.replace(/,\s*\*/g, ",*"); // put asterisks on the correct side of commas
if (i === 0) return;

View File

@@ -2,7 +2,16 @@
class PageFilterEquipment extends PageFilter {
static _MISC_FILTER_ITEMS = [
"Item Group", "Bundle", "SRD", "Basic Rules", "Legacy", "Has Images", "Has Info", "Reprinted",
"Item Group",
"Bundle",
"SRD",
"Basic Rules",
"Legacy",
"Has Images",
"Has Info",
"Reprinted",
"Disadvantage on Stealth",
"Strength Requirement",
];
static _RE_FOUNDRY_ATTR = /(?:[-+*/]\s*)?@[a-z0-9.]+/gi;
@@ -91,6 +100,8 @@ class PageFilterEquipment extends PageFilter {
if (item.hasFluffImages || item.fluff?.images) item._fMisc.push("Has Images");
if (item.miscTags) item._fMisc.push(...item.miscTags.map(Parser.itemMiscTagToFull));
if (this._isReprinted({reprintedAs: item.reprintedAs, tag: "item", prop: "item", page: UrlUtil.PG_ITEMS})) item._fMisc.push("Reprinted");
if (item.stealth) item._fMisc.push("Disadvantage on Stealth");
if (item.strength != null) item._fMisc.push("Strength Requirement");
if (item.focus || item.name === "Thieves' Tools" || item.type === "INS" || item.type === "SCF" || item.type === "AT") {
item._fFocus = item.focus ? item.focus === true ? [...Parser.ITEM_SPELLCASTING_FOCUS_CLASSES] : [...item.focus] : [];

View File

@@ -349,10 +349,14 @@ globalThis.Renderer = function () {
if (entry == null) return; // Avoid dying on nully entries
if (!textStack) throw new Error("Missing stack!");
if (!meta) throw new Error("Missing metadata!");
if (entry.type === "section") meta.depth = -1;
options = options || {};
// For wrapped entries, simply recurse
if (entry.type === "wrapper") return this._recursiveRender(entry.wrapped, textStack, meta, options);
if (entry.type === "section") meta.depth = -1;
meta._didRenderPrefix = false;
meta._didRenderSuffix = false;
@@ -360,9 +364,6 @@ globalThis.Renderer = function () {
// the root entry (e.g. "Rage" in barbarian "classFeatures") is assumed to be of type "entries"
const type = entry.type == null || entry.type === "section" ? "entries" : entry.type;
// For wrapped entries, simply recurse
if (type === "wrapper") return this._recursiveRender(entry.wrapped, textStack, meta, options);
meta._typeStack.push(type);
switch (type) {
@@ -784,7 +785,7 @@ globalThis.Renderer = function () {
? this._getPagePart(entry)
: "";
const partExpandCollapse = !this._isPartPageExpandCollapseDisabled && !isInlineTitle
? `<span class="rd__h-toggle ml-2 clickable no-select" data-rd-h-toggle-button="true" title="Toggle Visibility (CTRL to Toggle All)">[\u2013]</span>`
? this._getPtExpandCollapse()
: "";
const partPageExpandCollapse = !this._isPartPageExpandCollapseDisabled && (pagePart || partExpandCollapse)
? `<span class="ve-flex-vh-center">${[pagePart, partExpandCollapse].filter(Boolean).join("")}</span>`
@@ -905,6 +906,10 @@ globalThis.Renderer = function () {
}
};
this._getPtExpandCollapse = function () {
return `<span class="rd__h-toggle ml-2 clickable no-select" data-rd-h-toggle-button="true" title="Toggle Visibility (CTRL to Toggle All)">[\u2013]</span>`;
};
this._getPtExpandCollapseSpecial = function () {
return `<span class="rd__h-toggle ml-2 clickable no-select" data-rd-h-special-toggle-button="true" title="Toggle Visibility (CTRL to Toggle All)">[\u2013]</span>`;
};
@@ -917,7 +922,7 @@ globalThis.Renderer = function () {
this._handleTrackDepth(entry, 1);
const pagePart = this._getPagePart(entry, true);
const partExpandCollapse = this._getPtExpandCollapseSpecial();
const partExpandCollapse = !this._isPartPageExpandCollapseDisabled ? this._getPtExpandCollapseSpecial() : "";
const partPageExpandCollapse = `<span class="ve-flex-vh-center">${[pagePart, partExpandCollapse].filter(Boolean).join("")}</span>`;
if (entry.name != null) {
@@ -950,7 +955,7 @@ globalThis.Renderer = function () {
this._handleTrackDepth(entry, 1);
const pagePart = this._getPagePart(entry, true);
const partExpandCollapse = this._getPtExpandCollapseSpecial();
const partExpandCollapse = !this._isPartPageExpandCollapseDisabled ? this._getPtExpandCollapseSpecial() : "";
const partPageExpandCollapse = `<span class="ve-flex-vh-center">${[pagePart, partExpandCollapse].filter(Boolean).join("")}</span>`;
if (entry.name != null) {
@@ -981,7 +986,7 @@ globalThis.Renderer = function () {
this._handleTrackDepth(entry, 1);
const pagePart = this._getPagePart(entry, true);
const partExpandCollapse = this._getPtExpandCollapseSpecial();
const partExpandCollapse = !this._isPartPageExpandCollapseDisabled ? this._getPtExpandCollapseSpecial() : "";
const partPageExpandCollapse = `<span class="ve-flex-vh-center">${[pagePart, partExpandCollapse].filter(Boolean).join("")}</span>`;
textStack[0] += `<${this.wrapperTag} class="rd__b-special rd__b-inset" ${dataString}>`;

View File

@@ -1998,7 +1998,7 @@ class DataLoader {
static _isPossibleSource ({parent, sourceClean}) { return parent._isPrereleaseSource({sourceClean}) && !Parser.SOURCE_JSON_TO_FULL[Parser.sourceJsonToJson(sourceClean)]; }
static _getBrewUtil () { return typeof PrereleaseUtil !== "undefined" ? PrereleaseUtil : null; }
static _pGetSourceIndex () { return DataUtil.prerelease.pLoadSourceIndex(PrereleaseUtil.pGetCustomUrl()); }
static async _pGetSourceIndex () { return DataUtil.prerelease.pLoadSourceIndex(await PrereleaseUtil.pGetCustomUrl()); }
};
static _BrewPreloader = class extends this._PrereleaseBrewPreloader {
@@ -2009,7 +2009,7 @@ class DataLoader {
static _isPossibleSource ({parent, sourceClean}) { return !parent._isSiteSource({sourceClean}) && !parent._isPrereleaseSource({sourceClean}); }
static _getBrewUtil () { return typeof BrewUtil2 !== "undefined" ? BrewUtil2 : null; }
static _pGetSourceIndex () { return DataUtil.brew.pLoadSourceIndex(BrewUtil2.pGetCustomUrl()); }
static async _pGetSourceIndex () { return DataUtil.brew.pLoadSourceIndex(await BrewUtil2.pGetCustomUrl()); }
};
static async _pCacheAndGet_getCacheMeta ({pageClean, sourceClean, dataLoader}) {

View File

@@ -1366,6 +1366,7 @@ PropOrder._ITEM = [
"barding",
"bolt",
"bow",
"bulletSling",
"club",
"crossbow",
"dagger",
@@ -1373,6 +1374,7 @@ PropOrder._ITEM = [
"focus",
"hammer",
"mace",
"needleBlowgun",
"net",
"poison",
"polearm",

View File

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