mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
dependency handling for keywords
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@265 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <data/field.hpp>
|
||||
#include <data/action/set.hpp>
|
||||
#include <data/action/value.hpp>
|
||||
#include <data/action/keyword.hpp>
|
||||
#include <util/error.hpp>
|
||||
|
||||
typedef map<const StyleSheet*,Context*> Contexts;
|
||||
@@ -131,6 +132,12 @@ void SetScriptManager::initDependencies(Context& ctx, StyleSheet& stylesheet) {
|
||||
|
||||
void SetScriptManager::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
// is it a keyword's fake value?
|
||||
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
|
||||
if (value) {
|
||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||
return;
|
||||
}
|
||||
// find the affected card
|
||||
FOR_EACH(card, set.cards) {
|
||||
if (card->data.contains(action.valueP)) {
|
||||
@@ -138,6 +145,7 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// not a card value
|
||||
updateValue(*action.valueP, CardP());
|
||||
}
|
||||
TYPE_CASE_(action, ScriptValueEvent) {
|
||||
@@ -160,6 +168,14 @@ void SetScriptManager::onAction(const Action& action, bool undone) {
|
||||
wxLogDebug(_("-------------------------------\n"));
|
||||
#endif
|
||||
}
|
||||
TYPE_CASE_(action, KeywordListAction) {
|
||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||
return;
|
||||
}
|
||||
TYPE_CASE_(action, ChangeKeywordModeAction) {
|
||||
updateAllDependend(set.game->dependent_scripts_keywords);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void SetScriptManager::updateStyles(const CardP& card) {
|
||||
|
||||
Reference in New Issue
Block a user