Remove recursive search for light source, add LightSources

This commit is contained in:
2024-04-19 01:23:27 -04:00
parent e76e38bf0f
commit dbda8f9ca6
3 changed files with 38 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ type Impl_Constructor = {
__index: Impl_Constructor,
constructor: Constructor_Fun,
--Class functions
Init: (self: ClassConstructor) -> (),
Init: (self: ClassConstructor) -> ()
} & Impl_Static_Props
type Impl_Static_Props = {
@@ -63,6 +63,10 @@ local function ToggleSwitchLight(EnabledState: boolean, LightObject: BasePart, L
end
end
local function SwitchState()
end
local LightSwitchTween = TweenModule.constructor(TweenInfo.new(Lights.SwitchAnimationTime, Enum.EasingStyle.Linear))
local function SwitchAnimation(EnabledState: boolean, LightProperties: LightProperties)
@@ -92,6 +96,14 @@ function Lights:Init()
local EnabledState = false
if LightProperties.ColorDeactivated and LightProperties.ColorActivated and LightProperties.Prompt and LightProperties.Lights then
if LightProperties.Enabled then
LightProperties.Prompt.ActionText = "Toggle Off"
else
LightProperties.Prompt.ActionText = "Toggle On"
end
Prompt:AddHookTriggered(function(_Player: Player)
EnabledState = not EnabledState