mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2026-02-04 04:06:49 +00:00
Tag service module
This commit is contained in:
@@ -14,8 +14,6 @@ type TagProduct = TagsModule.TagProduct
|
||||
type HumanoidRootPart = BasePart
|
||||
type PromptCallback = (Player: Player) -> ()
|
||||
|
||||
type GetButtons = {[string]: Instance}
|
||||
|
||||
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
|
||||
type Impl_Constructor = {
|
||||
__index: Impl_Constructor,
|
||||
@@ -39,17 +37,6 @@ type Constructor_Return_Props = {
|
||||
Buttons: ButtonsTree
|
||||
}
|
||||
|
||||
export type ButtonsTree = {
|
||||
Landing: ButtonProperties,
|
||||
Car: ButtonProperties,
|
||||
Special: ButtonProperties,
|
||||
Relays: ButtonProperties
|
||||
}
|
||||
export type ButtonProperties = {
|
||||
Inst: Instance?,
|
||||
Prompt: ProximityPrompt?,
|
||||
Attachment: Attachment?
|
||||
}
|
||||
export type ButtonsConstructor = ClassConstructor
|
||||
|
||||
local ButtonsModule = {} :: Impl_Constructor
|
||||
@@ -68,30 +55,6 @@ function ButtonsModule.constructor(TagsConstructor, Model)
|
||||
}, ButtonsModule)
|
||||
end
|
||||
|
||||
--Button parsing
|
||||
|
||||
function ButtonsModule:DecodeCarTag(FloorTag)
|
||||
local Match = FloorTag:match('%d+$')
|
||||
return Match and tonumber(Match)
|
||||
end
|
||||
|
||||
function ButtonsModule:Get()
|
||||
local Buttons: GetButtons = {}
|
||||
|
||||
for TagName: string, Inst: TagProduct in self.Tags.__export do
|
||||
local Split = TagName:split('_')
|
||||
if Split[1] == self.Model and (Split[2] == "ElevatorButton" or Split[2] == "RelayButton") then
|
||||
if typeof(Inst) == "Instance" then
|
||||
Buttons[TagName] = Inst
|
||||
else
|
||||
warn("TODO block hit,", debug.traceback())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Buttons
|
||||
end
|
||||
|
||||
--[[
|
||||
CarButton = Model_ElevatorButton_1
|
||||
LandingButton = Model_ElevatorButton_Floor_1_Up
|
||||
|
||||
Reference in New Issue
Block a user