4th try now :/

This commit is contained in:
Cooldude2606
2018-10-26 15:02:38 +01:00
parent ea334175ee
commit b928d593f6
7 changed files with 125 additions and 45 deletions

View File

@@ -111,7 +111,30 @@ function popup.open(style,data,players)
end
Server.new_thread{
data={players=players,popup=_popup,data=data}
}:on_event('tick',on_tick):open()
}:on_event('tick',function(self)
-- the _env should be auto loaded but does not, so to prevent desyncs it cant be an anon function
if #self.data.players == 0 then self:close() return end
local player = table.remove(self.data.players,1)
if self.data.popup.left then self.data.popup.left:close(player) end
local flow = popup.flow(player)
flow.style.visible=true
local _frame = flow.add{
type='frame',
direction='horizontal',
style=mod_gui.frame_style
}
local frame = _frame.add{
type='frame',
name='inner_frame',
direction='vertical',
style='image_frame'
}
self.data.popup.close(_frame)
if is_type(self.data.popup.draw,'function') then
local success, err = pcall(self.data.popup.draw,frame,self.data.data)
if not success then error(err) end
else error('No Draw On Popup '..self.data.popup.name) end
end):open()
end
end