Further improve corescript formatting

This commit is contained in:
Lewin Kelly 2023-05-26 01:29:32 +01:00
parent 9f910a5ae2
commit d8073f394f
8 changed files with 163 additions and 170 deletions

View File

@ -123,13 +123,14 @@ preloadAssets = ->
-------------------------------- Accept/Decline Functions -------------------------------------- -------------------------------- Accept/Decline Functions --------------------------------------
removeCurrentPurchaseInfo = -> removeCurrentPurchaseInfo = ->
currentAssetId = nil currentAssetId \
currentCurrencyType = nil = currentCurrencyType \
currentCurrencyAmount = nil = currentCurrencyAmount \
currentEquipOnPurchase = nil = currentEquipOnPurchase \
currentProductId = nil = currentProductId \
currentProductInfo = nil = currentProductInfo \
currentServerResponseTable = nil = currentServerResponseTable \
= nil
checkingPlayerFunds = false checkingPlayerFunds = false
@ -270,12 +271,11 @@ updatePurchasePromptData = (_) ->
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newItemDescription purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newItemDescription
purchaseDialog.BodyFrame.ItemPreview.Image = "#{baseUrl}thumbs/asset.ashx?assetid=" ..
if purchasingConsumable if purchasingConsumable
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "#{currentProductInfo["IconImageAssetId"]}&x=100&y=100&format=png"
"thumbs/asset.ashx?assetid=#{currentProductInfo["IconImageAssetId"]}&x=100&y=100&format=png"
else else
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "#{currentAssetId}&x=100&y=100&format=png"
"thumbs/asset.ashx?assetid=#{currentAssetId}&x=100&y=100&format=png"
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified -- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
setCurrencyAmountAndType = (priceInRobux, priceInTix) -> setCurrencyAmountAndType = (priceInRobux, priceInTix) ->
@ -594,8 +594,7 @@ showPurchasePrompt = ->
doPlayerFundsCheck true doPlayerFundsCheck true
--HideFunction --HideFunction
-> -> .Visible = false
.Visible = false
) )
else -- we failed in prompting a purchase, do a decline else -- we failed in prompting a purchase, do a decline
doDeclinePurchase! doDeclinePurchase!
@ -604,8 +603,7 @@ showPurchasePrompt = ->
-- given an asset id, this function will grab that asset from the website, and return the first "Tool" object found inside it -- given an asset id, this function will grab that asset from the website, and return the first "Tool" object found inside it
getToolAssetID = (assetID) -> getToolAssetID = (assetID) ->
newTool = game\GetService"InsertService"\LoadAsset assetID newTool = game\GetService"InsertService"\LoadAsset assetID
if not newTool return if not newTool
return nil
if newTool\IsA "Tool" if newTool\IsA "Tool"
return newTool return newTool
@ -614,8 +612,6 @@ getToolAssetID = (assetID) ->
for i in *toolChildren for i in *toolChildren
if i\IsA "Tool" if i\IsA "Tool"
return i return i
nil
-- the user tried to purchase by clicking the purchase button, but something went wrong. -- the user tried to purchase by clicking the purchase button, but something went wrong.
-- let them know their account was not charged, and that they do not own the item yet. -- let them know their account was not charged, and that they do not own the item yet.
@ -738,8 +734,7 @@ doAcceptPurchase = (_) ->
-- check to see if this item was bought, and if we want to equip it (also need to make sure the asset type was gear) -- check to see if this item was bought, and if we want to equip it (also need to make sure the asset type was gear)
if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19 if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19
tool = getToolAssetID tonumber currentAssetId if tool = getToolAssetID tonumber currentAssetId
if tool
tool.Parent = game.Players.LocalPlayer.Backpack tool.Parent = game.Players.LocalPlayer.Backpack
@ -1135,16 +1130,13 @@ if enableBrowserWindowClosedEvent
Game.CoreGui.RobloxGui.Changed\connect -> Game.CoreGui.RobloxGui.Changed\connect ->
nowIsSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold nowIsSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
if nowIsSmallScreen and not isSmallScreen changeGuiToScreenSize if nowIsSmallScreen and not isSmallScreen
changeGuiToScreenSize true true
elseif not nowIsSmallScreen and isSmallScreen elseif not nowIsSmallScreen and isSmallScreen
changeGuiToScreenSize false false
isSmallScreen = nowIsSmallScreen isSmallScreen = nowIsSmallScreen
if isSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
isSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
if isSmallScreen
changeGuiToScreenSize true changeGuiToScreenSize true

