Skip to content

Commit 1e40962

Browse files
committed
v1.179.1
1 parent a937d58 commit 1e40962

11 files changed

+214
-24
lines changed

css/main.css

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

data/adventure/adventure-idrotf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
"page": 9,
268268
"id": "017",
269269
"entries": [
270-
"{@i For 6th-level characters}",
270+
"{@i For characters of 4th or 5th level}",
271271
"A duergar tyrant is building a chardalyn dragon to destroy Ten-Towns. The characters learn of this plot and try to thwart it."
272272
]
273273
},
@@ -277,7 +277,7 @@
277277
"page": 9,
278278
"id": "018",
279279
"entries": [
280-
"{@i For characters of 4th level and higher}",
280+
"{@i For 6th-level characters}",
281281
"After {@creature Xardorok Sunblight|IDRotF} unleashes his dragon, the characters must stop it before it destroys Ten-Towns."
282282
]
283283
},

data/bestiary/bestiary-ftd.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@
35543554
{
35553555
"name": "Amphibious",
35563556
"entries": [
3557-
"The dragon turtle can breathe air and water"
3557+
"The dragon turtle can breathe air and water."
35583558
]
35593559
},
35603560
{

data/changelog.json

+5
Original file line numberDiff line numberDiff line change
@@ -2399,5 +2399,10 @@
23992399
"date": "2023-04-17",
24002400
"title": "I Merely Borrow",
24012401
"txt": "- Added Honor Among Thieves Legendary Magic Items\n- Added item count to pinned lists\n- Added CTRL+click to hover window \"x\" button, which closes all hover windows\n- Added \"Clear\" button to \"homebrew\" section of Source filters\n- Fixed rare bug where hover windows could resize themselves\n- (Brew) When using the \"Add Predefined Action\" Button in the Creature Homebrew Builder, finesse weapons will now auto-calculate their to-hit and damage based on either the creature's STR or DEX (whichever is highest)\n- (Brew) Added `\"pbNote\"` input to Creature Homebrew Builder\n- (Brew) Added support for `\"start\"` on `\"list\"` entries\n- (Brew) Added source color picker to \"Add/Edit Homebrew Source\" screen\n- (Brew) Fixed Creature Text Converter handling of swarm creature types/sizes\n- (Fixed typos/added tags)"
2402+
},
2403+
{
2404+
"ver": "1.179.1",
2405+
"date": "2023-04-20",
2406+
"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"
24022407
}
24032408
]

data/feats.json

+27-3
Original file line numberDiff line numberDiff line change
@@ -4633,6 +4633,13 @@
46334633
"cha"
46344634
]
46354635
},
4636+
"known": {
4637+
"_": [
4638+
{
4639+
"choose": "level=0|class=Wizard"
4640+
}
4641+
]
4642+
},
46364643
"innate": {
46374644
"_": {
46384645
"daily": {
@@ -4644,7 +4651,8 @@
46444651
"false life",
46454652
"hex",
46464653
"ray of sickness"
4647-
]
4654+
],
4655+
"count": 2
46484656
}
46494657
}
46504658
]
@@ -4661,6 +4669,13 @@
46614669
"cha"
46624670
]
46634671
},
4672+
"known": {
4673+
"_": [
4674+
{
4675+
"choose": "level=0|class=Wizard"
4676+
}
4677+
]
4678+
},
46644679
"innate": {
46654680
"_": {
46664681
"daily": {
@@ -4672,7 +4687,8 @@
46724687
"disguise self",
46734688
"feather fall",
46744689
"longstrider"
4675-
]
4690+
],
4691+
"count": 2
46764692
}
46774693
}
46784694
]
@@ -4689,6 +4705,13 @@
46894705
"cha"
46904706
]
46914707
},
4708+
"known": {
4709+
"_": [
4710+
{
4711+
"choose": "level=0|class=Wizard"
4712+
}
4713+
]
4714+
},
46924715
"innate": {
46934716
"_": {
46944717
"daily": {
@@ -4700,7 +4723,8 @@
47004723
"detect evil and good",
47014724
"protection from evil and good",
47024725
"shield"
4703-
]
4726+
],
4727+
"count": 2
47044728
}
47054729
}
47064730
]

