mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Nicer colors for card list/stats panel;
Keywords updated so <name><cost> splits correctly git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@352 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -359,6 +359,7 @@ void KeywordDatabase::add(const Keyword& kw) {
|
||||
// Add to trie
|
||||
String text; // normal text
|
||||
size_t param = 0;
|
||||
bool only_star = true;
|
||||
for (size_t i = 0 ; i < kw.match.size() ;) {
|
||||
Char c = kw.match.GetChar(i);
|
||||
if (is_substr(kw.match, i, _("<atom-param"))) {
|
||||
@@ -384,9 +385,18 @@ void KeywordDatabase::add(const Keyword& kw) {
|
||||
cur = cur->insert(text);
|
||||
text.clear();
|
||||
cur = cur->insertAnyStar();
|
||||
// enough?
|
||||
if (!only_star) {
|
||||
// If we have matched anything specific, this is a good time to stop
|
||||
// it doesn't really matter how long we go on, since the trie is only used
|
||||
// as an optimization to not have to match lots of regexes.
|
||||
// As an added bonus, we get a better behaviour of matching earlier keywords first.
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
text += c;
|
||||
i++;
|
||||
only_star = false;
|
||||
}
|
||||
}
|
||||
cur = cur->insert(text);
|
||||
|
||||
Reference in New Issue
Block a user