View File

@ -361,8 +361,13 @@ initializeDeveloperConsole = ->
scrollDownIsDown = false scrollDownIsDown = false
clean = -> clean = ->
previousMousePos = pPos = previousMousePosResize = nil previousMousePos \
pSize = previousMousePosScroll = pOffset = nil = pPos \
= previousMousePosResize \
= pSize \
= previousMousePosScroll \
= pOffset \
= nil
-- pScrollHandle = nil -- pScrollHandle = nil
scrollUpIsDown = scrollDownIsDown = false scrollUpIsDown = scrollDownIsDown = false

View File

@ -309,9 +309,7 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
if scrollDownButton if scrollDownButton
scrollDownButton.ZIndex = baseZIndex + 3 scrollDownButton.ZIndex = baseZIndex + 3
if children = droppedDownMenu\GetChildren!
children = droppedDownMenu\GetChildren!
if children
for _, child in ipairs children for _, child in ipairs children
if child.Name == "ChoiceButton" if child.Name == "ChoiceButton"
child.ZIndex = baseZIndex + 2 child.ZIndex = baseZIndex + 2
@ -352,10 +350,10 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
areaSoak.Visible = not areaSoak.Visible areaSoak.Visible = not areaSoak.Visible
dropDownMenu.Visible = not dropDownSelected dropDownMenu.Visible = not dropDownSelected
droppedDownMenu.Visible = dropDownSelected droppedDownMenu.Visible = dropDownSelected
if dropDownSelected setZIndex if dropDownSelected
setZIndex 4 4
else else
setZIndex 2 2
if useScrollButtons if useScrollButtons
updateScroll! updateScroll!
@ -418,10 +416,8 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
Size: UDim2.new 0, 17, 0, 17 Size: UDim2.new 0, 17, 0, 17
Position: UDim2.new 1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 0 Position: UDim2.new 1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 0
scrollUpButton.MouseButton1Click\connect -> scrollUpButton.MouseButton1Click\connect -> scrollMouseCount += 1
scrollMouseCount += 1 scrollUpButton.MouseLeave\connect -> scrollMouseCount += 1
scrollUpButton.MouseLeave\connect ->
scrollMouseCount += 1
scrollUpButton.MouseButton1Down\connect -> scrollUpButton.MouseButton1Down\connect ->
scrollMouseCount += 1 scrollMouseCount += 1
@ -443,10 +439,8 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
Position: UDim2.new 1, -11, 1, -11 Position: UDim2.new 1, -11, 1, -11
Parent: droppedDownMenu Parent: droppedDownMenu
scrollDownButton.MouseButton1Click\connect -> scrollDownButton.MouseButton1Click\connect -> scrollMouseCount += 1
scrollMouseCount += 1 scrollDownButton.MouseLeave\connect -> scrollMouseCount += 1
scrollDownButton.MouseLeave\connect ->
scrollMouseCount += 1
scrollDownButton.MouseButton1Down\connect -> scrollDownButton.MouseButton1Down\connect ->
scrollMouseCount += 1 scrollMouseCount += 1
@ -579,25 +573,25 @@ layoutGuiObjectsHelper = (frame, guiObjects, settingsTable) ->
for _, child in ipairs guiObjects for _, child in ipairs guiObjects
if child\IsA"TextLabel" or child\IsA "TextButton" if child\IsA"TextLabel" or child\IsA "TextButton"
isLabel = child\IsA "TextLabel" isLabel = child\IsA "TextLabel"
if isLabel pixelsRemaining -= if isLabel
pixelsRemaining -= settingsTable["TextLabelPositionPadY"] settingsTable["TextLabelPositionPadY"]
else else
pixelsRemaining -= settingsTable["TextButtonPositionPadY"] settingsTable["TextButtonPositionPadY"]
child.Position = UDim2.new child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining child.Position = UDim2.new child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining
child.Size = UDim2.new child.Size.X.Scale, child.Size.X.Offset, 0, pixelsRemaining child.Size = UDim2.new child.Size.X.Scale, child.Size.X.Offset, 0, pixelsRemaining
if child.TextFits and child.TextBounds.Y < pixelsRemaining if child.TextFits and child.TextBounds.Y < pixelsRemaining
child.Visible = true child.Visible = true
if isLabel child.Size = if isLabel
child.Size = UDim2.new( UDim2.new(
child.Size.X.Scale, child.Size.X.Scale,
child.Size.X.Offset, child.Size.X.Offset,
0, 0,
child.TextBounds.Y + settingsTable["TextLabelSizePadY"] child.TextBounds.Y + settingsTable["TextLabelSizePadY"]
) )
else else
child.Size = UDim2.new( UDim2.new(
child.Size.X.Scale, child.Size.X.Scale,
child.Size.X.Offset, child.Size.X.Offset,
0, 0,
@ -610,10 +604,10 @@ layoutGuiObjectsHelper = (frame, guiObjects, settingsTable) ->
pixelsRemaining -= child.AbsoluteSize.Y pixelsRemaining -= child.AbsoluteSize.Y
if isLabel pixelsRemaining -= if isLabel
pixelsRemaining -= settingsTable["TextLabelPositionPadY"] settingsTable["TextLabelPositionPadY"]
else else
pixelsRemaining -= settingsTable["TextButtonPositionPadY"] settingsTable["TextButtonPositionPadY"]
else else
child.Visible = false child.Visible = false
@ -638,7 +632,6 @@ t.LayoutGuiObjects = (frame, guiObjects, settingsTable) ->
if not settingsTable if not settingsTable
settingsTable = {} settingsTable = {}
if not settingsTable["TextLabelSizePadY"] if not settingsTable["TextLabelSizePadY"]
settingsTable["TextLabelSizePadY"] = 0 settingsTable["TextLabelSizePadY"] = 0
@ -739,20 +732,16 @@ t.CreateSlider = (steps, width, position) ->
local areaSoakMouseMoveCon local areaSoakMouseMoveCon
areaSoak.MouseLeave\connect -> f = -> if areaSoak.Visible
if areaSoak.Visible cancelSlide areaSoak
cancelSlide areaSoak
areaSoak.MouseLeave\connect f
areaSoak.MouseButton1Up\connect -> areaSoak.MouseButton1Up\connect f
if areaSoak.Visible
cancelSlide areaSoak
slider.MouseButton1Down\connect -> slider.MouseButton1Down\connect ->
areaSoak.Visible = true areaSoak.Visible = true
if areaSoakMouseMoveCon areaSoakMouseMoveCon?\disconnect!
areaSoakMouseMoveCon\disconnect!
areaSoakMouseMoveCon = areaSoak.MouseMoved\connect (x, _) -> areaSoakMouseMoveCon = areaSoak.MouseMoved\connect (x, _) ->
setSliderPos x, slider, sliderPosition, bar, steps setSliderPos x, slider, sliderPosition, bar, steps
@ -772,13 +761,11 @@ t.CreateSlider = (steps, width, position) ->
setSliderPos x, slider, sliderPosition, bar, steps setSliderPos x, slider, sliderPosition, bar, steps
return sliderGui, sliderPosition, sliderSteps sliderGui, sliderPosition, sliderSteps
t.CreateTrueScrollingFrame = -> t.CreateTrueScrollingFrame = ->
local lowY, highY local lowY, highY, dragCon, upCon
local dragCon, upCon
internalChange = false internalChange = false
@ -789,29 +776,34 @@ t.CreateTrueScrollingFrame = ->
Size: UDim2.new 1, 0, 1, 0 Size: UDim2.new 1, 0, 1, 0
ClipsDescendants: true ClipsDescendants: true
controlFrame = New "Frame", "ControlFrame" * New "Frame", "ControlFrame"
BackgroundTransparency: 1 BackgroundTransparency: 1
Size: UDim2.new 0, 18, 1, 0 Size: UDim2.new 0, 18, 1, 0
Position: UDim2.new 1, -20, 0, 0 Position: UDim2.new 1, -20, 0, 0
Parent: scrollingFrame
scrollBottom = New "BoolValue", "ScrollBottom" * New "BoolValue", "ScrollBottom"
Value: false Value: false
Parent: controlFrame
scrollUp = New "BoolValue", "scrollUp" * New "BoolValue", "ScrollUp"
Value: false Value: false
Parent: controlFrame
* New "TextButton", "ScrollUpButton"
Text: ""
AutoButtonColor: false
BackgroundColor3: Color3.new 0, 0, 0
BorderColor3: Color3.new 1, 1, 1
BackgroundTransparency: 0.5
Size: UDim2.new 0, 18, 0, 18
ZIndex: 2
{
ControlFrame: controlFrame
ControlFrame:
ScrollBottom: scrollBottom
ScrollUp: scrollUp
ScrollUpButton: scrollUpButton
} = scrollingFrame
scrollUpButton = New "TextButton", "ScrollUpButton"
Text: ""
AutoButtonColor: false
BackgroundColor3: Color3.new 0, 0, 0
BorderColor3: Color3.new 1, 1, 1
BackgroundTransparency: 0.5
Size: UDim2.new 0, 18, 0, 18
ZIndex: 2
Parent: controlFrame
for i = 1, 6 for i = 1, 6
New "Frame", "tri#{i}" New "Frame", "tri#{i}"
@ -865,25 +857,30 @@ t.CreateTrueScrollingFrame = ->
Position: UDim2.new 0, 0, 0, 19 Position: UDim2.new 0, 0, 0, 19
Parent: controlFrame Parent: controlFrame
scrollbar = New "TextButton", "ScrollBar" * New "TextButton", "ScrollBar"
BackgroundColor3: Color3.new 0, 0, 0 BackgroundColor3: Color3.new 0, 0, 0
BorderColor3: Color3.new 1, 1, 1 BorderColor3: Color3.new 1, 1, 1
BackgroundTransparency: 0.5 BackgroundTransparency: 0.5
AutoButtonColor: false AutoButtonColor: false
Text: "" Text: ""
Active: true Active: true
ZIndex: 2 ZIndex: 2
Size: UDim2.new 0, 18, 0.1, 0 Size: UDim2.new 0, 18, 0.1, 0
Position: UDim2.new 0, 0, 0, 0 Position: UDim2.new 0, 0, 0, 0
Parent: scrollTrack
* New "Frame", "ScrollNub"
BorderColor3: Color3.new 1, 1, 1
Size: UDim2.new 0, 10, 0, 0
Position: UDim2.new 0.5, -5, 0.5, 0
ZIndex: 2
BackgroundTransparency: 0.5
{
ScrollBar: scrollbar
ScrollBar:
ScrollNub: scrollNub
} = scrollTrack
scrollNub = New "Frame", "ScrollNub"
BorderColor3: Color3.new 1, 1, 1
Size: UDim2.new 0, 10, 0, 0
Position: UDim2.new 0.5, -5, 0.5, 0
ZIndex: 2
BackgroundTransparency: 0.5
Parent: scrollbar
newNub = scrollNub\clone! newNub = scrollNub\clone!
newNub.Position = UDim2.new 0.5, -5, 0.5, -2 newNub.Position = UDim2.new 0.5, -5, 0.5, -2
@ -894,15 +891,15 @@ t.CreateTrueScrollingFrame = ->
lastNub.Parent = scrollbar lastNub.Parent = scrollbar
scrollbar.MouseEnter\connect -> scrollbar.MouseEnter\connect ->
scrollbar.BackgroundTransparency = 0.1 scrollbar.BackgroundTransparency = \
scrollNub.BackgroundTransparency = 0.1 scrollNub.BackgroundTransparency = \
newNub.BackgroundTransparency = 0.1 newNub.BackgroundTransparency = \
lastNub.BackgroundTransparency = 0.1 lastNub.BackgroundTransparency = 0.1
scrollbar.MouseLeave\connect -> scrollbar.MouseLeave\connect ->
scrollbar.BackgroundTransparency = 0.5 scrollbar.BackgroundTransparency = \
scrollNub.BackgroundTransparency = 0.5 scrollNub.BackgroundTransparency = \
newNub.BackgroundTransparency = 0.5 newNub.BackgroundTransparency = \
lastNub.BackgroundTransparency = 0.5 lastNub.BackgroundTransparency = 0.5
@ -919,14 +916,14 @@ t.CreateTrueScrollingFrame = ->
if y < scrollTrack.AbsolutePosition.y if y < scrollTrack.AbsolutePosition.y
scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 0, 0 scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 0, 0
return (oldPos ~= scrollbar.Position) return oldPos ~= scrollbar.Position
relativeSize = scrollbar.AbsoluteSize.Y / scrollTrack.AbsoluteSize.Y relativeSize = scrollbar.AbsoluteSize.Y / scrollTrack.AbsoluteSize.Y
if y > (scrollTrack.AbsolutePosition.y + scrollTrack.AbsoluteSize.y) if y > (scrollTrack.AbsolutePosition.y + scrollTrack.AbsoluteSize.y)
scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 1 - relativeSize, 0 scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 1 - relativeSize, 0
return (oldPos ~= scrollbar.Position) return oldPos ~= scrollbar.Position
newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset) / scrollTrack.AbsoluteSize.y newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset) / scrollTrack.AbsoluteSize.y
if newScaleYPos + relativeSize > 1 if newScaleYPos + relativeSize > 1
@ -943,7 +940,7 @@ t.CreateTrueScrollingFrame = ->
scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, newScaleYPos, 0 scrollbar.Position = UDim2.new scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, newScaleYPos, 0
return (oldPos ~= scrollbar.Position) oldPos ~= scrollbar.Position
drillDownSetHighLow = (instance) -> drillDownSetHighLow = (instance) ->
@ -998,7 +995,7 @@ t.CreateTrueScrollingFrame = ->
) )
lowY = nil lowY = \
highY = nil highY = nil
resetHighLow! resetHighLow!
internalChange = false internalChange = false
@ -1009,8 +1006,8 @@ t.CreateTrueScrollingFrame = ->
totalYSpan = math.abs highY - lowY totalYSpan = math.abs highY - lowY
if totalYSpan == 0 if totalYSpan == 0
scrollbar.Visible = false scrollbar.Visible = \
scrollDownButton.Visible = false scrollDownButton.Visible = \
scrollUpButton.Visible = false scrollUpButton.Visible = false
if dragCon if dragCon
@ -1083,8 +1080,7 @@ t.CreateTrueScrollingFrame = ->
if scrollUpButton.Active if scrollUpButton.Active
scrollStamp = tick! scrollStamp = tick!
current = scrollStamp current = scrollStamp
local upCon local upCon = mouseDrag.MouseButton1Up\connect ->
upCon = mouseDrag.MouseButton1Up\connect ->
scrollStamp = tick! scrollStamp = tick!
mouseDrag.Parent = nil mouseDrag.Parent = nil
upCon\disconnect! upCon\disconnect!
@ -1148,11 +1144,11 @@ t.CreateTrueScrollingFrame = ->
upCon = nil upCon = nil
reentrancyGuardMouseScroll = false reentrancyGuardMouseScroll = false
dragCon = mouseDrag.MouseMoved\connect (x, y) -> dragCon = mouseDrag.MouseMoved\connect (x2, y2) ->
return if reentrancyGuardMouseScroll return if reentrancyGuardMouseScroll
reentrancyGuardMouseScroll = true reentrancyGuardMouseScroll = true
if positionScrollBar x, y, mouseOffset if positionScrollBar x2, y2, mouseOffset
recalculate! recalculate!
reentrancyGuardMouseScroll = false reentrancyGuardMouseScroll = false
@ -1170,11 +1166,8 @@ t.CreateTrueScrollingFrame = ->
scrollMouseCount = 0 scrollMouseCount = 0
scrollUpButton.MouseButton1Down\connect -> scrollUpButton.MouseButton1Down\connect -> scrollUp!
scrollUp! scrollDownButton.MouseButton1Down\connect -> scrollDown!
scrollDownButton.MouseButton1Down\connect ->
scrollDown!
scrollTick = -> scrollTick = ->
@ -1331,7 +1324,7 @@ t.CreateScrollingFrame = (orderList, scrollStyle) ->
totalPixelsX = frame.AbsoluteSize.X totalPixelsX = frame.AbsoluteSize.X
xCounter = 0 xCounter = \
rowSizeCounter = 0 rowSizeCounter = 0
setRowSize = true setRowSize = true
@ -2055,13 +2048,14 @@ CreateBasicTutorialPage = (name, handleResize, skipTutorial, giveDoneButton) ->
Size: UDim2.new 1, -55, 0, 22 Size: UDim2.new 1, -55, 0, 22
Position: UDim2.new 0, 0, 0, 0 Position: UDim2.new 0, 0, 0, 0
skipButton = New "ImageButton", "SkipButton" * New "ImageButton", "SkipButton"
AutoButtonColor: false AutoButtonColor: false
BackgroundTransparency: 1 BackgroundTransparency: 1
Image: "rbxasset://textures/ui/closeButton.png" Image: "rbxasset://textures/ui/closeButton.png"
Size: UDim2.new 0, 25, 0, 25 Size: UDim2.new 0, 25, 0, 25
Position: UDim2.new 1, -25, 0, 0 Position: UDim2.new 1, -25, 0, 0
Parent: frame
{ SkipButton: skipButton } = frame
skipButton.MouseButton1Click\connect -> skipButton.MouseButton1Click\connect ->
skipTutorial! skipTutorial!
@ -2096,10 +2090,10 @@ CreateBasicTutorialPage = (name, handleResize, skipTutorial, giveDoneButton) ->
Position: UDim2.new 0, 0, 0, 25 Position: UDim2.new 0, 0, 0, 25
Parent: frame Parent: frame
innerFrame.Size = if giveDoneButton innerFrame.Size = UDim2.new 1, 0, 1, if giveDoneButton
UDim2.new 1, 0, 1, -75 -75
else else
UDim2.new 1, 0, 1, -22 -22
local parentConnection local parentConnection
@ -2122,10 +2116,8 @@ CreateBasicTutorialPage = (name, handleResize, skipTutorial, giveDoneButton) ->
wait! wait!
basicHandleResize! basicHandleResize!
basicHandleResize! basicHandleResize!
if prop == "Visible" if prop == "Visible"
basicHandleResize! basicHandleResize!

