Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
v1.179.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGiddyLimit committed May 2, 2023
1 parent 1e40962 commit d89622a
Show file tree
Hide file tree
Showing 13 changed files with 416 additions and 151 deletions.
1 change: 1 addition & 0 deletions data/bestiary/bestiary-kftgv.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@
"performance": "+7"
},
"reaction": null,
"actionTags": [],
"hasToken": true
},
{
Expand Down
7 changes: 6 additions & 1 deletion data/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,11 @@
{
"ver": "1.179.1",
"date": "2023-04-20",
"txt": "- Added \"As Names\"/\"As Abbreviations\"/\"As Names Plus Abbreviation\" customization option to Source filters\n- Searching for a source abbreviation (e.g. \"DMG\") in filters now shows sources matching that abbreviation \n- Fixed labelled slider filters failing to display matching labels in \"dropdown\" mode\n- (Fixed typos/added tags)\n"
"txt": "- Added \"As Names\"/\"As Abbreviations\"/\"As Names Plus Abbreviation\" customization option to Source filters\n- Searching for a source abbreviation (e.g. \"DMG\") in filters now shows sources matching that abbreviation \n- Fixed labelled slider filters failing to display matching labels in \"dropdown\" mode\n- (Fixed typos/added tags)"
},
{
"ver": "1.179.2",
"date": "2023-05-02",
"txt": "- Added \"Export\"/\"Import\" options to Point Buy Statgen \"Custom Rules\" section\n- (Fixed typos/added tags)"
}
]
2 changes: 1 addition & 1 deletion data/fluff-items.json
Original file line number Diff line number Diff line change
Expand Up @@ -2787,7 +2787,7 @@
"type": "image",
"href": {
"type": "internal",
"path": "items/CRCotN/Medal of the Maze.jpg"
"path": "items/CRCotN/Medal of the Maze.webp"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion data/magicvariants.json
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@
"namePrefix": "Mithral +1 ",
"source": "AI",
"page": 156,
"rarity": "unknown (magic)",
"rarity": "rare",
"strength": null,
"bonusAc": "+1",
"stealth": false,
Expand Down
2 changes: 1 addition & 1 deletion data/renderdemo.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{
"type": "list",
"items": [
"Style tags; {@bold some text to be bolded} (alternative {@b shorthand}), {@italic some text to be italicised} (alternative {@i shorthand}), {@underline some text to be underlined} (alternative {@u shorthand}), {@strike some text to strike-through}, (alternative {@s shorthand}), {@color color|e40707}/{@color color variable|--rgb-name} tags, {@code print("hello world")} tags, misc {@style Style|small-caps;small;capitalize;dnd-font} tags",
"Style tags; {@bold some text to be bolded} (alternative {@b shorthand}), {@italic some text to be italicised} (alternative {@i shorthand}), {@underline some text to be underlined} (alternative {@u shorthand}), {@strike some text to strike-through}, (alternative {@s shorthand}), {@color color|e40707}/{@color color variable|--rgb-name} tags, {@highlight highlight} tags, {@code print("hello world")} tags, misc {@style Style|small-caps;small;capitalize;dnd-font} tags",
"Additionally, {@note note tags}, used for adding errata or Twitter \"designer footnotes.\"",
"Dice roller tags; {@dice 1d2-2+2d3+5} for regular dice rolls ({@dice 1d6;2d6} for multiple options; {@dice 1d6 + #$prompt_number:min=1,title=Enter a Number!,default=123$#} for input prompts), with extended {@dice 1d20+2|display text} and {@dice 1d20+2|display text|rolled by name}, and a special 'hit' version which assumes a d20 is to be rolled {@hit +7} (and rolls advantage on shift-click, disadvantage on alt-click). There's also {@damage 1d12+3} which will roll critical hits on shift-click and half damage (rounding down) on alt-click, and {@d20 -4} which will also roll advantage/disadvantage, although @hit tags are preferred where appropriate. Spells can have scaling-dice tags, (damage of 2d6 or 3d6 at level 1, add an extra {@scaledice 2d6;3d6|2-9|1d6} for each level beyond 2nd), for when a spell effect scales at higher levels. {@ability str 20}, {@savingThrow str 5}, and {@skillCheck animal_handling 5} are used as internal shorthand, but may be useful elsewhere.",
"Auto dice tags; as above, but a result is automatically rolled upon rendering: {@autodice 2d10+2}.",
Expand Down
19 changes: 19 additions & 0 deletions js/filter-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class PageFilterEquipment extends PageFilter {
return this._getSortableDamageTerm(a.item) - this._getSortableDamageTerm(b.item);
}

static _getMasteryDisplay (mastery) {
const {name, source} = DataUtil.proxy.unpackUid("itemMastery", mastery, "itemMastery");
if (SourceUtil.isSiteSource(source)) return name.toTitleCase();
return `${name.toTitleCase()} (${Parser.sourceJsonToAbv(source)})`;
}

constructor ({filterOpts = null} = {}) {
super();

Expand Down Expand Up @@ -59,6 +65,7 @@ class PageFilterEquipment extends PageFilter {
this._damageDiceFilter = new Filter({header: "Weapon Damage Dice", items: ["1", "1d4", "1d6", "1d8", "1d10", "1d12", "2d6"], itemSortFn: (a, b) => PageFilterEquipment._sortDamageDice(a, b)});
this._miscFilter = new Filter({header: "Miscellaneous", items: ["Item Group", "Bundle", "SRD", "Basic Rules", "Has Images", "Has Info"], isMiscFilter: true});
this._poisonTypeFilter = new Filter({header: "Poison Type", items: ["ingested", "injury", "inhaled", "contact"], displayFn: StrUtil.toTitleCase});
this._masteryFilter = new Filter({header: "Mastery", displayFn: this.constructor._getMasteryDisplay.bind(this)});
}

static mutateForFilters (item) {
Expand Down Expand Up @@ -104,6 +111,13 @@ class PageFilterEquipment extends PageFilter {
item._fDamageDice = [];
if (item.dmg1) item._fDamageDice.push(item.dmg1);
if (item.dmg2) item._fDamageDice.push(item.dmg2);

item._fMastery = item.mastery
? item.mastery.map(it => {
const {name, source} = DataUtil.proxy.unpackUid("itemMastery", it, "itemMastery", {isLower: true});
return [name, source].join("|");
})
: null;
}

addToFilters (item, isExcluded) {
Expand All @@ -116,6 +130,7 @@ class PageFilterEquipment extends PageFilter {
this._damageDiceFilter.addItem(item._fDamageDice);
this._poisonTypeFilter.addItem(item.poisonTypes);
this._miscFilter.addItem(item._fMisc);
this._masteryFilter.addItem(item._fMastery);
}

async _pPopulateBoxOptions (opts) {
Expand All @@ -131,6 +146,7 @@ class PageFilterEquipment extends PageFilter {
this._damageDiceFilter,
this._miscFilter,
this._poisonTypeFilter,
this._masteryFilter,
];
}

Expand All @@ -148,6 +164,7 @@ class PageFilterEquipment extends PageFilter {
it._fDamageDice,
it._fMisc,
it.poisonTypes,
it._fMastery,
);
}
}
Expand Down Expand Up @@ -355,6 +372,7 @@ class PageFilterItems extends PageFilterEquipment {
this._miscFilter,
this._rechargeTypeFilter,
this._poisonTypeFilter,
this._masteryFilter,
this._lootTableFilter,
this._baseItemFilter,
this._baseSourceFilter,
Expand Down Expand Up @@ -382,6 +400,7 @@ class PageFilterItems extends PageFilterEquipment {
it._fMisc,
it.recharge,
it.poisonTypes,
it._fMastery,
it.lootTables,
it._fBaseItemAll,
it._baseSource,
Expand Down
11 changes: 7 additions & 4 deletions js/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ class FilterBox extends ProxyBase {
${$wrpBtnCombineFilters}
</div>
<div class="ve-flex-v-center mobile__m-1">
<div class="btn-group mr-2">
<div class="btn-group mr-2 ve-flex-h-center">
${$btnShowAllFilters}
${$btnHideAllFilters}
</div>
Expand Down Expand Up @@ -2998,9 +2998,12 @@ class SourceFilter extends Filter {
}

static getCompleteFilterSources (ent) {
return ent.otherSources
? [ent.source].concat(ent.otherSources.map(src => new SourceFilterItem({item: src.source, isIgnoreRed: true, isOtherSource: true})))
: ent.source;
if (!ent.otherSources) return ent.source;

const otherSourcesFilt = ent.otherSources.filter(src => !ExcludeUtil.isExcluded("*", "*", src.source, {isNoCount: true}));
if (!otherSourcesFilt.length) return ent.source;

return [ent.source].concat(otherSourcesFilt.map(src => new SourceFilterItem({item: src.source, isIgnoreRed: true, isOtherSource: true})));
}

_doRenderPills_doRenderWrpGroup_getHrDivider (group) {
Expand Down
Loading

0 comments on commit d89622a

Please sign in to comment.