Update jabby code

This commit is contained in:
Ukendio 2024-11-21 04:12:36 +01:00
parent 9ce28b999f
commit 78127d73e9
3 changed files with 33 additions and 41 deletions

View file

@ -18,14 +18,16 @@ local function start(modules)
return true return true
end) end)
if RunService:IsClient() then if RunService:IsClient() then
local player = game:GetService("Players").LocalPlayer
local playergui = player:WaitForChild("PlayerGui")
local client = jabby.obtain_client() local client = jabby.obtain_client()
local dtor
UserInputService.InputBegan:Connect(function(input) UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F4 then if input.KeyCode == Enum.KeyCode.F4 then
if dtor then local home = playergui:FindFirstChild("Home")
dtor() if home then
home:Destroy()
end end
dtor = client.spawn_app(client.apps.home) client.spawn_app(client.apps.home)
end end
end) end)
end end

View file

@ -71,14 +71,7 @@ do
local function run() local function run()
local id = sys.id local id = sys.id
local system_data = scheduler.system_data[id] scheduler:run(id, sys.callback, dt)
if system_data.paused then
return
end
scheduler:mark_system_frame_start(id)
sys.callback(dt)
scheduler:mark_system_frame_end(id)
end end
local function panic(str) local function panic(str)
@ -86,19 +79,17 @@ do
task.spawn(error, str) task.spawn(error, str)
end end
local function begin(events: { Systems }) local function begin(events: { Systems })
local threads = {} local connections = {}
for event, systems in events do for event, systems in events do
if not event then if not event then
continue continue
end end
local event_name = tostring(event) local event_name = tostring(event)
threads[event] = task.spawn(function() connections[event] = event:Connect(function(delta)
while true do
dt = event:Wait()
debug.profilebegin(event_name) debug.profilebegin(event_name)
for _, s in systems do for _, s in systems do
sys = s sys = s
dt = delta
local didNotYield, why = xpcall(function() local didNotYield, why = xpcall(function()
for _ in run do for _ in run do
break break
@ -122,7 +113,6 @@ do
panic(why) panic(why)
end end
debug.profileend() debug.profileend()
end
end) end)
end end
return threads return threads

View file

@ -5,4 +5,4 @@ registry = "https://github.com/UpliftGames/wally-index"
realm = "shared" realm = "shared"
[dependencies] [dependencies]
jabby = "alicesaidhi/jabby@0.1.0" jabby = "alicesaidhi/jabby@0.2.0-rc.3"