Add option to check for addition chat message properties

This commit is contained in:
WarmUpTill
2024-08-17 22:16:12 +02:00
committed by WarmUpTill
parent d69364ec19
commit 93efc7cab3
12 changed files with 784 additions and 185 deletions

View File

@@ -161,6 +161,7 @@ void TempVariableRef::Save(obs_data_t *obj, const char *name) const
obs_data_set_int(data, "type", static_cast<int>(type));
obs_data_set_int(data, "idx", GetIdx());
obs_data_set_string(data, "id", _id.c_str());
obs_data_set_int(data, "version", 1);
obs_data_set_obj(obj, name, data);
}
@@ -175,6 +176,14 @@ void TempVariableRef::Load(obs_data_t *obj, Macro *macro, const char *name)
_id = obs_data_get_string(data, "id");
const auto type =
static_cast<SegmentType>(obs_data_get_int(data, "type"));
// Backwards compatibility checks
if (obs_data_get_int(data, "version") < 1) {
if (_id == "chatter") {
_id = "user_login";
}
}
AddPostLoadStep([this, idx, type, macro]() {
this->PostLoad(idx, type, macro);
});