feat: move @ in control badge props from prefix to suffix for consistency

The old `@prop` syntax will still work, but consider it deprecated.
This commit is contained in:
tomasklaen
2022-10-10 10:20:46 +02:00
parent 75ab13f2e3
commit 30a3ec195d
2 changed files with 11 additions and 15 deletions

View File

@@ -3438,7 +3438,9 @@ function Controls:register_badge_updater(badge, element)
return count
end
else
if prop:sub(1, 1) == '@' then prop, is_external_prop = prop:sub(2), true end
local parts = split(prop, '@')
-- Support both new `prop@owner` and old `@prop` syntaxes
if #parts > 1 then prop, is_external_prop = parts[1] ~= '' and parts[1] or parts[2], true end
serializer = function(value) return value and (type(value) == 'table' and #value or tostring(value)) or nil end
end