mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Edit To Ranking and ExpLib
This commit is contained in:
@@ -49,16 +49,16 @@ function Ranking.get_rank(mixed)
|
||||
local _return = false
|
||||
if is_type(mixed,'table') then
|
||||
if mixed.index then
|
||||
_return = game.players[mixed.index] and ranks[mixed.permission_group.name] or false
|
||||
_return = game.players[mixed.index] and ranks[mixed.permission_group.name] or nil
|
||||
else
|
||||
_return = mixed.group and mixed or false
|
||||
_return = mixed.group and mixed or nil
|
||||
end
|
||||
else
|
||||
_return = game.players[mixed] and ranks[game.players[mixed].permission_group.name]
|
||||
or table.autokey(ranks,mixed) and table.autokey(ranks,mixed)
|
||||
or string.contains(mixed,'server') and Ranking.get_rank(Ranking._presets().meta.root)
|
||||
or string.contains(mixed,'root') and Ranking.get_rank(Ranking._presets().meta.root)
|
||||
or false
|
||||
or nil
|
||||
end
|
||||
return _return
|
||||
end
|
||||
|
||||
20
ExpLib.lua
20
ExpLib.lua
@@ -139,4 +139,24 @@ function ExpLib.tick_to_display_format(tick)
|
||||
end
|
||||
end
|
||||
|
||||
function ExpLib.Gui_tree(root)
|
||||
local tree = {}
|
||||
for _,child in pairs(root.children) do
|
||||
if #child.children > 0 then
|
||||
if child.name then
|
||||
tree[child.name] = ExpLib.Gui_tree(child)
|
||||
else
|
||||
table.insert(tree,ExpLib.Gui_tree(child))
|
||||
end
|
||||
else
|
||||
if child.name then
|
||||
tree[child.name] = child.type
|
||||
else
|
||||
table.insert(tree,child.type)
|
||||
end
|
||||
end
|
||||
end
|
||||
return tree
|
||||
end
|
||||
|
||||
return ExpLib
|
||||
Reference in New Issue
Block a user