mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Delayed updating of scripts on keyword changes
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@383 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -84,6 +84,7 @@ Context& SetScriptContext::getContext(const CardP& card) {
|
||||
|
||||
SetScriptManager::SetScriptManager(Set& set)
|
||||
: SetScriptContext(set)
|
||||
, delay(0)
|
||||
{
|
||||
// add as an action listener for the set, so we receive actions
|
||||
set.actions.addListener(this);
|
||||
@@ -143,7 +144,7 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
|
||||
value->keyword.prepare(set.game->keyword_parameter_types, true);
|
||||
set.keyword_db.clear();
|
||||
}
|
||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||
delay |= DELAY_KEYWORDS;
|
||||
return;
|
||||
}
|
||||
// find the affected card
|
||||
@@ -199,6 +200,13 @@ void SetScriptManager::updateStyles(const CardP& card) {
|
||||
}
|
||||
}
|
||||
|
||||
void SetScriptManager::updateDelayed() {
|
||||
if (delay & DELAY_KEYWORDS) {
|
||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||
}
|
||||
delay = 0;
|
||||
}
|
||||
|
||||
void SetScriptManager::updateValue(Value& value, const CardP& card) {
|
||||
Age starting_age; // the start of the update process
|
||||
deque<ToUpdate> to_update;
|
||||
|
||||
Reference in New Issue
Block a user