From 3e5996b70195579dda8f97860c5cfc9153870e50 Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Thu, 20 Apr 2023 04:31:41 +0100 Subject: [PATCH] Port some more corescripts to Yuescript --- yue/157877000.lua | 834 ++++++++++++++++ yue/157877000.yue | 914 ++++++++++++++++++ yue/46295863.lua | 1803 +++++++++++++++++++++++++++++++++++ yue/46295863.yue | 2295 +++++++++++++++++++++++++++++++++++++++++++++ yue/60595411.lua | 365 ++++++- yue/60595411.yue | 607 +++++++++++- 6 files changed, 6794 insertions(+), 24 deletions(-) create mode 100644 yue/157877000.lua create mode 100644 yue/46295863.lua diff --git a/yue/157877000.lua b/yue/157877000.lua new file mode 100644 index 0000000..12b3dd9 --- /dev/null +++ b/yue/157877000.lua @@ -0,0 +1,834 @@ +local Create = assert(LoadLibrary("RbxUtility")).Create +local gui = script.Parent:FindFirstChild("ControlFrame") or script.Parent +local Dev_Container = Create("Frame")({ + Name = "DevConsoleContainer", + Parent = gui, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.9, + Position = UDim2.new(0, 100, 0, 10), + Size = UDim2.new(0.5, 20, 0.5, 20), + Visible = false +}) +local ToggleConsole = Create("BindableFunction")({ + Name = "ToggleDevConsole", + Parent = gui +}) +local devConsoleInitialized = false +local initializeDeveloperConsole +initializeDeveloperConsole = function() + if devConsoleInitialized then + return + end + devConsoleInitialized = true + local LOCAL_CONSOLE = 1 + local SERVER_CONSOLE = 2 + local MAX_LIST_SIZE = 1000 + local minimumSize = Vector2.new(245, 180) + local currentConsole = LOCAL_CONSOLE + local localMessageList = { } + local serverMessageList = { } + local localOffset = 0 + local serverOffset = 0 + local errorToggleOn = true + local warningToggleOn = true + local infoToggleOn = true + local outputToggleOn = true + local wordWrapToggleOn = false + local textHolderSize = 0 + local frameNumber = 0 + local Dev_Body = Create("Frame")({ + Name = "Body", + Parent = Dev_Container, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 21), + Size = UDim2.new(1, 0, 1, -25) + }) + local Dev_OptionsHolder = Create("Frame")({ + Name = "OptionsHolder", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 220, 0, 0), + Size = UDim2.new(1, -255, 0, 24), + ClipsDescendants = true + }) + local Dev_OptionsBar = Create("Frame")({ + Name = "OptionsBar", + Parent = Dev_OptionsHolder, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, -250, 0, 4), + Size = UDim2.new(0, 234, 0, 18) + }) + local Dev_ErrorToggleFilter = Create("TextButton")({ + Name = "ErrorToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 0, 0), + Position = UDim2.new(0, 115, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 0, 0) + }) + Create("Frame")({ + Name = "CheckFrame", + Parent = Dev_ErrorToggleFilter, + BackgroundColor3 = Color3.new(1, 0, 0), + BorderColor3 = Color3.new(1, 0, 0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10) + }) + local Dev_InfoToggleFilter = Create("TextButton")({ + Name = "InfoToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(0.4, 0.5, 1.0), + Position = UDim2.new(0, 65, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(0.4, 0.5, 1.0) + }) + Create("Frame")({ + Name = "CheckFrame", + Parent = Dev_InfoToggleFilter, + BackgroundColor3 = Color3.new(0.4, 0.5, 1.0), + BorderColor3 = Color3.new(0.4, 0.5, 1.0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10) + }) + local Dev_OutputToggleFilter = Create("TextButton")({ + Name = "OutputToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 1, 1.0), + Position = UDim2.new(0, 40, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 1, 1.0) + }) + Create("Frame")({ + Name = "CheckFrame", + Parent = Dev_OutputToggleFilter, + BackgroundColor3 = Color3.new(1, 1, 1.0), + BorderColor3 = Color3.new(1, 1, 1.0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10) + }) + local Dev_WarningToggleFilter = Create("TextButton")({ + Name = "WarningToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 0.6, 0.4), + Position = UDim2.new(0, 90, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 0.6, 0.4) + }) + Create("Frame")({ + Name = "CheckFrame", + Parent = Dev_WarningToggleFilter, + BackgroundColor3 = Color3.new(1, 0.6, 0.4), + BorderColor3 = Color3.new(1, 0.6, 0.4), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10) + }) + local Dev_WordWrapToggle = Create("TextButton")({ + Name = "WordWrapToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(0.8, 0.8, 0.8), + Position = UDim2.new(0, 215, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(0.8, 0.8, 0.8) + }) + Create("Frame")({ + Name = "CheckFrame", + Parent = Dev_WordWrapToggle, + BackgroundColor3 = Color3.new(0.8, 0.8, 0.8), + BorderColor3 = Color3.new(0.8, 0.8, 0.8), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), + Visible = false + }) + Create("TextLabel")({ + Name = "Filter", + Parent = Dev_OptionsBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 40, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Filter", + TextColor3 = Color3.new(1, 1, 1) + }) + Create("TextLabel")({ + Name = "WordWrap", + Parent = Dev_OptionsBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 150, 0, 0), + Size = UDim2.new(0, 50, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Word Wrap", + TextColor3 = Color3.new(1, 1, 1) + }) + local Dev_ScrollBar = Create("Frame")({ + Name = "ScrollBar", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.9, + Position = UDim2.new(1, -20, 0, 26), + Size = UDim2.new(0, 20, 1, -50), + Visible = false + }) + local Dev_ScrollArea = Create("Frame")({ + Name = "ScrollArea", + Parent = Dev_ScrollBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 23), + Size = UDim2.new(1, 0, 1, -46) + }) + local Dev_Handle = Create("ImageButton")({ + Name = "Handle", + Parent = Dev_ScrollArea, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0.2, 0), + Size = UDim2.new(0, 20, 0, 40) + }) + Create("ImageLabel")({ + Name = "ImageLabel", + Parent = Dev_Handle, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0.5, -8), + Rotation = 180, + Size = UDim2.new(1, 0, 0, 16), + Image = "http://www.roblox.com/Asset?id=151205881" + }) + local Dev_DownButton = Create("ImageButton")({ + Name = "Down", + Parent = Dev_ScrollBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 1, -20), + Size = UDim2.new(0, 20, 0, 20) + }) + Create("ImageLabel")({ + Name = "ImageLabel", + Parent = Dev_DownButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Rotation = 180, + Image = "http://www.roblox.com/Asset?id=151205813" + }) + local Dev_UpButton = Create("ImageButton")({ + Name = "Up", + Parent = Dev_ScrollBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 20, 0, 20) + }) + Create("ImageLabel")({ + Name = "ImageLabel", + Parent = Dev_UpButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Image = "http://www.roblox.com/Asset?id=151205813" + }) + local Dev_TextBox = Create("Frame")({ + Name = "TextBox", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.6, + Position = UDim2.new(0, 2, 0, 26), + Size = UDim2.new(1, -4, 1, -28), + ClipsDescendants = true + }) + local Dev_TextHolder = Create("Frame")({ + Name = "TextHolder", + Parent = Dev_TextBox, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0) + }) + local Dev_OptionsButton = Create("ImageButton")({ + Name = "OptionsButton", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 200, 0, 2), + Size = UDim2.new(0, 20, 0, 20) + }) + Create("ImageLabel")({ + Name = "ImageLabel", + Parent = Dev_OptionsButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0), + Rotation = 0, + Image = "http://www.roblox.com/Asset?id=152093917" + }) + local Dev_ResizeButton = Create("ImageButton")({ + Name = "ResizeButton", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(1, -20, 1, -20), + Size = UDim2.new(0, 20, 0, 20) + }) + Create("ImageLabel")({ + Name = "ImageLabel", + Parent = Dev_ResizeButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 6, 0, 6), + Size = UDim2.new(0.8, 0, 0.8, 0), + Rotation = 135, + Image = "http://www.roblox.com/Asset?id=151205813" + }) + Create("TextButton")({ + Name = "LocalConsole", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.6, + Position = UDim2.new(0, 7, 0, 5), + Size = UDim2.new(0, 90, 0, 20), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Local Console", + TextColor3 = Color3.new(1, 1, 1), + TextYAlignment = Enum.TextYAlignment.Center + }) + Create("TextButton")({ + Name = "ServerConsole", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.8, + Position = UDim2.new(0, 102, 0, 5), + Size = UDim2.new(0, 90, 0, 17), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Server Console", + TextColor3 = Color3.new(1, 1, 1), + TextYAlignment = Enum.TextYAlignment.Center + }) + local Dev_TitleBar = Create("Frame")({ + Name = "TitleBar", + Parent = Dev_Container, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 0, 20) + }) + local Dev_CloseButton = Create("ImageButton")({ + Name = "CloseButton", + Parent = Dev_TitleBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(1, -20, 0, 0), + Size = UDim2.new(0, 20, 0, 20) + }) + Create("ImageLabel")({ + Parent = Dev_CloseButton, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Image = "http://www.roblox.com/Asset?id=151205852" + }) + Create("TextButton")({ + Name = "TextButton", + Parent = Dev_TitleBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, -23, 1, 0), + Text = "" + }) + Create("TextLabel")({ + Name = "TitleText", + Parent = Dev_TitleBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 185, 0, 20), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + Text = "Roblox Developer Console", + TextYAlignment = Enum.TextYAlignment.Top + }) + local previousMousePos + local pPos + local previousMousePosResize + local pSize + local previousMousePosScroll + local pOffset + local scrollUpIsDown = false + local scrollDownIsDown = false + local clean + clean = function() + previousMousePos = nil + pPos = nil + previousMousePosResize = nil + pSize = nil + previousMousePosScroll = nil + pOffset = nil + scrollUpIsDown = false + scrollDownIsDown = false + end + local refreshConsolePosition + refreshConsolePosition = function(x, y) + if not previousMousePos then + return + end + local delta = Vector2.new(x, y - previousMousePos) + Dev_Container.Position = UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y) + end + Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y) + previousMousePos = Vector2.new(x, y) + pPos = Dev_Container.AbsolutePosition + end) + Dev_TitleBar.TextButton.MouseButton1Up:connect(clean) + local refreshConsoleSize + refreshConsoleSize = function(x, y) + if not previousMousePosResize then + return + end + local delta = Vector2.new(x, y - previousMousePosResize) + Dev_Container.Size = UDim2.new(0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max(pSize.Y + delta.Y, minimumSize.Y)) + end + Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y) + previousMousePosResize = Vector2.new(x, y) + pSize = Dev_Container.AbsoluteSize + end) + Dev_Container.Body.ResizeButton.MouseButton1Up:connect(clean) + Dev_TitleBar.CloseButton.MouseButton1Down:connect(function() + Dev_Container.Visible = false + end) + Dev_Container.TitleBar.CloseButton.MouseButton1Up:connect(clean) + local optionsHidden = true + local animating = false + local startAnimation + startAnimation = function() + if animating then + return + end + animating = true + repeat + frameNumber = frameNumber + (function() + if optionsHidden then + return -1 + else + return 1 + end + end)() + local x = frameNumber / 5 + local smoothStep = x * x * (3 - (2 * x)) + Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9 + Dev_OptionsBar.Position = UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4) + wait() + if (frameNumber <= 0 and optionsHidden) or (frameNumber >= 5 and not optionsHidden) then + animating = false + end + until not animating + end + Dev_OptionsButton.MouseButton1Down:connect(function() + optionsHidden = not optionsHidden + return startAnimation() + end) + local repositionList + repositionList = function() + if currentConsole == LOCAL_CONSOLE then + localOffset = math.min(math.max(localOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) + Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) + elseif currentConsole == SERVER_CONSOLE then + serverOffset = math.min(math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) + Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) + end + local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y + if ratio >= 1 then + Dev_Container.Body.ScrollBar.Visible = false + Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28) + if currentConsole == LOCAL_CONSOLE or currentConsole == SERVER_CONSOLE then + Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize) + end + else + Dev_Container.Body.ScrollBar.Visible = true + Dev_Container.Body.TextBox.Size = UDim2.new(1, -25, 1, -28) + local backRatio = 1 - ratio + local offsetRatio + if currentConsole == LOCAL_CONSOLE then + offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y + elseif currentConsole == SERVER_CONSOLE then + offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y + end + local topRatio = math.max(0, backRatio - offsetRatio) + local scrollHandleSize = math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21) + local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y + local ratioConversion = (1 - scrollRatio) / (1 - ratio) + local topScrollRatio = topRatio * ratioConversion + local sPos = math.min(Dev_ScrollArea.AbsoluteSize.Y * topScrollRatio, Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize) + Dev_ScrollArea.Handle.Size = UDim2.new(1, 0, 0, scrollHandleSize) + Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos) + Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + (function() + if currentConsole == LOCAL_CONSOLE then + return localOffset + elseif currentConsole == SERVER_CONSOLE then + return serverOffset + end + end)()) + end + end + local changeOffset + changeOffset = function(value) + if currentConsole == LOCAL_CONSOLE then + localOffset = localOffset + value + elseif currentConsole == SERVER_CONSOLE then + serverOffset = serverOffset + value + end + return repositionList() + end + local refreshTextHolderForReal + refreshTextHolderForReal = function() + local childMessages = Dev_TextHolder:GetChildren() + local messageList + if currentConsole == LOCAL_CONSOLE then + messageList = localMessageList + elseif currentConsole == SERVER_CONSOLE then + messageList = serverMessageList + end + local posOffset = 0 + for i = 1, #childMessages do + childMessages[i].Visible = false + end + for i = 1, #messageList do + local message + local movePosition = false + if i > #childMessages then + message = Create("TextLabel")({ + Name = "Message", + Parent = Dev_TextHolder, + BackgroundTransparency = 1, + TextXAlignment = "Left", + Size = UDim2.new(1, 0, 0, 14), + FontSize = "Size10", + ZIndex = 1 + }) + movePosition = true + else + message = childMessages[i] + end + if (outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) and (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) then + do + message.TextWrapped = wordWrapToggleOn + message.Size = UDim2.new(0.98, 0, 0, 2000) + message.Parent = Dev_Container + message.Text = tostring(messageList[i].Time) .. " -- " .. tostring(messageList[i].Message) + message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y) + message.Position = UDim2.new(0, 5, 0, posOffset) + message.Parent = Dev_TextHolder + posOffset = posOffset + message.TextBounds.Y + end + if movePosition then + if (currentConsole == LOCAL_CONSOLE and localOffset > 0) or (currentConsole == SERVER_CONSOLE and serverOffset > 0) then + changeOffset(message.TextBounds.Y) + end + end + message.Visible = true + message.TextColor3 = Color3.new((function() + if messageList[i].Type == Enum.MessageType.MessageError then + return 1, 0, 0 + elseif messageList[i].Type == Enum.MessageType.MessageInfo then + return 0.4, 0.5, 1 + elseif messageList[i].Type == Enum.MessageType.MessageWarning then + return 1, 0.6, 0.4 + else + return 1, 1, 1 + end + end)()) + end + end + textHolderSize = posOffset + end + local refreshQueued = false + local refreshTextHolder + refreshTextHolder = function() + if refreshQueued then + return + end + Delay(0.1, function() + refreshQueued = false + return refreshTextHolderForReal() + end) + refreshQueued = true + end + local inside = 0 + local holdingUpButton + holdingUpButton = function() + if scrollUpIsDown then + return + end + scrollUpIsDown = true + wait(0.6) + inside = inside + 1 + while scrollUpIsDown and inside < 2 do + wait() + changeOffset(12) + end + inside = inside - 1 + end + local holdingDownButton + holdingDownButton = function() + if scrollDownIsDown then + return + end + scrollDownIsDown = true + wait(0.6) + inside = inside + 1 + while scrollDownIsDown and inside < 2 do + wait() + changeOffset(-12) + end + inside = inside - 1 + end + Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function() + return changeOffset(10) + end) + Dev_Container.Body.ScrollBar.Up.MouseButton1Down:connect(function() + changeOffset(10) + return holdingUpButton() + end) + Dev_Container.Body.ScrollBar.Up.MouseButton1Up:connect(clean) + Dev_Container.Body.ScrollBar.Down.MouseButton1Down:connect(function() + changeOffset(-10) + return holdingDownButton() + end) + Dev_Container.Body.ScrollBar.Down.MouseButton1Up:connect(clean) + local handleScroll + handleScroll = function(x, y) + if not previousMousePosScroll then + return + end + local delta = (Vector2.new(x, y - previousMousePosScroll)).Y + local backRatio = 1 - (Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y) + local movementSize = Dev_ScrollArea.AbsoluteSize.Y - Dev_ScrollArea.Handle.AbsoluteSize.Y + local normalDelta = math.max(math.min(delta, movementSize), 0 - movementSize) + local normalRatio = normalDelta / movementSize + local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y) + local offsetChange = textMovementSize * normalRatio + if currentConsole == LOCAL_CONSOLE then + localOffset = pOffset - offsetChange + elseif currentConsole == SERVER_CONSOLE then + serverOffset = pOffset - offsetChange + end + end + Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y) + previousMousePosScroll = Vector2.new(x, y) + if currentConsole == LOCAL_CONSOLE then + pOffset = localOffset + elseif currentConsole == SERVER_CONSOLE then + pOffset = serverOffset + end + end) + Dev_ScrollArea.Handle.MouseButton1Up:connect(clean) + local existsInsideContainer + existsInsideContainer = function(container, x, y) + local pos = container.AbsolutePosition + local size = container.AbsoluteSize + if x < pos.X or x > pos.X + size.X or y < pos.y or y > pos.y + size.y then + return false + end + return true + end + local numberWithZero + numberWithZero = function(num) + if num < 10 then + return "0" .. tostring(num) + else + return num + end + end + local str = "%s:%s:%s" + local ConvertTimeStamp + ConvertTimeStamp = function(timeStamp) + local localTime = timeStamp - os.time() + math.floor(tick()) + local dayTime = localTime % 86400 + local hour = math.floor(dayTime / 3600) + dayTime = dayTime - (hour * 3600) + local minute = math.floor(dayTime / 60) + dayTime = dayTime - (minute * 60) + local h = numberWithZero(hour) + local m = numberWithZero(minute) + local s = numberWithZero(dayTime) + return str:format(h, m, s) + end + Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function() + errorToggleOn = not errorToggleOn + Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn + refreshTextHolder() + return repositionList() + end) + Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function() + warningToggleOn = not warningToggleOn + Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn + refreshTextHolder() + return repositionList() + end) + Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function() + infoToggleOn = not infoToggleOn + Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn + refreshTextHolder() + return repositionList() + end) + Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function() + outputToggleOn = not outputToggleOn + Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn + refreshTextHolder() + return repositionList() + end) + Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function() + wordWrapToggleOn = not wordWrapToggleOn + Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn + refreshTextHolder() + return repositionList() + end) + local AddLocalMessage + AddLocalMessage = function(str, messageType, timeStamp) + localMessageList[#localMessageList + 1] = { + Message = str, + Time = ConvertTimeStamp(timeStamp), + Type = messageType + } + while #localMessageList > MAX_LIST_SIZE do + table.remove(localMessageList, 1) + end + refreshTextHolder() + return repositionList() + end + local AddServerMessage + AddServerMessage = function(str, messageType, timeStamp) + serverMessageList[#serverMessageList + 1] = { + Message = str, + Time = ConvertTimeStamp(timeStamp), + Type = messageType + } + while #serverMessageList > MAX_LIST_SIZE do + table.remove(serverMessageList, 1) + end + refreshTextHolder() + return repositionList() + end + Dev_Container.Body.LocalConsole.MouseButton1Click:connect(function() + if currentConsole == SERVER_CONSOLE then + currentConsole = LOCAL_CONSOLE + local localConsole = Dev_Container.Body.LocalConsole + local serverConsole = Dev_Container.Body.ServerConsole + localConsole.Size = UDim2.new(0, 90, 0, 20) + serverConsole.Size = UDim2.new(0, 90, 0, 17) + localConsole.BackgroundTransparency = 0.6 + serverConsole.BackgroundTransparency = 0.8 + if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then + local mouse = game.Players.LocalPlayer:GetMouse() + refreshConsolePosition(mouse.X, mouse.Y) + refreshConsoleSize(mouse.X, mouse.Y) + handleScroll(mouse.X, mouse.Y) + end + refreshTextHolder() + return repositionList() + end + end) + Dev_Container.Body.LocalConsole.MouseButton1Up:connect(clean) + local serverHistoryRequested = false + Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function() + if not serverHistoryRequested then + serverHistoryRequested = true + game:GetService("LogService"):RequestServerOutput() + end + if currentConsole == LOCAL_CONSOLE then + currentConsole = SERVER_CONSOLE + local localConsole = Dev_Container.Body.LocalConsole + local serverConsole = Dev_Container.Body.ServerConsole + serverConsole.Size = UDim2.new(0, 90, 0, 20) + localConsole.Size = UDim2.new(0, 90, 0, 17) + serverConsole.BackgroundTransparency = 0.6 + localConsole.BackgroundTransparency = 0.8 + if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then + local mouse = game.Players.LocalPlayer:GetMouse() + refreshConsolePosition(mouse.X, mouse.Y) + refreshConsoleSize(mouse.X, mouse.Y) + handleScroll(mouse.X, mouse.Y) + end + refreshTextHolder() + return repositionList() + end + end) + Dev_Container.Body.ServerConsole.MouseButton1Up:connect(clean) + if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then + local LocalMouse = game.Players.LocalPlayer:GetMouse() + LocalMouse.Move:connect(function() + if not Dev_Container.Visible then + return + end + local mouse = game.Players.LocalPlayer:GetMouse() + refreshConsolePosition(mouse.X, mouse.Y) + refreshConsoleSize(mouse.X, mouse.Y) + handleScroll(mouse.X, mouse.Y) + refreshTextHolder() + return repositionList() + end) + LocalMouse.Button1Up:connect(clean) + LocalMouse.WheelForward:connect(function() + if not Dev_Container.Visible then + return + end + if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then + return changeOffset(10) + end + end) + LocalMouse.WheelBackward:connect(function() + if not Dev_Container.Visible then + return + end + if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then + return changeOffset(-10) + end + end) + end + Dev_ScrollArea.Handle.MouseButton1Down:connect(function() + return repositionList() + end) + local history = game:GetService("LogService"):GetLogHistory() + for i = 1, #history do + AddLocalMessage(history[i].message, history[i].messageType, history[i].timestamp) + end + local _with_0 = game:GetService("LogService") + _with_0.MessageOut:connect(function(message, messageType) + return AddLocalMessage(message, messageType, os.time()) + end) + _with_0.ServerMessageOut:connect(AddServerMessage) + return _with_0 +end +local currentlyToggling = false +ToggleConsole.OnInvoke = function() + if currentlyToggling then + return + end + currentlyToggling = true + initializeDeveloperConsole() + Dev_Container.Visible = not Dev_Container.Visible + currentlyToggling = false +end diff --git a/yue/157877000.yue b/yue/157877000.yue index e69de29..e6e9473 100644 --- a/yue/157877000.yue +++ b/yue/157877000.yue @@ -0,0 +1,914 @@ +--Include +Create = assert(LoadLibrary "RbxUtility").Create + +-- A Few Script Globals +gui = script.Parent\FindFirstChild"ControlFrame" or script.Parent + +-- Dev-Console Root + +Dev_Container = Create"Frame" + Name: "DevConsoleContainer" + Parent: gui + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.9 + Position: UDim2.new 0, 100, 0, 10 + Size: UDim2.new 0.5, 20, 0.5, 20 + Visible: false + +ToggleConsole = Create"BindableFunction" + Name: "ToggleDevConsole" + Parent: gui + +devConsoleInitialized = false +initializeDeveloperConsole = -> + return if devConsoleInitialized + devConsoleInitialized = true + + ---Dev-Console Variables + LOCAL_CONSOLE = 1 + SERVER_CONSOLE = 2 + + MAX_LIST_SIZE = 1000 + + minimumSize = Vector2.new 245, 180 + currentConsole = LOCAL_CONSOLE + + localMessageList = {} + serverMessageList = {} + + localOffset = 0 + serverOffset = 0 + + errorToggleOn = true + warningToggleOn = true + infoToggleOn = true + outputToggleOn = true + wordWrapToggleOn = false + + textHolderSize = 0 + + frameNumber = 0 + + --Create Dev-Console + + Dev_Body = Create"Frame" + Name: "Body" + Parent: Dev_Container + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 0, 21 + Size: UDim2.new 1, 0, 1, -25 + + Dev_OptionsHolder = Create"Frame" + Name: "OptionsHolder" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 1 + Position: UDim2.new 0, 220, 0, 0 + Size: UDim2.new 1, -255, 0, 24 + ClipsDescendants: true + + Dev_OptionsBar = Create"Frame" + Name: "OptionsBar" + Parent: Dev_OptionsHolder + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 1 + Position: UDim2.new 0, -250, 0, 4 + Size: UDim2.new 0, 234, 0, 18 + + Dev_ErrorToggleFilter = Create"TextButton" + Name: "ErrorToggleButton" + Parent: Dev_OptionsBar + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 1, 0, 0 + Position: UDim2.new 0, 115, 0, 0 + Size: UDim2.new 0, 18, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "" + TextColor3: Color3.new 1, 0, 0 + + Create"Frame" + Name: "CheckFrame" + Parent: Dev_ErrorToggleFilter + BackgroundColor3: Color3.new 1, 0, 0 + BorderColor3: Color3.new 1, 0, 0 + Position: UDim2.new 0, 4, 0, 4 + Size: UDim2.new 0, 10, 0, 10 + + Dev_InfoToggleFilter = Create"TextButton" + Name: "InfoToggleButton" + Parent: Dev_OptionsBar + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 0.4, 0.5, 1.0 + Position: UDim2.new 0, 65, 0, 0 + Size: UDim2.new 0, 18, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "" + TextColor3: Color3.new 0.4, 0.5, 1.0 + + Create"Frame" + Name: "CheckFrame" + Parent: Dev_InfoToggleFilter + BackgroundColor3: Color3.new 0.4, 0.5, 1.0 + BorderColor3: Color3.new 0.4, 0.5, 1.0 + Position: UDim2.new 0, 4, 0, 4 + Size: UDim2.new 0, 10, 0, 10 + + Dev_OutputToggleFilter = Create"TextButton" + Name: "OutputToggleButton" + Parent: Dev_OptionsBar + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 1, 1, 1.0 + Position: UDim2.new 0, 40, 0, 0 + Size: UDim2.new 0, 18, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "" + TextColor3: Color3.new 1, 1, 1.0 + + Create"Frame" + Name: "CheckFrame" + Parent: Dev_OutputToggleFilter + BackgroundColor3: Color3.new 1, 1, 1.0 + BorderColor3: Color3.new 1, 1, 1.0 + Position: UDim2.new 0, 4, 0, 4 + Size: UDim2.new 0, 10, 0, 10 + + Dev_WarningToggleFilter = Create"TextButton" + Name: "WarningToggleButton" + Parent: Dev_OptionsBar + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 1, 0.6, 0.4 + Position: UDim2.new 0, 90, 0, 0 + Size: UDim2.new 0, 18, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "" + TextColor3: Color3.new 1, 0.6, 0.4 + + Create"Frame" + Name: "CheckFrame" + Parent: Dev_WarningToggleFilter + BackgroundColor3: Color3.new 1, 0.6, 0.4 + BorderColor3: Color3.new 1, 0.6, 0.4 + Position: UDim2.new 0, 4, 0, 4 + Size: UDim2.new 0, 10, 0, 10 + + Dev_WordWrapToggle = Create"TextButton" + Name: "WordWrapToggleButton" + Parent: Dev_OptionsBar + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 0.8, 0.8, 0.8 + Position: UDim2.new 0, 215, 0, 0 + Size: UDim2.new 0, 18, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "" + TextColor3: Color3.new 0.8, 0.8, 0.8 + + Create"Frame" + Name: "CheckFrame" + Parent: Dev_WordWrapToggle + BackgroundColor3: Color3.new 0.8, 0.8, 0.8 + BorderColor3: Color3.new 0.8, 0.8, 0.8 + Position: UDim2.new 0, 4, 0, 4 + Size: UDim2.new 0, 10, 0, 10 + Visible: false + + Create"TextLabel" + Name: "Filter" + Parent: Dev_OptionsBar + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 0, 40, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "Filter" + TextColor3: Color3.new 1, 1, 1 + + Create"TextLabel" + Name: "WordWrap" + Parent: Dev_OptionsBar + BackgroundTransparency: 1 + Position: UDim2.new 0, 150, 0, 0 + Size: UDim2.new 0, 50, 0, 18 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "Word Wrap" + TextColor3: Color3.new 1, 1, 1, + + Dev_ScrollBar = Create"Frame" + Name: "ScrollBar" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.9 + Position: UDim2.new 1, -20, 0, 26 + Size: UDim2.new 0, 20, 1, -50 + Visible: false + + Dev_ScrollArea = Create"Frame" + Name: "ScrollArea" + Parent: Dev_ScrollBar + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0, 23 + Size: UDim2.new 1, 0, 1, -46 + + Dev_Handle = Create"ImageButton" + Name: "Handle" + Parent: Dev_ScrollArea + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 0.2, 0 + Size: UDim2.new 0, 20, 0, 40 + + Create"ImageLabel" + Name: "ImageLabel" + Parent: Dev_Handle + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0.5, -8 + Rotation: 180 + Size: UDim2.new 1, 0, 0, 16 + Image: "http://www.roblox.com/Asset?id=151205881" + + Dev_DownButton = Create"ImageButton" + Name: "Down" + Parent: Dev_ScrollBar + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 1, -20 + Size: UDim2.new 0, 20, 0, 20 + + Create"ImageLabel" + Name: "ImageLabel" + Parent: Dev_DownButton + BackgroundTransparency: 1 + Position: UDim2.new 0, 3, 0, 3 + Size: UDim2.new 0, 14, 0, 14 + Rotation: 180 + Image: "http://www.roblox.com/Asset?id=151205813" + + Dev_UpButton = Create"ImageButton" + Name: "Up" + Parent: Dev_ScrollBar + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 0, 20, 0, 20 + + Create"ImageLabel" + Name: "ImageLabel" + Parent: Dev_UpButton + BackgroundTransparency: 1 + Position: UDim2.new 0, 3, 0, 3 + Size: UDim2.new 0, 14, 0, 14 + Image: "http://www.roblox.com/Asset?id=151205813" + + Dev_TextBox = Create"Frame" + Name: "TextBox" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.6 + Position: UDim2.new 0, 2, 0, 26 + Size: UDim2.new 1, -4, 1, -28 + ClipsDescendants: true + + Dev_TextHolder = Create"Frame" + Name: "TextHolder" + Parent: Dev_TextBox + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 1, 0, 1, 0 + + Dev_OptionsButton = Create"ImageButton" + Name: "OptionsButton" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 1 + Position: UDim2.new 0, 200, 0, 2 + Size: UDim2.new 0, 20, 0, 20 + + Create"ImageLabel" + Name: "ImageLabel" + Parent: Dev_OptionsButton + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 1, 0, 1, 0 + Rotation: 0 + Image: "http://www.roblox.com/Asset?id=152093917" + + Dev_ResizeButton = Create"ImageButton" + Name: "ResizeButton" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 1, -20, 1, -20 + Size: UDim2.new 0, 20, 0, 20 + + Create"ImageLabel" + Name: "ImageLabel" + Parent: Dev_ResizeButton + BackgroundTransparency: 1 + Position: UDim2.new 0, 6, 0, 6 + Size: UDim2.new 0.8, 0, 0.8, 0 + Rotation: 135 + Image: "http://www.roblox.com/Asset?id=151205813" + + Create"TextButton" + Name: "LocalConsole" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.6 + Position: UDim2.new 0, 7, 0, 5 + Size: UDim2.new 0, 90, 0, 20 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "Local Console" + TextColor3: Color3.new 1, 1, 1 + TextYAlignment: Enum.TextYAlignment.Center + + Create"TextButton" + Name: "ServerConsole" + Parent: Dev_Body + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.8 + Position: UDim2.new 0, 102, 0, 5 + Size: UDim2.new 0, 90, 0, 17 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size14 + Text: "Server Console" + TextColor3: Color3.new 1, 1, 1 + TextYAlignment: Enum.TextYAlignment.Center + + Dev_TitleBar = Create"Frame" + Name: "TitleBar" + Parent: Dev_Container + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 1, 0, 0, 20 + + Dev_CloseButton = Create"ImageButton" + Name: "CloseButton" + Parent: Dev_TitleBar + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 1, -20, 0, 0 + Size: UDim2.new 0, 20, 0, 20 + + Create"ImageLabel" + Parent: Dev_CloseButton + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 1 + Position: UDim2.new 0, 3, 0, 3 + Size: UDim2.new 0, 14, 0, 14 + Image: "http://www.roblox.com/Asset?id=151205852" + + Create"TextButton" + Name: "TextButton" + Parent: Dev_TitleBar + BackgroundColor3: Color3.new 0, 0, 0 + BackgroundTransparency: 0.5 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 1, -23, 1, 0 + Text: "" + + Create"TextLabel" + Name: "TitleText" + Parent: Dev_TitleBar + BackgroundTransparency: 1 + Position: UDim2.new 0, 0, 0, 0 + Size: UDim2.new 0, 185, 0, 20 + Font: "SourceSansBold" + FontSize: Enum.FontSize.Size18 + -- Text: "Server Console" + TextColor3: Color3.new 1, 1, 1 + Text: "Roblox Developer Console" + TextYAlignment: Enum.TextYAlignment.Top + + ---Saved Mouse Information + local previousMousePos + local pPos + + local previousMousePosResize + local pSize + + local previousMousePosScroll + + -- local pScrollHandle + + local pOffset + + scrollUpIsDown = false + scrollDownIsDown = false + + clean = -> + previousMousePos = pPos = previousMousePosResize = nil + pSize = previousMousePosScroll = pOffset = nil + -- pScrollHandle = nil + scrollUpIsDown = scrollDownIsDown = false + + + ---Handle Dev-Console Position + refreshConsolePosition = (x, y) -> + return if not previousMousePos + + delta = Vector2.new x, y - previousMousePos + Dev_Container.Position = UDim2.new 0, pPos.X + delta.X, 0, pPos.Y + delta.Y + + + Dev_TitleBar.TextButton.MouseButton1Down\connect (x, y) -> + previousMousePos = Vector2.new x, y + pPos = Dev_Container.AbsolutePosition + + + Dev_TitleBar.TextButton.MouseButton1Up\connect clean + + + ---Handle Dev-Console Size + refreshConsoleSize = (x, y) -> + return if not previousMousePosResize + + delta = Vector2.new x, y - previousMousePosResize + Dev_Container.Size = UDim2.new 0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max pSize.Y + delta.Y, minimumSize.Y + + Dev_Container.Body.ResizeButton.MouseButton1Down\connect (x, y) -> + previousMousePosResize = Vector2.new x, y + pSize = Dev_Container.AbsoluteSize + + + Dev_Container.Body.ResizeButton.MouseButton1Up\connect clean + + + ---Handle Dev-Console Close Button + Dev_TitleBar.CloseButton.MouseButton1Down\connect -> + Dev_Container.Visible = false + + + Dev_Container.TitleBar.CloseButton.MouseButton1Up\connect clean + + + optionsHidden = true + animating = false + --Options + startAnimation = -> + return if animating + animating = true + + repeat + frameNumber += if optionsHidden + -1 + else + 1 + + + x = frameNumber / 5 + smoothStep = x * x * (3 - (2 * x)) + Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9 + Dev_OptionsBar.Position = UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4) + + wait! + if (frameNumber <= 0 and optionsHidden) or (frameNumber >= 5 and not optionsHidden) + animating = false + + until not animating + + + Dev_OptionsButton.MouseButton1Down\connect -> + optionsHidden = not optionsHidden + startAnimation! + + --Refresh Dev-Console Message Positions + repositionList = -> + if currentConsole == LOCAL_CONSOLE + localOffset = math.min math.max(localOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y + Dev_TextHolder.Size = UDim2.new 1, 0, 0, textHolderSize + elseif currentConsole == SERVER_CONSOLE + serverOffset = math.min math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y + Dev_TextHolder.Size = UDim2.new 1, 0, 0, textHolderSize + + + ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y + + if ratio >= 1 + Dev_Container.Body.ScrollBar.Visible = false + Dev_Container.Body.TextBox.Size = UDim2.new 1, -4, 1, -28 + + if currentConsole == LOCAL_CONSOLE or currentConsole == SERVER_CONSOLE + Dev_TextHolder.Position = UDim2.new 0, 0, 1, 0 - textHolderSize + + else + Dev_Container.Body.ScrollBar.Visible = true + Dev_Container.Body.TextBox.Size = UDim2.new 1, -25, 1, -28 + + backRatio = 1 - ratio + local offsetRatio + + if currentConsole == LOCAL_CONSOLE + offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y + elseif currentConsole == SERVER_CONSOLE + offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y + + + topRatio = math.max 0, backRatio - offsetRatio + + scrollHandleSize = math.max Dev_ScrollArea.AbsoluteSize.Y * ratio, 21 + + scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y + ratioConversion = (1 - scrollRatio) / (1 - ratio) + + topScrollRatio = topRatio * ratioConversion + + sPos = math.min( + Dev_ScrollArea.AbsoluteSize.Y * topScrollRatio, + Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize + ) + + Dev_ScrollArea.Handle.Size = UDim2.new 1, 0, 0, scrollHandleSize + Dev_ScrollArea.Handle.Position = UDim2.new 0, 0, 0, sPos + + Dev_TextHolder.Position = UDim2.new 0, 0, 1, 0 - textHolderSize + if currentConsole == LOCAL_CONSOLE + localOffset + elseif currentConsole == SERVER_CONSOLE + serverOffset + + + --Scroll Position + + changeOffset = (value) -> + if currentConsole == LOCAL_CONSOLE + localOffset += value + elseif currentConsole == SERVER_CONSOLE + serverOffset += value + + repositionList! + + + --Refresh Dev-Console Text + refreshTextHolderForReal = -> + childMessages = Dev_TextHolder\GetChildren! + + local messageList + + messageList = if currentConsole == LOCAL_CONSOLE + localMessageList + elseif currentConsole == SERVER_CONSOLE + serverMessageList + + posOffset = 0 + + for i = 1, #childMessages + childMessages[i].Visible = false + + for i = 1, #messageList + local message + + movePosition = false + + if i > #childMessages + message = Create"TextLabel" + Name: "Message" + Parent: Dev_TextHolder + BackgroundTransparency: 1 + TextXAlignment: "Left" + Size: UDim2.new 1, 0, 0, 14 + FontSize: "Size10" + ZIndex: 1 + movePosition = true + else + message = childMessages[i] + + + if (outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) and + (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) and + (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) and + (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) + + with message + .TextWrapped = wordWrapToggleOn + .Size = UDim2.new 0.98, 0, 0, 2000 + .Parent = Dev_Container + .Text = "#{messageList[i].Time} -- #{messageList[i].Message}" + .Size = UDim2.new 0.98, 0, 0, .TextBounds.Y + .Position = UDim2.new 0, 5, 0, posOffset + .Parent = Dev_TextHolder + posOffset += .TextBounds.Y + + if movePosition + if (currentConsole == LOCAL_CONSOLE and localOffset > 0) or + (currentConsole == SERVER_CONSOLE and serverOffset > 0) + + changeOffset message.TextBounds.Y + + message.Visible = true + + message.TextColor3 = Color3.new if messageList[i].Type == Enum.MessageType.MessageError + 1, 0, 0 + elseif messageList[i].Type == Enum.MessageType.MessageInfo + 0.4, 0.5, 1 + elseif messageList[i].Type == Enum.MessageType.MessageWarning + 1, 0.6, 0.4 + else + 1, 1, 1 + + textHolderSize = posOffset + + + -- Refreshing the textholder every 0.1 (if needed) is good enough, surely fast enough + -- We don't want it to update 50x in a tick because there are 50 messages in that tick + -- (Whenever for one reason or another a lot of output comes in, it can lag + -- This will make it behave better in a situation of a lot of output comming in) + refreshQueued = false + refreshTextHolder = -> + return if refreshQueued + + Delay 0.1, -> + refreshQueued = false + refreshTextHolderForReal! + + refreshQueued = true + + + --Handle Dev-Console Scrollbar + + inside = 0 + holdingUpButton = -> + return if scrollUpIsDown + + scrollUpIsDown = true + wait 0.6 + inside += 1 + while scrollUpIsDown and inside < 2 + wait! + changeOffset 12 + + inside -= 1 + + + holdingDownButton = -> + return if scrollDownIsDown + + scrollDownIsDown = true + wait 0.6 + inside += 1 + while scrollDownIsDown and inside < 2 + wait! + changeOffset -12 + + inside -= 1 + + + Dev_Container.Body.ScrollBar.Up.MouseButton1Click\connect -> + changeOffset 10 + + Dev_Container.Body.ScrollBar.Up.MouseButton1Down\connect -> + changeOffset 10 + holdingUpButton! + + Dev_Container.Body.ScrollBar.Up.MouseButton1Up\connect clean + + Dev_Container.Body.ScrollBar.Down.MouseButton1Down\connect -> + changeOffset -10 + holdingDownButton! + + Dev_Container.Body.ScrollBar.Down.MouseButton1Up\connect clean + + handleScroll = (x, y) -> + return if not previousMousePosScroll + + delta = (Vector2.new x, y - previousMousePosScroll).Y + + backRatio = 1 - (Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y) + + movementSize = Dev_ScrollArea.AbsoluteSize.Y - Dev_ScrollArea.Handle.AbsoluteSize.Y + normalDelta = math.max(math.min(delta, movementSize), 0 - movementSize) + normalRatio = normalDelta / movementSize + + textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y) + offsetChange = textMovementSize * normalRatio + + if currentConsole == LOCAL_CONSOLE + localOffset = pOffset - offsetChange + elseif currentConsole == SERVER_CONSOLE + serverOffset = pOffset - offsetChange + + + Dev_ScrollArea.Handle.MouseButton1Down\connect (x, y) -> + previousMousePosScroll = Vector2.new x, y + -- pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition + pOffset = if currentConsole == LOCAL_CONSOLE + localOffset + elseif currentConsole == SERVER_CONSOLE + serverOffset + + + Dev_ScrollArea.Handle.MouseButton1Up\connect clean + + existsInsideContainer = (container, x, y) -> + pos = container.AbsolutePosition + size = container.AbsoluteSize + if x < pos.X or x > pos.X + size.X or y < pos.y or y > pos.y + size.y + return false + true + + + -- Easy, fast, and working nicely + numberWithZero = (num) -> + if num < 10 + "0#{num}" + else + num + + + str = "%s:%s:%s" + + ConvertTimeStamp = (timeStamp) -> + localTime = timeStamp - os.time! + math.floor tick! + dayTime = localTime % 86400 + + hour = math.floor dayTime / 3600 + + dayTime -= hour * 3600 + minute = math.floor dayTime / 60 + + dayTime -= minute * 60 + + h = numberWithZero hour + m = numberWithZero minute + s = numberWithZero dayTime + + str\format h, m, s + + + --Filter + + Dev_OptionsBar.ErrorToggleButton.MouseButton1Down\connect -> + errorToggleOn = not errorToggleOn + Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn + refreshTextHolder! + repositionList! + + + Dev_OptionsBar.WarningToggleButton.MouseButton1Down\connect -> + warningToggleOn = not warningToggleOn + Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn + refreshTextHolder! + repositionList! + + + Dev_OptionsBar.InfoToggleButton.MouseButton1Down\connect -> + infoToggleOn = not infoToggleOn + Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn + refreshTextHolder! + repositionList! + + + Dev_OptionsBar.OutputToggleButton.MouseButton1Down\connect -> + outputToggleOn = not outputToggleOn + Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn + refreshTextHolder! + repositionList! + + + Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down\connect -> + wordWrapToggleOn = not wordWrapToggleOn + Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn + refreshTextHolder! + repositionList! + + + ---Dev-Console Message Functionality + AddLocalMessage = (str, messageType, timeStamp) -> + localMessageList[] = + Message: str + Time: ConvertTimeStamp timeStamp + Type: messageType + + while #localMessageList > MAX_LIST_SIZE + table.remove localMessageList, 1 + + refreshTextHolder! + repositionList! + + AddServerMessage = (str, messageType, timeStamp) -> + serverMessageList[] = + Message: str + Time: ConvertTimeStamp timeStamp + Type: messageType + + while #serverMessageList > MAX_LIST_SIZE + table.remove serverMessageList, 1 + + + refreshTextHolder! + repositionList! + + --Handle Dev-Console Local/Server Buttons + Dev_Container.Body.LocalConsole.MouseButton1Click\connect -> + if currentConsole == SERVER_CONSOLE + currentConsole = LOCAL_CONSOLE + localConsole = Dev_Container.Body.LocalConsole + serverConsole = Dev_Container.Body.ServerConsole + + localConsole.Size = UDim2.new 0, 90, 0, 20 + serverConsole.Size = UDim2.new 0, 90, 0, 17 + localConsole.BackgroundTransparency = 0.6 + serverConsole.BackgroundTransparency = 0.8 + + if game\FindFirstChild"Players" and game.Players["LocalPlayer"] + mouse = game.Players.LocalPlayer\GetMouse! + refreshConsolePosition mouse.X, mouse.Y + refreshConsoleSize mouse.X, mouse.Y + handleScroll mouse.X, mouse.Y + + + refreshTextHolder! + repositionList! + + + Dev_Container.Body.LocalConsole.MouseButton1Up\connect clean + + + serverHistoryRequested = false + + Dev_Container.Body.ServerConsole.MouseButton1Click\connect -> + if not serverHistoryRequested + serverHistoryRequested = true + game\GetService"LogService"\RequestServerOutput! + + + if currentConsole == LOCAL_CONSOLE + currentConsole = SERVER_CONSOLE + localConsole = Dev_Container.Body.LocalConsole + serverConsole = Dev_Container.Body.ServerConsole + + serverConsole.Size = UDim2.new 0, 90, 0, 20 + localConsole.Size = UDim2.new 0, 90, 0, 17 + serverConsole.BackgroundTransparency = 0.6 + localConsole.BackgroundTransparency = 0.8 + + if game\FindFirstChild"Players" and game.Players["LocalPlayer"] + mouse = game.Players.LocalPlayer\GetMouse! + refreshConsolePosition mouse.X, mouse.Y + refreshConsoleSize mouse.X, mouse.Y + handleScroll mouse.X, mouse.Y + + refreshTextHolder! + repositionList! + + + ---Extra Mouse Handlers for Dev-Console + Dev_Container.Body.ServerConsole.MouseButton1Up\connect clean + + + if game\FindFirstChild"Players" and game.Players["LocalPlayer"] + LocalMouse = game.Players.LocalPlayer\GetMouse! + LocalMouse.Move\connect -> + return if not Dev_Container.Visible + + mouse = game.Players.LocalPlayer\GetMouse! + refreshConsolePosition mouse.X, mouse.Y + refreshConsoleSize mouse.X, mouse.Y + handleScroll mouse.X, mouse.Y + + refreshTextHolder! + repositionList! + + LocalMouse.Button1Up\connect clean + + LocalMouse.WheelForward\connect -> + return if not Dev_Container.Visible + if existsInsideContainer Dev_Container, LocalMouse.X, LocalMouse.Y + changeOffset 10 + + LocalMouse.WheelBackward\connect -> + return if not Dev_Container.Visible + if existsInsideContainer Dev_Container, LocalMouse.X, LocalMouse.Y + changeOffset -10 + + + Dev_ScrollArea.Handle.MouseButton1Down\connect -> + repositionList! + + + ---Populate Dev-Console with dummy messages + + history = game\GetService"LogService"\GetLogHistory! + + for i = 1, #history + AddLocalMessage history[i].message, history[i].messageType, history[i].timestamp + + with game\GetService"LogService" + .MessageOut\connect (message, messageType) -> + AddLocalMessage message, messageType, os.time! + .ServerMessageOut\connect AddServerMessage + +currentlyToggling = false +ToggleConsole.OnInvoke = -> + return if currentlyToggling + + currentlyToggling = true + initializeDeveloperConsole! + Dev_Container.Visible = not Dev_Container.Visible + currentlyToggling = false diff --git a/yue/46295863.lua b/yue/46295863.lua new file mode 100644 index 0000000..21a034b --- /dev/null +++ b/yue/46295863.lua @@ -0,0 +1,1803 @@ +local New +New = function(className, name, props) + if not (props ~= nil) then + props = name + name = nil + end + local obj = Instance.new(className) + if name then + obj.Name = name + end + local parent + for k, v in pairs(props) do + if type(k) == "string" then + if k == "Parent" then + parent = v + else + obj[k] = v + end + elseif type(k) == "number" and type(v) == "userdata" then + v.Parent = obj + end + end + obj.Parent = parent + return obj +end +local waitForChild +waitForChild = function(instance, name) + while not instance:FindFirstChild(name) do + instance.ChildAdded:wait() + end +end +local waitForProperty +waitForProperty = function(instance, property) + while not instance[property] do + instance.Changed:wait() + end +end +local gui +if script.Parent:FindFirstChild("ControlFrame") then + gui = script.Parent:FindFirstChild("ControlFrame") +else + gui = script.Parent +end +local RbxGui +local syncVideoCaptureSetting +local settingsButton, helpButton, settingsFrame, mouseLockLabel +local updateCameraDropDownSelection +local updateVideoCaptureDropDownSelection +local tweenTime = 0.2 +local mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825" +local classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798" +local hasGraphicsSlider = game:GetService("CoreGui").Version >= 5 +local GraphicsQualityLevels = 10 +local recordingVideo = false +local currentMenuSelection +local lastMenuSelection = { } +local centerDialogs = { } +local mainShield +local inStudioMode = UserSettings().GameSettings:InStudioMode() +local macClient = false +local success, isMac = pcall(function() + return not game.GuiService.IsWindows +end) +macClient = success and isMac +local Color3I +Color3I = function(r, g, b) + return Color3.new(r / 255, g / 255, b / 255) +end +local robloxLock +robloxLock = function(instance) + instance.RobloxLocked = true + local children = instance:GetChildren() + if children then + for _, child in ipairs(children) do + robloxLock(child) + end + end +end +local resumeGameFunction +resumeGameFunction = function(shield) + shield.Settings:TweenPosition(UDim2.new(0.5, -262, -0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + return delay(tweenTime, function() + shield.Visible = false + for i = 1, #centerDialogs do + centerDialogs[i].Visible = false + game.GuiService:RemoveCenterDialog(centerDialogs[i]) + end + game.GuiService:RemoveCenterDialog(shield) + settingsButton.Active = true + currentMenuSelection = nil + lastMenuSelection = { } + end) +end +local goToMenu +goToMenu = function(container, menuName, moveDirection, size, position) + if type(menuName) ~= "string" then + return + end + table.insert(lastMenuSelection, currentMenuSelection) + if menuName == "GameMainMenu" then + lastMenuSelection = { } + end + local containerChildren = container:GetChildren() + for i = 1, #containerChildren do + if containerChildren[i].Name == menuName then + containerChildren[i].Visible = true + currentMenuSelection = { + container = container, + name = menuName, + direction = moveDirection, + lastSize = size + } + if size and position then + containerChildren[i]:TweenSizeAndPosition(size, position, Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + elseif size then + containerChildren[i]:TweenSizeAndPosition(size, UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + else + containerChildren[i]:TweenPosition(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end + else + if moveDirection == "left" then + containerChildren[i]:TweenPosition(UDim2.new(-1, -525, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + elseif moveDirection == "right" then + containerChildren[i]:TweenPosition(UDim2.new(1, 525, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + elseif moveDirection == "up" then + containerChildren[i]:TweenPosition(UDim2.new(0, 0, -1, -400), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + elseif moveDirection == "down" then + containerChildren[i]:TweenPosition(UDim2.new(0, 0, 1, 400), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end + delay(tweenTime, function() + containerChildren[i].Visible = false + end) + end + end +end +local resetLocalCharacter +resetLocalCharacter = function() + local player = game.Players.LocalPlayer + if player then + if player.Character and player.Character:FindFirstChild("Humanoid") then + player.Character.Humanoid.Health = 0 + end + end +end +local createTextButton +createTextButton = function(text, style, fontSize, buttonSize, buttonPosition) + return New("TextButton", { + Font = Enum.Font.Arial, + FontSize = fontSize, + Size = buttonSize, + Position = buttonPosition, + Style = style, + TextColor3 = Color3.new(1, 1, 1), + Text = text + }) +end +local CreateTextButtons +CreateTextButtons = function(frame, buttons, yPos, ySize) + if #buttons < 1 then + error("Must have more than one button") + end + local buttonNum = 1 + local buttonObjs = { } + local toggleSelection + toggleSelection = function(button) + for _, obj in ipairs(buttonObjs) do + if obj == button then + obj.Style = Enum.ButtonStyle.RobloxButtonDefault + else + obj.Style = objEnum.ButtonStyle.RobloxButton + end + end + end + for _, obj in ipairs(buttons) do + local button = New("TextButton", "Button" .. tostring(buttonNum), { + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButton, + Text = obj.Text, + TextColor3 = Color3.new(1, 1, 1) + }) + button.MouseButton1Click:connect(function() + toggleSelection(button) + return obj.Function() + end) + button.Parent = frame + buttonObjs[buttonNum] = button + buttonNum = buttonNum + 1 + end + toggleSelection(buttonObjs[1]) + local numButtons = buttonNum - 1 + if numButtons == 1 then + frame.Button1.Position = UDim2.new(0.35, 0, yPos.Scale, yPos.Offset) + frame.Button1.Size = UDim2.new(0.4, 0, ySize.Scale, ySize.Offset) + elseif numButtons == 2 then + frame.Button1.Position = UDim2.new(0.1, 0, yPos.Scale, yPos.Offset) + frame.Button1.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) + frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset) + frame.Button2.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) + elseif numButtons >= 3 then + local spacing = 0.1 / numButtons + local buttonSize = 0.9 / numButtons + buttonNum = 1 + while buttonNum <= numButtons do + buttonObjs[buttonNum].Position = UDim2.new(spacing * buttonNum + (buttonNum - 1) * buttonSize, 0, yPos.Scale, yPos.Offset) + buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) + buttonNum = buttonNum + 1 + end + end +end +local setRecordGui +setRecordGui = function(recording, stopRecordButton, recordVideoButton) + if recording then + stopRecordButton.Visible = true + recordVideoButton.Text = "Stop Recording" + else + stopRecordButton.Visible = false + recordVideoButton.Text = "Record Video" + end +end +local recordVideoClick +recordVideoClick = function(recordVideoButton, stopRecordButton) + recordingVideo = not recordingVideo + return setRecordGui(recordingVideo, stopRecordButton, recordVideoButton) +end +local backToGame +backToGame = function(buttonClicked, shield, settingsButton) + buttonClicked.Parent.Parent.Parent.Parent.Visible = false + shield.Visible = false + for i = 1, #centerDialogs do + game.GuiService:RemoveCenterDialog(centerDialogs[i]) + centerDialogs[i].Visible = false + end + centerDialogs = { } + game.GuiService:RemoveCenterDialog(shield) + settingsButton.Active = true +end +local setDisabledState +setDisabledState = function(guiObject) + if not guiObject then + return + end + if guiObject:IsA("TextLabel") then + guiObject.TextTransparency = 0.9 + elseif guiObject:IsA("TextButton") then + guiObject.TextTransparency = 0.9 + guiObject.Active = false + else + if guiObject["ClassName"] then + return print("setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName) + end + end +end +local createHelpDialog +createHelpDialog = function(baseZIndex) + if not (helpButton ~= nil) then + if gui:FindFirstChild("TopLeftControl" and gui.TopLeftControl:FindFirstChild("Help")) then + helpButton = gui.TopLeftControl.Help + elseif gui:FindFirstChild("BottomRightControl" and gui.BottomRightControl:FindFirstChild("Help")) then + helpButton = gui.BottomRightControl.Help + end + end + local shield = New("Frame", "HelpDialogShield", { + Active = true, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 1 + }) + local helpDialog = New("Frame", "HelpDialog", { + Style = Enum.FrameStyle.RobloxRound, + Position = UDim2.new(0.2, 0, 0.2, 0), + Size = UDim2.new(0.6, 0, 0.6, 0), + Active = true, + Parent = shield, + New("TextLabel", "Title", { + Text = "Keyboard & Mouse Controls", + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + Position = UDim2.new(0, 0, 0.025, 0), + Size = UDim2.new(1, 0, 0, 40), + TextColor3 = Color3.new(1, 1, 1), + BackgroundTransparency = 1 + }) + }) + local buttonRow = New("Frame", "Buttons", { + Position = UDim2.new(0.1, 0, 0.07, 40), + Size = UDim2.new(0.8, 0, 0, 45), + BackgroundTransparency = 1, + Parent = helpDialog + }) + local imageFrame = New("Frame", "ImageFrame", { + Position = UDim2.new(0.05, 0, 0.075, 80), + Size = UDim2.new(0.9, 0, 0.9, -120), + BackgroundTransparency = 1, + Parent = helpDialog + }) + local layoutFrame = New("Frame", "LayoutFrame", { + Position = UDim2.new(0.5, 0, 0, 0), + Size = UDim2.new(1.5, 0, 1, 0), + BackgroundTransparency = 1, + SizeConstraint = Enum.SizeConstraint.RelativeYY, + Parent = imageFrame + }) + local image = New("ImageLabel", "Image") + if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + image.Image = mouseLockLookScreenUrl + else + image.Image = classicLookScreenUrl + end + image.Position = UDim2.new(-0.5, 0, 0, 0) + image.Size = UDim2.new(1, 0, 1, 0) + image.BackgroundTransparency = 1 + image.Parent = layoutFrame + local buttons = { } + buttons[1] = { } + buttons[1].Text = "Look" + buttons[1].Function = function() + if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + image.Image = mouseLockLookScreenUrl + else + image.Image = classicLookScreenUrl + end + end + buttons[2] = { } + buttons[2].Text = "Move" + buttons[2].Function = function() + image.Image = "http://www.roblox.com/Asset?id=45915811" + end + buttons[3] = { } + buttons[3].Text = "Gear" + buttons[3].Function = function() + image.Image = "http://www.roblox.com/Asset?id=45917596" + end + buttons[4] = { } + buttons[4].Text = "Zoom" + buttons[4].Function = function() + image.Image = "http://www.roblox.com/Asset?id=45915825" + end + CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0)) + delay(0, function() + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameSettingsMenu") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu, "CameraField") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField, "DropDownMenuButton") + return gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed:connect(function(prop) + if prop ~= "Text" then + return + end + if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxButtonDefault then + if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text == "Classic" then + image.Image = classicLookScreenUrl + else + image.Image = mouseLockLookScreenUrl + end + end + end) + end) + local okBtn = New("TextButton", "OkBtn", { + Text = "OK", + Modal = true, + Size = UDim2.new(0.3, 0, 0, 45), + Position = UDim2.new(0.35, 0, 0.975, -50), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + BackgroundTransparency = 1, + TextColor3 = Color3.new(1, 1, 1), + Style = Enum.ButtonStyle.RobloxButtonDefault, + Parent = helpDialog + }) + okBtn.MouseButton1Click:connect(function() + shield.Visible = false + return game.GuiService:RemoveCenterDialog(shield) + end) + robloxLock(shield) + return shield +end +local createLeaveConfirmationMenu +createLeaveConfirmationMenu = function(baseZIndex, shield) + local frame = New("Frame", "LeaveConfirmationMenu", { + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + Position = UDim2.new(0, 0, 2, 400), + ZIndex = baseZIndex + 4, + New("TextLabel", "LeaveText", { + Text = "Leave this game?", + Size = UDim2.new(1, 0, 0.8, 0), + TextWrap = true, + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4 + }) + }) + do + local _with_0 = createTextButton("Leave", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 128, 0, 50), UDim2.new(0, 313, 0.8, 0)) + _with_0.Name = "YesButton" + _with_0.ZIndex = baseZIndex + 4 + _with_0.Parent = frame + _with_0.Modal = true + _with_0:SetVerb("Exit") + end + do + local _with_0 = createTextButton("Stay", Enum.ButtonStyle.RobloxButtonDefault, Enum.FontSize.Size24, UDim2.new(0, 128, 0, 50), UDim2.new(0, 90, 0.8, 0)) + _with_0.Name = "NoButton" + _with_0.Parent = frame + _with_0.ZIndex = baseZIndex + 4 + _with_0.MouseButton1Click:connect(function() + goToMenu(shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new(0, 525, 0, 430)) + return shield.Settings:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end) + end + return frame +end +local createResetConfirmationMenu +createResetConfirmationMenu = function(baseZIndex, shield) + local frame = New("Frame", "ResetConfirmationMenu", { + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + Position = UDim2.new(0, 0, 2, 400), + ZIndex = baseZIndex + 4 + }) + do + local _with_0 = createTextButton("Reset", Enum.ButtonStyle.RobloxButtonDefault, Enum.FontSize.Size24, UDim2.new(0, 128, 0, 50), UDim2.new(0, 313, 0, 299)) + _with_0.Name = "YesButton" + _with_0.ZIndex = baseZIndex + 4 + _with_0.Parent = frame + _with_0.Modal = true + _with_0.MouseButton1Click:connect(function() + resumeGameFunction(shield) + return resetLocalCharacter() + end) + end + do + local _with_0 = createTextButton("Cancel", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 128, 0, 50), UDim2.new(0, 90, 0, 299)) + _with_0.Name = "NoButton" + _with_0.Parent = frame + _with_0.ZIndex = baseZIndex + 4 + _with_0.MouseButton1Click:connect(function() + goToMenu(shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new(0, 525, 0, 430)) + return shield.Settings:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end) + end + local resetCharacterText = New("TextLabel", "ResetCharacterText", { + Text = "Are you sure you want to reset your character?", + Size = UDim2.new(1, 0, 0.8, 0), + TextWrap = true, + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + Parent = frame + }) + do + local _with_0 = resetCharacterText:Clone() + _with_0.Name = "FineResetCharacterText" + _with_0.Text = "You will be put back on a spawn point" + _with_0.Size = UDim2.new(0, 303, 0, 18) + _with_0.Position = UDim2.new(0, 109, 0, 215) + _with_0.FontSize = Enum.FontSize.Size18 + _with_0.Parent = frame + end + return frame +end +local createGameMainMenu +createGameMainMenu = function(baseZIndex, shield) + local gameMainMenuFrame = New("Frame", "GameMainMenu", { + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = settingsFrame, + New("TextLabel", "Title", { + Text = "Game Menu", + BackgroundTransparency = 1, + TextStrokeTransparency = 0, + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + Size = UDim2.new(1, 0, 0, 36), + Position = UDim2.new(0, 0, 0, 4), + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4 + }) + }) + local robloxHelpButton = createTextButton("Help", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 164, 0, 50), UDim2.new(0, 82, 0, 256)) + robloxHelpButton.Name = "HelpButton" + robloxHelpButton.ZIndex = baseZIndex + 4 + robloxHelpButton.Parent = gameMainMenuFrame + helpButton = robloxHelpButton + local helpDialog = createHelpDialog(baseZIndex) + helpDialog.Parent = gui + helpButton.MouseButton1Click:connect(function() + table.insert(centerDialogs, helpDialog) + return game.GuiService:AddCenterDialog(helpDialog, Enum.CenterDialogType.ModalDialog, function() + helpDialog.Visible = true + mainShield.Visible = false + end, function() + helpDialog.Visible = false + end) + end) + helpButton.Active = true + local helpShortcut = New("TextLabel", "HelpShortcutText", { + Text = "F1", + Visible = false, + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size12, + Position = UDim2.new(0, 85, 0, 0), + Size = UDim2.new(0, 30, 0, 30), + TextColor3 = Color3.new(0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = robloxHelpButton + }) + local screenshotButton = createTextButton("Screenshot", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 168, 0, 50), UDim2.new(0, 254, 0, 256)) + screenshotButton.Name = "ScreenshotButton" + screenshotButton.ZIndex = baseZIndex + 4 + screenshotButton.Parent = gameMainMenuFrame + screenshotButton.Visible = not macClient + screenshotButton:SetVerb("Screenshot") + do + local _with_0 = helpShortcut:clone() + _with_0.Name = "ScreenshotShortcutText" + _with_0.Text = "PrintSc" + _with_0.Position = UDim2.new(0, 118, 0, 0) + _with_0.Visible = true + _with_0.Parent = screenshotButton + end + local recordVideoButton = createTextButton("Record Video", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 168, 0, 50), UDim2.new(0, 254, 0, 306)) + recordVideoButton.Name = "RecordVideoButton" + recordVideoButton.ZIndex = baseZIndex + 4 + recordVideoButton.Parent = gameMainMenuFrame + recordVideoButton.Visible = not macClient + recordVideoButton:SetVerb("RecordToggle") + do + local _with_0 = helpShortcut:clone() + _with_0.Name = "RecordVideoShortcutText" + _with_0.Visible = hasGraphicsSlider + _with_0.Text = "F12" + _with_0.Position = UDim2.new(0, 120, 0, 0) + _with_0.Parent = recordVideoButton + end + local stopRecordButton = New("ImageButton", "StopRecordButton", { + BackgroundTransparency = 1, + Image = "rbxasset://textures/ui/RecordStop.png", + Size = UDim2.new(0, 59, 0, 27) + }) + stopRecordButton:SetVerb("RecordToggle") + stopRecordButton.MouseButton1Click:connect(function() + return recordVideoClick(recordVideoButton, stopRecordButton) + end) + stopRecordButton.Visible = false + stopRecordButton.Parent = gui + local reportAbuseButton = createTextButton("Report Abuse", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 164, 0, 50), UDim2.new(0, 82, 0, 306)) + reportAbuseButton.Name = "ReportAbuseButton" + reportAbuseButton.ZIndex = baseZIndex + 4 + reportAbuseButton.Parent = gameMainMenuFrame + do + local _with_0 = createTextButton("Leave Game", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), UDim2.new(0, 82, 0, 358)) + _with_0.Name = "LeaveGameButton" + _with_0.ZIndex = baseZIndex + 4 + _with_0.Parent = gameMainMenuFrame + end + do + local _with_0 = createTextButton("Resume Game", Enum.ButtonStyle.RobloxButtonDefault, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), UDim2.new(0, 82, 0, 54)) + _with_0.Name = "resumeGameButton" + _with_0.ZIndex = baseZIndex + 4 + _with_0.Parent = gameMainMenuFrame + _with_0.Modal = true + _with_0.MouseButton1Click:connect(function() + return resumeGameFunction(shield) + end) + end + local gameSettingsButton = createTextButton("Game Settings", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), UDim2.new(0, 82, 0, 156)) + gameSettingsButton.Name = "SettingsButton" + gameSettingsButton.ZIndex = baseZIndex + 4 + gameSettingsButton.Parent = gameMainMenuFrame + if game:FindFirstChild("LoadingGuiService" and #game.LoadingGuiService:GetChildren() > 0) then + gameSettingsButton = createTextButton("Game Instructions", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), UDim2.new(0, 82, 0, 207)) + gameSettingsButton.Name = "GameInstructions" + gameSettingsButton.ZIndex = baseZIndex + 4 + gameSettingsButton.Parent = gameMainMenuFrame + gameSettingsButton.MouseButton1Click:connect(function() + if game:FindFirstChild("Players" and game.Players["LocalPlayer"]) then + local loadingGui = game.Players.LocalPlayer:FindFirstChild("PlayerLoadingGui") + if loadingGui then + loadingGui.Visible = true + end + end + end) + end + local resetButton = createTextButton("Reset Character", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), UDim2.new(0, 82, 0, 105)) + resetButton.Name = "ResetButton" + resetButton.ZIndex = baseZIndex + 4 + resetButton.Parent = gameMainMenuFrame + return gameMainMenuFrame +end +local createGameSettingsMenu +createGameSettingsMenu = function(baseZIndex, _) + local gameSettingsMenuFrame = New("Frame", "GameSettingsMenu", { + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + ZIndex = baseZIndex + 4, + New("TextLabel", "Title", { + Text = "Settings", + Size = UDim2.new(1, 0, 0, 48), + Position = UDim2.new(0, 9, 0, -9), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1 + }), + New("TextLabel", "FullscreenText", { + Text = "Fullscreen Mode", + Size = UDim2.new(0, 124, 0, 18), + Position = UDim2.new(0, 62, 0, 145), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1 + }) + }) + local fullscreenShortcut = New("TextLabel", "FullscreenShortcutText", { + Visible = hasGraphicsSlider, + Text = "F11", + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size12, + Position = UDim2.new(0, 186, 0, 141), + Size = UDim2.new(0, 30, 0, 30), + TextColor3 = Color3.new(0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame + }) + local studioText = New("TextLabel", "StudioText", { + Visible = false, + Text = "Studio Mode", + Size = UDim2.new(0, 95, 0, 18), + Position = UDim2.new(0, 62, 0, 179), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + Parent = gameSettingsMenuFrame + }) + local studioShortcut = fullscreenShortcut:clone() + studioShortcut.Name = "StudioShortcutText" + studioShortcut.Visible = false + studioShortcut.Text = "F2" + studioShortcut.Position = UDim2.new(0, 154, 0, 175) + studioShortcut.Parent = gameSettingsMenuFrame + local studioCheckbox + if hasGraphicsSlider then + local qualityText = New("TextLabel", "QualityText", { + Text = "Graphics Quality", + Size = UDim2.new(0, 128, 0, 18), + Position = UDim2.new(0, 30, 0, 239), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode + }) + local autoText = qualityText:clone() + autoText.Name = "AutoText" + autoText.Text = "Auto" + autoText.Position = UDim2.new(0, 183, 0, 214) + autoText.TextColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255) + autoText.Size = UDim2.new(0, 34, 0, 18) + autoText.Parent = gameSettingsMenuFrame + autoText.Visible = not inStudioMode + local fasterText = autoText:clone() + fasterText.Name = "FasterText" + fasterText.Text = "Faster" + fasterText.Position = UDim2.new(0, 185, 0, 274) + fasterText.TextColor3 = Color3.new(95, 95, 95) + fasterText.FontSize = Enum.FontSize.Size14 + fasterText.Parent = gameSettingsMenuFrame + fasterText.Visible = not inStudioMode + local fasterShortcut = fullscreenShortcut:clone() + fasterShortcut.Name = "FasterShortcutText" + fasterShortcut.Text = "F10 + Shift" + fasterShortcut.Position = UDim2.new(0, 185, 0, 283) + fasterShortcut.Parent = gameSettingsMenuFrame + fasterShortcut.Visible = not inStudioMode + local betterQualityText = autoText:clone() + betterQualityText.Name = "BetterQualityText" + betterQualityText.Text = "Better Quality" + betterQualityText.TextWrap = true + betterQualityText.Size = UDim2.new(0, 41, 0, 28) + betterQualityText.Position = UDim2.new(0, 390, 0, 269) + betterQualityText.TextColor3 = Color3.new(95, 95, 95) + betterQualityText.FontSize = Enum.FontSize.Size14 + betterQualityText.Parent = gameSettingsMenuFrame + betterQualityText.Visible = not inStudioMode + local betterQualityShortcut = fullscreenShortcut:clone()({ + Name = "BetterQualityShortcut", + Text = "F10", + Position = UDim2.new(0, 394, 0, 288), + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode + }) + local autoGraphicsButton = createTextButton("X", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 25, 0, 25), UDim2.new(0, 187, 0, 239)) + autoGraphicsButton.Name = "AutoGraphicsButton" + autoGraphicsButton.ZIndex = baseZIndex + 4 + autoGraphicsButton.Parent = gameSettingsMenuFrame + autoGraphicsButton.Visible = not inStudioMode + local graphicsSlider, graphicsLevel + graphicsSlider, graphicsLevel = RbxGui.CreateSlider(GraphicsQualityLevels, 150, UDim2.new(0, 230, 0, 280)) + graphicsSlider.Parent = gameSettingsMenuFrame + graphicsSlider.Bar.ZIndex = baseZIndex + 4 + graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 + graphicsSlider.Visible = not inStudioMode + graphicsLevel.Value = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) / 2) + local graphicsSetter = New("TextBox", "GraphicsSetter", { + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255), + Size = UDim2.new(0, 50, 0, 25), + Position = UDim2.new(0, 450, 0, 269), + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Text = "Auto", + ZIndex = 1, + TextWrap = true, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode + }) + local isAutoGraphics = true + if not inStudioMode then + isAutoGraphics = UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic + else + settings().Rendering.EnableFRM = false + end + local listenToGraphicsLevelChange = true + local setAutoGraphicsGui + setAutoGraphicsGui = function(active) + isAutoGraphics = active + if active then + autoGraphicsButton.Text = "X" + betterQualityText.ZIndex = 1 + betterQualityShortcut.ZIndex = 1 + fasterShortcut.ZIndex = 1 + fasterText.ZIndex = 1 + graphicsSlider.Bar.ZIndex = 1 + graphicsSlider.Bar.Slider.ZIndex = 1 + graphicsSetter.ZIndex = 1 + graphicsSetter.Text = "Auto" + else + autoGraphicsButton.Text = "" + graphicsSlider.Bar.ZIndex = baseZIndex + 4 + graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 + betterQualityShortcut.ZIndex = baseZIndex + 4 + fasterShortcut.ZIndex = baseZIndex + 4 + betterQualityText.ZIndex = baseZIndex + 4 + fasterText.ZIndex = baseZIndex + 4 + graphicsSetter.ZIndex = baseZIndex + 4 + end + end + local goToAutoGraphics + goToAutoGraphics = function() + setAutoGraphicsGui(true) + UserSettings().GameSettings.SavedQualityLevel = Enum.SavedQualitySetting.Automatic + settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic + end + local setGraphicsQualityLevel + setGraphicsQualityLevel = function(newLevel) + local percentage = newLevel / GraphicsQualityLevels + local newSetting = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) * percentage) + if newSetting == 20 then + newSetting = 21 + elseif newLevel == 1 then + newSetting = 1 + elseif newSetting > settings().Rendering:GetMaxQualityLevel() then + newSetting = settings().Rendering:GetMaxQualityLevel() - 1 + end + UserSettings().GameSettings.SavedQualityLevel = newLevel + settings().Rendering.QualityLevel = newSetting + end + local goToManualGraphics + goToManualGraphics = function(explicitLevel) + setAutoGraphicsGui(false) + if explicitLevel then + graphicsLevel.Value = explicitLevel + else + graphicsLevel.Value = math.floor((settings().Rendering.AutoFRMLevel / (settings().Rendering:GetMaxQualityLevel() - 1))({ + GraphicsQualityLevels + })) + end + if explicitLevel == graphicsLevel.Value then + setGraphicsQualityLevel(graphicsLevel.Value) + end + if not explicitLevel then + UserSettings().GameSettings.SavedQualityLevel = graphicsLevel.Value + end + graphicsSetter.Text = tostring(graphicsLevel.Value) + end + local showAutoGraphics + showAutoGraphics = function() + autoText.ZIndex = baseZIndex + 4 + autoGraphicsButton.ZIndex = baseZIndex + 4 + end + local hideAutoGraphics + hideAutoGraphics = function() + autoText.ZIndex = 1 + autoGraphicsButton.ZIndex = 1 + end + local showManualGraphics + showManualGraphics = function() + graphicsSlider.Bar.ZIndex = baseZIndex + 4 + graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 + betterQualityShortcut.ZIndex = baseZIndex + 4 + fasterShortcut.ZIndex = baseZIndex + 4 + betterQualityText.ZIndex = baseZIndex + 4 + fasterText.ZIndex = baseZIndex + 4 + graphicsSetter.ZIndex = baseZIndex + 4 + end + local hideManualGraphics + hideManualGraphics = function() + betterQualityText.ZIndex = 1 + betterQualityShortcut.ZIndex = 1 + fasterShortcut.ZIndex = 1 + fasterText.ZIndex = 1 + graphicsSlider.Bar.ZIndex = 1 + graphicsSlider.Bar.Slider.ZIndex = 1 + graphicsSetter.ZIndex = 1 + end + local translateSavedQualityLevelToInt + translateSavedQualityLevelToInt = function(savedQualityLevel) + if Enum.SavedQualitySetting.Automatic == savedQualityLevel then + return 0 + elseif Enum.SavedQualitySetting.QualityLevel1 == savedQualityLevel then + return 1 + elseif Enum.SavedQualitySetting.QualityLevel2 == savedQualityLevel then + return 2 + elseif Enum.SavedQualitySetting.QualityLevel3 == savedQualityLevel then + return 3 + elseif Enum.SavedQualitySetting.QualityLevel4 == savedQualityLevel then + return 4 + elseif Enum.SavedQualitySetting.QualityLevel5 == savedQualityLevel then + return 5 + elseif Enum.SavedQualitySetting.QualityLevel6 == savedQualityLevel then + return 6 + elseif Enum.SavedQualitySetting.QualityLevel7 == savedQualityLevel then + return 7 + elseif Enum.SavedQualitySetting.QualityLevel8 == savedQualityLevel then + return 8 + elseif Enum.SavedQualitySetting.QualityLevel9 == savedQualityLevel then + return 9 + elseif Enum.SavedQualitySetting.QualityLevel10 == savedQualityLevel then + return 10 + end + end + local enableGraphicsWidget + enableGraphicsWidget = function() + settings().Rendering.EnableFRM = true + isAutoGraphics = (UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) + if isAutoGraphics then + showAutoGraphics() + return goToAutoGraphics() + else + showAutoGraphics() + showManualGraphics() + return goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) + end + end + local disableGraphicsWidget + disableGraphicsWidget = function() + hideManualGraphics() + hideAutoGraphics() + settings().Rendering.EnableFRM = false + end + graphicsSetter.FocusLost:connect(function() + if isAutoGraphics then + graphicsSetter.Text = tostring(graphicsLevel.Value) + return + end + local newGraphicsValue = tonumber(graphicsSetter.Text) + if not (newGraphicsValue ~= nil) then + graphicsSetter.Text = tostring(graphicsLevel.Value) + return + end + if newGraphicsValue < 1 then + newGraphicsValue = 1 + elseif newGraphicsValue >= settings().Rendering:GetMaxQualityLevel() then + newGraphicsValue = settings().Rendering:GetMaxQualityLevel() - 1 + end + graphicsLevel.Value = newGraphicsValue + setGraphicsQualityLevel(graphicsLevel.Value) + graphicsSetter.Text = tostring(graphicsLevel.Value) + end) + graphicsLevel.Changed:connect(function(_) + if isAutoGraphics then + return + end + if not listenToGraphicsLevelChange then + return + end + graphicsSetter.Text = tostring(graphicsLevel.Value) + return setGraphicsQualityLevel(graphicsLevel.Value) + end) + if inStudioMode or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic then + if inStudioMode then + settings().Rendering.EnableFRM = false + disableGraphicsWidget() + else + settings().Rendering.EnableFRM = true + goToAutoGraphics() + end + else + settings().Rendering.EnableFRM = true + goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) + end + autoGraphicsButton.MouseButton1Click:connect(function() + if inStudioMode and not game.Players.LocalPlayer then + return + end + if not isAutoGraphics then + return goToAutoGraphics() + else + return goToManualGraphics(graphicsLevel.Value) + end + end) + game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) + if isAutoGraphics then + return + end + if graphicsIncrease then + if (graphicsLevel.Value + 1) > GraphicsQualityLevels then + return + end + graphicsLevel.Value = graphicsLevel.Value + 1 + graphicsSetter.Text = tostring(graphicsLevel.Value) + setGraphicsQualityLevel(graphicsLevel.Value) + return game:GetService("GuiService"):SendNotification("Graphics Quality", "Increased to (" .. tostring(graphicsSetter.Text) .. ")", "", 2, function() end) + else + if (graphicsLevel.Value - 1) <= 0 then + return + end + graphicsLevel.Value = graphicsLevel.Value - 1 + graphicsSetter.Text = tostring(graphicsLevel.Value) + setGraphicsQualityLevel(graphicsLevel.Value) + return game:GetService("GuiService"):SendNotification("Graphics Quality", "Decreased to (" .. tostring(graphicsSetter.Text) .. ")", "", 2, function() end) + end + end) + game.Players.PlayerAdded:connect(function(player) + if player == game.Players.LocalPlayer and inStudioMode then + return enableGraphicsWidget() + end + end) + game.Players.PlayerRemoving:connect(function(player) + if player == game.Players.LocalPlayer and inStudioMode then + return disableGraphicsWidget() + end + end) + studioCheckbox = createTextButton("", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 25, 0, 25), UDim2.new(0, 30, 0, 176)) + studioCheckbox.Name = "StudioCheckbox" + studioCheckbox.ZIndex = baseZIndex + 4 + studioCheckbox:SetVerb("TogglePlayMode") + studioCheckbox.Visible = false + local wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) + if inStudioMode and not game.Players.LocalPlayer then + studioCheckbox.Text = "X" + disableGraphicsWidget() + elseif inStudioMode then + studioCheckbox.Text = "X" + enableGraphicsWidget() + end + if hasGraphicsSlider then + UserSettings().GameSettings.StudioModeChanged:connect(function(isStudioMode) + inStudioMode = isStudioMode + if isStudioMode then + wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) + goToAutoGraphics() + studioCheckbox.Text = "X" + autoGraphicsButton.ZIndex = 1 + autoText.ZIndex = 1 + else + if wasManualGraphics then + goToManualGraphics() + end + studioCheckbox.Text = "" + autoGraphicsButton.ZIndex = baseZIndex + 4 + autoText.ZIndex = baseZIndex + 4 + end + end) + else + studioCheckbox.MouseButton1Click:connect(function() + if not studioCheckbox.Active then + return + end + if studioCheckbox.Text == "" then + studioCheckbox.Text = "X" + else + studioCheckbox.Text = "" + end + end) + end + end + local fullscreenCheckbox = createTextButton("", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size18, UDim2.new(0, 25, 0, 25), UDim2.new(0, 30, 0, 144)) + fullscreenCheckbox.Name = "FullscreenCheckbox" + fullscreenCheckbox.ZIndex = baseZIndex + 4 + fullscreenCheckbox.Parent = gameSettingsMenuFrame + fullscreenCheckbox:SetVerb("ToggleFullScreen") + if UserSettings().GameSettings:InFullScreen() then + fullscreenCheckbox.Text = "X" + end + if hasGraphicsSlider then + UserSettings().GameSettings.FullscreenChanged:connect(function(isFullscreen) + if isFullscreen then + fullscreenCheckbox.Text = "X" + else + fullscreenCheckbox.Text = "" + end + end) + else + fullscreenCheckbox.MouseButton1Click:connect(function() + if fullscreenCheckbox.Text == "" then + fullscreenCheckbox.Text = "X" + else + fullscreenCheckbox.Text = "" + end + end) + end + if game:FindFirstChild("NetworkClient") then + setDisabledState(studioText) + setDisabledState(studioShortcut) + setDisabledState(studioCheckbox) + end + local backButton + if hasGraphicsSlider then + backButton = createTextButton("OK", Enum.ButtonStyle.RobloxButtonDefault, Enum.FontSize.Size24, UDim2.new(0, 180, 0, 50), UDim2.new(0, 170, 0, 330)) + backButton.Modal = true + else + backButton = createTextButton("OK", Enum.ButtonStyle.RobloxButtonDefault, Enum.FontSize.Size24, UDim2.new(0, 180, 0, 50), UDim2.new(0, 170, 0, 270)) + backButton.Modal = true + end + backButton.Name = "BackButton" + backButton.ZIndex = baseZIndex + 4 + backButton.Parent = gameSettingsMenuFrame + if not macClient then + New("TextLabel", "VideoCaptureLabel", { + Text = "After Capturing Video", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 32, 0, 100), + Size = UDim2.new(0, 164, 0, 18), + BackgroundTransparency = 1, + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame + }) + local videoNames = { } + local videoNameToItem = { } + videoNames[1] = "Just Save to Disk" + videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"] + videoNames[2] = "Upload to YouTube" + videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"] + local videoCaptureDropDown + videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu(videoNames, function(text) + UserSettings().GameSettings.VideoUploadPromptBehavior = videoNameToItem[text] + end) + videoCaptureDropDown.Name = "VideoCaptureField" + videoCaptureDropDown.ZIndex = baseZIndex + 4 + videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 + videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 + videoCaptureDropDown.Position = UDim2.new(0, 270, 0, 94) + videoCaptureDropDown.Size = UDim2.new(0, 200, 0, 32) + videoCaptureDropDown.Parent = gameSettingsMenuFrame + syncVideoCaptureSetting = function() + return updateVideoCaptureDropDownSelection((function() + if UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"] then + return videoNames[1] + elseif UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"] then + return videoNames[2] + else + UserSettings().GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"] + return videoNames[2] + end + end)()) + end + end + New("TextLabel", "CameraLabel", { + Text = "Character & Camera Controls", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 31, 0, 58), + Size = UDim2.new(0, 224, 0, 18), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame + }) + mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) + local enumItems = Enum.ControlMode:GetEnumItems() + local enumNames = { } + local enumNameToItem = { } + for i, obj in ipairs(enumItems) do + enumNames[i] = obj.Name + enumNameToItem[obj.Name] = obj + end + local cameraDropDown + cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu(enumNames, function(text) + UserSettings().GameSettings.ControlMode = enumNameToItem[text] + return pcall(function() + if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + mouseLockLabel.Visible = true + elseif mouseLockLabel then + mouseLockLabel.Visible = false + end + end) + end) + cameraDropDown.Name = "CameraField" + cameraDropDown.ZIndex = baseZIndex + 4 + cameraDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 + cameraDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 + cameraDropDown.Position = UDim2.new(0, 270, 0, 52) + cameraDropDown.Size = UDim2.new(0, 200, 0, 32) + cameraDropDown.Parent = gameSettingsMenuFrame + return gameSettingsMenuFrame +end +if LoadLibrary then + RbxGui = LoadLibrary("RbxGui") + local baseZIndex = 0 + if UserSettings then + local createSettingsDialog + createSettingsDialog = function() + waitForChild(gui, "BottomLeftControl") + settingsButton = gui.BottomLeftControl:FindFirstChild("SettingsButton") + if not (settingsButton ~= nil) then + settingsButton = New("ImageButton", "SettingsButton", { + Image = "rbxasset://textures/ui/SettingsButton.png", + BackgroundTransparency = 1, + Active = false, + Size = UDim2.new(0, 54, 0, 46), + Position = UDim2.new(0, 2, 0, 50), + Parent = gui.BottomLeftControl + }) + end + local shield = New("TextButton", "UserSettingsShield", { + Text = "", + Active = true, + AutoButtonColor = false, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 2 + }) + mainShield = shield + local frame = New("Frame", "Settings", { + Position = UDim2.new(0.5, -262, -0.5, -200), + Size = UDim2.new(0, 525, 0, 430), + BackgroundTransparency = 1, + Active = true, + Parent = shield + }) + settingsFrame = New("Frame", "SettingsStyle", { + Size = UDim2.new(1, 0, 1, 0), + Style = Enum.FrameStyle.RobloxRound, + Active = true, + ZIndex = baseZIndex + 3, + Parent = frame + }) + local gameMainMenu = createGameMainMenu(baseZIndex, shield) + gameMainMenu.Parent = settingsFrame + gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() + return backToGame(gameMainMenu.ScreenshotButton, shield, settingsButton) + end) + gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() + recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) + return backToGame(gameMainMenu.RecordVideoButton, shield, settingsButton) + end) + if settings():FindFirstChild("Game Options") then +pcall(function() + return settings():FindFirstChild("Game Options").VideoRecordingChangeRequest:connect(function(recording) + recordingVideo = recording + return setRecordGui(recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton) + end) + end) + end + game.CoreGui.RobloxGui.Changed:connect(function(prop) + if prop == "AbsoluteSize" and recordingVideo then + return recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) + end + end) + local localPlayerChange + localPlayerChange = function() + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer then + settings().Rendering.EnableFRM = true + elseif inStudioMode then + settings().Rendering.EnableFRM = false + end + end + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if (game.Players.LocalPlayer ~= nil) then + game.Players.LocalPlayer.Changed:connect(function() + return localPlayerChange() + end) + else + delay(0, function() + waitForProperty(game.Players, "LocalPlayer") + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + return game.Players.LocalPlayer.Changed:connect(function() + return localPlayerChange() + end) + end) + end + gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild("NetworkClient") + if not gameMainMenu.ReportAbuseButton.Visible then + game.ChildAdded:connect(function(child) + if child:IsA("NetworkClient") then + gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild("NetworkClient") + end + end) + end + gameMainMenu.ResetButton.MouseButton1Click:connect(function() + return goToMenu(settingsFrame, "ResetConfirmationMenu", "up", UDim2.new(0, 525, 0, 370)) + end) + gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() + return goToMenu(settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new(0, 525, 0, 300)) + end) + if game.CoreGui.Version >= 4 then + game:GetService("GuiService").EscapeKeyPressed:connect(function() + if not (currentMenuSelection ~= nil) then + return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, function() + settingsButton.Active = false + updateCameraDropDownSelection(UserSettings().GameSettings.ControlMode.Name) + if syncVideoCaptureSetting ~= nil then + syncVideoCaptureSetting() + end + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) + shield.Visible = true + shield.Active = true + settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262, 0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + return settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end, function() + settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262, -0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + shield.Visible = false + settingsButton.Active = true + end) + elseif #lastMenuSelection > 0 then + if #centerDialogs > 0 then + for i = 1, #centerDialogs do + game.GuiService:RemoveCenterDialog(centerDialogs[i]) + centerDialogs[i].Visible = false + end + centerDialogs = { } + end + goToMenu(lastMenuSelection[#lastMenuSelection]["container"], lastMenuSelection[#lastMenuSelection]["name"], lastMenuSelection[#lastMenuSelection]["direction"], lastMenuSelection[#lastMenuSelection]["lastSize"]) + table.remove(lastMenuSelection, #lastMenuSelection) + if #lastMenuSelection == 1 then + lastMenuSelection = { } + end + else + return resumeGameFunction(shield) + end + end) + end + local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) + gameSettingsMenu.Visible = false + gameSettingsMenu.Parent = settingsFrame + gameMainMenu.SettingsButton.MouseButton1Click:connect(function() + return goToMenu(settingsFrame, "GameSettingsMenu", "left", UDim2.new(0, 525, 0, 350)) + end) + gameSettingsMenu.BackButton.MouseButton1Click:connect(function() + return goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) + end) + local resetConfirmationWindow = createResetConfirmationMenu(baseZIndex, shield) + resetConfirmationWindow.Visible = false + resetConfirmationWindow.Parent = settingsFrame + local leaveConfirmationWindow = createLeaveConfirmationMenu(baseZIndex, shield) + leaveConfirmationWindow.Visible = false + leaveConfirmationWindow.Parent = settingsFrame + robloxLock(shield) + settingsButton.MouseButton1Click:connect(function() + return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, function() + settingsButton.Active = false + updateCameraDropDownSelection(UserSettings().GameSettings.ControlMode.Name) + if syncVideoCaptureSetting ~= nil then + syncVideoCaptureSetting() + end + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) + shield.Visible = true + settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262, 0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + return settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + end, function() + settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262, -0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) + shield.Visible = false + settingsButton.Active = true + end) + end) + return shield + end + delay(0, function() + createSettingsDialog().Parent = gui + gui.BottomLeftControl.SettingsButton.Active = true + gui.BottomLeftControl.SettingsButton.Position = UDim2.new(0, 2, 0, -2) + if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + mouseLockLabel.Visible = true + elseif mouseLockLabel then + mouseLockLabel.Visible = false + end + local leaveGameButton = gui.BottomLeftControl:FindFirstChild("Exit") + if leaveGameButton then + leaveGameButton:Remove() + end + local topLeft = gui:FindFirstChild("TopLeftControl") + if topLeft then + leaveGameButton = topLeft:FindFirstChild("Exit") + if leaveGameButton then + leaveGameButton:Remove() + end + return topLeft:Remove() + end + end) + end + local createSaveDialogs + createSaveDialogs = function() + local shield = Instance.new("TextButton") + shield.Text = "" + shield.AutoButtonColor = false + shield.Name = "SaveDialogShield" + shield.Active = true + shield.Visible = false + shield.Size = UDim2.new(1, 0, 1, 0) + shield.BackgroundColor3 = Color3I(51, 51, 51) + shield.BorderColor3 = Color3I(27, 42, 53) + shield.BackgroundTransparency = 0.4 + shield.ZIndex = baseZIndex + 1 + local clearAndResetDialog + local save + local saveLocal + local dontSave + local cancel + local messageBoxButtons = { } + messageBoxButtons[1] = { } + messageBoxButtons[1].Text = "Save" + messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault + messageBoxButtons[1].Function = function() + return save() + end + messageBoxButtons[2] = { } + messageBoxButtons[2].Text = "Cancel" + messageBoxButtons[2].Function = function() + return cancel() + end + messageBoxButtons[3] = { } + messageBoxButtons[3].Text = "Don't Save" + messageBoxButtons[3].Function = function() + return dontSave() + end + local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog("Unsaved Changes", "Save your changes to Mercury before leaving?", "Confirm", messageBoxButtons) + saveDialogMessageBox.Visible = true + saveDialogMessageBox.Parent = shield + local errorBoxButtons = { } + local buttonOffset = 1 + if game.LocalSaveEnabled then + errorBoxButtons[buttonOffset] = { } + errorBoxButtons[buttonOffset].Text = "Save to Disk" + errorBoxButtons[buttonOffset].Function = function() + return saveLocal() + end + buttonOffset = buttonOffset + 1 + end + errorBoxButtons[buttonOffset] = { } + errorBoxButtons[buttonOffset].Text = "Keep Playing" + errorBoxButtons[buttonOffset].Function = function() + return cancel() + end + errorBoxButtons[buttonOffset + 1] = { } + errorBoxButtons[buttonOffset + 1].Text = "Don't Save" + errorBoxButtons[buttonOffset + 1].Function = function() + return dontSave() + end + local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog("Upload Failed", "Sorry, we could not save your changes to Mercury.", "Error", errorBoxButtons) + errorDialogMessageBox.Visible = false + errorDialogMessageBox.Parent = shield + local spinnerDialog = New("Frame", "SpinnerDialog", { + Style = Enum.FrameStyle.RobloxRound, + Size = UDim2.new(0, 350, 0, 150), + Position = UDim2.new(0.5, -175, 0.5, -75), + Visible = false, + Active = true, + Parent = shield, + New("TextLabel", "WaitingLabel", { + Text = "Saving to Mercury...", + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.5, 25, 0.5, 0), + TextColor3 = Color3.new(1, 1, 1) + }) + }) + local spinnerFrame = New("Frame", "Spinner", { + Size = UDim2.new(0, 80, 0, 80), + Position = UDim2.new(0.5, -150, 0.5, -40), + BackgroundTransparency = 1, + Parent = spinnerDialog + }) + local spinnerIcons = { } + local spinnerNum = 1 + while spinnerNum <= 8 do + local spinnerImage = New("ImageLabel", "Spinner" .. tostring(spinnerNum), { + Size = UDim2.new(0, 16, 0, 16), + Position = UDim2.new(0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), -8, 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), -8), + BackgroundTransparency = 1, + Image = "http://www.roblox.com/Asset?id=45880710", + Parent = spinnerFrame + }) + spinnerIcons[spinnerNum] = spinnerImage + spinnerNum = spinnerNum + 1 + end + save = function() + saveDialogMessageBox.Visible = false + spinnerDialog.Visible = true + local spin = true + delay(0, function() + local spinPos = 0 + while spin do + local pos = 0 + while pos < 8 do + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset?id=" .. (function() + if pos == spinPos or pos == ((spinPos + 1) % 8) then + return 45880668 + else + return 45880710 + end + end)() + pos = pos + 1 + end + spinPos = (spinPos + 1) % 8 + wait(0.2) + end + end) + local result = game:SaveToRoblox() + if not result then + result = game:SaveToRoblox() + end + spinnerDialog.Visible = false + spin = false + if result then + game:FinishShutdown(false) + return clearAndResetDialog() + else + errorDialogMessageBox.Visible = true + end + end + saveLocal = function() + errorDialogMessageBox.Visible = false + game:FinishShutdown(true) + return clearAndResetDialog() + end + dontSave = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + game:FinishShutdown(false) + return clearAndResetDialog() + end + cancel = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + return clearAndResetDialog() + end + clearAndResetDialog = function() + saveDialogMessageBox.Visible = true + errorDialogMessageBox.Visible = false + spinnerDialog.Visible = false + shield.Visible = false + return game.GuiService:RemoveCenterDialog(shield) + end + robloxLock(shield) + shield.Visible = false + return shield + end + local createReportAbuseDialog + createReportAbuseDialog = function() + waitForChild(game, "NetworkClient") + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + local localPlayer = game.Players.LocalPlayer + local reportAbuseButton + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton") + reportAbuseButton = gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton + local shield = New("TextButton", "ReportAbuseShield", { + Text = "", + AutoButtonColor = false, + Active = true, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 1 + }) + local closeAndResetDialog + local messageBoxButtons = { } + messageBoxButtons[1] = { } + messageBoxButtons[1].Text = "Ok" + messageBoxButtons[1].Modal = true + messageBoxButtons[1].Function = function() + return closeAndResetDialog() + end + local calmingMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", messageBoxButtons) + calmingMessageBox.Visible = false + calmingMessageBox.Parent = shield + local recordedMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "We've recorded your report for evaluation.", messageBoxButtons) + recordedMessageBox.Visible = false + recordedMessageBox.Parent = shield + local normalMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "Our moderators will review the chat logs and determine what happened.", messageBoxButtons) + normalMessageBox.Visible = false + normalMessageBox.Parent = shield + local frame = New("Frame", "Settings", { + Position = UDim2.new(0.5, -250, 0.5, -200), + Size = UDim2.new(0, 500, 0, 400), + BackgroundTransparency = 1, + Active = true, + Parent = shield + }) + settingsFrame = New("Frame", "ReportAbuseStyle", { + Size = UDim2.new(1, 0, 1, 0), + Style = Enum.FrameStyle.RobloxRound, + Active = true, + ZIndex = baseZIndex + 1, + Parent = frame, + New("TextLabel", "Title", { + Text = "Report Abuse", + TextColor3 = Color3I(221, 221, 221), + Position = UDim2.new(0.5, 0, 0, 30), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + ZIndex = baseZIndex + 2 + }), + New("TextLabel", "Description", { + Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.", + TextColor3 = Color3I(221, 221, 221), + Position = UDim2.new(0, 0, 0, 55), + Size = UDim2.new(1, 0, 0, 40), + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextWrap = true, + ZIndex = baseZIndex + 2, + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top + }), + New("TextLabel", "PlayerLabel", { + Text = "Which player?", + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 100), + Size = UDim2.new(0.4, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 2 + }), + New("TextLabel", "AbuseLabel", { + Text = "Type of Abuse:", + Font = Enum.Font.Arial, + BackgroundTransparency = 1, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 140), + Size = UDim2.new(0.4, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 2 + }) + }) + local abusingPlayer + local abuse + local submitReportButton + local updatePlayerSelection + local createPlayersDropDown + createPlayersDropDown = function() + local players = game:GetService("Players") + local playerNames = { } + local nameToPlayer = { } + local children = players:GetChildren() + local pos = 1 + if children then + for _, player in ipairs(children) do + if player:IsA("Player" and player ~= localPlayer) then + playerNames[pos] = player.Name + nameToPlayer[player.Name] = player + pos = pos + 1 + end + end + end + local playerDropDown + playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu(playerNames, function(playerName) + abusingPlayer = nameToPlayer[playerName] + if abuse and abusingPlayer then + submitReportButton.Active = true + end + end) + playerDropDown.Name = "PlayersComboBox" + playerDropDown.ZIndex = baseZIndex + 2 + playerDropDown.Position = UDim2.new(0.425, 0, 0, 102) + playerDropDown.Size = UDim2.new(0.55, 0, 0, 32) + return playerDropDown + end + local abuses = { + "Swearing", + "Bullying", + "Scamming", + "Dating", + "Cheating/Exploiting", + "Personal Questions", + "Offsite Links", + "Bad Model or Script", + "Bad Username" + } + local abuseDropDown, updateAbuseSelection + abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, function(abuseText) + abuse = abuseText + if abuse and abusingPlayer then + submitReportButton.Active = true + end + end, true) + abuseDropDown.Name = "AbuseComboBox" + abuseDropDown.ZIndex = baseZIndex + 2 + abuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) + abuseDropDown.Size = UDim2.new(0.55, 0, 0, 32) + abuseDropDown.Parent = settingsFrame + New("TextLabel", "ShortDescriptionLabel", { + Text = "Short Description: (optional)", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 180), + Size = UDim2.new(0.95, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 2, + Parent = settingsFrame + }) + local shortDescriptionWrapper = New("Frame", "ShortDescriptionWrapper", { + Position = UDim2.new(0.025, 0, 0, 220), + Size = UDim2.new(0.95, 0, 1, -310), + BackgroundColor3 = Color3I(0, 0, 0), + BorderSizePixel = 0, + ZIndex = baseZIndex + 2, + Parent = settingsFrame + }) + local shortDescriptionBox = New("TextBox", "TextBox", { + Text = "", + ClearTextOnFocus = false, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(1, -6, 1, -6), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top, + TextWrap = true, + BackgroundColor3 = Color3I(0, 0, 0), + BorderSizePixel = 0, + ZIndex = baseZIndex + 2, + Parent = shortDescriptionWrapper + }) + submitReportButton = New("TextButton", "SubmitReportBtn", { + Active = false, + Modal = true, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.1, 0, 1, -80), + Size = UDim2.new(0.35, 0, 0, 50), + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButtonDefault, + Text = "Submit Report", + TextColor3 = Color3I(255, 255, 255), + ZIndex = baseZIndex + 2, + Parent = settingsFrame + }) + submitReportButton.MouseButton1Click:connect(function() + if submitReportButton.Active then + if abuse and abusingPlayer then + frame.Visible = false + game.Players:ReportAbuse(abusingPlayer, abuse, shortDescriptionBox.Text) + if abuse == "Cheating/Exploiting" then + recordedMessageBox.Visible = true + elseif abuse == "Bullying" or abuse == "Swearing" then + calmingMessageBox.Visible = true + else + normalMessageBox.Visible = true + end + else + return closeAndResetDialog() + end + end + end) + local cancelButton = New("TextButton", "CancelBtn", { + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.55, 0, 1, -80), + Size = UDim2.new(0.35, 0, 0, 50), + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButtonDefault, + Text = "Cancel", + TextColor3 = Color3I(255, 255, 255), + ZIndex = baseZIndex + 2, + Parent = settingsFrame + }) + closeAndResetDialog = function() + local oldComboBox = settingsFrame:FindFirstChild("PlayersComboBox") + if oldComboBox then + oldComboBox.Parent = nil + end + abusingPlayer = nil + updatePlayerSelection(nil) + abuse = nil + updateAbuseSelection(nil) + submitReportButton.Active = false + shortDescriptionBox.Text = "" + frame.Visible = true + calmingMessageBox.Visible = false + recordedMessageBox.Visible = false + normalMessageBox.Visible = false + shield.Visible = false + reportAbuseButton.Active = true + return game.GuiService:RemoveCenterDialog(shield) + end + cancelButton.MouseButton1Click:connect(closeAndResetDialog) + reportAbuseButton.MouseButton1Click:connect(function() + createPlayersDropDown().Parent = settingsFrame + table.insert(centerDialogs, shield) + return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, function() + reportAbuseButton.Active = false + shield.Visible = true + mainShield.Visible = false + end, function() + reportAbuseButton.Active = true + shield.Visible = false + end) + end) + robloxLock(shield) + return shield + end + local isSaveDialogSupported = pcall(function() end) + if isSaveDialogSupported then + delay(0, function() + local saveDialogs = createSaveDialogs() + saveDialogs.Parent = gui + game.RequestShutdown = function() + table.insert(centerDialogs, saveDialogs) + game.GuiService:AddCenterDialog(saveDialogs, Enum.CenterDialogType.QuitDialog, function() + saveDialogs.Visible = true + end, function() + saveDialogs.Visible = false + end) + return true + end + end) + end + delay(0, function() + createReportAbuseDialog().Parent = gui + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton") + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = true + end) +pcall(function() + return game.GuiService.UseLuaChat + end) + local BurningManPlaceID = 41324860 + return delay(0, function() + waitForChild(game, "NetworkClient") + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + waitForProperty(game.Players.LocalPlayer, "Character") + waitForChild(game.Players.LocalPlayer.Character, "Humanoid") + waitForProperty(game, "PlaceId") + if game.PlaceId == BurningManPlaceID then + game.Players.LocalPlayer.Character.Humanoid:SetClickToWalkEnabled(false) + return game.Players.LocalPlayer.CharacterAdded:connect(function(character) + waitForChild(character, "Humanoid") + return character.Humanoid:SetClickToWalkEnabled(false) + end) + end + end) +end diff --git a/yue/46295863.yue b/yue/46295863.yue index e69de29..cd1486e 100644 --- a/yue/46295863.yue +++ b/yue/46295863.yue @@ -0,0 +1,2295 @@ +-- Heliodex's basic New function (basically a simplified version of melt) +New = (className, name, props) -> + if not props? -- no name was provided + props = name + name = nil + + obj = Instance.new className + obj.Name = name if name + local parent + + for k, v in pairs props + if type(k) == "string" + if k == "Parent" + parent = v + else + obj[k] = v + + elseif type(k) == "number" and type(v) == "userdata" + v.Parent = obj + + obj.Parent = parent + obj +-- + +waitForChild = (instance, name) -> + while not instance\FindFirstChild name + instance.ChildAdded\wait! + +waitForProperty = (instance, property) -> + while not instance[property] + instance.Changed\wait! + +-- A Few Script Globals +gui = if script.Parent\FindFirstChild "ControlFrame" + script.Parent\FindFirstChild "ControlFrame" +else + script.Parent + +local RbxGui +local syncVideoCaptureSetting +local settingsButton, helpButton, settingsFrame, mouseLockLabel +local updateCameraDropDownSelection +local updateVideoCaptureDropDownSelection +tweenTime = 0.2 + +mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825" +classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798" + +hasGraphicsSlider = game\GetService"CoreGui".Version >= 5 +GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider +recordingVideo = false + +local currentMenuSelection +lastMenuSelection = {} + +-- defaultPosition = UDim2.new 0, 0, 0, 0 +-- newGuiPlaces = { 0, 41324860 } + +centerDialogs = {} +local mainShield + +inStudioMode = UserSettings!.GameSettings\InStudioMode! + +macClient = false +success, isMac = try + not game.GuiService.IsWindows + +macClient = success and isMac + +Color3I = (r, g, b) -> + Color3.new(r / 255, g / 255, b / 255) + + +robloxLock = (instance) -> + instance.RobloxLocked = true + children = instance\GetChildren! + if children + for _, child in ipairs children + robloxLock child + + +resumeGameFunction = (shield) -> + shield.Settings\TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + delay tweenTime, -> + shield.Visible = false + for i = 1, #centerDialogs + centerDialogs[i].Visible = false + game.GuiService\RemoveCenterDialog centerDialogs[i] + + game.GuiService\RemoveCenterDialog shield + settingsButton.Active = true + currentMenuSelection = nil + lastMenuSelection = {} + + +goToMenu = (container, menuName, moveDirection, size, position) -> + return if type(menuName) ~= "string" + + table.insert lastMenuSelection, currentMenuSelection + if menuName == "GameMainMenu" + lastMenuSelection = {} + + + containerChildren = container\GetChildren! + for i = 1, #containerChildren + if containerChildren[i].Name == menuName + containerChildren[i].Visible = true + currentMenuSelection = + container: container + name: menuName + direction: moveDirection + lastSize: size + -- selectedMenu = true + if size and position + containerChildren[i]\TweenSizeAndPosition( + size, + position, + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + elseif size + containerChildren[i]\TweenSizeAndPosition( + size, + UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + else + containerChildren[i]\TweenPosition( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + else + if moveDirection == "left" + containerChildren[i]\TweenPosition( + UDim2.new(-1, -525, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + elseif moveDirection == "right" + containerChildren[i]\TweenPosition( + UDim2.new(1, 525, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + elseif moveDirection == "up" + containerChildren[i]\TweenPosition( + UDim2.new(0, 0, -1, -400), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + elseif moveDirection == "down" + containerChildren[i]\TweenPosition( + UDim2.new(0, 0, 1, 400), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + delay tweenTime, -> + containerChildren[i].Visible = false + + +resetLocalCharacter = -> + player = game.Players.LocalPlayer + if player + if player.Character and player.Character\FindFirstChild "Humanoid" + player.Character.Humanoid.Health = 0 + + +createTextButton = (text, style, fontSize, buttonSize, buttonPosition) -> + New "TextButton" + Font: Enum.Font.Arial + FontSize: fontSize + Size: buttonSize + Position: buttonPosition + Style: style + TextColor3: Color3.new 1, 1, 1 + Text: text + + +CreateTextButtons = (frame, buttons, yPos, ySize) -> + if #buttons < 1 + error "Must have more than one button" + + + buttonNum = 1 + buttonObjs = {} + + toggleSelection = (button) -> + for _, obj in ipairs buttonObjs + obj.Style = if obj == button + Enum.ButtonStyle.RobloxButtonDefault + else + objEnum.ButtonStyle.RobloxButton + + + for _, obj in ipairs buttons + button = New "TextButton", "Button#{buttonNum}" + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + AutoButtonColor: true + Style: Enum.ButtonStyle.RobloxButton + Text: obj.Text + TextColor3: Color3.new 1, 1, 1 + button.MouseButton1Click\connect -> + toggleSelection button + obj.Function! + + button.Parent = frame + buttonObjs[buttonNum] = button + + buttonNum += 1 + + toggleSelection buttonObjs[1] + + numButtons = buttonNum - 1 + + if numButtons == 1 + frame.Button1.Position = UDim2.new 0.35, 0, yPos.Scale, yPos.Offset + frame.Button1.Size = UDim2.new 0.4, 0, ySize.Scale, ySize.Offset + elseif numButtons == 2 + frame.Button1.Position = UDim2.new 0.1, 0, yPos.Scale, yPos.Offset + frame.Button1.Size = UDim2.new 0.35, 0, ySize.Scale, ySize.Offset + + frame.Button2.Position = UDim2.new 0.55, 0, yPos.Scale, yPos.Offset + frame.Button2.Size = UDim2.new 0.35, 0, ySize.Scale, ySize.Offset + elseif numButtons >= 3 + spacing = 0.1 / numButtons + buttonSize = 0.9 / numButtons + + buttonNum = 1 + while buttonNum <= numButtons + buttonObjs[buttonNum].Position = UDim2.new spacing * buttonNum + (buttonNum - 1) * buttonSize, 0, yPos.Scale, yPos.Offset + buttonObjs[buttonNum].Size = UDim2.new buttonSize, 0, ySize.Scale, ySize.Offset + buttonNum += 1 + + +setRecordGui = (recording, stopRecordButton, recordVideoButton) -> + if recording + stopRecordButton.Visible = true + recordVideoButton.Text = "Stop Recording" + else + stopRecordButton.Visible = false + recordVideoButton.Text = "Record Video" + + +recordVideoClick = (recordVideoButton, stopRecordButton) -> + recordingVideo = not recordingVideo + setRecordGui(recordingVideo, stopRecordButton, recordVideoButton) + + +backToGame = (buttonClicked, shield, settingsButton) -> + buttonClicked.Parent.Parent.Parent.Parent.Visible = false + shield.Visible = false + for i = 1, #centerDialogs + game.GuiService\RemoveCenterDialog(centerDialogs[i]) + centerDialogs[i].Visible = false + + centerDialogs = {} + game.GuiService\RemoveCenterDialog(shield) + settingsButton.Active = true + + +setDisabledState = (guiObject) -> + return if not guiObject + + if guiObject\IsA "TextLabel" + guiObject.TextTransparency = 0.9 + elseif guiObject\IsA "TextButton" + guiObject.TextTransparency = 0.9 + guiObject.Active = false + else + if guiObject["ClassName"] + print "setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName + + +createHelpDialog = (baseZIndex) -> + if not helpButton? + if gui\FindFirstChild "TopLeftControl" and gui.TopLeftControl\FindFirstChild "Help" + helpButton = gui.TopLeftControl.Help + elseif gui\FindFirstChild "BottomRightControl" and gui.BottomRightControl\FindFirstChild "Help" + helpButton = gui.BottomRightControl.Help + + + shield = New "Frame", "HelpDialogShield" + Active: true + Visible: false + Size: UDim2.new 1, 0, 1, 0 + BackgroundColor3: Color3I 51, 51, 51 + BorderColor3: Color3I 27, 42, 53 + BackgroundTransparency: 0.4 + ZIndex: baseZIndex + 1 + + helpDialog = New "Frame", "HelpDialog" + Style: Enum.FrameStyle.RobloxRound + Position: UDim2.new 0.2, 0, 0.2, 0 + Size: UDim2.new 0.6, 0, 0.6, 0 + Active: true + Parent: shield + + * New "TextLabel", "Title" + Text: "Keyboard & Mouse Controls" + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + Position: UDim2.new 0, 0, 0.025, 0 + Size: UDim2.new 1, 0, 0, 40 + TextColor3: Color3.new 1, 1, 1 + BackgroundTransparency: 1 + + buttonRow = New "Frame", "Buttons" + Position: UDim2.new 0.1, 0, 0.07, 40 + Size: UDim2.new 0.8, 0, 0, 45 + BackgroundTransparency: 1 + Parent: helpDialog + + imageFrame = New "Frame", "ImageFrame" + Position: UDim2.new 0.05, 0, 0.075, 80 + Size: UDim2.new 0.9, 0, 0.9, -120 + BackgroundTransparency: 1 + Parent: helpDialog + + layoutFrame = New "Frame", "LayoutFrame" + Position: UDim2.new 0.5, 0, 0, 0 + Size: UDim2.new 1.5, 0, 1, 0 + BackgroundTransparency: 1 + SizeConstraint: Enum.SizeConstraint.RelativeYY + Parent: imageFrame + + image = New "ImageLabel", "Image" + if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] + image.Image = mouseLockLookScreenUrl + else + image.Image = classicLookScreenUrl + + image.Position = UDim2.new -0.5, 0, 0, 0 + image.Size = UDim2.new 1, 0, 1, 0 + image.BackgroundTransparency = 1 + image.Parent = layoutFrame + + buttons = {} + buttons[1] = {} + buttons[1].Text = "Look" + buttons[1].Function = -> + if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] + image.Image = mouseLockLookScreenUrl + else + image.Image = classicLookScreenUrl + + + buttons[2] = {} + buttons[2].Text = "Move" + buttons[2].Function = -> + image.Image = "http://www.roblox.com/Asset?id=45915811" + + buttons[3] = {} + buttons[3].Text = "Gear" + buttons[3].Function = -> + image.Image = "http://www.roblox.com/Asset?id=45917596" + + buttons[4] = {} + buttons[4].Text = "Zoom" + buttons[4].Function = -> + image.Image = "http://www.roblox.com/Asset?id=45915825" + + + CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0)) + + -- set up listeners for type of mouse mode, but keep constructing gui at same time + delay 0, -> + waitForChild gui, "UserSettingsShield" + waitForChild gui.UserSettingsShield, "Settings" + waitForChild gui.UserSettingsShield.Settings, "SettingsStyle" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle, "GameSettingsMenu" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu, "CameraField" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField, "DropDownMenuButton" + gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed\connect (prop) -> + return if prop ~= "Text" + + if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxButtonDefault -- only change if this is the currently selected panel + image.Image = if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text == + "Classic" + + classicLookScreenUrl + else + mouseLockLookScreenUrl + + + okBtn = New "TextButton", "OkBtn" + Text: "OK" + Modal: true + Size: UDim2.new 0.3, 0, 0, 45 + Position: UDim2.new 0.35, 0, 0.975, -50 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + BackgroundTransparency: 1 + TextColor3: Color3.new 1, 1, 1 + Style: Enum.ButtonStyle.RobloxButtonDefault + Parent: helpDialog + okBtn.MouseButton1Click\connect -> + shield.Visible = false + game.GuiService\RemoveCenterDialog shield + + robloxLock shield + shield + + +createLeaveConfirmationMenu = (baseZIndex, shield) -> + frame = New "Frame", "LeaveConfirmationMenu" + BackgroundTransparency: 1 + Size: UDim2.new 1, 0, 1, 0 + Position: UDim2.new 0, 0, 2, 400 + ZIndex: baseZIndex + 4 + + * New "TextLabel", "LeaveText" + Text: "Leave this game?" + Size: UDim2.new 1, 0, 0.8, 0 + TextWrap: true + TextColor3: Color3.new 1, 1, 1 + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + BackgroundTransparency: 1 + ZIndex: baseZIndex + 4 + + with createTextButton( + "Leave", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 313, 0.8, 0) + ) + .Name = "YesButton" + .ZIndex = baseZIndex + 4 + .Parent = frame + .Modal = true + \SetVerb "Exit" + + with createTextButton( + "Stay", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 90, 0.8, 0) + ) + .Name = "NoButton" + .Parent = frame + .ZIndex = baseZIndex + 4 + .MouseButton1Click\connect -> + goToMenu shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new 0, 525, 0, 430 + shield.Settings\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + frame + + +createResetConfirmationMenu = (baseZIndex, shield) -> + frame = New "Frame", "ResetConfirmationMenu" + BackgroundTransparency: 1 + Size: UDim2.new 1, 0, 1, 0 + Position: UDim2.new 0, 0, 2, 400 + ZIndex: baseZIndex + 4 + + with createTextButton( + "Reset", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 313, 0, 299) + ) + .Name = "YesButton" + .ZIndex = baseZIndex + 4 + .Parent = frame + .Modal = true + .MouseButton1Click\connect -> + resumeGameFunction shield + resetLocalCharacter! + + + with createTextButton( + "Cancel", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 90, 0, 299) + ) + .Name = "NoButton" + .Parent = frame + .ZIndex = baseZIndex + 4 + .MouseButton1Click\connect -> + goToMenu shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new 0, 525, 0, 430 + shield.Settings\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + + resetCharacterText = New "TextLabel", "ResetCharacterText" + Text: "Are you sure you want to reset your character?" + Size: UDim2.new 1, 0, 0.8, 0 + TextWrap: true + TextColor3: Color3.new 1, 1, 1 + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + BackgroundTransparency: 1 + ZIndex: baseZIndex + 4 + Parent: frame + + with resetCharacterText\Clone! + .Name = "FineResetCharacterText" + .Text = "You will be put back on a spawn point" + .Size = UDim2.new 0, 303, 0, 18 + .Position = UDim2.new 0, 109, 0, 215 + .FontSize = Enum.FontSize.Size18 + .Parent = frame + + frame + + +createGameMainMenu = (baseZIndex, shield) -> + gameMainMenuFrame = New "Frame", "GameMainMenu" + BackgroundTransparency: 1 + Size: UDim2.new 1, 0, 1, 0 + ZIndex: baseZIndex + 4 + Parent: settingsFrame + + * New "TextLabel", "Title" + Text: "Game Menu" + BackgroundTransparency: 1 + TextStrokeTransparency: 0 + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + Size: UDim2.new 1, 0, 0, 36 + Position: UDim2.new 0, 0, 0, 4 + TextColor3: Color3.new 1, 1, 1 + ZIndex: baseZIndex + 4 + + robloxHelpButton = createTextButton( + "Help", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new 0, 82, 0, 256 + ) + robloxHelpButton.Name = "HelpButton" + robloxHelpButton.ZIndex = baseZIndex + 4 + robloxHelpButton.Parent = gameMainMenuFrame + helpButton = robloxHelpButton + + helpDialog = createHelpDialog baseZIndex + helpDialog.Parent = gui + + helpButton.MouseButton1Click\connect -> + table.insert centerDialogs, helpDialog + game.GuiService\AddCenterDialog( + helpDialog, + Enum.CenterDialogType.ModalDialog, + --ShowFunction + -> + helpDialog.Visible = true + mainShield.Visible = false + --HideFunction + -> + helpDialog.Visible = false + + ) + + helpButton.Active = true + + helpShortcut = New "TextLabel", "HelpShortcutText" + Text: "F1" + Visible: false + BackgroundTransparency: 1 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size12 + Position: UDim2.new 0, 85, 0, 0 + Size: UDim2.new 0, 30, 0, 30 + TextColor3: Color3.new 0, 1, 0 + ZIndex: baseZIndex + 4 + Parent: robloxHelpButton + + screenshotButton = createTextButton( + "Screenshot", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new 0, 254, 0, 256 + ) + with screenshotButton + .Name = "ScreenshotButton" + .ZIndex = baseZIndex + 4 + .Parent = gameMainMenuFrame + .Visible = not macClient + \SetVerb "Screenshot" + + with helpShortcut\clone! + .Name = "ScreenshotShortcutText" + .Text = "PrintSc" + .Position = UDim2.new 0, 118, 0, 0 + .Visible = true + .Parent = screenshotButton + + recordVideoButton = createTextButton( + "Record Video", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new 0, 254, 0, 306 + ) + with recordVideoButton + .Name = "RecordVideoButton" + .ZIndex = baseZIndex + 4 + .Parent = gameMainMenuFrame + .Visible = not macClient + \SetVerb "RecordToggle" + + with helpShortcut\clone! + .Name = "RecordVideoShortcutText" + .Visible = hasGraphicsSlider + .Text = "F12" + .Position = UDim2.new 0, 120, 0, 0 + .Parent = recordVideoButton + + stopRecordButton = New "ImageButton", "StopRecordButton" + BackgroundTransparency: 1 + Image: "rbxasset://textures/ui/RecordStop.png" + Size: UDim2.new 0, 59, 0, 27 + stopRecordButton\SetVerb "RecordToggle" + + stopRecordButton.MouseButton1Click\connect -> + recordVideoClick recordVideoButton, stopRecordButton + + stopRecordButton.Visible = false + stopRecordButton.Parent = gui + + reportAbuseButton = createTextButton( + "Report Abuse", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new 0, 82, 0, 306 + ) + reportAbuseButton.Name = "ReportAbuseButton" + reportAbuseButton.ZIndex = baseZIndex + 4 + reportAbuseButton.Parent = gameMainMenuFrame + + with createTextButton( + "Leave Game", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new 0, 82, 0, 358 + ) + .Name = "LeaveGameButton" + .ZIndex = baseZIndex + 4 + .Parent = gameMainMenuFrame + + with createTextButton( + "Resume Game", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new 0, 82, 0, 54 + ) + .Name = "resumeGameButton" + .ZIndex = baseZIndex + 4 + .Parent = gameMainMenuFrame + .Modal = true + .MouseButton1Click\connect -> + resumeGameFunction shield + + + gameSettingsButton = createTextButton( + "Game Settings", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new 0, 82, 0, 156 + ) + gameSettingsButton.Name = "SettingsButton" + gameSettingsButton.ZIndex = baseZIndex + 4 + gameSettingsButton.Parent = gameMainMenuFrame + + if game\FindFirstChild "LoadingGuiService" and #game.LoadingGuiService\GetChildren! > 0 + gameSettingsButton = createTextButton( + "Game Instructions", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new 0, 82, 0, 207 + ) + gameSettingsButton.Name = "GameInstructions" + gameSettingsButton.ZIndex = baseZIndex + 4 + gameSettingsButton.Parent = gameMainMenuFrame + gameSettingsButton.MouseButton1Click\connect -> + if game\FindFirstChild "Players" and game.Players["LocalPlayer"] + loadingGui = game.Players.LocalPlayer\FindFirstChild "PlayerLoadingGui" + if loadingGui + loadingGui.Visible = true + + + resetButton = createTextButton( + "Reset Character", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new 0, 82, 0, 105 + ) + resetButton.Name = "ResetButton" + resetButton.ZIndex = baseZIndex + 4 + resetButton.Parent = gameMainMenuFrame + + gameMainMenuFrame + + +createGameSettingsMenu = (baseZIndex, _) -> + gameSettingsMenuFrame = New "Frame", "GameSettingsMenu" + BackgroundTransparency: 1 + Size: UDim2.new 1, 0, 1, 0 + ZIndex: baseZIndex + 4 + + * New "TextLabel", "Title" + Text: "Settings" + Size: UDim2.new 1, 0, 0, 48 + Position: UDim2.new 0, 9, 0, -9 + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + TextColor3: Color3.new 1, 1, 1 + ZIndex: baseZIndex + 4 + BackgroundTransparency: 1 + + * New "TextLabel", "FullscreenText" + Text: "Fullscreen Mode" + Size: UDim2.new 0, 124, 0, 18 + Position: UDim2.new 0, 62, 0, 145 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + TextColor3: Color3.new 1, 1, 1 + ZIndex: baseZIndex + 4 + BackgroundTransparency: 1 + + fullscreenShortcut = New "TextLabel", "FullscreenShortcutText" + Visible: hasGraphicsSlider + Text: "F11" + BackgroundTransparency: 1 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size12 + Position: UDim2.new 0, 186, 0, 141 + Size: UDim2.new 0, 30, 0, 30 + TextColor3: Color3.new 0, 1, 0 + ZIndex: baseZIndex + 4 + Parent: gameSettingsMenuFrame + + studioText = New "TextLabel", "StudioText" + Visible: false + Text: "Studio Mode" + Size: UDim2.new 0, 95, 0, 18 + Position: UDim2.new 0, 62, 0, 179 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + TextColor3: Color3.new 1, 1, 1 + ZIndex: baseZIndex + 4 + BackgroundTransparency: 1 + Parent: gameSettingsMenuFrame + + studioShortcut = fullscreenShortcut\clone! + studioShortcut.Name = "StudioShortcutText" + studioShortcut.Visible = false -- TODO: turn back on when f2 hack is fixed + studioShortcut.Text = "F2" + studioShortcut.Position = UDim2.new 0, 154, 0, 175 + studioShortcut.Parent = gameSettingsMenuFrame + + local studioCheckbox + + if hasGraphicsSlider + qualityText = New "TextLabel", "QualityText" + Text: "Graphics Quality" + Size: UDim2.new 0, 128, 0, 18 + Position: UDim2.new 0, 30, 0, 239 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + TextColor3: Color3.new 1, 1, 1 + ZIndex: baseZIndex + 4 + BackgroundTransparency: 1 + Parent: gameSettingsMenuFrame + Visible: not inStudioMode + + autoText = qualityText\clone! + with autoText + .Name = "AutoText" + .Text = "Auto" + .Position = UDim2.new 0, 183, 0, 214 + .TextColor3 = Color3.new 128 / 255, 128 / 255, 128 / 255 + .Size = UDim2.new 0, 34, 0, 18 + .Parent = gameSettingsMenuFrame + .Visible = not inStudioMode + + fasterText = autoText\clone! + with fasterText + .Name = "FasterText" + .Text = "Faster" + .Position = UDim2.new 0, 185, 0, 274 + .TextColor3 = Color3.new 95, 95, 95 + .FontSize = Enum.FontSize.Size14 + .Parent = gameSettingsMenuFrame + .Visible = not inStudioMode + + fasterShortcut = fullscreenShortcut\clone! + with fasterShortcut + .Name = "FasterShortcutText" + .Text = "F10 + Shift" + .Position = UDim2.new 0, 185, 0, 283 + .Parent = gameSettingsMenuFrame + .Visible = not inStudioMode + + betterQualityText = autoText\clone! + with betterQualityText + .Name = "BetterQualityText" + .Text = "Better Quality" + .TextWrap = true + .Size = UDim2.new 0, 41, 0, 28 + .Position = UDim2.new 0, 390, 0, 269 + .TextColor3 = Color3.new 95, 95, 95 + .FontSize = Enum.FontSize.Size14 + .Parent = gameSettingsMenuFrame + .Visible = not inStudioMode + + betterQualityShortcut = fullscreenShortcut\clone! + Name: "BetterQualityShortcut" + Text: "F10" + Position: UDim2.new 0, 394, 0, 288 + Parent: gameSettingsMenuFrame + Visible: not inStudioMode + + autoGraphicsButton = createTextButton( + "X", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new 0, 187, 0, 239 + ) + with autoGraphicsButton + .Name = "AutoGraphicsButton" + .ZIndex = baseZIndex + 4 + .Parent = gameSettingsMenuFrame + .Visible = not inStudioMode + + local graphicsSlider, graphicsLevel = RbxGui.CreateSlider GraphicsQualityLevels, 150, UDim2.new 0, 230, 0, 280 -- graphics - 1 because slider starts at 1 instead of 0 + with graphicsSlider + .Parent = gameSettingsMenuFrame + .Bar.ZIndex = baseZIndex + 4 + .Bar.Slider.ZIndex = baseZIndex + 5 + .Visible = not inStudioMode + graphicsLevel.Value = math.floor (settings!.Rendering\GetMaxQualityLevel! - 1) / 2 + + graphicsSetter = New "TextBox", "GraphicsSetter" + BackgroundColor3: Color3.new 0, 0, 0 + BorderColor3: Color3.new 128 / 255, 128 / 255, 128 / 255 + Size: UDim2.new 0, 50, 0, 25 + Position: UDim2.new 0, 450, 0, 269 + TextColor3: Color3.new 1, 1, 1 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Text: "Auto" + ZIndex: 1 + TextWrap: true + Parent: gameSettingsMenuFrame + Visible: not inStudioMode + + isAutoGraphics = true + if not inStudioMode + isAutoGraphics = UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic + else + settings!.Rendering.EnableFRM = false + + + listenToGraphicsLevelChange = true + + setAutoGraphicsGui = (active) -> + isAutoGraphics = active + if active + autoGraphicsButton.Text = "X" + betterQualityText.ZIndex = 1 + betterQualityShortcut.ZIndex = 1 + fasterShortcut.ZIndex = 1 + fasterText.ZIndex = 1 + graphicsSlider.Bar.ZIndex = 1 + graphicsSlider.Bar.Slider.ZIndex = 1 + graphicsSetter.ZIndex = 1 + graphicsSetter.Text = "Auto" + else + autoGraphicsButton.Text = "" + graphicsSlider.Bar.ZIndex = baseZIndex + 4 + graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 + betterQualityShortcut.ZIndex = baseZIndex + 4 + fasterShortcut.ZIndex = baseZIndex + 4 + betterQualityText.ZIndex = baseZIndex + 4 + fasterText.ZIndex = baseZIndex + 4 + graphicsSetter.ZIndex = baseZIndex + 4 + + + goToAutoGraphics = -> + setAutoGraphicsGui true + + UserSettings!.GameSettings.SavedQualityLevel = Enum.SavedQualitySetting.Automatic + + settings!.Rendering.QualityLevel = Enum.QualityLevel.Automatic + + + setGraphicsQualityLevel = (newLevel) -> + percentage = newLevel / GraphicsQualityLevels + newSetting = math.floor (settings!.Rendering\GetMaxQualityLevel! - 1) * percentage + newSetting = if newSetting == 20 -- Level 20 is the same as level 21, except it doesn't render ambient occlusion + 21 + elseif newLevel == 1 -- make sure we can go to lowest settings (for terrible computers) + 1 + elseif newSetting > settings!.Rendering\GetMaxQualityLevel! + settings!.Rendering\GetMaxQualityLevel! - 1 + + + UserSettings!.GameSettings.SavedQualityLevel = newLevel + settings!.Rendering.QualityLevel = newSetting + + + goToManualGraphics = (explicitLevel) -> + setAutoGraphicsGui false + + if explicitLevel + graphicsLevel.Value = explicitLevel + else + graphicsLevel.Value = math.floor( + (settings!.Rendering.AutoFRMLevel / (settings!.Rendering\GetMaxQualityLevel! - 1)) + * GraphicsQualityLevels + ) + + + if explicitLevel == graphicsLevel.Value -- make sure we are actually in right graphics mode + setGraphicsQualityLevel graphicsLevel.Value + + + if not explicitLevel + UserSettings!.GameSettings.SavedQualityLevel = graphicsLevel.Value + + graphicsSetter.Text = "#{graphicsLevel.Value}" + + + showAutoGraphics = -> + autoText.ZIndex = baseZIndex + 4 + autoGraphicsButton.ZIndex = baseZIndex + 4 + + + hideAutoGraphics = -> + autoText.ZIndex = 1 + autoGraphicsButton.ZIndex = 1 + + + showManualGraphics = -> + graphicsSlider.Bar.ZIndex = baseZIndex + 4 + graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 + betterQualityShortcut.ZIndex = baseZIndex + 4 + fasterShortcut.ZIndex = baseZIndex + 4 + betterQualityText.ZIndex = baseZIndex + 4 + fasterText.ZIndex = baseZIndex + 4 + graphicsSetter.ZIndex = baseZIndex + 4 + + + hideManualGraphics = -> + betterQualityText.ZIndex = 1 + betterQualityShortcut.ZIndex = 1 + fasterShortcut.ZIndex = 1 + fasterText.ZIndex = 1 + graphicsSlider.Bar.ZIndex = 1 + graphicsSlider.Bar.Slider.ZIndex = 1 + graphicsSetter.ZIndex = 1 + + + translateSavedQualityLevelToInt = (savedQualityLevel) -> + switch savedQualityLevel + when Enum.SavedQualitySetting.Automatic then 0 + when Enum.SavedQualitySetting.QualityLevel1 then 1 + when Enum.SavedQualitySetting.QualityLevel2 then 2 + when Enum.SavedQualitySetting.QualityLevel3 then 3 + when Enum.SavedQualitySetting.QualityLevel4 then 4 + when Enum.SavedQualitySetting.QualityLevel5 then 5 + when Enum.SavedQualitySetting.QualityLevel6 then 6 + when Enum.SavedQualitySetting.QualityLevel7 then 7 + when Enum.SavedQualitySetting.QualityLevel8 then 8 + when Enum.SavedQualitySetting.QualityLevel9 then 9 + when Enum.SavedQualitySetting.QualityLevel10 then 10 + + + enableGraphicsWidget = -> + settings!.Rendering.EnableFRM = true + + isAutoGraphics = (UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) + if isAutoGraphics + showAutoGraphics! + goToAutoGraphics! + else + showAutoGraphics! + showManualGraphics! + goToManualGraphics(translateSavedQualityLevelToInt(UserSettings!.GameSettings.SavedQualityLevel)) + + + disableGraphicsWidget = -> + hideManualGraphics! + hideAutoGraphics! + settings!.Rendering.EnableFRM = false + + + graphicsSetter.FocusLost\connect -> + if isAutoGraphics + graphicsSetter.Text = "#{graphicsLevel.Value}" + return + + + newGraphicsValue = tonumber(graphicsSetter.Text) + if not newGraphicsValue? + graphicsSetter.Text = "#{graphicsLevel.Value}" + return + + + if newGraphicsValue < 1 + newGraphicsValue = 1 + elseif newGraphicsValue >= settings!.Rendering\GetMaxQualityLevel! + newGraphicsValue = settings!.Rendering\GetMaxQualityLevel! - 1 + + + graphicsLevel.Value = newGraphicsValue + setGraphicsQualityLevel graphicsLevel.Value + graphicsSetter.Text = "#{graphicsLevel.Value}" + + + graphicsLevel.Changed\connect (_) -> + return if isAutoGraphics + return if not listenToGraphicsLevelChange + + graphicsSetter.Text = "#{graphicsLevel.Value}" + setGraphicsQualityLevel graphicsLevel.Value + + + -- setup our graphic mode on load + if inStudioMode or UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic + if inStudioMode + settings!.Rendering.EnableFRM = false + disableGraphicsWidget! + else + settings!.Rendering.EnableFRM = true + goToAutoGraphics! + + else + settings!.Rendering.EnableFRM = true + goToManualGraphics(translateSavedQualityLevelToInt(UserSettings!.GameSettings.SavedQualityLevel)) + + + autoGraphicsButton.MouseButton1Click\connect -> + return if inStudioMode and not game.Players.LocalPlayer + + if not isAutoGraphics + goToAutoGraphics! + else + goToManualGraphics graphicsLevel.Value + + + game.GraphicsQualityChangeRequest\connect (graphicsIncrease) -> + return if isAutoGraphics + + -- only can set graphics in manual mode + + if graphicsIncrease + return if (graphicsLevel.Value + 1) > GraphicsQualityLevels + + graphicsLevel.Value = graphicsLevel.Value + 1 + graphicsSetter.Text = "#{graphicsLevel.Value}" + setGraphicsQualityLevel graphicsLevel.Value + + game\GetService"GuiService"\SendNotification( + "Graphics Quality", + "Increased to (#{graphicsSetter.Text})", + "", + 2, + -> + ) + else + if (graphicsLevel.Value - 1) <= 0 + return + + graphicsLevel.Value = graphicsLevel.Value - 1 + graphicsSetter.Text = "#{graphicsLevel.Value}" + setGraphicsQualityLevel graphicsLevel.Value + + game\GetService"GuiService"\SendNotification( + "Graphics Quality", + "Decreased to (#{graphicsSetter.Text})", + "", + 2, + -> + ) + + + game.Players.PlayerAdded\connect (player) -> + if player == game.Players.LocalPlayer and inStudioMode + enableGraphicsWidget! + + + game.Players.PlayerRemoving\connect (player) -> + if player == game.Players.LocalPlayer and inStudioMode + disableGraphicsWidget! + + + studioCheckbox = createTextButton( + "", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new 0, 30, 0, 176 + ) + studioCheckbox.Name = "StudioCheckbox" + studioCheckbox.ZIndex = baseZIndex + 4 + --studioCheckbox.Parent = gameSettingsMenuFrame -- todo: enable when studio h4x aren't an issue anymore + studioCheckbox\SetVerb "TogglePlayMode" + studioCheckbox.Visible = false -- todo: enabled when studio h4x aren't an issue anymore + + wasManualGraphics = (settings!.Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) + if inStudioMode and not game.Players.LocalPlayer + studioCheckbox.Text = "X" + disableGraphicsWidget! + elseif inStudioMode + studioCheckbox.Text = "X" + enableGraphicsWidget! + + if hasGraphicsSlider + UserSettings!.GameSettings.StudioModeChanged\connect (isStudioMode) -> + inStudioMode = isStudioMode + if isStudioMode + wasManualGraphics = (settings!.Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) + goToAutoGraphics! + studioCheckbox.Text = "X" + autoGraphicsButton.ZIndex = 1 + autoText.ZIndex = 1 + else + if wasManualGraphics + goToManualGraphics! + + studioCheckbox.Text = "" + autoGraphicsButton.ZIndex = baseZIndex + 4 + autoText.ZIndex = baseZIndex + 4 + + + else + studioCheckbox.MouseButton1Click\connect -> + if not studioCheckbox.Active + return + + + if studioCheckbox.Text == "" + studioCheckbox.Text = "X" + else + studioCheckbox.Text = "" + + + fullscreenCheckbox = createTextButton( + "", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new(0, 30, 0, 144) + ) + fullscreenCheckbox.Name = "FullscreenCheckbox" + fullscreenCheckbox.ZIndex = baseZIndex + 4 + fullscreenCheckbox.Parent = gameSettingsMenuFrame + fullscreenCheckbox\SetVerb "ToggleFullScreen" + if UserSettings!.GameSettings\InFullScreen! + fullscreenCheckbox.Text = "X" + + if hasGraphicsSlider + UserSettings!.GameSettings.FullscreenChanged\connect (isFullscreen) -> + if isFullscreen + fullscreenCheckbox.Text = "X" + else + fullscreenCheckbox.Text = "" + + + else + fullscreenCheckbox.MouseButton1Click\connect -> + if fullscreenCheckbox.Text == "" + fullscreenCheckbox.Text = "X" + else + fullscreenCheckbox.Text = "" + + + if game\FindFirstChild "NetworkClient" -- we are playing online + setDisabledState studioText + setDisabledState studioShortcut + setDisabledState studioCheckbox + + + local backButton + if hasGraphicsSlider + backButton = createTextButton( + "OK", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 180, 0, 50), + UDim2.new(0, 170, 0, 330) + ) + backButton.Modal = true + else + backButton = createTextButton( + "OK", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 180, 0, 50), + UDim2.new(0, 170, 0, 270) + ) + backButton.Modal = true + + + backButton.Name = "BackButton" + backButton.ZIndex = baseZIndex + 4 + backButton.Parent = gameSettingsMenuFrame + + if not macClient + New "TextLabel", "VideoCaptureLabel" + Text: "After Capturing Video" + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0, 32, 0, 100 + Size: UDim2.new 0, 164, 0, 18 + BackgroundTransparency: 1 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + ZIndex: baseZIndex + 4 + Parent: gameSettingsMenuFrame + + videoNames = {} + videoNameToItem = {} + videoNames[1] = "Just Save to Disk" + videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"] + videoNames[2] = "Upload to YouTube" + videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"] + + local videoCaptureDropDown + videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu videoNames, (text) -> + UserSettings!.GameSettings.VideoUploadPromptBehavior = videoNameToItem[text] + + with videoCaptureDropDown + .Name = "VideoCaptureField" + .ZIndex = baseZIndex + 4 + .DropDownMenuButton.ZIndex = baseZIndex + 4 + .DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 + .Position = UDim2.new 0, 270, 0, 94 + .Size = UDim2.new 0, 200, 0, 32 + .Parent = gameSettingsMenuFrame + + syncVideoCaptureSetting = -> + updateVideoCaptureDropDownSelection if UserSettings!.GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"] + videoNames[1] + elseif UserSettings!.GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"] + videoNames[2] + else + UserSettings!.GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"] + videoNames[2] + + + New "TextLabel", "CameraLabel" + Text: "Character & Camera Controls" + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0, 31, 0, 58 + Size: UDim2.new 0, 224, 0, 18 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + BackgroundTransparency: 1 + ZIndex: baseZIndex + 4 + Parent: gameSettingsMenuFrame + + mouseLockLabel = game.CoreGui.RobloxGui\FindFirstChild "MouseLockLabel", true + + enumItems = Enum.ControlMode\GetEnumItems! + enumNames = {} + enumNameToItem = {} + for i, obj in ipairs enumItems + enumNames[i] = obj.Name + enumNameToItem[obj.Name] = obj + + + local cameraDropDown + cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu enumNames, (text) -> + UserSettings!.GameSettings.ControlMode = enumNameToItem[text] + + try + if mouseLockLabel and UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] + mouseLockLabel.Visible = true + elseif mouseLockLabel + mouseLockLabel.Visible = false + + + cameraDropDown.Name = "CameraField" + cameraDropDown.ZIndex = baseZIndex + 4 + cameraDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 + cameraDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 + cameraDropDown.Position = UDim2.new 0, 270, 0, 52 + cameraDropDown.Size = UDim2.new 0, 200, 0, 32 + cameraDropDown.Parent = gameSettingsMenuFrame + + gameSettingsMenuFrame + + +if LoadLibrary + RbxGui = LoadLibrary "RbxGui" + baseZIndex = 0 + if UserSettings + createSettingsDialog = -> + waitForChild(gui, "BottomLeftControl") + settingsButton = gui.BottomLeftControl\FindFirstChild "SettingsButton" + + if not settingsButton? + settingsButton = New "ImageButton", "SettingsButton" + Image: "rbxasset://textures/ui/SettingsButton.png" + BackgroundTransparency: 1 + Active: false + Size: UDim2.new 0, 54, 0, 46 + Position: UDim2.new 0, 2, 0, 50 + Parent: gui.BottomLeftControl + + + shield = New "TextButton", "UserSettingsShield" + Text: "" + Active: true + AutoButtonColor: false + Visible: false + Size: UDim2.new 1, 0, 1, 0 + BackgroundColor3: Color3I 51, 51, 51 + BorderColor3: Color3I 27, 42, 53 + BackgroundTransparency: 0.4 + ZIndex: baseZIndex + 2 + mainShield = shield + + frame = New "Frame", "Settings" + Position: UDim2.new 0.5, -262, -0.5, -200 + Size: UDim2.new 0, 525, 0, 430 + BackgroundTransparency: 1 + Active: true + Parent: shield + + settingsFrame = New "Frame", "SettingsStyle" + Size: UDim2.new 1, 0, 1, 0 + Style: Enum.FrameStyle.RobloxRound + Active: true + ZIndex: baseZIndex + 3 + Parent: frame + + gameMainMenu = createGameMainMenu baseZIndex, shield + gameMainMenu.Parent = settingsFrame + + gameMainMenu.ScreenshotButton.MouseButton1Click\connect -> + backToGame gameMainMenu.ScreenshotButton, shield, settingsButton + + + gameMainMenu.RecordVideoButton.MouseButton1Click\connect -> + recordVideoClick gameMainMenu.RecordVideoButton, gui.StopRecordButton + backToGame gameMainMenu.RecordVideoButton, shield, settingsButton + + + if settings!\FindFirstChild "Game Options" + try + settings!\FindFirstChild"Game Options".VideoRecordingChangeRequest\connect (recording) -> + recordingVideo = recording + setRecordGui recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton + + + game.CoreGui.RobloxGui.Changed\connect (prop) -> -- We have stopped recording when we resize + if prop == "AbsoluteSize" and recordingVideo + recordVideoClick gameMainMenu.RecordVideoButton, gui.StopRecordButton + + + localPlayerChange = -> + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer + settings!.Rendering.EnableFRM = true + elseif inStudioMode + settings!.Rendering.EnableFRM = false + + + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer? + game.Players.LocalPlayer.Changed\connect -> + localPlayerChange! + + else + delay 0, -> + waitForProperty(game.Players, "LocalPlayer") + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + game.Players.LocalPlayer.Changed\connect -> + localPlayerChange! + + + gameMainMenu.ReportAbuseButton.Visible = game\FindFirstChild "NetworkClient" + if not gameMainMenu.ReportAbuseButton.Visible + game.ChildAdded\connect (child) -> + if child\IsA "NetworkClient" + gameMainMenu.ReportAbuseButton.Visible = game\FindFirstChild "NetworkClient" + + + gameMainMenu.ResetButton.MouseButton1Click\connect -> + goToMenu settingsFrame, "ResetConfirmationMenu", "up", UDim2.new 0, 525, 0, 370 + + + gameMainMenu.LeaveGameButton.MouseButton1Click\connect -> + goToMenu settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new 0, 525, 0, 300 + + + if game.CoreGui.Version >= 4 -- we can use escape! + game\GetService"GuiService".EscapeKeyPressed\connect -> + if not currentMenuSelection? + game.GuiService\AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --showFunction + -> + settingsButton.Active = false + updateCameraDropDownSelection(UserSettings!.GameSettings.ControlMode.Name) + syncVideoCaptureSetting?! + + + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new 0, 525, 0, 430) + shield.Visible = true + shield.Active = true + settingsFrame.Parent\TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + --hideFunction + -> + settingsFrame.Parent\TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true + + ) + elseif #lastMenuSelection > 0 + if #centerDialogs > 0 + for i = 1, #centerDialogs + game.GuiService\RemoveCenterDialog centerDialogs[i] + centerDialogs[i].Visible = false + + centerDialogs = {} + + + goToMenu( + lastMenuSelection[#lastMenuSelection]["container"], + lastMenuSelection[#lastMenuSelection]["name"], + lastMenuSelection[#lastMenuSelection]["direction"], + lastMenuSelection[#lastMenuSelection]["lastSize"] + ) + + table.remove(lastMenuSelection, #lastMenuSelection) + if #lastMenuSelection == 1 -- apparently lua can't reduce count to 0... T_T + lastMenuSelection = {} + + else + resumeGameFunction(shield) + + + gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) + gameSettingsMenu.Visible = false + gameSettingsMenu.Parent = settingsFrame + + gameMainMenu.SettingsButton.MouseButton1Click\connect -> + goToMenu(settingsFrame, "GameSettingsMenu", "left", UDim2.new 0, 525, 0, 350) + + + gameSettingsMenu.BackButton.MouseButton1Click\connect -> + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new 0, 525, 0, 430) + + + resetConfirmationWindow = createResetConfirmationMenu(baseZIndex, shield) + resetConfirmationWindow.Visible = false + resetConfirmationWindow.Parent = settingsFrame + + leaveConfirmationWindow = createLeaveConfirmationMenu(baseZIndex, shield) + leaveConfirmationWindow.Visible = false + leaveConfirmationWindow.Parent = settingsFrame + + robloxLock(shield) + + settingsButton.MouseButton1Click\connect -> + game.GuiService\AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --showFunction + -> + settingsButton.Active = false + updateCameraDropDownSelection(UserSettings!.GameSettings.ControlMode.Name) + syncVideoCaptureSetting?! + + + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new 0, 525, 0, 430) + shield.Visible = true + settingsFrame.Parent\TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + + --hideFunction + -> + settingsFrame.Parent\TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent\TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true + + ) + + + return shield + + + delay 0, -> + createSettingsDialog!.Parent = gui + + gui.BottomLeftControl.SettingsButton.Active = true + gui.BottomLeftControl.SettingsButton.Position = UDim2.new 0, 2, 0, -2 + + if mouseLockLabel and UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] + mouseLockLabel.Visible = true + elseif mouseLockLabel + mouseLockLabel.Visible = false + + + -- our script has loaded, get rid of older buttons now + leaveGameButton = gui.BottomLeftControl\FindFirstChild "Exit" + if leaveGameButton + leaveGameButton\Remove! + + + topLeft = gui\FindFirstChild "TopLeftControl" + if topLeft + leaveGameButton = topLeft\FindFirstChild "Exit" + if leaveGameButton + leaveGameButton\Remove! + + + topLeft\Remove! + --UserSettings call + + createSaveDialogs = -> + shield = Instance.new "TextButton" + shield.Text = "" + shield.AutoButtonColor = false + shield.Name = "SaveDialogShield" + shield.Active = true + shield.Visible = false + shield.Size = UDim2.new 1, 0, 1, 0 + shield.BackgroundColor3 = Color3I 51, 51, 51 + shield.BorderColor3 = Color3I 27, 42, 53 + shield.BackgroundTransparency = 0.4 + shield.ZIndex = baseZIndex + 1 + + local clearAndResetDialog + local save + local saveLocal + local dontSave + local cancel + + messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Save" + messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault + messageBoxButtons[1].Function = -> + save! + + messageBoxButtons[2] = {} + messageBoxButtons[2].Text = "Cancel" + messageBoxButtons[2].Function = -> + cancel! + + messageBoxButtons[3] = {} + messageBoxButtons[3].Text = "Don't Save" + messageBoxButtons[3].Function = -> + dontSave! + + + saveDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Unsaved Changes", + "Save your changes to Mercury before leaving?", + "Confirm", + messageBoxButtons + ) + saveDialogMessageBox.Visible = true + saveDialogMessageBox.Parent = shield + + errorBoxButtons = {} + + buttonOffset = 1 + if game.LocalSaveEnabled + errorBoxButtons[buttonOffset] = {} + errorBoxButtons[buttonOffset].Text = "Save to Disk" + errorBoxButtons[buttonOffset].Function = -> + saveLocal! + + buttonOffset += 1 + + errorBoxButtons[buttonOffset] = {} + errorBoxButtons[buttonOffset].Text = "Keep Playing" + errorBoxButtons[buttonOffset].Function = -> + cancel! + + errorBoxButtons[buttonOffset + 1] = {} + errorBoxButtons[buttonOffset + 1].Text = "Don't Save" + errorBoxButtons[buttonOffset + 1].Function = -> + dontSave! + + + errorDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Upload Failed", + "Sorry, we could not save your changes to Mercury.", + "Error", + errorBoxButtons + ) + errorDialogMessageBox.Visible = false + errorDialogMessageBox.Parent = shield + + spinnerDialog = New "Frame", "SpinnerDialog" + Style: Enum.FrameStyle.RobloxRound + Size: UDim2.new 0, 350, 0, 150 + Position: UDim2.new 0.5, -175, 0.5, -75 + Visible: false + Active: true + Parent: shield + + * New "TextLabel", "WaitingLabel" + Text: "Saving to Mercury..." + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.5, 25, 0.5, 0 + TextColor3: Color3.new 1, 1, 1 + + spinnerFrame = New "Frame", "Spinner" + Size: UDim2.new 0, 80, 0, 80 + Position: UDim2.new 0.5, -150, 0.5, -40 + BackgroundTransparency: 1 + Parent: spinnerDialog + + spinnerIcons = {} + spinnerNum = 1 + while spinnerNum <= 8 + spinnerImage = New "ImageLabel", "Spinner#{spinnerNum}" + Size: UDim2.new 0, 16, 0, 16 + Position: UDim2.new( + 0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), + -8, + 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), + -8 + ) + BackgroundTransparency: 1 + Image: "http://www.roblox.com/Asset?id=45880710" + Parent: spinnerFrame + + spinnerIcons[spinnerNum] = spinnerImage + spinnerNum += 1 + + + save = -> + saveDialogMessageBox.Visible = false + + --Show the spinner dialog + spinnerDialog.Visible = true + spin = true + --Make it spin + delay 0, -> + spinPos = 0 + while spin + pos = 0 + + while pos < 8 + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset?id=" .. + if pos == spinPos or pos == ((spinPos + 1) % 8) + 45880668 + else + 45880710 + + + pos += 1 + + spinPos = (spinPos + 1) % 8 + wait(0.2) + + + --Do the save while the spinner is going, function will wait + result = game\SaveToRoblox! + if not result + --Try once more + result = game\SaveToRoblox! + + + --Hide the spinner dialog + spinnerDialog.Visible = false + --And cause the delay thread to stop + spin = false + + --Now process the result + if result + --Success, close + game\FinishShutdown false + clearAndResetDialog! + else + --Failure, show the second dialog prompt + errorDialogMessageBox.Visible = true + + + saveLocal = -> + errorDialogMessageBox.Visible = false + game\FinishShutdown true + clearAndResetDialog! + + + dontSave = -> + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + game\FinishShutdown false + clearAndResetDialog! + + cancel = -> + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + clearAndResetDialog! + + + clearAndResetDialog = -> + saveDialogMessageBox.Visible = true + errorDialogMessageBox.Visible = false + spinnerDialog.Visible = false + shield.Visible = false + game.GuiService\RemoveCenterDialog shield + + + robloxLock shield + shield.Visible = false + shield + + + createReportAbuseDialog = -> + --Only show things if we are a NetworkClient + waitForChild game, "NetworkClient" + + waitForChild game, "Players" + waitForProperty game.Players, "LocalPlayer" + localPlayer = game.Players.LocalPlayer + + local reportAbuseButton + waitForChild gui, "UserSettingsShield" + waitForChild gui.UserSettingsShield, "Settings" + waitForChild gui.UserSettingsShield.Settings, "SettingsStyle" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton" + reportAbuseButton = gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton + + shield = New "TextButton", "ReportAbuseShield" + Text: "" + AutoButtonColor: false + Active: true + Visible: false + Size: UDim2.new 1, 0, 1, 0 + BackgroundColor3: Color3I 51, 51, 51 + BorderColor3: Color3I 27, 42, 53 + BackgroundTransparency: 0.4 + ZIndex: baseZIndex + 1 + + local closeAndResetDialog + + messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Ok" + messageBoxButtons[1].Modal = true + messageBoxButtons[1].Function = -> + closeAndResetDialog! + + calmingMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", + messageBoxButtons + ) + calmingMessageBox.Visible = false + calmingMessageBox.Parent = shield + + recordedMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "We've recorded your report for evaluation.", + messageBoxButtons + ) + recordedMessageBox.Visible = false + recordedMessageBox.Parent = shield + + normalMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "Our moderators will review the chat logs and determine what happened.", + messageBoxButtons + ) + normalMessageBox.Visible = false + normalMessageBox.Parent = shield + + frame = New "Frame", "Settings" + Position: UDim2.new 0.5, -250, 0.5, -200 + Size: UDim2.new 0, 500, 0, 400 + BackgroundTransparency: 1 + Active: true + Parent: shield + + settingsFrame = New "Frame", "ReportAbuseStyle" + Size: UDim2.new 1, 0, 1, 0 + Style: Enum.FrameStyle.RobloxRound + Active: true + ZIndex: baseZIndex + 1 + Parent: frame + + * New "TextLabel", "Title" + Text: "Report Abuse" + TextColor3: Color3I 221, 221, 221 + Position: UDim2.new 0.5, 0, 0, 30 + Font: Enum.Font.ArialBold + FontSize: Enum.FontSize.Size36 + ZIndex: baseZIndex + 2 + + * New "TextLabel", "Description" + Text: "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action." + TextColor3: Color3I 221, 221, 221 + Position: UDim2.new 0, 0, 0, 55 + Size: UDim2.new 1, 0, 0, 40 + BackgroundTransparency: 1 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + TextWrap: true + ZIndex: baseZIndex + 2 + TextXAlignment: Enum.TextXAlignment.Left + TextYAlignment: Enum.TextYAlignment.Top + + * New "TextLabel", "PlayerLabel" + Text: "Which player?" + BackgroundTransparency: 1 + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.025, 0, 0, 100 + Size: UDim2.new 0.4, 0, 0, 36 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + ZIndex: baseZIndex + 2 + + * New "TextLabel", "AbuseLabel" + Text: "Type of Abuse:" + Font: Enum.Font.Arial + BackgroundTransparency: 1 + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.025, 0, 0, 140 + Size: UDim2.new 0.4, 0, 0, 36 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + ZIndex: baseZIndex + 2 + + local abusingPlayer + local abuse + local submitReportButton + + local updatePlayerSelection + createPlayersDropDown = -> + players = game\GetService "Players" + playerNames = {} + nameToPlayer = {} + children = players\GetChildren! + pos = 1 + if children + for _, player in ipairs children + if player\IsA "Player" and player ~= localPlayer + playerNames[pos] = player.Name + nameToPlayer[player.Name] = player + pos += 1 + + + local playerDropDown + playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu playerNames, (playerName) -> + abusingPlayer = nameToPlayer[playerName] + if abuse and abusingPlayer + submitReportButton.Active = true + + + playerDropDown.Name = "PlayersComboBox" + playerDropDown.ZIndex = baseZIndex + 2 + playerDropDown.Position = UDim2.new 0.425, 0, 0, 102 + playerDropDown.Size = UDim2.new 0.55, 0, 0, 32 + playerDropDown + + abuses = { + "Swearing", + "Bullying", + "Scamming", + "Dating", + "Cheating/Exploiting", + "Personal Questions", + "Offsite Links", + "Bad Model or Script", + "Bad Username", + } + local abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, (abuseText) -> + abuse = abuseText + if abuse and abusingPlayer + submitReportButton.Active = true + true) + + with abuseDropDown + .Name = "AbuseComboBox" + .ZIndex = baseZIndex + 2 + .Position = UDim2.new 0.425, 0, 0, 142 + .Size = UDim2.new 0.55, 0, 0, 32 + .Parent = settingsFrame + + New "TextLabel", "ShortDescriptionLabel" + Text: "Short Description: (optional)" + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.025, 0, 0, 180 + Size: UDim2.new 0.95, 0, 0, 36 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + BackgroundTransparency: 1 + ZIndex: baseZIndex + 2 + Parent: settingsFrame + + shortDescriptionWrapper = New "Frame", "ShortDescriptionWrapper" + Position: UDim2.new 0.025, 0, 0, 220 + Size: UDim2.new 0.95, 0, 1, -310 + BackgroundColor3: Color3I 0, 0, 0 + BorderSizePixel: 0 + ZIndex: baseZIndex + 2 + Parent: settingsFrame + + shortDescriptionBox = New "TextBox", "TextBox" + Text: "" + ClearTextOnFocus: false + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0, 3, 0, 3 + Size: UDim2.new 1, -6, 1, -6 + TextColor3: Color3I 255, 255, 255 + TextXAlignment: Enum.TextXAlignment.Left + TextYAlignment: Enum.TextYAlignment.Top + TextWrap: true + BackgroundColor3: Color3I 0, 0, 0 + BorderSizePixel: 0 + ZIndex: baseZIndex + 2 + Parent: shortDescriptionWrapper + + submitReportButton = New "TextButton", "SubmitReportBtn" + Active: false + Modal: true + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.1, 0, 1, -80 + Size: UDim2.new 0.35, 0, 0, 50 + AutoButtonColor: true + Style: Enum.ButtonStyle.RobloxButtonDefault + Text: "Submit Report" + TextColor3: Color3I 255, 255, 255 + ZIndex: baseZIndex + 2 + Parent: settingsFrame + + submitReportButton.MouseButton1Click\connect -> + if submitReportButton.Active + if abuse and abusingPlayer + frame.Visible = false + game.Players\ReportAbuse abusingPlayer, abuse, shortDescriptionBox.Text + if abuse == "Cheating/Exploiting" + recordedMessageBox.Visible = true + elseif abuse == "Bullying" or abuse == "Swearing" + calmingMessageBox.Visible = true + else + normalMessageBox.Visible = true + + else + closeAndResetDialog! + + + cancelButton = New "TextButton", "CancelBtn" + Font: Enum.Font.Arial + FontSize: Enum.FontSize.Size18 + Position: UDim2.new 0.55, 0, 1, -80 + Size: UDim2.new 0.35, 0, 0, 50 + AutoButtonColor: true + Style: Enum.ButtonStyle.RobloxButtonDefault + Text: "Cancel" + TextColor3: Color3I 255, 255, 255 + ZIndex: baseZIndex + 2 + Parent: settingsFrame + + closeAndResetDialog = -> + --Delete old player combo box + oldComboBox = settingsFrame\FindFirstChild "PlayersComboBox" + if oldComboBox + oldComboBox.Parent = nil + + + abusingPlayer = nil + updatePlayerSelection nil + abuse = nil + updateAbuseSelection nil + submitReportButton.Active = false + shortDescriptionBox.Text = "" + frame.Visible = true + calmingMessageBox.Visible = false + recordedMessageBox.Visible = false + normalMessageBox.Visible = false + shield.Visible = false + reportAbuseButton.Active = true + game.GuiService\RemoveCenterDialog shield + + + cancelButton.MouseButton1Click\connect closeAndResetDialog + + reportAbuseButton.MouseButton1Click\connect -> + createPlayersDropDown!.Parent = settingsFrame + table.insert centerDialogs, shield + game.GuiService\AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --ShowFunction + -> + reportAbuseButton.Active = false + shield.Visible = true + mainShield.Visible = false + + --HideFunction + -> + reportAbuseButton.Active = true + shield.Visible = false + + ) + + + robloxLock shield + + shield + + + -- createChatBar = -> + -- --Only show a chat bar if we are a NetworkClient + -- waitForChild(game, "NetworkClient") + + -- waitForChild(game, "Players") + -- waitForProperty(game.Players, "LocalPlayer") + + -- chatBar = Instance.new "Frame" + -- chatBar.Name = "ChatBar" + -- chatBar.Size = UDim2.new 1, 0, 0, 22 + -- chatBar.Position = UDim2.new 0, 0, 1, 0 + -- chatBar.BackgroundColor3 = Color3.new 0, 0, 0 + -- chatBar.BorderSizePixel = 0 + + -- chatBox = Instance.new "TextBox" + -- chatBox.Text = "" + -- chatBox.Visible = false + -- chatBox.Size = UDim2.new 1, -4, 1, 0 + -- chatBox.Position = UDim2.new 0, 2, 0, 0 + -- chatBox.TextXAlignment = Enum.TextXAlignment.Left + -- chatBox.Font = Enum.Font.Arial + -- chatBox.ClearTextOnFocus = false + -- chatBox.FontSize = Enum.FontSize.Size14 + -- chatBox.TextColor3 = Color3.new 1, 1, 1 + -- chatBox.BackgroundTransparency = 1 + -- --chatBox.Parent = chatBar + + -- chatButton = Instance.new "TextButton" + -- chatButton.Size = UDim2.new 1, -4, 1, 0 + -- chatButton.Position = UDim2.new 0, 2, 0, 0 + -- chatButton.AutoButtonColor = false + -- chatButton.Text = 'To chat click here or press "/" key' + -- chatButton.TextXAlignment = Enum.TextXAlignment.Left + -- chatButton.Font = Enum.Font.Arial + -- chatButton.FontSize = Enum.FontSize.Size14 + -- chatButton.TextColor3 = Color3.new 1, 1, 1 + -- chatButton.BackgroundTransparency = 1 + -- --chatButton.Parent = chatBar + + -- activateChat = -> + -- if chatBox.Visible + -- return + -- end + -- chatButton.Visible = false + -- chatBox.Text = "" + -- chatBox.Visible = true + -- chatBox\CaptureFocus! + -- end + + -- chatButton.MouseButton1Click\connect(activateChat) + + -- -- hotKeyEnabled = true + -- toggleHotKey = function(_) + -- -- hotKeyEnabled = value + -- end + + -- -- guiService = game\GetService "GuiService" + -- --[[newChatMode = ]]try + -- --guiService\AddSpecialKey(Enum.SpecialKey.ChatHotkey) + -- --guiService.SpecialKeyPressed\connect (key) -> if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat! end end) + -- end) + -- -- if not newChatMode + -- --guiService\AddKey("/") + -- --guiService.KeyPressed\connect (key) -> if key == "/" and hotKeyEnabled then activateChat! end end) + -- -- end + + -- chatBox.FocusLost\connect (enterPressed) -> + -- if enterPressed + -- if chatBox.Text ~= "" + -- str = chatBox.Text + -- if string.sub(str, 1, 1) == "%" + -- game.Players\TeamChat(string.sub(str, 2)) + -- else + -- game.Players\Chat(str) + -- end + -- end + -- end + -- chatBox.Text = "" + -- chatBox.Visible = false + -- chatButton.Visible = true + -- end) + -- robloxLock(chatBar) + -- return chatBar, toggleHotKey + -- end + + --Spawn a thread for the Save dialogs + isSaveDialogSupported = try + -- var = game.LocalSaveEnabled + + if isSaveDialogSupported + delay 0, -> + saveDialogs = createSaveDialogs! + saveDialogs.Parent = gui + + game.RequestShutdown = -> + table.insert(centerDialogs, saveDialogs) + game.GuiService\AddCenterDialog( + saveDialogs, + Enum.CenterDialogType.QuitDialog, + --ShowFunction + -> + saveDialogs.Visible = true + --HideFunction + -> + saveDialogs.Visible = false + + ) + + true + + + --Spawn a thread for the Report Abuse dialogs + delay 0, -> + createReportAbuseDialog!.Parent = gui + waitForChild gui, "UserSettingsShield" + waitForChild gui.UserSettingsShield, "Settings" + waitForChild gui.UserSettingsShield.Settings, "SettingsStyle" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu" + waitForChild gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton" + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = true + + + --Spawn a thread for Chat Bar + --[[local success, luaChat = ]] + try + game.GuiService.UseLuaChat + + -- if success and luaChat + + --[[delay 0, + -> + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + + advancedChatBarSupported = game.Players.LocalPlayer.ChatMode + local chatBar, toggleHotKey = createChatBar! + + [if advancedChatBarSupported + toggleChatBar = (chatMode) -> + if chatMode == Enum.ChatMode.Menu + chatBar.Parent = nil + game.GuiService\SetGlobalSizeOffsetPixel(0,0) + toggleHotKey(false) + elseif chatMode == Enum.ChatMode.TextAndMenu + --chatBar.Parent = gui + --game.GuiService\SetGlobalSizeOffsetPixel(0,-22) + toggleHotKey(true) + + + game.Players.LocalPlayer.Changed\connect( + function(prop) + if prop == "ChatMode" + toggleChatBar(game.Players.LocalPlayer.ChatMode) + + + toggleChatBar(game.Players.LocalPlayer.ChatMode) + else + --chatBar.Parent = gui + --game.GuiService\SetGlobalSizeOffsetPixel(0,-22) + + end)]] + -- end + + BurningManPlaceID = 41324860 + -- TODO: remove click to walk completely if testing shows we don't need it + -- Removes click to walk option from Burning Man + delay 0, -> + waitForChild game, "NetworkClient" + waitForChild game, "Players" + waitForProperty game.Players, "LocalPlayer" + waitForProperty game.Players.LocalPlayer, "Character" + waitForChild game.Players.LocalPlayer.Character, "Humanoid" + waitForProperty game, "PlaceId" + + if game.PlaceId == BurningManPlaceID + game.Players.LocalPlayer.Character.Humanoid\SetClickToWalkEnabled false + game.Players.LocalPlayer.CharacterAdded\connect (character) -> + waitForChild character, "Humanoid" + character.Humanoid\SetClickToWalkEnabled false +--LoadLibrary if diff --git a/yue/60595411.lua b/yue/60595411.lua index 4a7a035..ea9bc6c 100644 --- a/yue/60595411.lua +++ b/yue/60595411.lua @@ -1,4 +1,29 @@ local t = { } +local New +New = function(className, name, props) + if not (props ~= nil) then + props = name + name = nil + end + local obj = Instance.new(className) + if name then + obj.Name = name + end + local parent + for k, v in pairs(props) do + if type(k) == "string" then + if k == "Parent" then + parent = v + else + obj[k] = v + end + elseif type(k) == "number" and type(v) == "userdata" then + v.Parent = obj + end + end + obj.Parent = parent + return obj +end local assert = assert local Null Null = function() @@ -201,29 +226,29 @@ JsonReader.Read = function(self) end JsonReader.ReadTrue = function(self) self:TestReservedWord({ - "t", - "r", - "u", - "e" + 't', + 'r', + 'u', + 'e' }) return true end JsonReader.ReadFalse = function(self) self:TestReservedWord({ - "f", - "a", - "l", - "s", - "e" + 'f', + 'a', + 'l', + 's', + 'e' }) return false end JsonReader.ReadNull = function(self) self:TestReservedWord({ - "n", - "u", - "l", - "l" + 'n', + 'u', + 'l', + 'l' }) return nil end @@ -389,3 +414,317 @@ Decode = function(s) _with_0:Read() return _with_0 end +t.DecodeJSON = function(jsonString) +pcall(function() + return warn('RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.') + end) + if type(jsonString) == "string" then + return Decode(jsonString) + end + print("RbxUtil.DecodeJSON expects string argument!") + return nil +end +t.EncodeJSON = function(jsonTable) +pcall(function() + return warn('RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.') + end) + return Encode(jsonTable) +end +t.MakeWedge = function(x, y, z, _) + return game:GetService("Terrain"):AutoWedgeCell(x, y, z) +end +t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent) + local terrain = game.Workspace:FindFirstChild("Terrain") + if not terrain then + return + end + assert(regionToSelect) + assert(color) + if not type(regionToSelect) == "Region3" then + error("regionToSelect (first arg), should be of type Region3, but is type", type(regionToSelect)) + end + if not type(color) == "BrickColor" then + error("color (second arg), should be of type BrickColor, but is type", type(color)) + end + local GetCell = terrain.GetCell + local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid + local CellCenterToWorld = terrain.CellCenterToWorld + local emptyMaterial = Enum.CellMaterial.Empty + local selectionContainer = New("Model", "SelectionContainer", { + Archivable = false, + Parent = (function() + if selectionParent then + return selectionParent + else + return game.Workspace + end + end)() + }) + local updateSelection + local currentKeepAliveTag + local aliveCounter = 0 + local lastRegion + local adornments = { } + local reusableAdorns = { } + local selectionPart = New("Part", "SelectionPart", { + Transparency = 1, + Anchored = true, + Locked = true, + CanCollide = false, + Size = Vector3.new(4.2, 4.2, 4.2) + }) + local selectionBox = Instance.new("SelectionBox") + local createAdornment + createAdornment = function(theColor) + local selectionPartClone + local selectionBoxClone + if #reusableAdorns > 0 then + selectionPartClone = reusableAdorns[1]["part"] + selectionBoxClone = reusableAdorns[1]["box"] + table.remove(reusableAdorns, 1) + selectionBoxClone.Visible = true + else + selectionPartClone = selectionPart:Clone() + selectionPartClone.Archivable = false + selectionBoxClone = selectionBox:Clone() + selectionBoxClone.Archivable = false + selectionBoxClone.Adornee = selectionPartClone + selectionBoxClone.Parent = selectionContainer + selectionBoxClone.Adornee = selectionPartClone + selectionBoxClone.Parent = selectionContainer + end + if theColor then + selectionBoxClone.Color = theColor + end + return selectionPartClone, selectionBoxClone + end + local cleanUpAdornments + cleanUpAdornments = function() + for cellPos, adornTable in pairs(adornments) do + if adornTable.KeepAlive ~= currentKeepAliveTag then + adornTable.SelectionBox.Visible = false + table.insert(reusableAdorns, { + part = adornTable.SelectionPart, + box = adornTable.SelectionBox + }) + adornments[cellPos] = nil + end + end + end + local incrementAliveCounter + incrementAliveCounter = function() + aliveCounter = aliveCounter + 1 + if aliveCounter > 1000000 then + aliveCounter = 0 + end + return aliveCounter + end + local adornFullCellsInRegion + adornFullCellsInRegion = function(region, color) + local regionBegin = region.CFrame.p - region.Size / 2 + Vector3.new(2, 2, 2) + local regionEnd = region.CFrame.p + region.Size / 2 - Vector3.new(2, 2, 2) + local cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin) + local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd) + currentKeepAliveTag = incrementAliveCounter() + for y = cellPosBegin.y, cellPosEnd.y do + for z = cellPosBegin.z, cellPosEnd.z do + for x = cellPosBegin.x, cellPosEnd.x do + local cellMaterial = GetCell(terrain, x, y, z) + if cellMaterial ~= emptyMaterial then + local cframePos = CellCenterToWorld(terrain, x, y, z) + local cellPos = Vector3int16.new(x, y, z) + local updated = false + for cellPosAdorn, adornTable in pairs(adornments) do + if cellPosAdorn == cellPos then + adornTable.KeepAlive = currentKeepAliveTag + if color then + adornTable.SelectionBox.Color = color + end + updated = true + break + end + end + if not updated then + local selectionPart, selectionBox + selectionPart, selectionBox = createAdornment(color) + selectionPart.Size = Vector3.new(4, 4, 4) + selectionPart.CFrame = CFrame.new(cframePos) + local adornTable = { + SelectionPart = selectionPart, + SelectionBox = selectionBox, + KeepAlive = currentKeepAliveTag + } + adornments[cellPos] = adornTable + end + end + end + end + end + return cleanUpAdornments() + end + lastRegion = regionToSelect + if selectEmptyCells then + local selectionPart, selectionBox + selectionPart, selectionBox = createAdornment(color) + selectionPart.Size = regionToSelect.Size + selectionPart.CFrame = regionToSelect.CFrame + adornments.SelectionPart = selectionPart + adornments.SelectionBox = selectionBox + updateSelection = function(newRegion, color) + if newRegion and newRegion ~= lastRegion then + lastRegion = newRegion + selectionPart.Size = newRegion.Size + selectionPart.CFrame = newRegion.CFrame + end + if color then + selectionBox.Color = color + end + end + else + adornFullCellsInRegion(regionToSelect, color) + updateSelection = function(newRegion, color) + if newRegion and newRegion ~= lastRegion then + lastRegion = newRegion + return adornFullCellsInRegion(newRegion, color) + end + end + end + local destroyFunc + destroyFunc = function() + updateSelection = nil + if selectionContainer ~= nil then + selectionContainer:Destroy() + end + adornments = nil + end + return updateSelection, destroyFunc +end +t.CreateSignal = function() + local this = { } + local mBindableEvent = Instance.new("BindableEvent") + local mAllCns = { } + this.connect = function(self, func) + if self ~= this then + error("connect must be called with `:`, not `.`", 2) + end + if type(func) ~= "function" then + error("Argument #1 of connect must be a function, got a " .. tostring(type(func)), 2) + end + local cn = mBindableEvent.Event:connect(func) + mAllCns[cn] = true + local pubCn = { } + pubCn.disconnect = function(self) + cn:disconnect() + mAllCns[cn] = nil + end + pubCn.Disconnect = pubCn.disconnect + return pubCn + end + this.disconnect = function(self) + if self ~= this then + error("disconnect must be called with `:`, not `.`", 2) + end + for cn, _ in pairs(mAllCns) do + cn:disconnect() + mAllCns[cn] = nil + end + end + this.wait = function(self) + if self ~= this then + error("wait must be called with `:`, not `.`", 2) + end + return mBindableEvent.Event:wait() + end + this.fire = function(self, ...) + if self ~= this then + error("fire must be called with `:`, not `.`", 2) + end + return mBindableEvent:Fire(...) + end + this.Connect = this.connect + this.Disconnect = this.disconnect + this.Wait = this.wait + this.Fire = this.fire + return this +end +local Create_PrivImpl +Create_PrivImpl = function(objectType) + if type(objectType) ~= "string" then + error("Argument of Create must be a string", 2) + end + return function(dat) + dat = dat or { } + local obj = Instance.new(objectType) + local parent + local ctor + for k, v in pairs(dat) do + if type(k) == "string" then + if k == "Parent" then + parent = v + else + obj[k] = v + end + elseif type(k) == "number" then + if type(v) ~= "userdata" then + error("Bad entry in Create body: Numeric keys must be paired with children, got a: " .. tostring(type(v)), 2) + end + v.Parent = obj + elseif type(k) == "table" and k.__eventname then + if type(v) ~= "function" then + error("Bad entry in Create body: Key `[Create.E'" .. tostring(k.__eventname) .. "']` must have a function value, got: " .. tostring(v), 2) + end + obj[k.__eventname]:connect(v) + elseif k == t.Create then + if type(v) ~= "function" then + error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: " .. tostring(v), 2) + elseif ctor then + error("Bad entry in Create body: Only one constructor function is allowed", 2) + end + ctor = v + else + error("Bad entry (" .. tostring(k) .. " => " .. tostring(v) .. ") in Create body", 2) + end + end + if ctor ~= nil then + ctor(obj) + end + if parent then + obj.Parent = parent + end + return obj + end +end +t.Create = setmetatable({ }, { + ["__call"] = function(_, ...) + return Create_PrivImpl(...) + end +}) +t.Create.E = function(eventName) + return { + __eventname = eventName + } +end +t.Help = function(funcNameOrFunc) + if "DecodeJSON" == funcNameOrFunc or t.DecodeJSON == funcNameOrFunc then + return "Function DecodeJSON. " .. "Arguments: (string). " .. "Side effect: returns a table with all parsed JSON values" + elseif "EncodeJSON" == funcNameOrFunc or t.EncodeJSON == funcNameOrFunc then + return "Function EncodeJSON. " .. "Arguments: (table). " .. "Side effect: returns a string composed of argument table in JSON data format" + elseif "MakeWedge" == funcNameOrFunc or t.MakeWedge == funcNameOrFunc then + return "Function MakeWedge. " .. "Arguments: (x, y, z, [default material]). " .. "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " .. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " .. "Returns true if made a wedge, false if the cell remains a block " + elseif "SelectTerrainRegion" == funcNameOrFunc or t.SelectTerrainRegion == funcNameOrFunc then + return "Function SelectTerrainRegion. " .. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " .. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " .. "(this should be a region3 value). The selection box color is detemined by the color argument " .. "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." .. "SelectEmptyCells is bool, when true will select all cells in the " .. "region, otherwise we only select non-empty cells. Returns a function that can update the selection," .. "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " .. "Also returns a second function that takes no arguments and destroys the selection" + elseif "CreateSignal" == funcNameOrFunc or t.CreateSignal == funcNameOrFunc then + return "Function CreateSignal. " .. "Arguments: None. " .. "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " .. "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" .. "Lua code. " .. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " .. "For more info you can pass the method name to the Help function, or view the wiki page " .. "for this library. EG: Help('Signal:connect')." + elseif "Signal:connect" == funcNameOrFunc then + return "Method Signal:connect. " .. "Arguments: (function handler). " .. "Return: A connection object which can be used to disconnect the connection to this handler. " .. "Description: Connectes a handler function to this Signal, so that when |fire| is called the " .. "handler function will be called with the arguments passed to |fire|." + elseif "Signal:wait" == funcNameOrFunc then + return "Method Signal:wait. " .. "Arguments: None. " .. "Returns: The arguments passed to the next call to |fire|. " .. "Description: This call does not return until the next call to |fire| is made, at which point it " .. "will return the values which were passed as arguments to that |fire| call." + elseif "Signal:fire" == funcNameOrFunc then + return "Method Signal:fire. " .. "Arguments: Any number of arguments of any type. " .. "Returns: None. " .. "Description: This call will invoke any connected handler functions, and notify any waiting code " .. "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " .. "to handlers are made asynchronously, so this call will return immediately regardless of how long " .. "it takes the connected handler functions to complete." + elseif "Signal:disconnect" == funcNameOrFunc then + return "Method Signal:disconnect. " .. "Arguments: None. " .. "Returns: None. " .. "Description: This call disconnects all handlers attacched to this function, note however, it " .. "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method " .. "can also be called on the connection object which is returned from Signal:connect to only " .. "disconnect a single handler, as opposed to this method, which will disconnect all handlers." + elseif "Create" == funcNameOrFunc then + return "Function Create. " .. "Arguments: A table containing information about how to construct a collection of objects. " .. "Returns: The constructed objects. " .. "Descrition: Create is a very powerfull function, whose description is too long to fit here, and " .. "is best described via example, please see the wiki page for a description of how to use it." + end +end +return t diff --git a/yue/60595411.yue b/yue/60595411.yue index 262403a..aacab73 100644 --- a/yue/60595411.yue +++ b/yue/60595411.yue @@ -1,5 +1,29 @@ t = {} +-- Heliodex's basic New function (basically a simplified version of melt) +New = (className, name, props) -> + if not props? -- no name was provided + props = name + name = nil + + obj = Instance.new className + obj.Name = name if name + local parent + + for k, v in pairs props + if type(k) == "string" + if k == "Parent" + parent = v + else + obj[k] = v + + elseif type(k) == "number" and type(v) == "userdata" + v.Parent = obj + + obj.Parent = parent + obj +-- if a bit redundant due to the Create function at the bottom + ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -15,9 +39,8 @@ t = {} assert = assert Null = -> Null -StringBuilder = { +StringBuilder = buffer: {} -} StringBuilder.New ==> o = <>: @ @@ -105,8 +128,7 @@ JsonWriter.IsArray = (t) => else count = math.max count, k - - return true, "[", "]", count + true, "[", "]", count JsonWriter.WriteTable = (t) => @@ -213,15 +235,15 @@ JsonReader.Read ==> nil JsonReader.ReadTrue ==> - @\TestReservedWord { "t", "r", "u", "e" } + @\TestReservedWord { 't', 'r', 'u', 'e' } true JsonReader.ReadFalse ==> - @\TestReservedWord { "f", "a", "l", "s", "e" } + @\TestReservedWord { 'f', 'a', 'l', 's', 'e' } false JsonReader.ReadNull ==> - @\TestReservedWord { "n", "u", "l", "l" } + @\TestReservedWord { 'n', 'u', 'l', 'l' } nil JsonReader.TestReservedWord = (t) => @@ -244,7 +266,6 @@ JsonReader.ReadNumber ==> return result - JsonReader.ReadString ==> result = "" assert @\Next! == '"' @@ -284,7 +305,6 @@ JsonReader.ReadBlockComment ==> if not done and ch == "/" and @\Peek! == "*" error string.format "Invalid comment: %s, '/*' illegal.", @\All! - @\Next! @@ -313,7 +333,6 @@ JsonReader.ReadArray ==> if ch ~= "," error string.format "Invalid array: '%s' due to: '%s'", @\All!, ch - assert "]" == @\Next! result @@ -380,4 +399,570 @@ Decode = (s) -> -------------------- End JSON Parser ------------------------ --- TODO +t.DecodeJSON = (jsonString) -> + try + warn 'RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.' + + if type(jsonString) == "string" + return Decode jsonString + + print "RbxUtil.DecodeJSON expects string argument!" + nil + +t.EncodeJSON = (jsonTable) -> + try + warn 'RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.' + + Encode jsonTable + +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +--------------------------------------------Terrain Utilities Begin----------------------------------------------------- +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +--makes a wedge at location x, y, z +--sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w +--returns true if made a wedge, false if the cell remains a block +t.MakeWedge = (x, y, z, _) -> game\GetService"Terrain"\AutoWedgeCell x, y, z + + +t.SelectTerrainRegion = (regionToSelect, color, selectEmptyCells, selectionParent) -> + terrain = game.Workspace\FindFirstChild "Terrain" + return if not terrain + + assert regionToSelect + assert color + + if not type(regionToSelect) == "Region3" + error "regionToSelect (first arg), should be of type Region3, but is type", type regionToSelect + + if not type(color) == "BrickColor" + error "color (second arg), should be of type BrickColor, but is type", type color + + + -- frequently used terrain calls (speeds up call, no lookup necessary) + GetCell = terrain.GetCell + WorldToCellPreferSolid = terrain.WorldToCellPreferSolid + CellCenterToWorld = terrain.CellCenterToWorld + emptyMaterial = Enum.CellMaterial.Empty + + -- container for all adornments, passed back to user + selectionContainer = New "Model", "SelectionContainer" + Archivable: false + Parent: if selectionParent + selectionParent + else + game.Workspace + + local updateSelection -- function we return to allow user to update selection + local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed + aliveCounter = 0 -- helper for currentKeepAliveTag + local lastRegion -- used to stop updates that do nothing + adornments = {} -- contains all adornments + reusableAdorns = {} + + selectionPart = New "Part", "SelectionPart" + Transparency: 1 + Anchored: true + Locked: true + CanCollide: false + Size: Vector3.new 4.2, 4.2, 4.2 + + selectionBox = Instance.new "SelectionBox" + + -- srs translation from region3 to region3int16 + -- Region3ToRegion3int16 = (region3) -> + -- theLowVec = region3.CFrame.p - region3.Size / 2 + Vector3.new 2, 2, 2 + -- lowCell = WorldToCellPreferSolid terrain, theLowVec + + -- theHighVec = region3.CFrame.p + region3.Size / 2 - Vector3.new 2, 2, 2 + -- highCell = WorldToCellPreferSolid terrain, theHighVec + + -- highIntVec = Vector3int16.new highCell.x, highCell.y, highCell.z + -- lowIntVec = Vector3int16.new lowCell.x, lowCell.y, lowCell.z + + -- Region3int16.new lowIntVec, highIntVec + + -- helper function that creates the basis for a selection box + createAdornment = (theColor) -> + local selectionPartClone + local selectionBoxClone + + if #reusableAdorns > 0 + selectionPartClone = reusableAdorns[1]["part"] + selectionBoxClone = reusableAdorns[1]["box"] + table.remove reusableAdorns, 1 + + selectionBoxClone.Visible = true + else + selectionPartClone = selectionPart\Clone! + selectionPartClone.Archivable = false + + selectionBoxClone = selectionBox\Clone! + + with selectionBoxClone + .Archivable = false + .Adornee = selectionPartClone + .Parent = selectionContainer + .Adornee = selectionPartClone + .Parent = selectionContainer + + + if theColor + selectionBoxClone.Color = theColor + + selectionPartClone, selectionBoxClone + + -- iterates through all current adornments and deletes any that don't have latest tag + cleanUpAdornments = -> + for cellPos, adornTable in pairs adornments + if adornTable.KeepAlive ~= currentKeepAliveTag -- old news, we should get rid of this + adornTable.SelectionBox.Visible = false + table.insert reusableAdorns, part: adornTable.SelectionPart, box: adornTable.SelectionBox + adornments[cellPos] = nil + + + -- helper function to update tag + incrementAliveCounter = -> + aliveCounter += 1 + if aliveCounter > 1000000 + aliveCounter = 0 + + aliveCounter + + -- finds full cells in region and adorns each cell with a box, with the argument color + adornFullCellsInRegion = (region, color) -> + regionBegin = region.CFrame.p - region.Size / 2 + Vector3.new 2, 2, 2 + regionEnd = region.CFrame.p + region.Size / 2 - Vector3.new 2, 2, 2 + + cellPosBegin = WorldToCellPreferSolid terrain, regionBegin + cellPosEnd = WorldToCellPreferSolid terrain, regionEnd + + currentKeepAliveTag = incrementAliveCounter! + for y = cellPosBegin.y, cellPosEnd.y + for z = cellPosBegin.z, cellPosEnd.z + for x = cellPosBegin.x, cellPosEnd.x + cellMaterial = GetCell terrain, x, y, z + + if cellMaterial ~= emptyMaterial + cframePos = CellCenterToWorld terrain, x, y, z + cellPos = Vector3int16.new x, y, z + + updated = false + for cellPosAdorn, adornTable in pairs adornments + if cellPosAdorn == cellPos + adornTable.KeepAlive = currentKeepAliveTag + if color + adornTable.SelectionBox.Color = color + + updated = true + break + + + if not updated + local selectionPart, selectionBox = createAdornment color + selectionPart.Size = Vector3.new 4, 4, 4 + selectionPart.CFrame = CFrame.new cframePos + adornTable = + SelectionPart: selectionPart + SelectionBox: selectionBox + KeepAlive: currentKeepAliveTag + + adornments[cellPos] = adornTable + + cleanUpAdornments! + + + ------------------------------------- setup code ------------------------------ + lastRegion = regionToSelect + + if selectEmptyCells -- use one big selection to represent the area selected + local selectionPart, selectionBox = createAdornment color + + selectionPart.Size = regionToSelect.Size + selectionPart.CFrame = regionToSelect.CFrame + + adornments.SelectionPart = selectionPart + adornments.SelectionBox = selectionBox + + updateSelection = (newRegion, color) -> + if newRegion and newRegion ~= lastRegion + lastRegion = newRegion + selectionPart.Size = newRegion.Size + selectionPart.CFrame = newRegion.CFrame + + if color + selectionBox.Color = color + + + else -- use individual cell adorns to represent the area selected + adornFullCellsInRegion regionToSelect, color + updateSelection = (newRegion, color) -> + if newRegion and newRegion ~= lastRegion + lastRegion = newRegion + adornFullCellsInRegion newRegion, color + + + destroyFunc = -> + updateSelection = nil + selectionContainer?\Destroy! + + adornments = nil + + updateSelection, destroyFunc + + +-----------------------------Terrain Utilities End----------------------------- + +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------Signal class begin------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +--[[ +A 'Signal' object identical to the internal RBXScriptSignal object in it's public API and semantics. This function +can be used to create "custom events" for user-made code. +API: +Method \connect function handler + Arguments: The function to connect to. + Returns: A new connection object which can be used to disconnect the connection + Description: Connects this signal to the function specified by |handler|. That is, when |fire ...| is called for + the signal the |handler| will be called with the arguments given to |fire ...|. Note, the functions + connected to a signal are called in NO PARTICULAR ORDER, so connecting one function after another does + NOT mean that the first will be called before the second as a result of a call to |fire|. + +Method \disconnect! + Arguments: None + Returns: None + Description: Disconnects all of the functions connected to this signal. + +Method \fire ... + Arguments: Any arguments are accepted + Returns: None + Description: Calls all of the currently connected functions with the given arguments. + +Method \wait! + Arguments: None + Returns: The arguments given to fire + Description: This call blocks until +]] + +t.CreateSignal = -> + this = {} + + mBindableEvent = Instance.new "BindableEvent" + mAllCns = {} --all connection objects returned by mBindableEvent::connect + + --main functions + this.connect = (func) => + if self ~= this + error "connect must be called with `:`, not `.`", 2 + + if type(func) ~= "function" + error "Argument #1 of connect must be a function, got a #{type func}" , 2 + + cn = mBindableEvent.Event\connect func + mAllCns[cn] = true + pubCn = {} + pubCn.disconnect ==> + cn\disconnect! + mAllCns[cn] = nil + + pubCn.Disconnect = pubCn.disconnect + pubCn + + this.disconnect ==> + if self ~= this + error "disconnect must be called with `:`, not `.`", 2 + + for cn, _ in pairs mAllCns + cn\disconnect! + mAllCns[cn] = nil + + this.wait ==> + if self ~= this + error "wait must be called with `:`, not `.`", 2 + + mBindableEvent.Event\wait! + + + this.fire = (...) => + if self ~= this + error "fire must be called with `:`, not `.`", 2 + + mBindableEvent\Fire ... + + this.Connect = this.connect + this.Disconnect = this.disconnect + this.Wait = this.wait + this.Fire = this.fire + this + + +------------------------------------------------- Signal class End ------------------------------------------------------ + +-- this 1s my favourite (heliodex) +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +-----------------------------------------------Create Function Begins--------------------------------------------------- +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +--[[ +A "Create" function for easy creation of Roblox instances. The function accepts a string which is the classname of +the object to be created. The function then returns another function which either accepts accepts no arguments, in +which case it simply creates an object of the given type, or a table argument that may contain several types of data, +in which case it mutates the object in varying ways depending on the nature of the aggregate data. These are the +type of data and what operation each will perform: +1) A string key mapping to some value: + Key-Value pairs in this form will be treated as properties of the object, and will be assigned in NO PARTICULAR + ORDER. If the order in which properties is assigned matter, then they must be assigned somewhere else than the + |Create| call's body. + +2) An integral key mapping to another Instance: + Normal numeric keys mapping to Instances will be treated as children if the object being created, and will be + parented to it. This allows nice recursive calls to Create to create a whole hierarchy of objects without a + need for temporary variables to store references to those objects. + +3) A key which is a value returned from Create.Event( eventname ), and a value which is a function function + The Create.E( string ) function provides a limited way to connect to signals inside of a Create hierarchy + for those who really want such a functionality. The name of the event whose name is passed to + Create.E( string ) + +4) A key which is the Create function itself, and a value which is a function + The function will be run with the argument of the object itself after all other initialization of the object is + done by create. This provides a way to do arbitrary things involving the object from withing the create + hierarchy. + Note: This function is called SYNCHRONOUSLY, that means that you should only so initialization in + it, not stuff which requires waiting, as the Create call will block until it returns. While waiting in the + constructor callback function is possible, it is probably not a good design choice. + Note: Since the constructor function is called after all other initialization, a Create block cannot have two + constructor functions, as it would not be possible to call both of them last, also, this would be unnecessary. + + +Some example usages: + +A simple example which uses the Create function to create a model object and assign two of it's properties. +local model = Create'Model'{ + Name = 'A New model', + Parent = game.Workspace, +} + + +An example where a larger hierarchy of object is made. After the call the hierarchy will look like this: +Model_Container + |-ObjectValue + | | + | `-BoolValueChild + `-IntValue + +local model = Create'Model'{ + Name = 'Model_Container', + Create'ObjectValue'{ + Create'BoolValue'{ + Name = 'BoolValueChild', + }, + }, + Create'IntValue'{}, +} + + +An example using the event syntax: + +local part = Create'Part'{ + [Create.E'Touched'] = function(part) + print("I was touched by "..part.Name) + end, +} + + +An example using the general constructor syntax: + +local model = Create'Part'{ + [Create] = function(this) + print("Constructor running!") + this.Name = GetGlobalFoosAndBars(this) + end, +} + + +Note: It is also perfectly legal to save a reference to the function returned by a call Create, this will not cause + any unexpected behavior. EG: + local partCreatingFunction = Create'Part' + local part = partCreatingFunction() +]] + +--the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it +--will be created in several steps rather than as a single function declaration. +Create_PrivImpl = (objectType) -> + if type(objectType) ~= "string" + error "Argument of Create must be a string", 2 + + --return the proxy function that gives us the nice Create'string'{data} syntax + --The first function call is a function call using Lua's single-string-argument syntax + --The second function call is using Lua's single-table-argument syntax + --Both can be chained together for the nice effect. + (dat) -> + --default to nothing, to handle the no argument given case + dat or= {} + + --make the object to mutate + obj = Instance.new objectType + local parent + + --stored constructor function to be called after other initialization + local ctor + + for k, v in pairs dat + --add property + if type(k) == "string" + if k == "Parent" + -- Parent should always be set last, setting the Parent of a new object + -- immediately makes performance worse for all subsequent property updates. + parent = v + else + obj[k] = v + + --add child + elseif type(k) == "number" + if type(v) ~= "userdata" + error "Bad entry in Create body: Numeric keys must be paired with children, got a: #{type v}", 2 + + v.Parent = obj + + --event connect + elseif type(k) == "table" and k.__eventname + if type(v) ~= "function" + error "Bad entry in Create body: Key `[Create.E'#{k.__eventname}']` must have a function value, got: #{v}", 2 + + obj[k.__eventname]\connect v + + --define constructor function + elseif k == t.Create + if type(v) ~= "function" + error "Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: #{v}", 2 + + elseif ctor + --ctor already exists, only one allowed + error "Bad entry in Create body: Only one constructor function is allowed", 2 + + ctor = v + else + error "Bad entry (#{k} => #{v}) in Create body", 2 + + + --apply constructor function if it exists + ctor? obj + + if parent + obj.Parent = parent + + --return the completed object + obj + + +--now, create the functor: +t.Create = <"__call">: (_, ...) -> Create_PrivImpl ... + +--and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create +--function can recognize as special. +t.Create.E = (eventName) -> __eventname: eventName + +-------------------------------------------------Create function End---------------------------------------------------- + +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------Documentation Begin----------------------------------------------------- +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------------ + +t.Help = (funcNameOrFunc) -> + switch funcNameOrFunc + --input argument can be a string or a function. Should return a description (of arguments and expected side effects) + when "DecodeJSON", t.DecodeJSON + "Function DecodeJSON. " .. + "Arguments: (string). " .. + "Side effect: returns a table with all parsed JSON values" + + when "EncodeJSON", t.EncodeJSON + "Function EncodeJSON. " .. + "Arguments: (table). " .. + "Side effect: returns a string composed of argument table in JSON data format" + + when "MakeWedge", t.MakeWedge + "Function MakeWedge. " .. + "Arguments: (x, y, z, [default material]). " .. + "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " .. + "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " .. + "Returns true if made a wedge, false if the cell remains a block " + + when "SelectTerrainRegion", t.SelectTerrainRegion + "Function SelectTerrainRegion. " .. + "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " .. + "Description: Selects all terrain via a series of selection boxes within the regionToSelect " .. + "(this should be a region3 value). The selection box color is detemined by the color argument " .. + "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." .. + "SelectEmptyCells is bool, when true will select all cells in the " .. + "region, otherwise we only select non-empty cells. Returns a function that can update the selection," .. + "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " .. + "Also returns a second function that takes no arguments and destroys the selection" + + when "CreateSignal", t.CreateSignal + "Function CreateSignal. " .. + "Arguments: None. " .. + "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " .. + "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" .. + "Lua code. " .. + "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " .. + "For more info you can pass the method name to the Help function, or view the wiki page " .. + "for this library. EG: Help('Signal:connect')." + + when "Signal:connect" + "Method Signal:connect. " .. + "Arguments: (function handler). " .. + "Return: A connection object which can be used to disconnect the connection to this handler. " .. + "Description: Connectes a handler function to this Signal, so that when |fire| is called the " .. + "handler function will be called with the arguments passed to |fire|." + + when "Signal:wait" + "Method Signal:wait. " .. + "Arguments: None. " .. + "Returns: The arguments passed to the next call to |fire|. " .. + "Description: This call does not return until the next call to |fire| is made, at which point it " .. + "will return the values which were passed as arguments to that |fire| call." + + when "Signal:fire" + "Method Signal:fire. " .. + "Arguments: Any number of arguments of any type. " .. + "Returns: None. " .. + "Description: This call will invoke any connected handler functions, and notify any waiting code " .. + "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " .. + "to handlers are made asynchronously, so this call will return immediately regardless of how long " .. + "it takes the connected handler functions to complete." + + when "Signal:disconnect" + "Method Signal:disconnect. " .. + "Arguments: None. " .. + "Returns: None. " .. + "Description: This call disconnects all handlers attacched to this function, note however, it " .. + "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method " .. + "can also be called on the connection object which is returned from Signal:connect to only " .. + "disconnect a single handler, as opposed to this method, which will disconnect all handlers." + + when "Create" + "Function Create. " .. + "Arguments: A table containing information about how to construct a collection of objects. " .. + "Returns: The constructed objects. " .. + "Descrition: Create is a very powerfull function, whose description is too long to fit here, and " .. + "is best described via example, please see the wiki page for a description of how to use it." + +--------------------------------------------Documentation Ends---------------------------------------------------------- + +t