libobs: Fix source type versioning system
(This also modifies image-source, obs-text, text-freetype2, and UI) This improves source definition versioning. To do this, it now stores two identifier names. One "unversioned" which is the original name, and one "versioned" with the version number appended. This fixes both backward compatibility with older OBS versions, and fixes the inability to use "add existing" in OBS itself on sources created from older version definitions.
This commit is contained in:
@@ -111,8 +111,8 @@ function script_properties()
|
||||
local sources = obs.obs_enum_sources()
|
||||
if sources ~= nil then
|
||||
for _, source in ipairs(sources) do
|
||||
source_id = obs.obs_source_get_id(source)
|
||||
if source_id == "text_gdiplus" or source_id == "text_ft2_source" or source_id == "text_gdiplus_v2" or source_id == "text_ft2_source_v2" then
|
||||
source_id = obs.obs_source_get_unversioned_id(source)
|
||||
if source_id == "text_gdiplus" or source_id == "text_ft2_source" then
|
||||
local name = obs.obs_source_get_name(source)
|
||||
obs.obs_property_list_add_string(p, name, name)
|
||||
end
|
||||
|
@@ -66,8 +66,8 @@ def script_properties():
|
||||
sources = obs.obs_enum_sources()
|
||||
if sources is not None:
|
||||
for source in sources:
|
||||
source_id = obs.obs_source_get_id(source)
|
||||
if source_id == "text_gdiplus" or source_id == "text_ft2_source" or source_id == "text_gdiplus_v2" or source_id == "text_ft2_source_v2":
|
||||
source_id = obs.obs_source_get_unversioned_id(source)
|
||||
if source_id == "text_gdiplus" or source_id == "text_ft2_source":
|
||||
name = obs.obs_source_get_name(source)
|
||||
obs.obs_property_list_add_string(p, name, name)
|
||||
|
||||
|
Reference in New Issue
Block a user