View File

@ -912,12 +912,12 @@ createGameSettingsMenu = (baseZIndex, _) ->
isAutoGraphics = active isAutoGraphics = active
if active if active
autoGraphicsButton.Text = "X" autoGraphicsButton.Text = "X"
betterQualityText.ZIndex = 1 betterQualityText.ZIndex = \
betterQualityShortcut.ZIndex = 1 betterQualityShortcut.ZIndex = \
fasterShortcut.ZIndex = 1 fasterShortcut.ZIndex = \
fasterText.ZIndex = 1 fasterText.ZIndex = \
graphicsSlider.Bar.ZIndex = 1 graphicsSlider.Bar.ZIndex = \
graphicsSlider.Bar.Slider.ZIndex = 1 graphicsSlider.Bar.Slider.ZIndex = \
graphicsSetter.ZIndex = 1 graphicsSetter.ZIndex = 1
graphicsSetter.Text = "Auto" graphicsSetter.Text = "Auto"
else else
@ -997,13 +997,13 @@ createGameSettingsMenu = (baseZIndex, _) ->
hideManualGraphics = -> hideManualGraphics = ->
betterQualityText.ZIndex = 1 betterQualityText.ZIndex \
betterQualityShortcut.ZIndex = 1 = betterQualityShortcut.ZIndex \
fasterShortcut.ZIndex = 1 = fasterShortcut.ZIndex \
fasterText.ZIndex = 1 = fasterText.ZIndex \
graphicsSlider.Bar.ZIndex = 1 = graphicsSlider.Bar.ZIndex \
graphicsSlider.Bar.Slider.ZIndex = 1 = graphicsSlider.Bar.Slider.ZIndex \
graphicsSetter.ZIndex = 1 = graphicsSetter.ZIndex = 1
translateSavedQualityLevelToInt = (savedQualityLevel) -> translateSavedQualityLevelToInt = (savedQualityLevel) ->

