mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
T
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
|
||||||
type CharacterSharedFolder = Folder
|
type CharacterSharedFolder = Folder
|
||||||
|
type Character = Model
|
||||||
type TCP = RemoteEvent
|
type TCP = RemoteEvent
|
||||||
|
|
||||||
|
type include<T> = (this: LuaSourceContainer, FunName: string, ...T) -> T
|
||||||
|
|
||||||
local CharacterModule = {}
|
local CharacterModule = {}
|
||||||
CharacterModule.__index = CharacterModule
|
CharacterModule.__index = CharacterModule
|
||||||
|
|
||||||
@@ -13,25 +16,29 @@ local Storage = game:GetService("ReplicatedStorage")
|
|||||||
|
|
||||||
local ClientStorage = Storage:WaitForChild("Client") :: Folder
|
local ClientStorage = Storage:WaitForChild("Client") :: Folder
|
||||||
|
|
||||||
local preprocessor = {}
|
local function client_preprocessor<T>(Character: Character): (include<T>, CharacterSharedFolder)
|
||||||
local CharacterShared: Folder
|
local preprocessor = {}
|
||||||
|
local CharacterShared = Character:WaitForChild("shared") :: CharacterSharedFolder
|
||||||
|
|
||||||
function preprocessor.CharacterShared(): CharacterSharedFolder
|
function preprocessor.CharacterShared(): CharacterSharedFolder
|
||||||
return CharacterShared
|
return CharacterShared
|
||||||
end
|
|
||||||
|
|
||||||
_G.include = function(this: LuaSourceContainer, FunName: string, ...)
|
|
||||||
if this:IsDescendantOf(script) then --getfenv is being removed
|
|
||||||
local switch = preprocessor[FunName]
|
|
||||||
return type(switch) == "function" and switch(...) or switch
|
|
||||||
else
|
|
||||||
warn(`Preprocessor append failed "{FunName}"`, debug.traceback())
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
_G.include = function<T>(this: LuaSourceContainer, FunName: string, ...: T)
|
||||||
|
if this:IsDescendantOf(script) then --getfenv is being removed
|
||||||
|
local switch = preprocessor[FunName]
|
||||||
|
return type(switch) == "function" and switch(...) or switch
|
||||||
|
else
|
||||||
|
warn(`Preprocessor append failed "{FunName}"`, debug.traceback())
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return _G.include, CharacterShared
|
||||||
end
|
end
|
||||||
|
|
||||||
function CharacterModule.constructor(Character)
|
function CharacterModule.constructor(Character)
|
||||||
CharacterShared = Character:WaitForChild("shared")
|
local _, CharacterShared = client_preprocessor(Character)
|
||||||
|
|
||||||
local HumanoidRPSettings = require(script:WaitForChild("HumanoidRootPart"))
|
local HumanoidRPSettings = require(script:WaitForChild("HumanoidRootPart"))
|
||||||
local CameraModule = require(script:WaitForChild("Camera"))
|
local CameraModule = require(script:WaitForChild("Camera"))
|
||||||
@@ -52,6 +59,11 @@ function CharacterModule.constructor(Character)
|
|||||||
self.HumanoidSettings = HumanoidModule.constructor(Humanoid)
|
self.HumanoidSettings = HumanoidModule.constructor(Humanoid)
|
||||||
self.SpineMovement = SpineModule.constructor(self.CurrentCamera)
|
self.SpineMovement = SpineModule.constructor(self.CurrentCamera)
|
||||||
|
|
||||||
|
pcall(table.clear, _G)
|
||||||
|
pcall(table.freeze, _G)
|
||||||
|
pcall(table.clear, shared)
|
||||||
|
pcall(table.freeze, shared)
|
||||||
|
|
||||||
return setmetatable(self, CharacterModule)
|
return setmetatable(self, CharacterModule)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -120,6 +132,4 @@ function CharacterModule:EnableSpineMovement()
|
|||||||
self.SpineMovement:Enable()
|
self.SpineMovement:Enable()
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.include = nil
|
|
||||||
|
|
||||||
return CharacterModule
|
return CharacterModule
|
||||||
@@ -19,8 +19,6 @@ type Scalar = {
|
|||||||
Rotation: number
|
Rotation: number
|
||||||
}
|
}
|
||||||
|
|
||||||
type Stepped = RBXScriptConnection
|
|
||||||
|
|
||||||
type GuiDependencies = {
|
type GuiDependencies = {
|
||||||
IntroGui: ScreenGui,
|
IntroGui: ScreenGui,
|
||||||
Frame: Frame,
|
Frame: Frame,
|
||||||
@@ -52,14 +50,14 @@ local function GuiDependencies(IntroGui: ScreenGui): GuiDependencies
|
|||||||
|
|
||||||
local Frame = IntroGui:WaitForChild("Frame") :: Frame
|
local Frame = IntroGui:WaitForChild("Frame") :: Frame
|
||||||
|
|
||||||
local FrameGradient = Frame:WaitForChild("UIGradient") :: UIGradient
|
local FrameGradient = Frame:WaitForChild("UIGradient") :: UIGradient
|
||||||
local TextShadow = Frame:WaitForChild("TextShadow") :: TextLabel
|
local TextShadow = Frame:WaitForChild("TextShadow") :: TextLabel
|
||||||
local FrameworkText = Frame:WaitForChild("Framework") :: TextLabel
|
local FrameworkText = Frame:WaitForChild("Framework") :: TextLabel
|
||||||
local SandboxText = Frame:WaitForChild("Sandbox") :: TextLabel
|
local SandboxText = Frame:WaitForChild("Sandbox") :: TextLabel
|
||||||
local DeveloperText = Frame:WaitForChild("Developer") :: TextLabel
|
local DeveloperText = Frame:WaitForChild("Developer") :: TextLabel
|
||||||
local ShadowGradient = TextShadow:WaitForChild("UIGradient") :: UIGradient
|
local ShadowGradient = TextShadow:WaitForChild("UIGradient") :: UIGradient
|
||||||
local Quaternions = Frame:WaitForChild("Quaternions") :: ImageLabel
|
local Quaternions = Frame:WaitForChild("Quaternions") :: ImageLabel
|
||||||
local TaylorSeries = Frame:WaitForChild("TaylorSeries") :: ImageLabel
|
local TaylorSeries = Frame:WaitForChild("TaylorSeries") :: ImageLabel
|
||||||
|
|
||||||
local Xframe = Frame:WaitForChild("X") :: Frame
|
local Xframe = Frame:WaitForChild("X") :: Frame
|
||||||
local Yframe = Frame:WaitForChild("Y") :: Frame
|
local Yframe = Frame:WaitForChild("Y") :: Frame
|
||||||
@@ -92,7 +90,7 @@ end
|
|||||||
local Size = 300
|
local Size = 300
|
||||||
local WorldSize = 3
|
local WorldSize = 3
|
||||||
|
|
||||||
local function GUI_LoadFinish(Stepped: Stepped, Gui: GuiDependencies) --We can now access the framework
|
local function GUI_LoadFinish(Gui: GuiDependencies) --We can now access the framework
|
||||||
--Image if we had HTML and CSS...
|
--Image if we had HTML and CSS...
|
||||||
local Tween = require(Storage:WaitForChild("Tween"))
|
local Tween = require(Storage:WaitForChild("Tween"))
|
||||||
|
|
||||||
@@ -141,7 +139,6 @@ local function GUI_LoadFinish(Stepped: Stepped, Gui: GuiDependencies) --We can n
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
FrameTween.Completed:Wait()
|
FrameTween.Completed:Wait()
|
||||||
Stepped:Disconnect()
|
|
||||||
Gui.IntroGui:Destroy() --We dont need the intro gui anymore
|
Gui.IntroGui:Destroy() --We dont need the intro gui anymore
|
||||||
script.Parent:Destroy()
|
script.Parent:Destroy()
|
||||||
end
|
end
|
||||||
@@ -206,7 +203,7 @@ end
|
|||||||
return function(IntroGui: ScreenGui, load_elapse_start: number)
|
return function(IntroGui: ScreenGui, load_elapse_start: number)
|
||||||
local Gui = GuiDependencies(IntroGui)
|
local Gui = GuiDependencies(IntroGui)
|
||||||
|
|
||||||
local Stepped = RS.Stepped:Connect(function(Delta: number, _dt: number)
|
RS.Stepped:Connect(function(Delta: number, _dt: number)
|
||||||
UI_3D_Rotation(Gui, Delta)
|
UI_3D_Rotation(Gui, Delta)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -224,6 +221,6 @@ return function(IntroGui: ScreenGui, load_elapse_start: number)
|
|||||||
|
|
||||||
TS:Message("Load elapse: "..tostring(load_elapse), game)
|
TS:Message("Load elapse: "..tostring(load_elapse), game)
|
||||||
|
|
||||||
GUI_LoadFinish(Stepped, Gui)
|
GUI_LoadFinish(Gui)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -11,13 +11,6 @@ local Dir = script.Parent
|
|||||||
local Character = Dir.Parent
|
local Character = Dir.Parent
|
||||||
local preprocessor = {}
|
local preprocessor = {}
|
||||||
|
|
||||||
--Production--
|
|
||||||
--if not RS:IsStudio() then
|
|
||||||
task.wait()
|
|
||||||
Dir.Parent = nil
|
|
||||||
--end
|
|
||||||
--
|
|
||||||
|
|
||||||
--Create the character shared directory here
|
--Create the character shared directory here
|
||||||
local CharacterShared = Instance.new("Folder")
|
local CharacterShared = Instance.new("Folder")
|
||||||
CharacterShared.Name = "shared"
|
CharacterShared.Name = "shared"
|
||||||
|
|||||||
Reference in New Issue
Block a user