From 8676dcf7fdbad4b1eee2b1847292d52c91989097 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 13 Mar 2018 17:06:01 +0000 Subject: [PATCH] Moved Some More Code In Gui --- ExpCore/gui.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ExpCore/gui.lua b/ExpCore/gui.lua index 90e123be..a9f14934 100644 --- a/ExpCore/gui.lua +++ b/ExpCore/gui.lua @@ -93,11 +93,6 @@ Event.register(-1,function(event) end):open() end) -local function _thread() - local thread = Server.get_thread('camera-follow') - if not thread then error('Camera Follow Thread Is Missing') end - return thread -end --- Adds a camera that updates every tick (or less depeading on how many are opening) it will move to follow an entity -- @usage Gui.cam_link{entity=game.player.character,frame=frame,width=50,hight=50,zoom=1} -- @usage Gui.cam_link{entity=game.player.character,cam=frame.camera,surface=game.surfaces['testing']} @@ -125,7 +120,7 @@ function Gui.cam_link(data) data.cam.style.width = data.width or 100 data.cam.style.height = data.height or 100 else return end - if not Server or not Server._thread then + if not Server or not Server._thread or not Server.get_thread('camera-follow') then if not Gui._global().cams then Gui._global().cams = {} Gui._global().cam_index = 1 @@ -144,7 +139,7 @@ function Gui.cam_link(data) end end else - local thread = _thread() + local thread = Server.get_thread('camera-follow') local surface = data.surface and data.surface.index or nil table.insert(thread.data.cams,{cam=data.cam,entity=data.entity,surface=surface}) if data.respawn_open then