Cenrtre Gui custom now gets the frame given to them

This commit is contained in:
Cooldude2606
2017-07-23 20:17:52 +01:00
parent cada119a13
commit eff1fa5a3a

View File

@@ -43,8 +43,8 @@ function draw_frame.center(player,element)
for _,frame in pairs(frames.center) do if element.name == frame[1] then frame_data = frame break end end
if player.gui.is_valid_sprite_path(frame_data[2]) then frame_data[2] = frame_data[1] end
if player.gui.center[frame_data[1]] then player.gui.center.clear() return else player.gui.center.clear() end
if frame_data[4] and type(frame_data[4]) == 'function' then frame_data[4](player,element) return end
local frame = player.gui.center.add{name=frame_data[1],type='frame',caption=frame_data[2],direction='vertical',style=mod_gui.frame_style}
if frame_data[4] and type(frame_data[4]) == 'function' then frame_data[4](player,frame) return end
local tab_bar_scroll = frame.add{type = "scroll-pane", name= "tab_bar_scroll", vertical_scroll_policy="never", horizontal_scroll_policy="always"}
local tab_bar = tab_bar_scroll.add{type='flow',direction='horizontal',name='tab_bar'}
local tab = frame.add{type = "scroll-pane", name= "tab", vertical_scroll_policy="auto", horizontal_scroll_policy="never"}