mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -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:
@@ -280,18 +280,20 @@ void KeywordsPanel::onChangeSet() {
|
||||
|
||||
void KeywordsPanel::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
{
|
||||
KeywordReminderTextValue* value = dynamic_cast<KeywordReminderTextValue*>(action.valueP.get());
|
||||
if (value && &value->keyword == list->getKeyword().get()) {
|
||||
// the current keyword's reminder text changed
|
||||
errors->SetLabel(value->errors);
|
||||
if (!action.card) {
|
||||
{
|
||||
KeywordReminderTextValue* value = dynamic_cast<KeywordReminderTextValue*>(action.valueP.get());
|
||||
if (value && &value->keyword == list->getKeyword().get()) {
|
||||
// the current keyword's reminder text changed
|
||||
errors->SetLabel(value->errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
|
||||
if (value && value->underlying == &list->getKeyword()->match) {
|
||||
// match string changes, maybe there are parameters now
|
||||
ref_param->Enable(!value->keyword.fixed && !value->keyword.parameters.empty());
|
||||
{
|
||||
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
|
||||
if (value && value->underlying == &list->getKeyword()->match) {
|
||||
// match string changes, maybe there are parameters now
|
||||
ref_param->Enable(!value->keyword.fixed && !value->keyword.parameters.empty());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,12 +73,14 @@ void StylePanel::onAction(const Action& action, bool undone) {
|
||||
}
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
// is it a styling action?
|
||||
const StyleSheet& s = set->stylesheetFor(card);
|
||||
FOR_EACH_CONST(f, s.styling_fields) {
|
||||
if (action.valueP->fieldP == f) {
|
||||
// refresh the viewer
|
||||
preview->redraw();
|
||||
return;
|
||||
if (!action.card) {
|
||||
const StyleSheet& s = set->stylesheetFor(card);
|
||||
FOR_EACH_CONST(f, s.styling_fields) {
|
||||
if (action.valueP->fieldP == f) {
|
||||
// refresh the viewer
|
||||
preview->redraw();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,8 +264,10 @@ void SetWindow::onChangeSet() {
|
||||
|
||||
void SetWindow::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
if (set->data.contains(action.valueP) && action.valueP->fieldP->identifying) {
|
||||
updateTitle();
|
||||
if (!action.card) {
|
||||
if (set->data.contains(action.valueP) && action.valueP->fieldP->identifying) {
|
||||
updateTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* TYPE_CASE_(action, DisplayChangeAction) {
|
||||
|
||||
Reference in New Issue
Block a user