mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Working on the keywords panel;
Correct styling data now shown on style panel git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@259 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -160,7 +160,7 @@ void KeywordReminderTextValue::highlight(const String& code) {
|
||||
size_t end = code.find_first_not_of(_("0123456789"), pos + 5);
|
||||
if (end == String::npos) end = code.size();
|
||||
String param = code.substr(pos, end-pos);
|
||||
new_value += _("<") + param + _(">") + param + _("</") + param + _(">");
|
||||
new_value += _("<ref-") + param + _(">") + param + _("</ref-") + param + _(">");
|
||||
pos = end;
|
||||
} else {
|
||||
new_value += c;
|
||||
|
||||
+12
-8
@@ -115,20 +115,24 @@ FakeTextValue::FakeTextValue(const TextFieldP& field, String* underlying, bool e
|
||||
{}
|
||||
|
||||
void FakeTextValue::store() {
|
||||
if (editable) {
|
||||
*underlying = untagged ? untag(value) : value;
|
||||
} else {
|
||||
retrieve();
|
||||
if (underlying) {
|
||||
if (editable) {
|
||||
*underlying = untagged ? untag(value) : value;
|
||||
} else {
|
||||
retrieve();
|
||||
}
|
||||
}
|
||||
}
|
||||
void FakeTextValue::retrieve() {
|
||||
value.assign(untagged ? escape(*underlying) : *underlying);
|
||||
if (underlying) {
|
||||
value.assign(untagged ? escape(*underlying) : *underlying);
|
||||
} else {
|
||||
value.assign(wxEmptyString);
|
||||
}
|
||||
}
|
||||
|
||||
void FakeTextValue::onAction(Action& a, bool undone) {
|
||||
if (underlying) {
|
||||
store();
|
||||
}
|
||||
store();
|
||||
}
|
||||
|
||||
bool FakeTextValue::equals(const Value* that) {
|
||||
|
||||
@@ -52,7 +52,7 @@ void read_compat(Reader& tag, Keyword* k) {
|
||||
k->match += separator.substr(start + 1, end - start - 1);
|
||||
}
|
||||
if (!parameter.empty()) {
|
||||
k->match += _("<param>") + parameter + _("</param>");
|
||||
k->match += _("<atom-param>") + parameter + _("</atom-param>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void Keyword::prepare(const vector<KeywordParamP>& param_types, bool force) {
|
||||
// Parse the 'match' string
|
||||
for (size_t i = 0 ; i < match.size() ;) {
|
||||
Char c = match.GetChar(i);
|
||||
if (is_substr(match, i, _("<param"))) {
|
||||
if (is_substr(match, i, _("<atom-param"))) {
|
||||
// parameter, determine type...
|
||||
size_t start = skip_tag(match, i), end = match_close_tag(match, i);
|
||||
String type = match.substr(start, end-start);
|
||||
@@ -237,7 +237,7 @@ void KeywordDatabase::add(const Keyword& kw) {
|
||||
KeywordTrie* cur = root->insertAnyStar();
|
||||
for (size_t i = 0 ; i < kw.match.size() ;) {
|
||||
Char c = kw.match.GetChar(i);
|
||||
if (is_substr(kw.match, i, _("<param"))) {
|
||||
if (is_substr(kw.match, i, _("<atom-param"))) {
|
||||
// tag, parameter, match anything
|
||||
cur = cur->insertAnyStar();
|
||||
i = match_close_tag_end(kw.match, i);
|
||||
|
||||
@@ -58,7 +58,7 @@ class Keyword {
|
||||
|
||||
String keyword; ///< The keyword, only for human use
|
||||
String rules; ///< Rules/explanation
|
||||
String match; ///< String to match, <param> tags are used for parameters
|
||||
String match; ///< String to match, <atom-param> tags are used for parameters
|
||||
vector<KeywordParamP> parameters; ///< The types of parameters
|
||||
StringScript reminder; ///< Reminder text of the keyword
|
||||
String mode; ///< Mode of use, can be used by scripts (only gives the name)
|
||||
|
||||
Reference in New Issue
Block a user