View File

@ -864,13 +864,14 @@ local SelectedPlayerEntry
local SelectedPlayer local SelectedPlayer
-- locks(semaphores) for stopping race conditions -- locks(semaphores) for stopping race conditions
AddingFrameLock = false AddingFrameLock \
AddingStatLock = false = AddingStatLock \
BaseUpdateLock = false = BaseUpdateLock \
WaitForClickLock = false = WaitForClickLock \
InPopupWaitForClick = false = InPopupWaitForClick \
PlayerChangedLock = false = PlayerChangedLock \
NeutralTeamLock = false = NeutralTeamLock \
= false
ScrollWheelConnections = {} ScrollWheelConnections = {}

View File

@ -840,12 +840,13 @@ ColorZone = makeZone(
UDim2.new(0.5, -60, 0.5, -100), UDim2.new(0.5, -60, 0.5, -100),
ColorFrame ColorFrame
) )
makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor = false makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor \
makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor = false = makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor \
makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor = false = makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor \
makeStyledButton("Torso", UDim2.new(0.43, 0, 0.36, 0), UDim2.new(0.28, 0, 0.26, 0), ColorZone).AutoButtonColor = false = makeStyledButton("Torso", UDim2.new(0.43, 0, 0.36, 0), UDim2.new(0.28, 0, 0.26, 0), ColorZone).AutoButtonColor \
makeStyledButton("RightLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.275, 0, 0.67, 0), ColorZone).AutoButtonColor = false = makeStyledButton("RightLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.275, 0, 0.67, 0), ColorZone).AutoButtonColor \
makeStyledButton("LeftLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.525, 0, 0.67, 0), ColorZone).AutoButtonColor = false = makeStyledButton("LeftLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.525, 0, 0.67, 0), ColorZone).AutoButtonColor \
= false
-- no need for this to stick around -- no need for this to stick around

