uranium-core/stdlib/noautoplay.lua

14 lines
322 B
Lua
Raw Permalink Normal View History

2022-09-19 22:49:20 +02:00
local oldAutoplay
return function()
2023-05-04 21:07:28 +02:00
uranium.on('ready', function()
2022-09-19 22:49:20 +02:00
oldAutoplay = PREFSMAN:GetPreference('AutoPlay')
PREFSMAN:SetPreference('AutoPlay', 0)
2023-05-04 21:07:28 +02:00
end)
2022-09-19 22:49:20 +02:00
2023-05-04 21:07:28 +02:00
uranium.on('exit', function()
2022-09-19 22:49:20 +02:00
if oldAutoplay and oldAutoplay ~= 0 then
PREFSMAN:SetPreference('AutoPlay', oldAutoplay)
end
2023-05-04 21:07:28 +02:00
end)
2022-09-19 22:49:20 +02:00
end