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:
parent
c7fca1b956
commit
68612c6900
9 changed files with 407 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue