Closed Muhsigbokz closed 8 months ago
Some features that could later be added:
@TabBrowser[]{}
for the current filterupdated for 1fed3a7581546e08250c2b60dddc7d610125c372
@CompSearch[Abqweilities e]{I render, but you cant open me}
@CompSearch[Abqweilities] This also can't be opened
@CompSearch[Abilities idontexist=12 order-dir=desc e]{My setting idontexist does not exist}
@CompSearch[Abilities order-by=name order-dir=desc e]{Abilties with E, descending by name}
@CompSearch[Edges of art]{Edges, searching for art of}
@CompSearch[Feats class=arcanist class=berserk order-by=name]{Arcanist or Berserker features, sortby name}
@CompSearch[Moves type=nuclear category=special e]{Nuclear Special Moves with e}
@CompSearch[PokeEdges source=homebrew]{Homebrew PokeEdges}
@CompSearch[Species source=ptr-core-dex-megas types=not-dragon abilities-logic=or abilities=memory-wipe abilities=cruelty abilities=blaze sky-min=1 swim-max=5]{Species from PTR Core Dex Mega Mon that are 1) not dragon type and 2) can gain either of a) memory whipe or b) cruelty or c) blaze and 4) have a) at least 1 sky and b) max 5 swim}
@CompSearch[Species source=ptr-core-dex-megas types=not-dragon abilities-logic=or abilities=memory-wipe abilities=cruelty abilities=blaze sky-min=1 swim-max=5]
renders to
order-dir=neitherAscNorDesc
as per /@CompSearch\[([A-Za-z]+) ?([0-9a-zA-Z\-= ]*)\](:?{(:?[^\[\]\{\}@]*)?})?/gim
@CompSearch[<tabNameUpperCase> <settings> <searchWords>]{<explicitDisplayText>} | @<tabNameUpperCase>Browser[<settings>]
>tabNameUpperCase>
can be Abilities, Capabilities, and such{<explicitDisplayText>}
is optional, as seen in last the example above
<key>=<value>
strings, with spaces
in between
<key>
refers to filterData
object after the layer of filter type. examples would be overland
of speciesTab.filterData.sliders.overland
. This is the case of any filter that is set via checkboxes
, multiselects
, sliders
, selects
order
or search
, as special cases compared to the previous<value>
refers mostly to a sluggified version of the value as displayed.Special things:
overland-min=1
and overland-max=6
type=not-poison
and type-logic=or
The enrichment of all(?) visible content is done with a custom enricher in CONFIG.TextEditor.enrichers
. Apparently there is no doc for those, or at least none easily findable (https://foundryvtt.com/api/classes/client.TextEditor.html), but thanks to some guidance https://discord.com/channels/170995199584108546/722559135371231352/1192834854614737068 it seems very simple and handy - if you know about it, like it is always the case.
A single Event Listener takes care of all tabs.
During development, tagify caused some trouble. Specifically, see #593. Thats why that has been touched together this feature.
I am not aware of a similar thing done in this code so far. CompendiumBrowserInlineEnricher.listen
both adds the enrichers to CONFIG.TextEditor.enrichers
as well as the Event Listeners to the respective hooks. There are likely other ways to structure this, but this way all logic stay in one place, both for Enrichment and Compendium opening. Seems fine to me.
The Compendium Browser can be called via In-Line Tags with Setting written in the Tag
Examples
renders to
Logic
order:dir:neitherAscNorDesc
Syntax
as per
/@([A-Z][a-z]+)Browser\[([|:_0-9a-zA-Z\- ]*)\](:?{(:?[^\[\]\{\}@]*)?})?/gim
@<tabNameUpperCase>Browser[<settings>]{<explicitDisplayText>} | @<tabNameUpperCase>Browser[<settings>]
>tabNameUpperCase>
can be Abilities, Capabilities, and such{<explicitDisplayText>}
is optional, as seen in last the example above<key>:<value>
strings, concatinated by|
such that<key>
refers tofilterData
object after the layer of filter type. examples would beoverland
ofspeciesTab.filterData.sliders.overland
. This is the case of any filter that is set viacheckboxes
,multiselects
,sliders
,selects
order
orsearch
, as special cases compared to the previous<value>
refers mostly to a sluggified version of the value as displayed. it can also be further structured likemin:1
foroverland:min:1
- this depends on the type of input used for the given keyMisc Tech Details
The enrichment of all(?) visible content is done with a custom enricher in
CONFIG.TextEditor.enrichers
. Apparently there is no doc for those, or at least none easily findable (https://foundryvtt.com/api/classes/client.TextEditor.html), but thanks to some guidance https://discord.com/channels/170995199584108546/722559135371231352/1192834854614737068 it seems very simple and handy - if you know about it, like it is always the case.A single Event Listener takes care of all tabs.
During development, tagify caused some trouble. Specifically, see #593. Thats why that has been touched together this feature.
I am not aware of a similar thing done in this code so far.
CompendiumBrowserInlineEnricher.listen
both adds the enrichers toCONFIG.TextEditor.enrichers
as well as the Event Listeners to the respective hooks. There are likely other ways to structure this, but this way all logic stay in one place, both for Enrichment and Compendium opening. Seems fine to me.