Add ResolveVariables()

Settings will be set to fixed values based on the values of the
variables used.
This commit is contained in:
WarmUpTill
2024-03-01 23:32:50 +01:00
committed by WarmUpTill
parent 2928775f5b
commit f8dadd38b4
20 changed files with 122 additions and 1 deletions

View File

@@ -304,6 +304,25 @@ void SceneItemSelection::SetSourceTypeSelection(const char *type)
_sourceGroup = type;
}
void SceneItemSelection::ResolveVariables()
{
_index.ResolveVariables();
_indexEnd.ResolveVariables();
_pattern = std::string(_pattern);
if (_type != Type::VARIABLE_NAME) {
return;
}
_type = Type::SOURCE_NAME;
auto variable = _variable.lock();
if (variable) {
_source = GetWeakSourceByName(variable->Value().c_str());
} else {
_source = nullptr;
}
}
void SceneItemSelection::ReduceBadedOnIndexSelection(
std::vector<OBSSceneItem> &items) const
{