-
-
Notifications
You must be signed in to change notification settings - Fork 107
CVFilterLine
Extends: LineEdit
A special LineEdit which compiles the text written into distinct CVFilter objects
The filters use roughly the same syntax as netrunnerdb but have different criteria (see criteria_map(#criteria_map))
export var criteria_map = {"a":"Abilities","c":"Cost","g":"Tags","p":"Power","r":"Requirements","t":"Type"}
Defines the available criteria for this game's filters.
Developers can customize this dictionary based on each game's card properties Each character key defined here, corresponds to one property and when inserted as the criteria, will check the expression against that property
func on_text_changed(new_text: String) -> void
Fired whenever the text of the LineEdit changes. It compiles the filters Then fires a signal which is caught by the deckbuilder.
func compile_filters(line_text: String) -> Array
Function which takes as input a string, and then returns an array of DBFilters.
func get_active_filters() -> Array
Regenerates and returns the current filters based on the existing text
- signal filters_changed(filters): Emited whenever the line text is changed. The deckbuilder grabs it and filters the cards based on the compiled filters sent with it