Moved Bug Fix some where it would work

This commit is contained in:
Cooldude2606
2017-07-19 20:29:13 +01:00
parent a69226f836
commit 67327ecb84

View File

@@ -33,9 +33,6 @@ function add_frame.tab(name,default_display,default_tooltip,restriction,frame,ev
if not name then error('Tab requires a name') end
if not frame then error('Tab requires a frame') end
table.insert(frames.tabs,{name,default_display,frame,event})
local temp_restriction = nil
if type(restriction) == 'number' then temp_restriction = restriction end
local restriction = temp_restriction or string_to_rank(restriction).power or 0
for _,f in pairs(frames.center) do if f[1] == frame then table.insert(f[3],{name,restriction}) end end
ExpGui.add_input.button(name,default_display,default_tooltip,draw_frame.tab)
end
@@ -51,7 +48,12 @@ function draw_frame.center(player,element)
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"}
for n,t in pairs(frame_data[3]) do if t[2] >= get_rank(player).power then ExpGui.add_input.draw_button(tab_bar,t[1]) end end
for n,t in pairs(frame_data[3]) do
local temp_restriction = nil
if type(t[2]) == 'number' then temp_restriction = t[2] end
local restriction = temp_restriction or string_to_rank(t[2]).power or 0
if restriction >= get_rank(player).power then ExpGui.add_input.draw_button(tab_bar,t[1]) end
end
draw_frame.tab(player,tab_bar[frame_data[3][1][1]])
ExpGui.add_input.draw_button(tab_bar,'close_center')
tab.style.minimal_height = 300