mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
combined_editor function, and improved dependency handling (removing duplicates), viewer refreshes on events from script manager
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@147 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -134,4 +134,16 @@ void DataViewer::onAction(const Action& action, bool undone) {
|
||||
}
|
||||
}
|
||||
}
|
||||
TYPE_CASE(action, ScriptValueEvent) {
|
||||
if (action.card == card.get()) {
|
||||
FOR_EACH(v, viewers) {
|
||||
if (v->getValue().get() == action.value) {
|
||||
// refresh the viewer
|
||||
v->onAction(action, undone);
|
||||
onChange();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
class Set;
|
||||
class DataViewer;
|
||||
class ValueAction;
|
||||
class Action;
|
||||
DECLARE_POINTER_TYPE(Style);
|
||||
DECLARE_POINTER_TYPE(Value);
|
||||
|
||||
@@ -55,7 +55,7 @@ class ValueViewer {
|
||||
/// Called when a (scripted) property of the associated style has changed
|
||||
virtual void onStyleChange() {}
|
||||
/// Called when an action is performed on the associated value
|
||||
virtual void onAction(const ValueAction&, bool undone) { onValueChange(); }
|
||||
virtual void onAction(const Action&, bool undone) { onValueChange(); }
|
||||
|
||||
/// Convert this viewer to an editor, if possible
|
||||
virtual ValueEditor* getEditor() { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user