Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CatalogueManager = {}
- local MarketplaceService = game:GetService("MarketplaceService")
- local InputService = game:GetService("UserInputService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local SoundService = game:GetService("SoundService")
- local InsertService = game:GetService("InsertService")
- local Player = game:GetService("Players").LocalPlayer
- local Mouse = Player:GetMouse()
- local Camera = workspace.CurrentCamera
- local PlayerGui = Player:WaitForChild("PlayerGui")
- local AccessoryHold = ReplicatedStorage:WaitForChild("AccessoryHold")
- local Config = ReplicatedStorage:WaitForChild("Config")
- local Events = ReplicatedStorage:WaitForChild("Events")
- local ProductData = require(Config:WaitForChild("Product"))
- local RequestData = Events:WaitForChild("RequestData")
- local SendRequest = Events:WaitForChild("SendRequest")
- local CatalogueGui = PlayerGui:WaitForChild("CatalogueGui")
- local MainFrame = CatalogueGui:WaitForChild("MainFrame")
- local ScrollingFrame = MainFrame:WaitForChild("ScrollingFrame")
- local SearchRibbon = MainFrame:WaitForChild("SearchRibbon")
- local TabsRibbon = MainFrame:WaitForChild("TabsRibbon")
- local TextBox = SearchRibbon:WaitForChild("TextBox")
- local Designer = workspace:WaitForChild("Designer")
- local Avatar = Designer:WaitForChild("Avatar")
- local Humanoid, HumRP = Avatar:WaitForChild("Humanoid"),
- Avatar:WaitForChild("HumanoidRootPart")
- local ItemAssociations = {
- Head = {
- "Hat",
- "Hair",
- "Face",
- "Neck",
- "Eyebrow",
- "Eyelash"
- },
- Torso = {
- "Neck",
- "Shoulder",
- "Front",
- "Back",
- "Waist",
- "TShirt",
- "Shirt",
- "Pants",
- "Jacket",
- "Sweater",
- "Unknown",
- },
- Arms = {
- "TShirt",
- "Shirt",
- "Jacket",
- "Sweater",
- },
- Legs = {
- "Waist",
- "Pants",
- "Shorts",
- "LeftShoe",
- "RightShoe",
- "DressSkirt"
- }
- }
- local CatalogueData = {}
- local CatalogueConnections = {
- --[[ View = {
- Cell = {
- Base = {
- --// Connections on the cell itself
- ConnectionName = RbxScriptSignal
- },
- Any other keys will be separate objects within the cell, which
- will also have a table of connections.
- ex; Try = {
- MouseButton1Click = RbxScriptSignal
- }
- }
- }]]
- }
- --// Scale values, not offset.
- local HORIZONTAL_GAP = .247
- local VERTICAL_GAP = .359
- local CELL_BASE_TRANSPARENCY = .5
- local CELL_HOVER_TRANSPARENCY = .4
- local CELL_ACTIVATED_TRANSPARENCY = .25
- --// Both values are percentage based on ViewportSize
- local MOUSE_PORTION_X_OFFSET = .4
- local MOUSE_PORTION_X_SIZE = 50
- local MOUSE_PORTION_Y_SIZE = 90
- local AVATAR_ROTATION_SPEED = .5
- local EQUIP_COLOR = Color3.fromRGB(49, 43, 162)
- local TAKE_OFF_COLOR = Color3.fromRGB(150, 44, 44)
- local FirstItem = true
- local MouseInScreenPortion = false
- local MouseHoldingScreenPortion = false
- local LastMousePosition = 0
- local InitialClick = true
- local function VisualizeScreenPortion(PortionWidth, PortionHeight, PortionPosition)
- local ScreenGui = Instance.new("ScreenGui")
- local PortionFrame = Instance.new("Frame")
- ScreenGui.Name = "ScreenPortionDEBUG"
- ScreenGui.IgnoreGuiInset = true
- PortionFrame.Position = UDim2.new(0, PortionPosition.X, 0, PortionPosition.Y)
- PortionFrame.Size = UDim2.new(0, PortionWidth, 0, PortionHeight)
- PortionFrame.BackgroundTransparency = .75
- PortionFrame.Parent = ScreenGui
- ScreenGui.Parent = PlayerGui
- end
- local function ScaleToOffset(X, Y, ParentFrame)
- local ViewportSize = Camera.ViewportSize
- X = ParentFrame ~= nil and X * ParentFrame.AbsoluteSize.X
- or X * ViewportSize.X
- Y = ParentFrame ~= nil and Y * ParentFrame.AbsoluteSize.Y
- or Y * ViewportSize.Y
- return X, Y
- end
- local function OffsetToScale(X, Y, ParentFrame)
- local ViewportSize = Camera.ViewportSize
- X = ParentFrame ~= nil and X / ParentFrame.AbsoluteSize.X
- or X / ViewportSize.X
- Y = ParentFrame ~= nil and Y / ParentFrame.AbsoluteSize.Y
- or Y / ViewportSize.Y
- return X, Y
- end
- local function CompareIndicies(A, B)
- local NameA = CatalogueData[A].Name:lower()
- local NameB = CatalogueData[B].Name:lower()
- return NameA < NameB
- end
- local function GetConvertedGeometryOfGuiObject(GuiObject, Geometry, Type)
- local ConvertFunction = Type == "Offset" and ScaleToOffset
- or Type == "Scale" and OffsetToScale
- local InitialGeometry = GuiObject[Geometry]
- local InitialX, InitialY = InitialGeometry.X[Type], InitialGeometry.Y[Type]
- if Type == "Offset" then
- InitialX, InitialY = InitialX / 1000, InitialY / 1000
- end
- local NewX, NewY = ConvertFunction(InitialX, InitialY, GuiObject.Parent)
- local NewGeometry = Type == "Offset" and UDim2.new(0, NewX, 0, NewY) or
- Type == "Scale" and UDim2.new(NewX, 0, NewY, 0)
- return NewGeometry
- end
- local function ConvertCatalogueToOffset()
- for _,View in ipairs(ScrollingFrame:GetChildren()) do
- for _,Gui in ipairs(View:GetDescendants()) do
- --// We look for GuiButton and Frame so we don't have cutoff at the bottom for the details of the cell.
- if not Gui:IsA("GuiButton") and not Gui:IsA("Frame") then
- continue
- end
- local Details = Gui:FindFirstChild("Details")
- local GuiSize, GuiPosition = Gui.Size, Gui.Position
- local NewSize = GetConvertedGeometryOfGuiObject(Gui, "Size", "Offset")
- local NewPosition = GetConvertedGeometryOfGuiObject(Gui, "Position", "Offset")
- warn(`NewSize: {NewSize}, NewPosition: {NewPosition}`)
- if NewSize ~= UDim2.new(0, 0, 0, 0) then
- Gui.Size = NewSize
- end
- if NewPosition ~= UDim2.new(0, 0, 0, 0) then
- Gui.Position = NewPosition
- end
- if not Details then
- continue
- end
- for _,Label in ipairs(Details:GetChildren()) do
- NewSize = GetConvertedGeometryOfGuiObject(Gui, "Size", "Scale")
- NewPosition = GetConvertedGeometryOfGuiObject(Gui, "Position", "Scale")
- if NewSize ~= UDim2.new(0, 0, 0, 0) then
- Gui.Size = NewSize
- end
- Gui.Position = NewPosition
- end
- end
- end
- --// Repeat for the details of the frame, after the parent has been scaled
- end
- local function SortCatalogueAlpabetically()
- local SortedCatalogue = {}
- local CatalogueIndicies = {}
- for Index,_ in ipairs(CatalogueData) do
- CatalogueIndicies[Index] = Index
- end
- table.sort(CatalogueIndicies, CompareIndicies)
- for _,Index in ipairs(CatalogueIndicies) do
- table.insert(SortedCatalogue, CatalogueData[Index])
- end
- CatalogueData = {}
- for _,Data in ipairs(SortedCatalogue) do
- table.insert(CatalogueData, Data)
- end
- end
- local function EnableCorrectViewFrame(Tab)
- local SearchFrame = ScrollingFrame:FindFirstChild("Search")
- local ViewFrame, EnabledLine = nil
- if Tab ~= nil then
- ViewFrame = ScrollingFrame:FindFirstChild(Tab.Name)
- Tab.EnabledLine.BackgroundTransparency = 0
- if SearchFrame then
- SearchFrame:Destroy()
- end
- else
- ViewFrame = SearchFrame
- end
- for _,OtherViewFrame in ipairs(ScrollingFrame:GetChildren()) do
- if not OtherViewFrame:IsA("Frame") or OtherViewFrame == ViewFrame or OtherViewFrame.Name == "Search" then
- continue
- end
- local OtherEnabledLine = TabsRibbon[OtherViewFrame.Name].EnabledLine
- OtherEnabledLine.BackgroundTransparency = 1
- OtherViewFrame.Visible = false
- end
- if ViewFrame and not ViewFrame.Visible then
- ViewFrame.Visible = true
- end
- end
- local function EquipAsset(Try)
- local Cell = Try.Parent
- local AssetId = Cell:GetAttribute("AssetId")
- for _,AssetData in ipairs(CatalogueData) do
- local Id = AssetData.AssetId
- if Id == AssetId then
- SendRequest:FireServer("AddAccessoryToDesigner", AssetId)
- end
- end
- Try.BackgroundColor3 = TAKE_OFF_COLOR
- Try.Text = "Take Off"
- end
- local function DeEquipAsset(Try)
- local Cell = Try.Parent
- local Accessories = Humanoid:GetAccessories()
- local AssetId = Cell:GetAttribute("AssetId")
- for _,Accessory in Accessories do
- if Accessory:GetAttribute("AssetId") ~= AssetId then
- continue
- end
- Accessory:Destroy()
- end
- Try.BackgroundColor3 = EQUIP_COLOR
- Try.Text = "Try On"
- end
- local function BuyMouseButton1Click(Buy)
- local Cell = Buy.Parent
- local AssetId = Cell:GetAttribute("AssetId")
- SendRequest:FireServer("PromptPurchase", AssetId)
- end
- local function TryMouseButton1Click(Try)
- local Cell = Try.Parent
- local AssetId = Cell:GetAttribute("AssetId")
- local AssetEquipped = Cell:GetAttribute("Equipped")
- local ResultingFunction = not AssetEquipped and EquipAsset
- or DeEquipAsset
- ResultingFunction(Try)
- Cell:SetAttribute("Equipped", not AssetEquipped)
- end
- local function HideAllCellButtons(View)
- for _,Cell in ipairs(View:GetChildren()) do
- for _,Button in ipairs(Cell:GetChildren()) do
- if not Button:IsA("GuiButton") then
- continue
- end
- Button.Visible = false
- end
- end
- end
- local function CellMouseEntered(Cell)
- local Sound = _G.GetSound("Hover")
- Sound.Parent = SoundService
- Sound:Destroy()
- Cell.BackgroundTransparency = CELL_HOVER_TRANSPARENCY
- end
- local function CellMouseLeft(Cell)
- Cell.BackgroundTransparency = CELL_BASE_TRANSPARENCY
- end
- local function CellMouse1Click(Cell)
- local Click = _G.GetSound("Click")
- local View = Cell.Parent
- local Buy, Try = Cell.Buy, Cell.Try
- local Activated = nil
- --// First, we disable all cells Buy and Try buttons.
- HideAllCellButtons(View)
- --// Then, we can enable our cells Buy and Try buttons.
- print("CellMouse1Click ran.")
- for _,Button in ipairs({Buy, Try}) do
- Activated = Button.Visible
- print(not Activated)
- Button.Visible = not Activated
- end
- local NewCellTransparency = Activated and CELL_ACTIVATED_TRANSPARENCY or CELL_BASE_TRANSPARENCY
- Cell.BackgroundTransparency = NewCellTransparency
- Click.Parent = SoundService
- Click:Destroy()
- end
- local function CellButtonMouse1Click(Button)
- local Cell = Button.Parent
- local Buy, Try = Cell.Buy, Cell.Try
- local Click = _G.GetSound("Click")
- local Function = Button.Name == "Buy" and BuyMouseButton1Click
- or TryMouseButton1Click
- Function(Button)
- Buy.Visible, Try.Visible = false, false
- Cell.BackgroundTransparency = CELL_BASE_TRANSPARENCY
- Click.Parent = SoundService
- Click:Destroy()
- end
- local function EstablishCellConnections(Cell)
- local View = Cell.Parent
- local Try, Buy = Cell:WaitForChild("Try"),
- Cell:WaitForChild("Buy")
- local ViewConnections = CatalogueConnections[View.Name]
- ViewConnections.Base = {}
- ViewConnections.Try = {}
- ViewConnections.Buy = {}
- local BaseConnections = ViewConnections.Base
- local TryConnections, BuyConnections = ViewConnections.Try, ViewConnections.Buy
- BaseConnections.MouseEnter = Cell.MouseEnter:Connect(function()
- CellMouseEntered(Cell)
- end)
- BaseConnections.MouseLeave = Cell.MouseLeave:Connect(function()
- CellMouseLeft(Cell)
- end)
- BaseConnections.Mouse1Click = Cell.MouseButton1Click:Connect(function()
- CellMouse1Click(Cell)
- end)
- for _,Button in ipairs({Try, Buy}) do
- ViewConnections[Button.Name].Mouse1Click = Button.MouseButton1Click:Connect(function()
- CellButtonMouse1Click(Button)
- end)
- end
- end
- local function EstablishTabConnections(Tab)
- Tab.MouseEnter:Connect(function()
- local Sound = _G.GetSound("Hover")
- Sound.Parent = SoundService
- Sound:Destroy()
- Tab.ImageTransparency = .35
- end)
- Tab.MouseLeave:Connect(function()
- Tab.ImageTransparency = 0
- end)
- Tab.MouseButton1Click:Connect(function()
- if Tab:GetAttribute("Enabled") then
- return
- end
- local Sound = _G.GetSound("Click")
- Sound.Parent = SoundService
- Sound:Destroy()
- Tab:SetAttribute("Enabled", true)
- for _,OtherTab in ipairs(TabsRibbon:GetChildren()) do
- if OtherTab == Tab then
- continue
- end
- Tab:SetAttribute("Enabled", false)
- end
- EnableCorrectViewFrame(Tab)
- end)
- end
- local function EstablishViewConnections(View)
- CatalogueConnections[View.Name] = {}
- local ViewConnections = CatalogueConnections[View.Name]
- for _,Cell in ipairs(View:GetChildren()) do
- ViewConnections[Cell.Name] = {}
- ViewConnections.Base = {}
- ViewConnections.Try = {}
- ViewConnections.Buy = {}
- EstablishCellConnections(Cell)
- end
- end
- local function CreateCatalogueCell(View)
- local ViewFrame = ScrollingFrame[View.Name]
- local FirstItem = ViewFrame:GetAttribute("FirstItem")
- local Column, Row = ViewFrame:GetAttribute("Column"),
- ViewFrame:GetAttribute("Row")
- local PreviousCellName = "Cell"..tostring(Row).."-"..(tostring(Column))
- local NewColumn = Column < 4 and Column + 1 or 1
- local NewRow = NewColumn == 1 and Row + 1 or Row
- local NewCellName = "Cell"..tostring(NewRow).."-"..tostring(NewColumn)
- local PreviousCell = ViewFrame[PreviousCellName]
- local NewCell = PreviousCell:Clone()
- if NewCell.Name:match("-(.)") == "4" then
- NewCell = ViewFrame["Cell"..tostring(Row).."-1"]:Clone()
- end
- local CurrentPosition = NewCell.Position
- CurrentPosition = UDim2.fromScale(OffsetToScale(CurrentPosition.X.Offset, CurrentPosition.Y.Offset, ScrollingFrame))
- local NewPosition = NewRow == Row and UDim2.new(CurrentPosition.X.Scale + HORIZONTAL_GAP, 0, CurrentPosition.Y.Scale, 0)
- or UDim2.new(CurrentPosition.X.Scale, 0, CurrentPosition.Y.Scale + VERTICAL_GAP, 0)
- NewPosition = UDim2.fromOffset(ScaleToOffset(NewPosition.X.Scale, NewPosition.Y.Scale, ScrollingFrame))
- if FirstItem then
- NewPosition = CurrentPosition
- NewCellName = "Cell1-1"
- NewColumn, NewRow = 1, 1
- ViewFrame:SetAttribute("FirstItem", false)
- PreviousCell:Destroy()
- end
- NewCell.Name = NewCellName
- NewCell.Position = NewPosition
- NewCell.Parent = ViewFrame
- ViewFrame:SetAttribute("Column", NewColumn)
- ViewFrame:SetAttribute("Row", NewRow)
- return NewCell
- end
- --// Try and implement the search function into this functionality.
- local function CreateCatalogueView(View)
- local ViewFrame = ScrollingFrame[View.Name]
- for _,AssetData in ipairs(CatalogueData) do
- local AssetId, AssetName = AssetData.AssetId, AssetData.Name
- local Accessory = AssetData.Accessory
- if Accessory == nil then
- continue
- end
- local AccessoryType = Accessory.AccessoryType
- local CorrectAssetType = View.Name == "All" and true
- or table.find(ItemAssociations[View.Name], AccessoryType.Name)
- if not CorrectAssetType then
- continue
- end
- local Name, Price = AssetData.Name, AssetData.PriceInRobux
- local Cell = CreateCatalogueCell(View)
- local Details = Cell.Details
- local NameLabel, PriceLabel = Details.Label, Details.Price
- Cell.Image = `rbxthumb://type=Asset&id={AssetId}&w=420&h=420`
- Cell:SetAttribute("AssetId", AssetId)
- Cell:SetAttribute("Name", Name)
- NameLabel.Text, PriceLabel.Text = Name, tostring(Price)
- end
- EstablishViewConnections(ViewFrame)
- --ConvertCatalogueToOffset()
- end
- local function LoadAllAccessories()
- for _,AssetData in ipairs(CatalogueData) do
- local AssetId = AssetData.AssetId
- local AccessoryLoaded = RequestData:InvokeServer("LoadAccessory", AssetId)
- if not AccessoryLoaded then
- continue
- end
- local Accessory = AccessoryHold:FindFirstChildOfClass("Accessory")
- local AccessoryType = Accessory.AccessoryType
- if AccessoryType == nil then
- continue
- end
- AssetData.Accessory = Accessory
- Accessory.Parent = nil
- end
- end
- local function LoadCatalogueData()
- for _,AssetId in ipairs(ProductData) do
- table.insert(CatalogueData, MarketplaceService:GetProductInfo(AssetId))
- end
- SortCatalogueAlpabetically()
- LoadAllAccessories()
- end
- local function RemoveCellsFromSearchResult(View, Result)
- for _,Cell in ipairs(View:GetChildren()) do
- local AssetName = string.lower(Cell:GetAttribute("Name") or "")
- local NameContainsSearch = string.find(AssetName, Result)
- if not NameContainsSearch then
- Cell:Destroy()
- else
- Cell.Position = UDim2.new(0, 0, 0, 0)
- end
- end
- end
- local function PositionBunchedCells(View)
- local PreviousCell = nil
- for _,Cell in ipairs(View:GetChildren()) do
- local Row, Column = View:GetAttribute("Row") or 1,
- View:GetAttribute("Column") or 1
- local NewColumn = (Column + 1 <= 4 and Column + 1) or 1
- if PreviousCell == nil then
- NewColumn = 1
- end
- local NewRow = (NewColumn == 1 and Row + 1) or Row
- local CurrentPosition = PreviousCell and PreviousCell.Position or Cell.Position
- CurrentPosition = UDim2.fromScale(OffsetToScale(CurrentPosition.X.Offset, CurrentPosition.Y.Offset, ScrollingFrame))
- local NewPosition = NewRow == Row and UDim2.new(CurrentPosition.X.Scale + HORIZONTAL_GAP, 0, CurrentPosition.Y.Scale, 0)
- or UDim2.new(0, 0, CurrentPosition.Y.Scale + VERTICAL_GAP, 0)
- NewPosition = UDim2.fromOffset(ScaleToOffset(NewPosition.X.Scale, NewPosition.Y.Scale, ScrollingFrame))
- if PreviousCell == nil then
- NewPosition = UDim2.new(0, 0, 0, 0)
- end
- Cell.Name = "Cell"..Row.."-"..Column
- Cell.Position = NewPosition
- View:SetAttribute("Row", NewRow)
- View:SetAttribute("Column", NewColumn)
- PreviousCell = Cell
- end
- --ConvertCatalogueToOffset()
- end
- local function ValidateSearchResults()
- local Result = TextBox.Text
- Result = string.lower(Result)
- local OldView = ScrollingFrame:FindFirstChild("Search")
- if OldView then
- OldView:Destroy()
- end
- if Result == "" then
- EnableCorrectViewFrame("All")
- return
- end
- local NewView = ScrollingFrame.All:Clone()
- NewView.Name = "Search"
- NewView.Parent = ScrollingFrame
- NewView:SetAttribute("Row", 1)
- NewView:SetAttribute("Column", 1)
- RemoveCellsFromSearchResult(NewView, Result)
- PositionBunchedCells(NewView)
- EnableCorrectViewFrame()
- for _,ViewFrame in ipairs(ScrollingFrame:GetChildren()) do
- if ViewFrame == NewView then
- continue
- end
- ViewFrame.Visible = false
- end
- end
- local function PlayRadioMusic(Radio)
- local Playlist = _G.GetSound("Music")
- local DistortionEffect = Instance.new("DistortionSoundEffect")
- DistortionEffect.Level = .4
- task.spawn(function()
- while true do task.wait()
- local SongValues = _G.ArrayFromDictionary(Playlist)
- for Name, Song in Playlist do
- local RandomIndex = math.random(1, #SongValues)
- local RandomSong = SongValues[RandomIndex]
- if Song ~= RandomSong then
- continue
- end
- table.remove(SongValues, RandomIndex)
- Song.PlayOnRemove = false
- Song.Volume = 1
- Song.Parent = Radio
- Song:Play()
- warn(`Now playing: {Name}`)
- Song.Ended:Wait()
- Song:Destroy()
- end
- end
- end)
- end
- local function IsMouseInScreenPortion()
- local MousePosition = InputService:GetMouseLocation()
- local ViewportSize = Camera.ViewportSize
- local ScreenWidth, ScreenHeight = ViewportSize.X, ViewportSize.Y
- local PortionWidth = ScreenWidth * MOUSE_PORTION_X_SIZE / 100
- local PortionHeight = ScreenHeight * MOUSE_PORTION_Y_SIZE / 100
- local PortionXStart = ScreenWidth - PortionWidth - (ScreenWidth * MOUSE_PORTION_X_OFFSET / 100)
- local PortionYStart = (ScreenHeight - PortionHeight) / 2
- local PortionYEnd = ScreenHeight - PortionYStart
- local PortionPosition = Vector2.new(PortionXStart, PortionYStart)
- return (
- MousePosition.X >= PortionXStart and MousePosition.X <= ScreenWidth and
- MousePosition.Y >= PortionYStart and MousePosition.Y <= PortionYEnd
- )
- end
- local function MouseEnteredScreenPortion()
- local IsMouseInScreenPortion = IsMouseInScreenPortion()
- local StateChanged = (IsMouseInScreenPortion and not MouseInScreenPortion)
- or (not IsMouseInScreenPortion and MouseInScreenPortion)
- if not StateChanged then
- return
- end
- MouseInScreenPortion = IsMouseInScreenPortion
- if not MouseInScreenPortion then
- MouseHoldingScreenPortion = false
- end
- end
- local function RotateAvatar()
- local MousePosition = InputService:GetMouseLocation().X
- if InitialClick then
- InitialClick = false
- LastMousePosition = MousePosition
- return
- end
- local MouseDelta = MousePosition - (LastMousePosition or MousePosition)
- local RotationAngle = math.rad(MouseDelta * AVATAR_ROTATION_SPEED)
- Avatar:SetPrimaryPartCFrame(HumRP.CFrame * CFrame.Angles(0, RotationAngle, 0))
- LastMousePosition = MousePosition
- end
- local function OnMouseMove()
- MouseEnteredScreenPortion()
- if (MouseInScreenPortion and MouseHoldingScreenPortion) then
- RotateAvatar()
- end
- end
- local function EstablishMouseConnections()
- Mouse.Move:Connect(OnMouseMove)
- for _,InputState in ipairs({"InputBegan", "InputEnded"}) do
- InputService[InputState]:Connect(function(Input)
- local IsMouse1Input = Input.UserInputType == Enum.UserInputType.MouseButton1
- local MouseDown = InputState == "InputBegan" and true or false
- if not IsMouse1Input or (not MouseInScreenPortion) then
- return
- end
- MouseHoldingScreenPortion = MouseDown
- if not MouseDown then
- InitialClick = true
- end
- end)
- end
- end
- local function InitCatalogue()
- local Scene = workspace:WaitForChild("Designer")
- local CameraPart = Scene:WaitForChild("Camera")
- local RadioPart = Scene:WaitForChild("Radio")
- Camera.CFrame = CameraPart.CFrame
- EstablishMouseConnections()
- PlayRadioMusic(RadioPart)
- LoadCatalogueData()
- for _,Tab in ipairs(TabsRibbon:GetChildren()) do
- if not Tab:IsA("GuiButton") then
- continue
- end
- CreateCatalogueView(Tab)
- EstablishTabConnections(Tab)
- end
- EnableCorrectViewFrame(TabsRibbon.All)
- CatalogueGui.Enabled = true
- end
- function CatalogueManager.Initialize()
- TextBox:GetPropertyChangedSignal("Text"):Connect(ValidateSearchResults)
- InitCatalogue()
- end
- return CatalogueManager
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement