optimize native scripts

This commit is contained in:
2024-09-06 14:58:12 -04:00
parent f0bf277d13
commit a5afa7792a
61 changed files with 45 additions and 96 deletions

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
local Camera = {}
@@ -51,7 +50,7 @@ function Camera:ZoomIn(Vignette: Vignette?, Crosshair: Crosshair?)
if Camera.VignetteEnabled then
if Vignette then
Vignette.Screen.Enabled = true
VignetteTween:Start(Vignette.Icon, {
ImageTransparency = 0
}, TweenInfo.new(Camera.FOV.Speed.In, Camera.EffectsEase))
@@ -79,7 +78,7 @@ function Camera:ZoomOut(Vignette: Vignette?, Crosshair: Crosshair?)
if Camera.VignetteEnabled then
if Vignette then
Vignette.Screen.Enabled = true
VignetteTween:Start(Vignette.Icon, {
ImageTransparency = 1
}, TweenInfo.new(Camera.FOV.Speed.Out, Camera.EffectsEase))
@@ -87,7 +86,7 @@ function Camera:ZoomOut(Vignette: Vignette?, Crosshair: Crosshair?)
warn("Camera: no Vignette object was provided for the camera", debug.traceback())
end
end
if Camera.CrosshairEffect then
if Crosshair then
VignetteTween:Start(Crosshair.Icon, {

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
--Couldn't get ContextActionService to work how i wanted
@@ -46,7 +45,7 @@ function BindLink.constructor(gameProcessing: boolean) --Allow multiple bindings
Began = {},
Ended = {}
}
--Return these for convenience
self.InputBegan = UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessing and gameProcessedEvent or not gameProcessedEvent then

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
local Delta = {

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
local Enums = {}

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
local RunService = game:GetService("RunService")

View File

@@ -1,3 +1,2 @@
--!optimize 2
--!native
--!strict

View File

@@ -1,5 +1,4 @@
--!optimize 2
--!native
--!strict
--Weird type hack for allowing more than 1 property to be defined inside a tween