mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-18 12:11:54 +00:00
New game file structure
Scratch making the framework/engine open source for now until i figure out a better file structure that will work with Rojo
This commit is contained in:
30
src/client/Player/CoreGuis.lua
Normal file
30
src/client/Player/CoreGuis.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local CoreGuis = {
|
||||
IncludeReset = true --disable the reset button?
|
||||
}
|
||||
CoreGuis.__index = CoreGuis
|
||||
|
||||
local SG = game:GetService("StarterGui")
|
||||
|
||||
local function DisableReset(enabled: boolean)
|
||||
--Roblox actually doesn't register this fast enough so we gotta resort to cringe tactics
|
||||
repeat
|
||||
local PossibleMemoryLeak = pcall(SG.SetCore, SG, "ResetButtonCallback", enabled)
|
||||
task.wait()
|
||||
until PossibleMemoryLeak
|
||||
end
|
||||
|
||||
function CoreGuis:on()
|
||||
SG:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
|
||||
if CoreGuis.IncludeReset then
|
||||
DisableReset(true)
|
||||
end
|
||||
end
|
||||
|
||||
function CoreGuis:off()
|
||||
SG:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
|
||||
if CoreGuis.IncludeReset then
|
||||
DisableReset(false)
|
||||
end
|
||||
end
|
||||
|
||||
return CoreGuis
|
||||
Reference in New Issue
Block a user