mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fixed cursor position before <atom>s
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@313 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -316,42 +316,5 @@ void SetScriptManager::alsoUpdate(deque<ToUpdate>& to_update, const vector<Depen
|
||||
} default:
|
||||
assert(false);
|
||||
}
|
||||
/* if (d.type == DependendScript.setField) {
|
||||
// from set data
|
||||
ValueP value = set->data.at(ds.index);
|
||||
toUpdate.push_back(ToUpdate(&*value));
|
||||
} else if (ds.type == DependendScript.cardField) {
|
||||
// from the same card's data
|
||||
assert(card);
|
||||
ValueP value = card->data.at(ds.index);
|
||||
toUpdate.push_back(ToUpdate(&*value, card));
|
||||
} else if (ds.type == DependendScript.cardsField) {
|
||||
// something invalidates a card value for all cards, so all cards need updating
|
||||
FOR_EACH(card, set)->cards {
|
||||
ValueP value = card->data.at(ds.index);
|
||||
toUpdate.push_back(ToUpdate(&*value, card));
|
||||
}
|
||||
} else if (ds.type >= DependendScript.choiceImage) {
|
||||
// a generated image has become invalid, there is not much we can do
|
||||
// because the index is not exact enough, it only gives the field
|
||||
// TODO : Indicate what style
|
||||
//CardStyleP style = set->styleOf(card) // WRONG?
|
||||
CardStyle* style = CardStyle.getByIndex(ds.type - DependendScript.choiceImage);
|
||||
StyleP s = style->cardStyle.at(ds.index);
|
||||
s->invalidate();
|
||||
// something changed, send event
|
||||
ScriptStyleEvent change(&*s);
|
||||
set->actions.tellListeners(change);
|
||||
} else if (ds.type == DependendScript.cardCopyDep) {
|
||||
// propagate dependencies from another field
|
||||
FieldP f = game->cardFields#(ds.index);
|
||||
alsoUpdate(toUpdate, f->dependendScripts, card);
|
||||
} else if (ds.type == DependendScript.setCopyDep) {
|
||||
// propagate dependencies from another field
|
||||
FieldP f = game->setFields#(ds.index);
|
||||
alsoUpdate(toUpdate, f->dependendScripts, card);
|
||||
} else {
|
||||
assert(false); // only setField, cardField and cardsField should be possible
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ void cursor_to_index_range(const String& str, size_t cursor, size_t& start, size
|
||||
// a tag
|
||||
if (is_substr(str, i, _("<atom")) || is_substr(str, i, _("<sep"))) {
|
||||
// never move the end over an atom/sep
|
||||
if (cur >= cursor) break;
|
||||
if (cur >= cursor) { ++i; break; }
|
||||
// skip tag contents, tag counts as a single 'character'
|
||||
i = match_close_tag_end(str, i);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user