mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
nested macros
This commit is contained in:
@@ -251,6 +251,14 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
||||
return;
|
||||
}
|
||||
|
||||
Macro *const parentMacro =
|
||||
(*_entryData)->GetMacro()->GetNestedParentMacro();
|
||||
OBSDataAutoRelease parentBeforeData;
|
||||
if (parentMacro) {
|
||||
parentBeforeData = obs_data_create();
|
||||
parentMacro->Save(parentBeforeData);
|
||||
}
|
||||
|
||||
const std::string oldId = (*_entryData)->GetId();
|
||||
const int oldLogic = (int)(*_entryData)->GetLogicType();
|
||||
OBSDataAutoRelease oldData = obs_data_create();
|
||||
@@ -276,9 +284,14 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
||||
|
||||
OBSDataAutoRelease newData = obs_data_create();
|
||||
(*_entryData)->Save(newData);
|
||||
RegisterSegmentTypeChangeUndoRedo(
|
||||
macro, MacroEdit::SegmentType::CONDITION, idx, oldId, oldData,
|
||||
oldLogic, id, newData, (int)(*_entryData)->GetLogicType());
|
||||
if (parentMacro) {
|
||||
RegisterMacroModifyUndoRedo(parentMacro, parentBeforeData);
|
||||
} else {
|
||||
RegisterSegmentTypeChangeUndoRedo(
|
||||
macro, MacroEdit::SegmentType::CONDITION, idx, oldId,
|
||||
oldData, oldLogic, id, newData,
|
||||
(int)(*_entryData)->GetLogicType());
|
||||
}
|
||||
auto widget =
|
||||
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||
|
||||
Reference in New Issue
Block a user