Skip to content

Commit

Permalink
v0.1.6
Browse files Browse the repository at this point in the history
- Hotfix
  • Loading branch information
Pf2eTools committed Feb 13, 2022
1 parent 58d2b01 commit 48acebb
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 47 deletions.
4 changes: 3 additions & 1 deletion ancestries.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ <h1 class="page__title">Ancestries</h1>
</div>
<div class="col-ml-9" id="ancestrystats-wrp">
<div class="wrp-stats-table mb-4">
<div class="stats pf2-book pf2-book--large" id="ancestrystats"></div>
<div class="stats pf2-book pf2-book--large" id="ancestrystats">
<div class="initial-message">Loading...</div>
</div>
</div>
</div>
<div class="col-ml-9 feat-view hidden">
Expand Down
4 changes: 2 additions & 2 deletions archetypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1 class="page__title">Archetypes</h1>
</nav>

<div class="view-col-group h-100 mh-0">
<div class="container view-col-wrapper feat-view--active">
<div class="container view-col-wrapper feat-view--inactive">
<div class="view-col" id="listcontainer" style="flex: 6;">
<div class="lst__form-top" id="filter-search-group">
<div class="w-100 relative">
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1 class="page__title">Archetypes</h1>
<div class="feat-view--resizable">
<div class="wrp-stats-table">
<div id="pagecontent" class="stats pf2-stat">
<div class="initial-message">Select an entry from the list to view it here</div>
<div class="initial-message">Loading...</div>
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ <h1 class="page__title">Classes</h1>
</div>
<div class="col-ml-9" id="classesstats-wrp">
<div class="mb-2 wrp-stats-table">
<div class="stats pf2-book pf2-book--large" id="classesstats"></div>
<div class="stats pf2-book pf2-book--large" id="classesstats">
<div class="initial-message">Loading...</div>
</div>
</div>
</div>
<div class="col-ml-9 feat-view hidden">
Expand Down
1 change: 0 additions & 1 deletion data/book/book-gmg.json
Original file line number Diff line number Diff line change
Expand Up @@ -17805,7 +17805,6 @@
"class": false,
"general": true,
"ancestry": false,
"skill": true,
"archetype": false
},
"traits": [
Expand Down
1 change: 0 additions & 1 deletion data/feats/feats-apg.json
Original file line number Diff line number Diff line change
Expand Up @@ -11209,7 +11209,6 @@
"page": 208,
"level": 2,
"featType": {
"skill": true
},
"traits": [
"General",
Expand Down
1 change: 0 additions & 1 deletion data/feats/feats-logm.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
"page": 105,
"level": 2,
"featType": {
"skill": true
},
"traits": [
"General",
Expand Down
1 change: 0 additions & 1 deletion data/feats/feats-lopsg.json
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@
},
"level": 4,
"featType": {
"skill": true
},
"traits": [
"Uncommon",
Expand Down
1 change: 0 additions & 1 deletion data/variantrules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,6 @@
"class": false,
"general": true,
"ancestry": false,
"skill": true,
"archetype": false
},
"traits": [
Expand Down
2 changes: 1 addition & 1 deletion feats.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h1 class="page__title">Feats</h1>

<div class="wrp-stats-table">
<div id="pagecontent" class="stats pf2-stat">
<div class="initial-message">Select a feat from the list to view it here</div>
<div class="initial-message">Loading...</div>
</div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion js/archetypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class ArchetypesPage extends BaseComponent {

_addFeatsData (feats) {
if (!(feats.feat && feats.feat.length)) return false;
const arcFeats = feats.feat.filter(f => !!f.featType.archetype)
const arcFeats = feats.feat.filter(f => f.featType && f.featType.archetype)
arcFeats.forEach(f => {
const isExcluded = ExcludeUtil.isExcluded(UrlUtil.URL_TO_HASH_BUILDER[UrlUtil.PG_FEATS](f), "feat", f.source);
this._featFilter.mutateAndAddToFilters(f, isExcluded)
Expand Down Expand Up @@ -251,6 +251,8 @@ class ArchetypesPage extends BaseComponent {
const [lvl, name, source] = ft.split("|");
const hash = UrlUtil.encodeForHash([name, source]);
const mutateExtraFeat = (feat) => {
// FIXME:
feat.featType = feat.featType || {};
feat.featType.archetype = typeof feat.featType.archetype === "object" ? feat.featType.archetype : [];
feat.featType.archetype.push(arc.name);
feat._fType = ["Archetype"];
Expand Down
8 changes: 7 additions & 1 deletion js/filter-feats.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class PageFilterFeats extends PageFilter {
}

mutateForFilters (feat) {
if (feat.featType == null) feat.featType = {};
feat._fSources = SourceFilter.getCompleteFilterSources(feat);
feat._slPrereq = Renderer.stripTags(feat.prerequisites || `\u2014`).uppercaseFirst();
feat._fTraits = feat.traits.map(t => Parser.getTraitName(t));
if (!feat._fTraits.map(t => Renderer.trait.isTraitInCategory(t, "Rarity")).some(Boolean)) feat._fTraits.push("Common");
if (feat.featType == null) feat.featType = {};

feat._fType = [];
if (Renderer.trait.filterTraitsByCats(feat._fTraits, ["Ancestry & Heritage"]).length) feat._fType.push("Ancestry");
Expand All @@ -62,6 +62,12 @@ class PageFilterFeats extends PageFilter {
if (feat.special != null) feat._fMisc.push("Has Special");
if (feat.leadsTo && feat.leadsTo.length) feat._fMisc.push("Leads to...");
if (feat.featType.variant === true) feat._fMisc.push("Variant");
// FIXME: Temporary workaround until prerequisites data changes
if (feat.prerequisites) {
const regExpSkills = /{@skill (.*?)[}|]/g;
feat.featType.skill = feat.featType.skill || [];
feat.featType.skill.push(...[...feat.prerequisites.matchAll(regExpSkills)].map(m => m[1]));
}
}

addToFilters (feat, isExcluded) {
Expand Down
33 changes: 1 addition & 32 deletions js/render-dice.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,19 +524,6 @@ Renderer.dice = {
async _pHandleRoll2 (wrpTree, rolledBy, opts) {
opts = {...opts};

if (wrpTree.meta && wrpTree.meta.hasPb) {
const userPb = await InputUiUtil.pGetUserNumber({
min: 0,
int: true,
title: "Enter Proficiency Bonus",
default: 2,
storageKey_default: "dice.playerProficiencyBonus",
isGlobal_default: true,
});
if (userPb == null) return null;
opts.pb = userPb;
}

if (Renderer.dice._isManualMode) return Renderer.dice._pHandleRoll2_manual(wrpTree.tree, rolledBy, opts);
else return Renderer.dice._pHandleRoll2_automatic(wrpTree.tree, rolledBy, opts);
},
Expand All @@ -546,7 +533,6 @@ Renderer.dice = {
* @param rolledBy
* @param [opts] Options object.
* @param [opts.fnGetMessage]
* @param [opts.pb] User-entered proficiency bonus, to be propagated to the meta.
*/
_pHandleRoll2_automatic (tree, rolledBy, opts) {
opts = opts || {};
Expand All @@ -557,7 +543,6 @@ Renderer.dice = {

if (tree) {
const meta = {};
if (opts.pb) meta.pb = opts.pb;
const result = tree.evl(meta);
const fullHtml = (meta.html || []).join("");
const allMax = meta.allMax && meta.allMax.length && !(meta.allMax.filter(it => !it).length);
Expand Down Expand Up @@ -832,7 +817,6 @@ Renderer.dice.lang = {
braceCount: 0,
mode: null,
token: "",
hasPb: false,
};

str = str
Expand All @@ -856,7 +840,7 @@ Renderer.dice.lang = {

this._lex3_lex(self, str);

return {lexed: self.tokenStack, lexedMeta: {hasPb: self.hasPb}};
return {lexed: self.tokenStack, lexedMeta: {}};
},

_lex3_lex (self, l) {
Expand Down Expand Up @@ -931,9 +915,6 @@ Renderer.dice.lang = {
case "*": self.tokenStack.push(Renderer.dice.tk.MULT); break;
case "/": self.tokenStack.push(Renderer.dice.tk.DIV); break;
case "^": self.tokenStack.push(Renderer.dice.tk.POW); break;
case "pb": self.tokenStack.push(Renderer.dice.tk.PB); self.hasPb = true; break;
case "summonspelllevel": self.tokenStack.push(Renderer.dice.tk.SUMMON_SPELL_LEVEL); self.hasSummonSpellLevel = true; break;
case "summonclasslevel": self.tokenStack.push(Renderer.dice.tk.SUMMON_CLASS_LEVEL); self.hasSummonClassLevel = true; break;
case "floor": self.tokenStack.push(Renderer.dice.tk.FLOOR); break;
case "ceil": self.tokenStack.push(Renderer.dice.tk.CEIL); break;
case "round": self.tokenStack.push(Renderer.dice.tk.ROUND); break;
Expand Down Expand Up @@ -1047,12 +1028,6 @@ Renderer.dice.lang = {
}

return new Renderer.dice.parsed.Factor(self.lastAccepted);
} else if (this._parse3_accept(self, Renderer.dice.tk.PB)) {
return new Renderer.dice.parsed.Factor(Renderer.dice.tk.PB);
} else if (this._parse3_accept(self, Renderer.dice.tk.SUMMON_SPELL_LEVEL)) {
return new Renderer.dice.parsed.Factor(Renderer.dice.tk.SUMMON_SPELL_LEVEL);
} else if (this._parse3_accept(self, Renderer.dice.tk.SUMMON_CLASS_LEVEL)) {
return new Renderer.dice.parsed.Factor(Renderer.dice.tk.SUMMON_CLASS_LEVEL);
} else if (
// Single-arg functions
this._parse3_match(self, Renderer.dice.tk.FLOOR)
Expand Down Expand Up @@ -1299,7 +1274,6 @@ Renderer.dice.tk.SUB = Renderer.dice.tk._new("SUB", "-");
Renderer.dice.tk.MULT = Renderer.dice.tk._new("MULT", "*");
Renderer.dice.tk.DIV = Renderer.dice.tk._new("DIV", "/");
Renderer.dice.tk.POW = Renderer.dice.tk._new("POW", "^");
Renderer.dice.tk.PB = Renderer.dice.tk._new("PB", "pb");
Renderer.dice.tk.FLOOR = Renderer.dice.tk._new("FLOOR", "floor");
Renderer.dice.tk.CEIL = Renderer.dice.tk._new("CEIL", "ceil");
Renderer.dice.tk.ROUND = Renderer.dice.tk._new("ROUND", "round");
Expand Down Expand Up @@ -1715,10 +1689,6 @@ Renderer.dice.parsed = {
if (this._hasParens) this.addToMeta(meta, ")");
return out;
}
case Renderer.dice.tk.PB.type: {
this.addToMeta(meta, this.toString(meta));
return meta.pb == null ? 0 : meta.pb;
}
default: throw new Error(`Unimplemented!`);
}
}
Expand All @@ -1728,7 +1698,6 @@ Renderer.dice.parsed = {
switch (this._node.type) {
case Renderer.dice.tk.TYP_NUMBER: out = this._node.value; break;
case Renderer.dice.tk.TYP_SYMBOL: out = this._node.toString(); break;
case Renderer.dice.tk.PB.type: out = this.meta ? (this.meta.pb || 0) : "PB"; break;
default: throw new Error(`Unimplemented!`);
}
return this._hasParens ? `(${out})` : out;
Expand Down
2 changes: 1 addition & 1 deletion js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (typeof module !== "undefined") require("./parser.js");

// in deployment, `IS_DEPLOYED = "<version number>";` should be set below.
IS_DEPLOYED = undefined;
VERSION_NUMBER = /* PF2ETOOLS_VERSION__OPEN */"0.1.5"/* PF2ETOOLS_VERSION__CLOSE */;
VERSION_NUMBER = /* PF2ETOOLS_VERSION__OPEN */"0.1.6"/* PF2ETOOLS_VERSION__CLOSE */;
DEPLOYED_STATIC_ROOT = ""; // ""; // FIXME re-enable this when we have a CDN again
IS_VTT = false;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pf2etools",
"author": "Pf2eTools",
"version": "0.1.5",
"version": "0.1.6",
"license": "MIT",
"description": "A site dedicated to making playing games with your friends as easy as possible.",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// importScripts("./js/sw-files.js");

const cacheName = /* PF2ETOOLS_VERSION__OPEN */"0.1.5"/* PF2ETOOLS_VERSION__CLOSE */;
const cacheName = /* PF2ETOOLS_VERSION__OPEN */"0.1.6"/* PF2ETOOLS_VERSION__CLOSE */;
// const cacheableFilenames = new Set(filesToCache);

let isCacheRunning;
Expand Down

0 comments on commit 48acebb

Please sign in to comment.