data/generated/gendata-spell-source-lookup.json

+1-1
Large diffs are not rendered by default.

js/filter.js

+82-12
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,12 @@ class Filter extends FilterBase {
17171717
return this._displayFn ? this._displayFn(item.item, item) : item.item;
17181718
}
17191719

1720+
_getDisplayTextMini (item) {
1721+
return this._displayFnMini
1722+
? this._displayFnMini(item.item, item)
1723+
: this._getDisplayText(item);
1724+
}
1725+
17201726
_getPill (item) {
17211727
const displayText = this._getDisplayText(item);
17221728

@@ -1728,12 +1734,7 @@ class Filter extends FilterBase {
17281734
contextmenu: evt => this._getPill_handleContextmenu({evt, item}),
17291735
});
17301736

1731-
const hook = () => {
1732-
const val = FilterBox._PILL_STATES[this._state[item.item]];
1733-
btnPill.attr("state", val);
1734-
};
1735-
this._addHook("state", item.item, hook);
1736-
hook();
1737+
this._getPill_bindHookState({btnPill, item});
17371738

17381739
item.searchText = displayText.toLowerCase();
17391740

@@ -1758,6 +1759,13 @@ class Filter extends FilterBase {
17581759
if (--this._state[item.item] < 0) this._state[item.item] = 2;
17591760
}
17601761

