mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added a "quick search" box for filtering the card list
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1483 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -55,6 +55,13 @@ String Card::identification() const {
|
||||
}
|
||||
}
|
||||
|
||||
bool Card::contains(String const& query) const {
|
||||
FOR_EACH_CONST(v, data) {
|
||||
if (v->toString().find(query) != String::npos) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
IndexMap<FieldP, ValueP>& Card::extraDataFor(const StyleSheet& stylesheet) {
|
||||
return extra_data.get(stylesheet.name(), stylesheet.extra_card_fields);
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ class Card : public IntrusivePtrVirtualBase {
|
||||
/// Get the identification of this card, an identification is something like a name, title, etc.
|
||||
/** May return "" */
|
||||
String identification() const;
|
||||
/// Does any field contains the given query string?
|
||||
bool contains(String const& query) const;
|
||||
|
||||
/// Find a value in the data by name and type
|
||||
template <typename T> T& value(const String& name) {
|
||||
|
||||
Reference in New Issue
Block a user