Rotation matrix UI and Interactions dir

This commit is contained in:
2024-04-19 00:24:25 -04:00
parent a9391feb87
commit e76e38bf0f
7 changed files with 181 additions and 67 deletions

View File

@@ -2,7 +2,7 @@
--!native
--!strict
local MapDir = script.Parent
local MapDir = script.Parent.Parent
local MainDir = MapDir.Parent
local Storage = game:GetService("ReplicatedStorage")
@@ -19,7 +19,7 @@ type Impl_Constructor = {
__index: Impl_Constructor,
constructor: Constructor_Fun,
--Class functions
Create: (self: ClassConstructor) -> (),
Init: (self: ClassConstructor) -> (),
} & Impl_Static_Props
type Impl_Static_Props = {
@@ -38,8 +38,6 @@ Lights.__index = Lights
Lights.SwitchAnimationTime = .1
local LightSwitchTween = TweenModule.constructor(TweenInfo.new(Lights.SwitchAnimationTime, Enum.EasingStyle.Linear))
function Lights.constructor(LightSwitches)
return setmetatable({
LightSwitches = LightSwitches
@@ -65,6 +63,8 @@ local function ToggleSwitchLight(EnabledState: boolean, LightObject: BasePart, L
end
end
local LightSwitchTween = TweenModule.constructor(TweenInfo.new(Lights.SwitchAnimationTime, Enum.EasingStyle.Linear))
local function SwitchAnimation(EnabledState: boolean, LightProperties: LightProperties)
local Switch = LightProperties.Switch
@@ -85,7 +85,7 @@ end
Guide for lights with toggable switches:
TODO
]]
function Lights:Create()
function Lights:Init()
for _, LightProperties in self.LightSwitches do
if LightProperties.Prompt and LightProperties.Switch then
local Prompt = PromptsConstructor.constructor(LightProperties.Prompt, LightProperties.Switch)
@@ -104,7 +104,7 @@ function Lights:Create()
end
end)
else
warn(`Prompt failed`)
warn(`LightSwitch hook failed, a required field is missing:\n-----\nColorDeactivated = {LightProperties.ColorDeactivated}\nColorActivated = {LightProperties.ColorActivated}\nPrompt = {LightProperties.Prompt}\nLights = {LightProperties.Lights}\n-----`)
end
end
end