1762+
_getPill_bindHookState ({btnPill, item}) {
1763+
this._addHook("state", item.item, () => {
1764+
const val = FilterBox._PILL_STATES[this._state[item.item]];
1765+
btnPill.attr("state", val);
1766+
})();
1767+
}
1768+
17611769
setTempFnSel (tempFnSel) {
17621770
this._selFnCache = this._selFnCache || this._selFn;
17631771
if (tempFnSel) this._selFn = tempFnSel;
@@ -1775,7 +1783,7 @@ class Filter extends FilterBase {
17751783
}
17761784

17771785
_getBtnMini (item) {
1778-
const toDisplay = this._displayFnMini ? this._displayFnMini(item.item, item) : this._displayFn ? this._displayFn(item.item, item) : item.item;
1786+
const toDisplay = this._getDisplayTextMini(item);
17791787

17801788
const btnMini = e_({
17811789
tag: "div",
@@ -2394,8 +2402,8 @@ class Filter extends FilterBase {
23942402
getDefaultMeta () {
23952403
// Key order is important, as @filter tags depend on it
23962404
return {
2397-
...Filter._DEFAULT_META,
23982405
...super.getDefaultMeta(),
2406+
...Filter._DEFAULT_META,
23992407
};
24002408
}
24012409

@@ -2853,6 +2861,15 @@ class SourceFilter extends Filter {
28532861
this._addHook("tmpState", "ixAdded", hkIsBrewActive);
28542862
hkIsBrewActive();
28552863

2864+
const actionSelectDisplayMode = new ContextUtil.ActionSelect({
2865+
values: Object.keys(SourceFilter._PILL_DISPLAY_MODE_LABELS).map(Number),
2866+
fnGetDisplayValue: val => SourceFilter._PILL_DISPLAY_MODE_LABELS[val] || SourceFilter._PILL_DISPLAY_MODE_LABELS[0],
2867+
fnOnChange: val => this._meta.pillDisplayMode = val,
2868+
});
2869+
this._addHook("meta", "pillDisplayMode", () => {
2870+
actionSelectDisplayMode.setValue(this._meta.pillDisplayMode);
2871+
})();
2872+
28562873
const menu = ContextUtil.getMenu([
28572874
new ContextUtil.Action(
28582875
"Select All Standard Sources",
@@ -2887,6 +2904,8 @@ class SourceFilter extends Filter {
28872904
"Invert Selection",
28882905
() => this._doInvertPins(),
28892906
),
2907+
null,
2908+
actionSelectDisplayMode,
28902909
]);
28912910
const btnBurger = e_({
28922911
tag: "button",
@@ -3174,6 +3193,51 @@ class SourceFilter extends Filter {
31743193
return entryVal;
31753194
}
31763195

3196+
_getPill (item) {
3197+
const displayText = this._getDisplayText(item);
3198+
const displayTextMini = this._getDisplayTextMini(item);
3199+
3200+
const dispName = e_({
3201+
tag: "span",
3202+
html: displayText,
3203+
});
3204+
3205+
const spc = e_({
3206+
tag: "span",
3207+
clazz: "px-2 fltr-src__spc-pill",
3208+
text: "|",
3209+
});
3210+
3211+
const dispAbbreviation = e_({
3212+
tag: "span",
3213+
html: displayTextMini,
3214+
});
3215+
3216+
const btnPill = e_({
3217+
tag: "div",
3218+
clazz: "fltr__pill",
3219+
children: [
3220+
dispAbbreviation,
3221+
spc,
3222+
dispName,
3223+
],
3224+
click: evt => this._getPill_handleClick({evt, item}),
3225+
contextmenu: evt => this._getPill_handleContextmenu({evt, item}),
3226+
});
3227+
3228+
this._getPill_bindHookState({btnPill, item});
3229+
3230+
this._addHook("meta", "pillDisplayMode", () => {
3231+
dispAbbreviation.toggleVe(this._meta.pillDisplayMode !== 0);
3232+
spc.toggleVe(this._meta.pillDisplayMode === 2);
3233+
dispName.toggleVe(this._meta.pillDisplayMode !== 1);
3234+
})();
3235+
3236+
item.searchText = `${Parser.sourceJsonToAbv(item.item || item).toLowerCase()} -- ${displayText.toLowerCase()}`;
3237+
3238+
return btnPill;
3239+
}
3240+
31773241
getSources () {
31783242
const out = {
31793243
all: [],
@@ -3195,13 +3259,19 @@ class SourceFilter extends Filter {
31953259
getDefaultMeta () {
31963260
// Key order is important, as @filter tags depend on it
31973261
return {
3198-
...SourceFilter._DEFAULT_META,
31993262
...super.getDefaultMeta(),
3263+
...SourceFilter._DEFAULT_META,
32003264
};
32013265
}
32023266
}
32033267
SourceFilter._DEFAULT_META = {
32043268
isIncludeOtherSources: false,
3269+
pillDisplayMode: 0,
3270+
};
3271+
SourceFilter._PILL_DISPLAY_MODE_LABELS = {
3272+
"0": "As Names",
3273+
"1": "As Abbreviations",
3274+
"2": "As Names Plus Abbreviations",
32053275
};
32063276
SourceFilter._SRD_SOURCES = null;
32073277
SourceFilter._BASIC_RULES_SOURCES = null;
@@ -4392,7 +4462,7 @@ class RangeFilter extends FilterBase {
43924462
let tmp = "";
43934463
for (let i = 0, len = this._state.max - this._state.min + 1; i < len; ++i) {
43944464
const val = i + this._state.min;
4395-
const label = this._labels ? `${this._labels[i]}`.qq() : val;
4465+
const label = `${this._getDisplayText(val)}`.qq();
43964466
tmp += `<option value="${val}" ${curVal === val ? "selected" : ""}>${label}</option>`;
43974467
}
43984468
sel.innerHTML = tmp;
@@ -4527,8 +4597,8 @@ class RangeFilter extends FilterBase {
45274597
getDefaultMeta () {
45284598
// Key order is important, as @filter tags depend on it
45294599
const out = {
4530-
...RangeFilter._DEFAULT_META,
45314600
...super.getDefaultMeta(),
4601+
...RangeFilter._DEFAULT_META,
45324602
};
45334603
if (Renderer.hover.isSmallScreen()) out.isUseDropdowns = true;
45344604
return out;
@@ -4832,8 +4902,8 @@ class OptionsFilter extends FilterBase {
48324902
getDefaultMeta () {
48334903
// Key order is important, as @filter tags depend on it
48344904
return {
4835-
...OptionsFilter._DEFAULT_META,
48364905
...super.getDefaultMeta(),
4906+
...OptionsFilter._DEFAULT_META,
48374907
};
48384908
}
48394909

0 commit comments

Comments
 (0)