View File

@ -218,7 +218,10 @@ insertGear = (gear, addToSlot) ->
for i = start, pos + 1, -1 for i = start, pos + 1, -1
gearSlots[i] = gearSlots[i - 1] gearSlots[i] = gearSlots[i - 1]
gearSlots[i].SlotNumber.Text = gearSlots[i].SlotNumberDownShadow.Text = gearSlots[i].SlotNumberUpShadow.Text = if i == 10 gearSlots[i].SlotNumber.Text \
= gearSlots[i].SlotNumberDownShadow.Text \
= gearSlots[i].SlotNumberUpShadow.Text \
= if i == 10
"0" "0"
else else
i i
@ -228,8 +231,8 @@ insertGear = (gear, addToSlot) ->
if pos ~= maxNumLoadoutItems if pos ~= maxNumLoadoutItems
if type"#{pos}" == "string" if type"#{pos}" == "string"
posString = "#{pos}" posString = "#{pos}"
gear.SlotNumber.Text = posString gear.SlotNumber.Text = \
gear.SlotNumberDownShadow.Text = posString gear.SlotNumberDownShadow.Text = \
gear.SlotNumberUpShadow.Text = posString gear.SlotNumberUpShadow.Text = posString
else -- tenth gear doesn't follow mathematical pattern :( else -- tenth gear doesn't follow mathematical pattern :(

View File

@ -106,11 +106,10 @@ JsonWriter.WriteString = (o) => @\Append "#{o}"
JsonWriter.ParseString = (s) => JsonWriter.ParseString = (s) =>
@\Append '"' @\Append '"'
@\Append string.gsub s, '[%z%c\\"/]', (n) -> @\Append string.gsub s, '[%z%c\\"/]', (n) ->
c = @backslashes[n] if c = @backslashes[n]
if c
return c return c
return string.format "\\u%.4X", string.byte n string.format "\\u%.4X", string.byte n
@\Append '"' @\Append '"'
@ -123,7 +122,7 @@ JsonWriter.IsArray = (t) =>
math.floor(k) == k math.floor(k) == k
return true return true
return false false
for k, _ in pairs t for k, _ in pairs t
if not isindex k if not isindex k