2258 lines
62 KiB
Plaintext
2258 lines
62 KiB
Plaintext
import "macros" as { $ }
|
|
$load $FILE
|
|
|
|
-- Heliodex's basic New function (basically a simplified version of melt)
|
|
New = (className, name, props) ->
|
|
if props == nil -- 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) ->
|
|
until instance\FindFirstChild name
|
|
instance.ChildAdded\wait!
|
|
|
|
waitForProperty = (instance, property) ->
|
|
until instance[property]
|
|
instance.Changed\wait!
|
|
|
|
-- A Few Script Globals
|
|
gui = if script.Parent\FindFirstChild "ControlFrame"
|
|
script.Parent\FindFirstChild "ControlFrame"
|
|
else
|
|
script.Parent
|
|
|
|
|
|
local helpButton
|
|
local updateCameraDropDownSelection
|
|
local updateVideoCaptureDropDownSelection
|
|
tweenTime = 0.2
|
|
|
|
mouseLockLookScreenUrl = "http://banland.xyz/asset?id=54071825"
|
|
classicLookScreenUrl = "http://banland.xyz/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 in *centerDialogs
|
|
i.Visible = false
|
|
game.GuiService\RemoveCenterDialog 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 in *containerChildren
|
|
if i.Name == menuName
|
|
i.Visible = true
|
|
currentMenuSelection =
|
|
container: container
|
|
name: menuName
|
|
direction: moveDirection
|
|
lastSize: size
|
|
|
|
-- selectedMenu = true
|
|
if size and position
|
|
i\TweenSizeAndPosition(
|
|
size,
|
|
position,
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
elseif size
|
|
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
|
|
i\TweenPosition(
|
|
UDim2.new(0, 0, 0, 0),
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
|
|
else
|
|
if moveDirection == "left"
|
|
i\TweenPosition(
|
|
UDim2.new(-1, -525, 0, 0),
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
elseif moveDirection == "right"
|
|
i\TweenPosition(
|
|
UDim2.new(1, 525, 0, 0),
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
elseif moveDirection == "up"
|
|
i\TweenPosition(
|
|
UDim2.new(0, 0, -1, -400),
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
elseif moveDirection == "down"
|
|
i\TweenPosition(
|
|
UDim2.new(0, 0, 1, 400),
|
|
Enum.EasingDirection.InOut,
|
|
Enum.EasingStyle.Sine,
|
|
tweenTime,
|
|
true
|
|
)
|
|
|
|
delay tweenTime, ->
|
|
i.Visible = false
|
|
|
|
|
|
resetLocalCharacter = ->
|
|
player = game.Players.LocalPlayer
|
|
if player and
|
|
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
|
|
Enum.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
|
|
Parent: frame
|
|
|
|
button.MouseButton1Click\connect ->
|
|
toggleSelection button
|
|
obj.Function!
|
|
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 in *centerDialogs
|
|
game.GuiService\RemoveCenterDialog i
|
|
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 helpButton == nil
|
|
helpButton = if gui\FindFirstChild "TopLeftControl" and gui.TopLeftControl\FindFirstChild "Help"
|
|
gui.TopLeftControl.Help
|
|
elseif gui\FindFirstChild "BottomRightControl" and gui.BottomRightControl\FindFirstChild "Help"
|
|
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
|
|
|
|
* New "Frame", "Buttons"
|
|
Position: UDim2.new 0.1, 0, 0.07, 40
|
|
Size: UDim2.new 0.8, 0, 0, 45
|
|
BackgroundTransparency: 1
|
|
|
|
* New "Frame", "ImageFrame"
|
|
Position: UDim2.new 0.05, 0, 0.075, 80
|
|
Size: UDim2.new 0.9, 0, 0.9, -120
|
|
BackgroundTransparency: 1
|
|
|
|
* 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
|
|
|
|
* New "ImageLabel", "Image"
|
|
Image: if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
|
|
mouseLockLookScreenUrl
|
|
else
|
|
classicLookScreenUrl
|
|
Position: UDim2.new -0.5, 0, 0, 0
|
|
Size: UDim2.new 1, 0, 1, 0
|
|
BackgroundTransparency: 1
|
|
|
|
{
|
|
Buttons: buttonRow
|
|
ImageFrame:
|
|
LayoutFrame:
|
|
Image: image
|
|
} = helpDialog
|
|
|
|
|
|
buttons = {}
|
|
buttons[1] = {}
|
|
buttons[1].Text = "Look"
|
|
buttons[1].Function = ->
|
|
image.Image = if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
|
|
mouseLockLookScreenUrl
|
|
else
|
|
classicLookScreenUrl
|
|
|
|
buttons[2] = {}
|
|
buttons[2].Text = "Move"
|
|
buttons[2].Function = ->
|
|
image.Image = "http://banland.xyz/asset?id=45915811"
|
|
|
|
buttons[3] = {}
|
|
buttons[3].Text = "Gear"
|
|
buttons[3].Function = ->
|
|
image.Image = "http://banland.xyz/asset?id=45917596"
|
|
|
|
buttons[4] = {}
|
|
buttons[4].Text = "Zoom"
|
|
buttons[4].Function = ->
|
|
image.Image = "http://banland.xyz/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
|
|
|
|
yesButton = createTextButton(
|
|
"Leave",
|
|
Enum.ButtonStyle.RobloxButton,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 128, 0, 50),
|
|
UDim2.new 0, 313, 0.8, 0
|
|
)
|
|
yesButton.Name = "YesButton"
|
|
yesButton.ZIndex = baseZIndex + 4
|
|
yesButton.Parent = frame
|
|
yesButton.Modal = true
|
|
yesButton\SetVerb "Exit"
|
|
|
|
noButton = createTextButton(
|
|
"Stay",
|
|
Enum.ButtonStyle.RobloxButtonDefault,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 128, 0, 50),
|
|
UDim2.new 0, 90, 0.8, 0
|
|
)
|
|
noButton.Name = "NoButton"
|
|
noButton.Parent = frame
|
|
noButton.ZIndex = baseZIndex + 4
|
|
noButton.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
|
|
|
|
yesButton = createTextButton(
|
|
"Reset",
|
|
Enum.ButtonStyle.RobloxButtonDefault,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 128, 0, 50),
|
|
UDim2.new 0, 313, 0, 299
|
|
)
|
|
yesButton.Name = "YesButton"
|
|
yesButton.ZIndex = baseZIndex + 4
|
|
yesButton.Parent = frame
|
|
yesButton.Modal = true
|
|
yesButton.MouseButton1Click\connect ->
|
|
resumeGameFunction shield
|
|
resetLocalCharacter!
|
|
|
|
|
|
noButton = createTextButton(
|
|
"Cancel",
|
|
Enum.ButtonStyle.RobloxButton,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 128, 0, 50),
|
|
UDim2.new 0, 90, 0, 299
|
|
)
|
|
noButton.Name = "NoButton"
|
|
noButton.Parent = frame
|
|
noButton.ZIndex = baseZIndex + 4
|
|
noButton.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
|
|
)
|
|
screenshotButton.Name = "ScreenshotButton"
|
|
screenshotButton.ZIndex = baseZIndex + 4
|
|
screenshotButton.Parent = gameMainMenuFrame
|
|
screenshotButton.Visible = not macClient
|
|
screenshotButton\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
|
|
)
|
|
recordVideoButton.Name = "RecordVideoButton"
|
|
recordVideoButton.ZIndex = baseZIndex + 4
|
|
recordVideoButton.Parent = gameMainMenuFrame
|
|
recordVideoButton.Visible = not macClient
|
|
recordVideoButton\SetVerb "RecordToggle"
|
|
|
|
with helpShortcut\clone!
|
|
.Visible = hasGraphicsSlider
|
|
.Name = "RecordVideoShortcutText"
|
|
.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
|
|
|
|
leaveGameButton = createTextButton(
|
|
"Leave Game",
|
|
Enum.ButtonStyle.RobloxButton,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 340, 0, 50),
|
|
UDim2.new 0, 82, 0, 358
|
|
)
|
|
leaveGameButton.Name = "LeaveGameButton"
|
|
leaveGameButton.ZIndex = baseZIndex + 4
|
|
leaveGameButton.Parent = gameMainMenuFrame
|
|
|
|
resumeGameButton = createTextButton(
|
|
"Resume Game",
|
|
Enum.ButtonStyle.RobloxButtonDefault,
|
|
Enum.FontSize.Size24,
|
|
UDim2.new(0, 340, 0, 50),
|
|
UDim2.new 0, 82, 0, 54
|
|
)
|
|
resumeGameButton.Name = "resumeGameButton"
|
|
resumeGameButton.ZIndex = baseZIndex + 4
|
|
resumeGameButton.Parent = gameMainMenuFrame
|
|
resumeGameButton.Modal = true
|
|
resumeGameButton.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"]
|
|
if loadingGui = game.Players.LocalPlayer\FindFirstChild "PlayerLoadingGui"
|
|
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!
|
|
with studioShortcut
|
|
.Name = "StudioShortcutText"
|
|
.Visible = false -- TODO: turn back on when f2 hack is fixed
|
|
.Text = "F2"
|
|
.Position = UDim2.new 0, 154, 0, 175
|
|
.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!
|
|
with betterQualityShortcut
|
|
.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
|
|
)
|
|
autoGraphicsButton.Name = "AutoGraphicsButton"
|
|
autoGraphicsButton.ZIndex = baseZIndex + 4
|
|
autoGraphicsButton.Parent = gameSettingsMenuFrame
|
|
autoGraphicsButton.Visible = not inStudioMode
|
|
|
|
graphicsSlider, graphicsLevel = RbxGui.CreateSlider GraphicsQualityLevels, 150, UDim2.new 0, 230, 0, 280 -- graphics - 1 because slider starts at 1 instead of 0
|
|
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
|
|
|
|
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 = \
|
|
betterQualityShortcut.ZIndex = \
|
|
fasterShortcut.ZIndex = \
|
|
fasterText.ZIndex = \
|
|
graphicsSlider.Bar.ZIndex = \
|
|
graphicsSlider.Bar.Slider.ZIndex = \
|
|
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 \
|
|
= betterQualityShortcut.ZIndex \
|
|
= fasterShortcut.ZIndex \
|
|
= fasterText.ZIndex \
|
|
= graphicsSlider.Bar.ZIndex \
|
|
= graphicsSlider.Bar.Slider.ZIndex \
|
|
= 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 newGraphicsValue == nil
|
|
graphicsSetter.Text = "#{graphicsLevel.Value}"
|
|
return
|
|
|
|
|
|
newGraphicsValue = if newGraphicsValue < 1
|
|
1
|
|
elseif newGraphicsValue >= settings!.Rendering\GetMaxQualityLevel!
|
|
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
|
|
return if (graphicsLevel.Value - 1) <= 0
|
|
|
|
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 ->
|
|
return if not studioCheckbox.Active
|
|
|
|
studioCheckbox.Text = if studioCheckbox.Text == ""
|
|
"X"
|
|
else
|
|
""
|
|
|
|
|
|
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) ->
|
|
fullscreenCheckbox.Text = if isFullscreen
|
|
"X"
|
|
else
|
|
""
|
|
|
|
else
|
|
fullscreenCheckbox.MouseButton1Click\connect ->
|
|
fullscreenCheckbox.Text = if fullscreenCheckbox.Text == ""
|
|
"X"
|
|
else
|
|
""
|
|
|
|
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
|
|
|
|
global syncVideoCaptureSetting = nil
|
|
|
|
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
|
|
mouseLockLabel.Visible = if mouseLockLabel and UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
|
|
true
|
|
elseif mouseLockLabel
|
|
false
|
|
|
|
with cameraDropDown
|
|
.Name = "CameraField"
|
|
.ZIndex = baseZIndex + 4
|
|
.DropDownMenuButton.ZIndex = baseZIndex + 4
|
|
.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4
|
|
.Position = UDim2.new 0, 270, 0, 52
|
|
.Size = UDim2.new 0, 200, 0, 32
|
|
.Parent = gameSettingsMenuFrame
|
|
|
|
gameSettingsMenuFrame
|
|
|
|
if LoadLibrary
|
|
global RbxGui = LoadLibrary "RbxGui"
|
|
baseZIndex = 0
|
|
if UserSettings
|
|
createSettingsDialog = ->
|
|
waitForChild gui, "BottomLeftControl"
|
|
global settingsButton = gui.BottomLeftControl\FindFirstChild "SettingsButton"
|
|
|
|
if settingsButton == nil
|
|
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 currentMenuSelection == nil
|
|
game.GuiService\AddCenterDialog(
|
|
shield,
|
|
Enum.CenterDialogType.ModalDialog,
|
|
--showFunction
|
|
->
|
|
settingsButton.Active = false
|
|
updateCameraDropDownSelection UserSettings!.GameSettings.ControlMode.Name
|
|
|
|
if syncVideoCaptureSetting
|
|
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 in *centerDialogs
|
|
game.GuiService\RemoveCenterDialog i
|
|
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
|
|
|
|
if syncVideoCaptureSetting
|
|
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
|
|
|
|
)
|
|
|
|
shield
|
|
|
|
|
|
delay 0, ->
|
|
createSettingsDialog!.Parent = gui
|
|
|
|
gui.BottomLeftControl.SettingsButton.Active = true
|
|
gui.BottomLeftControl.SettingsButton.Position = UDim2.new 0, 2, 0, -2
|
|
|
|
mouseLockLabel.Visible = if mouseLockLabel and UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
|
|
true
|
|
elseif mouseLockLabel
|
|
false
|
|
|
|
|
|
-- our script has loaded, get rid of older buttons now
|
|
leaveGameButton = gui.BottomLeftControl\FindFirstChild "Exit"
|
|
leaveGameButton?\Remove!
|
|
|
|
|
|
topLeft = gui\FindFirstChild "TopLeftControl"
|
|
if topLeft
|
|
leaveGameButton = topLeft\FindFirstChild "Exit"
|
|
leaveGameButton?\Remove!
|
|
|
|
|
|
topLeft\Remove!
|
|
|
|
--UserSettings call
|
|
|
|
createSaveDialogs = ->
|
|
shield = New "TextButton", "SaveDialogShield"
|
|
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 clearAndResetDialog, save, saveLocal, dontSave, 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://banland.xyz/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 = if pos == spinPos or pos == ((spinPos + 1) % 8)
|
|
"http://banland.xyz/asset?id=45880668"
|
|
else
|
|
"http://banland.xyz/asset?id=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
|
|
|
|
|
|
save= ->
|
|
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"
|
|
|
|
abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, (abuseText) ->
|
|
abuse = abuseText
|
|
if abuse and abusingPlayer
|
|
submitReportButton.Active = true
|
|
|
|
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
|
|
|
|
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 = New "Frame", "ChatBar"
|
|
-- Size: UDim2.new 1, 0, 0, 22
|
|
-- Position: UDim2.new 0, 0, 1, 0
|
|
-- BackgroundColor3: Color3.new 0, 0, 0
|
|
-- BorderSizePixel: 0
|
|
|
|
-- chatBox = New "TextBox"
|
|
-- Text: ""
|
|
-- Visible: false
|
|
-- Size: UDim2.new 1, -4, 1, 0
|
|
-- Position: UDim2.new 0, 2, 0, 0
|
|
-- TextXAlignment: Enum.TextXAlignment.Left
|
|
-- Font: Enum.Font.Arial
|
|
-- ClearTextOnFocus: false
|
|
-- FontSize: Enum.FontSize.Size14
|
|
-- TextColor3: Color3.new 1, 1, 1
|
|
-- BackgroundTransparency: 1
|
|
-- -- Parent: chatBar
|
|
|
|
-- chatButton = New "TextButton"
|
|
-- Size: UDim2.new 1, -4, 1, 0
|
|
-- Position: UDim2.new 0, 2, 0, 0
|
|
-- AutoButtonColor: false
|
|
-- Text: 'To chat click here or press "/" key'
|
|
-- TextXAlignment: Enum.TextXAlignment.Left
|
|
-- Font: Enum.Font.Arial
|
|
-- FontSize: Enum.FontSize.Size14
|
|
-- TextColor3: Color3.new 1, 1, 1
|
|
-- BackgroundTransparency: 1
|
|
-- -- Parent: chatBar
|
|
|
|
-- activateChat = ->
|
|
-- return if chatBox.Visible
|
|
-- chatButton.Visible = false
|
|
-- chatBox.Text = ""
|
|
-- chatBox.Visible = true
|
|
-- chatBox\CaptureFocus!
|
|
|
|
-- chatButton.MouseButton1Click\connect activateChat
|
|
|
|
-- -- hotKeyEnabled = true
|
|
-- toggleHotKey = (_) ->
|
|
-- -- hotKeyEnabled = value
|
|
|
|
-- -- guiService = game\GetService "GuiService"
|
|
-- --[[newChatMode = ]]try
|
|
-- --guiService\AddSpecialKey Enum.SpecialKey.ChatHotkey
|
|
-- --guiService.SpecialKeyPressed\connect (key) -> if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat!
|
|
|
|
-- -- if not newChatMode
|
|
-- --guiService\AddKey "/"
|
|
-- --guiService.KeyPressed\connect (key) -> if key == "/" and hotKeyEnabled then activateChat!
|
|
|
|
-- 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
|
|
-- chatBox.Text = ""
|
|
-- chatBox.Visible = false
|
|
-- chatButton.Visible = true
|
|
-- robloxLock chatBar
|
|
-- chatBar, toggleHotKey
|
|
|
|
--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
|
|
--[[success, luaChat = ]]
|
|
try
|
|
game.GuiService.UseLuaChat
|
|
|
|
-- if success and luaChat
|
|
|
|
--[[delay 0, ->
|
|
waitForChild game, "Players"
|
|
waitForProperty game.Players, "LocalPlayer"
|
|
|
|
advancedChatBarSupported = game.Players.LocalPlayer.ChatMode
|
|
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
|
|
]]
|
|
|
|
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
|