move some scripts as modules and also change rds1 group hook

This commit is contained in:
2026-06-20 14:42:10 +02:00
parent a189c56cdf
commit 90d082a845
9 changed files with 107 additions and 102 deletions
+25
View File
@@ -0,0 +1,25 @@
local md = {}
md.registered_groups = {}
hooks.group[#hooks.group+1] = function (group)
if md.registered_groups[group] then
local ok, generated, b, c, d = pcall(md.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 md.register_group(designator, handler)
for i = 1, #designator do
local char = designator:sub(i, i)
md.registered_groups[char] = handler
end
end
return md