mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 04:21:41 +09:00
Small edits
This commit is contained in:
@@ -92,10 +92,12 @@ function find_new_rank(player)
|
||||
local current_rank = get_rank(player)
|
||||
local old_rank = get_rank(player)
|
||||
local possible_ranks = {current_rank}
|
||||
--loops though preset ranks
|
||||
for rank,players in pairs(global.preset_ranks) do
|
||||
local found_rank = loop_preset_rank(players, rank)
|
||||
if found_rank then table.insert(possible_ranks,string_to_rank(found_rank)) break end
|
||||
--loops though preset ranks only if playtime is less than 5 minutes
|
||||
if tick_to_min(player.online_time) < 5 then
|
||||
for rank,players in pairs(global.preset_ranks) do
|
||||
local found_rank = loop_preset_rank(players, rank)
|
||||
if found_rank then table.insert(possible_ranks,string_to_rank(found_rank)) break end
|
||||
end
|
||||
end
|
||||
--loops though rank times
|
||||
for _,rank in pairs(global.ranks) do
|
||||
|
||||
@@ -31,6 +31,7 @@ local preset_ranks = {
|
||||
'Smou'},
|
||||
|
||||
Mod={
|
||||
'AcThPaU',
|
||||
'Alanore',
|
||||
'Aquaday',
|
||||
'cafeslacker',
|
||||
|
||||
@@ -21,7 +21,7 @@ local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits
|
||||
local add_frame = ExpGui.add_frame
|
||||
local frames = ExpGui.frames
|
||||
local draw_frame = ExpGui.draw_frame
|
||||
--adds a frame in the center; tabs is a list that can contain already defined tabs; event(player,element) is a option to have a custom gui in the center
|
||||
--adds a frame in the center; tabs {{name,restriction},{...}} is a list that can contain already defined tabs; event(player,element) is a option to have a custom gui in the center
|
||||
function add_frame.center(name,default_display,default_tooltip,restriction,tabs,event)
|
||||
if not name then error('Frame requires a name') end
|
||||
local tabs = tabs or {}
|
||||
|
||||
@@ -31,13 +31,19 @@ function add_frame.left(name,default_display,default_tooltip,restriction,vis,eve
|
||||
table.insert(frames.left,{name,default_display,event,vis})
|
||||
ExpGui.toolbar.add_button(name,default_display,default_tooltip,restriction,draw_frame.left)
|
||||
end
|
||||
--draw the left gui for the player; do not call manuley must use other functions to call
|
||||
function draw_frame.left(player,element)
|
||||
--draw the left gui for the player; called via script, only call manuley when update is true and element is the name of the gui
|
||||
function draw_frame.left(player,element,update)
|
||||
local frame = nil
|
||||
local frame_data = nil
|
||||
for _,frame in pairs(frames.left) do if element.name == frame[1] then frame_data = frame break end end
|
||||
local left = mod_gui.get_frame_flow(player)
|
||||
if left[frame_data[1]] then ExpGui.toggleVisable(left[frame_data[1]]) return end
|
||||
local frame = left.add{name=frame_data[1],type='frame',capption=frame_data[2],direction='vertical',style=mod_gui.frame_style}
|
||||
if not update then
|
||||
for _,frame in pairs(frames.left) do if element.name == frame[1] then frame_data = frame break end end
|
||||
if left[frame_data[1]] then ExpGui.toggleVisable(left[frame_data[1]]) return end
|
||||
local frame = left.add{name=frame_data[1],type='frame',capption=frame_data[2],direction='vertical',style=mod_gui.frame_style}
|
||||
else
|
||||
for _,frame in pairs(frames.left) do if element == frame[1] then frame_data = frame break end end
|
||||
local frame = left[frame_data[1]] frame.clear()
|
||||
end
|
||||
frame_data[3](player,frame)
|
||||
end
|
||||
--used to load all left guis
|
||||
|
||||
Reference in New Issue
Block a user