mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-15 21:41:53 +00:00
TagService -> Tags and more refactoring, close to working again
This commit is contained in:
@@ -8,8 +8,7 @@ local MainDir = Elevators.Parent
|
||||
local Storage: ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local RS: RunService = game:GetService("RunService")
|
||||
|
||||
local TagsModule = require(Storage:WaitForChild("Tags"))
|
||||
local Enums = require(Storage:WaitForChild("Enums"))
|
||||
local Enums = require(Storage:WaitForChild("Enums"))
|
||||
|
||||
local Leveling = require(script:WaitForChild("Leveling"))
|
||||
local Doors = require(script:WaitForChild("Doors"))
|
||||
@@ -21,12 +20,12 @@ local TractionRopes = require(Elevators:WaitForChild("TractionRopes"))
|
||||
local Lanterns = require(Elevators:WaitForChild("Lanterns"))
|
||||
|
||||
local PromptModule = require(MainDir:WaitForChild("Map"):WaitForChild("Prompts"))
|
||||
local TagService = require(MainDir:WaitForChild("TagService"))
|
||||
local Tags = require(MainDir:WaitForChild("Tags"))
|
||||
|
||||
type rbxassetid = string
|
||||
|
||||
type Tags = TagsModule.ExportedTags
|
||||
type TagsConstructor = TagsModule.TagsConstructor
|
||||
type Tags = Tags.ExportedTags
|
||||
type TagsConstructor = Tags.TagsConstructor
|
||||
|
||||
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
|
||||
type Impl_Constructor = {
|
||||
@@ -49,7 +48,7 @@ type Impl_Static_Props = {
|
||||
__CurrentFloor: number
|
||||
}
|
||||
|
||||
type Constructor_Fun = (TagsConstructor: TagsConstructor, TagServiceConstructor: TagService.TagsServiceConstructor) -> ClassConstructor
|
||||
type Constructor_Fun = (TagsConstructor: TagsConstructor, ButtonsTags: Tags.ButtonsTree, LanternsTags: Tags.Lanterns) -> ClassConstructor
|
||||
type Constructor_Return_Props = {
|
||||
Tags: Tags,
|
||||
MOConstructor: MovingObjects.MovingObjectsConstructor,
|
||||
@@ -73,7 +72,10 @@ type Constructor_Return_Props = {
|
||||
__MovingConnection: RBXScriptConnection?,
|
||||
}
|
||||
|
||||
type ButtonFunction = (self: ClassConstructor, ButtonName: string, ButtonsConstructor: ButtonTags.ButtonsConstructor, ButtonTree: ButtonTags.ButtonProperties) -> ()
|
||||
type ButtonFunction = (self: ClassConstructor, ButtonName: string, ButtonsConstructor: ButtonTags.ButtonsConstructor, ButtonTree: Tags.ButtonProperties) -> ()
|
||||
type ButtonFunctions = {
|
||||
[Enums.ButtonTreeValues]: ButtonFunction
|
||||
}
|
||||
|
||||
local Otis1960 = {} :: Impl_Constructor
|
||||
Otis1960.__index = Otis1960
|
||||
@@ -89,13 +91,13 @@ Otis1960.LanternChimeLanding = "rbxassetid://16990290265"
|
||||
Otis1960.__Moving = false
|
||||
Otis1960.__CurrentFloor = 1
|
||||
|
||||
local ButtonFunctions: {[Enums.ButtonTreeValues]: ButtonFunction} = {
|
||||
local ButtonFunctions: ButtonFunctions = {
|
||||
[Enums.ButtonTree.Landing] = function(self, ButtonName, ButtonsConstructor, ButtonTree)
|
||||
|
||||
end,
|
||||
|
||||
[Enums.ButtonTree.Car] = function(self, ButtonName, ButtonsConstructor, ButtonTree)
|
||||
local DecodedFloor = TagService.Decoder.CarTag(ButtonName)
|
||||
local DecodedFloor = Tags.Decoders.CarTag(ButtonName)
|
||||
if not DecodedFloor then
|
||||
|
||||
end
|
||||
@@ -134,7 +136,7 @@ local function HookButtons(self: ClassConstructor, ButtonsConstructor: ButtonTag
|
||||
end
|
||||
end
|
||||
|
||||
function Otis1960.constructor(TagsConstructor, TagServiceConstructor)
|
||||
function Otis1960.constructor(TagsConstructor, ButtonsTags, LanternsTags)
|
||||
local self = {} :: Constructor_Return_Props
|
||||
self.ElevatorBox_1960 = TagsConstructor:Request("ElevatorMover_1960") :: UnionOperation
|
||||
self.ElevatorDoor1 = TagsConstructor:Request("ElevatorDoor_1960_1") :: BasePart
|
||||
@@ -155,10 +157,10 @@ function Otis1960.constructor(TagsConstructor, TagServiceConstructor)
|
||||
self.MOConstructor = MovingObjects.constructor({MachineRoom = self.MachineRoom} :: MovingObjects.InstanceTree)
|
||||
|
||||
--Audio
|
||||
local LanternDisplay = TagsConstructor:Request("Otis1960_LanternDisplayMain") :: UnionOperation
|
||||
local LaternTags = TagServiceConstructor:Lanterns(Enums.Elevator.Otis1960) :: TagService.Lanterns
|
||||
local LanternDisplay = TagsConstructor:Request("Otis1960_LanternDisplayMain") :: UnionOperation
|
||||
local LanternTags = TagsConstructor:ElevatorLanterns()[Enums.Elevator.Otis1960]
|
||||
|
||||
self.LanternsConstructor = Lanterns.constructor(LanternDisplay, Otis1960.LanternChimeDirection, Otis1960.LanternChimeLanding, LaternTags, {
|
||||
self.LanternsConstructor = Lanterns.constructor(LanternDisplay, Otis1960.LanternChimeDirection, Otis1960.LanternChimeLanding, LanternTags, {
|
||||
Active = Otis1960.LanternDisplayColorOn,
|
||||
Off = Otis1960.LanternDisplayColorOff
|
||||
} :: Lanterns.Colors)
|
||||
@@ -177,7 +179,7 @@ function Otis1960.constructor(TagsConstructor, TagServiceConstructor)
|
||||
local ClassConstructor = setmetatable(self, Otis1960)
|
||||
HookButtons(ClassConstructor, ButtonsConstructor, Enums.ButtonTree.Car)
|
||||
|
||||
print("[DEBUG] Otis1960 Lanterns=", LaternTags)
|
||||
print("[DEBUG] Otis1960 Lanterns=", LanternTags)
|
||||
print("[DEBUG] Otis1960 Buttons=", Otis1960_Buttons)
|
||||
print("🔝 Otis1960 initialized and ready")
|
||||
return ClassConstructor
|
||||
|
||||
Reference in New Issue
Block a user