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

Commit

Permalink
v1.179.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGiddyLimit committed Apr 20, 2023
1 parent a937d58 commit 1e40962
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 24 deletions.
2 changes: 1 addition & 1 deletion css/main.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions data/adventure/adventure-idrotf.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"page": 9,
"id": "017",
"entries": [
"{@i For 6th-level characters}",
"{@i For characters of 4th or 5th level}",
"A duergar tyrant is building a chardalyn dragon to destroy Ten-Towns. The characters learn of this plot and try to thwart it."
]
},
Expand All @@ -277,7 +277,7 @@
"page": 9,
"id": "018",
"entries": [
"{@i For characters of 4th level and higher}",
"{@i For 6th-level characters}",
"After {@creature Xardorok Sunblight|IDRotF} unleashes his dragon, the characters must stop it before it destroys Ten-Towns."
]
},
Expand Down
2 changes: 1 addition & 1 deletion data/bestiary/bestiary-ftd.json
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,7 @@
{
"name": "Amphibious",
"entries": [
"The dragon turtle can breathe air and water"
"The dragon turtle can breathe air and water."
]
},
{
Expand Down
5 changes: 5 additions & 0 deletions data/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2399,5 +2399,10 @@
"date": "2023-04-17",
"title": "I Merely Borrow",
"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)"
},
{
"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"
}
]
30 changes: 27 additions & 3 deletions data/feats.json
Original file line number Diff line number Diff line change
Expand Up @@ -4633,6 +4633,13 @@
"cha"
]
},
"known": {
"_": [
{
"choose": "level=0|class=Wizard"
}
]
},
"innate": {
"_": {
"daily": {
Expand All @@ -4644,7 +4651,8 @@
"false life",
"hex",
"ray of sickness"
]
],
"count": 2
}
}
]
Expand All @@ -4661,6 +4669,13 @@
"cha"
]
},
"known": {
"_": [
{
"choose": "level=0|class=Wizard"
}
]
},
"innate": {
"_": {
"daily": {
Expand All @@ -4672,7 +4687,8 @@
"disguise self",
"feather fall",
"longstrider"
]
],
"count": 2
}
}
]
Expand All @@ -4689,6 +4705,13 @@
"cha"
]
},
"known": {
"_": [
{
"choose": "level=0|class=Wizard"
}
]
},
"innate": {
"_": {
"daily": {
Expand All @@ -4700,7 +4723,8 @@
"detect evil and good",
"protection from evil and good",
"shield"
]
],
"count": 2
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion data/generated/gendata-spell-source-lookup.json

Large diffs are not rendered by default.

94 changes: 82 additions & 12 deletions js/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,12 @@ class Filter extends FilterBase {
return this._displayFn ? this._displayFn(item.item, item) : item.item;
}

_getDisplayTextMini (item) {
return this._displayFnMini
? this._displayFnMini(item.item, item)
: this._getDisplayText(item);
}

_getPill (item) {
const displayText = this._getDisplayText(item);

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

const hook = () => {
const val = FilterBox._PILL_STATES[this._state[item.item]];
btnPill.attr("state", val);
};
this._addHook("state", item.item, hook);
hook();
this._getPill_bindHookState({btnPill, item});

item.searchText = displayText.toLowerCase();

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

_getPill_bindHookState ({btnPill, item}) {
this._addHook("state", item.item, () => {
const val = FilterBox._PILL_STATES[this._state[item.item]];
btnPill.attr("state", val);
})();
}

setTempFnSel (tempFnSel) {
this._selFnCache = this._selFnCache || this._selFn;
if (tempFnSel) this._selFn = tempFnSel;
Expand All @@ -1775,7 +1783,7 @@ class Filter extends FilterBase {
}

_getBtnMini (item) {
const toDisplay = this._displayFnMini ? this._displayFnMini(item.item, item) : this._displayFn ? this._displayFn(item.item, item) : item.item;
const toDisplay = this._getDisplayTextMini(item);

const btnMini = e_({
tag: "div",
Expand Down Expand Up @@ -2394,8 +2402,8 @@ class Filter extends FilterBase {
getDefaultMeta () {
// Key order is important, as @filter tags depend on it
return {
...Filter._DEFAULT_META,
...super.getDefaultMeta(),
...Filter._DEFAULT_META,
};
}

Expand Down Expand Up @@ -2853,6 +2861,15 @@ class SourceFilter extends Filter {
this._addHook("tmpState", "ixAdded", hkIsBrewActive);
hkIsBrewActive();

const actionSelectDisplayMode = new ContextUtil.ActionSelect({
values: Object.keys(SourceFilter._PILL_DISPLAY_MODE_LABELS).map(Number),
fnGetDisplayValue: val => SourceFilter._PILL_DISPLAY_MODE_LABELS[val] || SourceFilter._PILL_DISPLAY_MODE_LABELS[0],
fnOnChange: val => this._meta.pillDisplayMode = val,
});
this._addHook("meta", "pillDisplayMode", () => {
actionSelectDisplayMode.setValue(this._meta.pillDisplayMode);
})();

const menu = ContextUtil.getMenu([
new ContextUtil.Action(
"Select All Standard Sources",
Expand Down Expand Up @@ -2887,6 +2904,8 @@ class SourceFilter extends Filter {
"Invert Selection",
() => this._doInvertPins(),
),
null,
actionSelectDisplayMode,
]);
const btnBurger = e_({
tag: "button",
Expand Down Expand Up @@ -3174,6 +3193,51 @@ class SourceFilter extends Filter {
return entryVal;
}

_getPill (item) {
const displayText = this._getDisplayText(item);
const displayTextMini = this._getDisplayTextMini(item);

const dispName = e_({
tag: "span",
html: displayText,
});

const spc = e_({
tag: "span",
clazz: "px-2 fltr-src__spc-pill",
text: "|",
});

const dispAbbreviation = e_({
tag: "span",
html: displayTextMini,
});

const btnPill = e_({
tag: "div",
clazz: "fltr__pill",
children: [
dispAbbreviation,
spc,
dispName,
],
click: evt => this._getPill_handleClick({evt, item}),
contextmenu: evt => this._getPill_handleContextmenu({evt, item}),
});

this._getPill_bindHookState({btnPill, item});

this._addHook("meta", "pillDisplayMode", () => {
dispAbbreviation.toggleVe(this._meta.pillDisplayMode !== 0);
spc.toggleVe(this._meta.pillDisplayMode === 2);
dispName.toggleVe(this._meta.pillDisplayMode !== 1);
})();

item.searchText = `${Parser.sourceJsonToAbv(item.item || item).toLowerCase()} -- ${displayText.toLowerCase()}`;

return btnPill;
}

getSources () {
const out = {
all: [],
Expand All @@ -3195,13 +3259,19 @@ class SourceFilter extends Filter {
getDefaultMeta () {
// Key order is important, as @filter tags depend on it
return {
...SourceFilter._DEFAULT_META,
...super.getDefaultMeta(),
...SourceFilter._DEFAULT_META,
};
}
}
SourceFilter._DEFAULT_META = {
isIncludeOtherSources: false,
pillDisplayMode: 0,
};
SourceFilter._PILL_DISPLAY_MODE_LABELS = {
"0": "As Names",
"1": "As Abbreviations",
"2": "As Names Plus Abbreviations",
};
SourceFilter._SRD_SOURCES = null;
SourceFilter._BASIC_RULES_SOURCES = null;
Expand Down Expand Up @@ -4392,7 +4462,7 @@ class RangeFilter extends FilterBase {
let tmp = "";
for (let i = 0, len = this._state.max - this._state.min + 1; i < len; ++i) {
const val = i + this._state.min;
const label = this._labels ? `${this._labels[i]}`.qq() : val;
const label = `${this._getDisplayText(val)}`.qq();
tmp += `<option value="${val}" ${curVal === val ? "selected" : ""}>${label}</option>`;
}
sel.innerHTML = tmp;
Expand Down Expand Up @@ -4527,8 +4597,8 @@ class RangeFilter extends FilterBase {
getDefaultMeta () {
// Key order is important, as @filter tags depend on it
const out = {
...RangeFilter._DEFAULT_META,
...super.getDefaultMeta(),
...RangeFilter._DEFAULT_META,
};
if (Renderer.hover.isSmallScreen()) out.isUseDropdowns = true;
return out;
Expand Down Expand Up @@ -4832,8 +4902,8 @@ class OptionsFilter extends FilterBase {
getDefaultMeta () {
// Key order is important, as @filter tags depend on it
return {
...OptionsFilter._DEFAULT_META,
...super.getDefaultMeta(),
...OptionsFilter._DEFAULT_META,
};
}

Expand Down
Loading

0 comments on commit 1e40962

Please sign in to comment.