UI: Add versioned sources to scene collection importer
Versioned sources were added in commit b2302902a3b3e1cce140a6417f4c5e490869a3f2 after the scene collection importer was added in commit 191165c7210f2b8adf8756cf121341075bf16b3d. When a versioned source gets converted in TranslateOSStudio, it can end up with a translated "id" but an untranslated "versioned_id". When OBS loads the resulting JSON, it will rely on the versioned_id, and rewrite the id to the corresponding value. Use obs_get_latest_input_type_id on the translated source id to get the correct versioned_id when using TranslateOSStudio.
This commit is contained in:
parent
183fb20dde
commit
0a3cd9021b
@ -31,15 +31,17 @@ void TranslateOSStudio(Json &res)
|
||||
|
||||
string id = source["id"].string_value();
|
||||
|
||||
#define DirectTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
#define DirectTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["versioned_id"] = obs_get_latest_input_type_id(after); \
|
||||
}
|
||||
|
||||
#define ClearTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["settings"] = Json::object{}; \
|
||||
#define ClearTranslation(before, after) \
|
||||
if (id == before) { \
|
||||
source["id"] = after; \
|
||||
source["settings"] = Json::object{}; \
|
||||
source["versioned_id"] = obs_get_latest_input_type_id(after); \
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
Loading…
x
Reference in New Issue
Block a user