1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Add button, toggle, and option elements

This commit is contained in:
v-rob 2024-02-07 22:48:56 -08:00
parent c7fca1b956
commit 68612c6900
9 changed files with 407 additions and 0 deletions

View file

@ -246,6 +246,19 @@ func_preds["nth_last_match"] = function(str)
end
end
func_preds["family"] = function(family)
if family == "*" then
return function(elem)
return result(elem._family ~= nil)
end
end
assert(ui.is_id(family), "Expected '*' or ID string for ?family()")
return function(elem)
return result(elem._family == family)
end
end
local function parse_term(str, pred)
str = str:trim()
assert(str ~= "", "Expected selector term")