mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-07-29 16:29:17 +02:00
quite a lot of stuff, can't list them all here (approaching 1.9)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
hooks.registered_groups = {}
|
||||
|
||||
function hooks.group(group)
|
||||
if hooks.registered_groups[group] then
|
||||
local ok, generated, b, c, d = pcall(hooks.registered_groups[group], group)
|
||||
if ok then return generated, b, c, d
|
||||
else
|
||||
print(generated)
|
||||
return false, 0, 0, 0
|
||||
end
|
||||
end
|
||||
return false, 0, 0, 0
|
||||
end
|
||||
|
||||
---@param designator string
|
||||
---@param handler function
|
||||
function rds.ext.register_group(designator, handler)
|
||||
for i = 1, #designator do
|
||||
local char = designator:sub(i, i)
|
||||
hooks.registered_groups[char] = handler
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user