Skip to content

CVFilterLine

Divided by Zer0 edited this page Sep 26, 2021 · 1 revision

CVFilterLine

Extends: LineEdit

Description

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))

Property Descriptions

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

Method Descriptions

on_text_changed

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.

compile_filters

func compile_filters(line_text: String) -> Array

Function which takes as input a string, and then returns an array of DBFilters.

get_active_filters

func get_active_filters() -> Array

Regenerates and returns the current filters based on the existing text

Signals

  • 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