mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added 'card' to value actions, this fixes a bug where extra fields get updated with the wrong context, and it should also speed things up.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@673 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -192,12 +192,14 @@ void DataViewer::onAction(const Action& action, bool undone) {
|
||||
return;
|
||||
}
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
FOR_EACH(v, viewers) {
|
||||
if (v->getValue()->equals( action.valueP.get() )) {
|
||||
// refresh the viewer
|
||||
v->onAction(action, undone);
|
||||
onChange();
|
||||
return;
|
||||
if (action.card == card.get()) {
|
||||
FOR_EACH(v, viewers) {
|
||||
if (v->getValue()->equals( action.valueP.get() )) {
|
||||
// refresh the viewer
|
||||
v->onAction(action, undone);
|
||||
onChange();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class DataViewer : public SetView {
|
||||
Context& getContext() const;
|
||||
/// The rotation to use
|
||||
virtual Rotation getRotation() const;
|
||||
/// The card we are viewing
|
||||
/// The card we are viewing, can be null
|
||||
inline const CardP& getCard() const { return card; }
|
||||
/// Invalidate and redraw (the area of) a single value viewer
|
||||
virtual void redraw(const ValueViewer&) {}
|
||||
|
||||
Reference in New Issue
Block a user