Formatting improvements to corescripts
This commit is contained in:
parent
2dfc35883b
commit
415a662fde
|
|
@ -340,10 +340,10 @@ updateAfterBalanceText = (playerBalance, notRightBc) ->
|
|||
return true, false
|
||||
|
||||
local keyWord
|
||||
if currentCurrencyType == Enum.CurrencyType.Robux
|
||||
keyWord = "robux"
|
||||
keyWord = if currentCurrencyType == Enum.CurrencyType.Robux
|
||||
"robux"
|
||||
elseif currentCurrencyType == Enum.CurrencyType.Tix
|
||||
keyWord = "tickets"
|
||||
"tickets"
|
||||
|
||||
if not keyWord
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -466,10 +466,10 @@ initializeDeveloperConsole = ->
|
|||
backRatio = 1 - ratio
|
||||
local offsetRatio
|
||||
|
||||
if currentConsole == LOCAL_CONSOLE
|
||||
offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y
|
||||
offsetRatio = if currentConsole == LOCAL_CONSOLE
|
||||
localOffset / Dev_TextHolder.AbsoluteSize.Y
|
||||
elseif currentConsole == SERVER_CONSOLE
|
||||
offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y
|
||||
serverOffset / Dev_TextHolder.AbsoluteSize.Y
|
||||
|
||||
|
||||
topRatio = math.max 0, backRatio - offsetRatio
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ local gui
|
|||
waitForChild game, "CoreGui"
|
||||
waitForChild game.CoreGui, "RobloxGui"
|
||||
|
||||
if game.CoreGui.RobloxGui\FindFirstChild "ControlFrame"
|
||||
gui = game.CoreGui.RobloxGui.ControlFrame
|
||||
gui = if game.CoreGui.RobloxGui\FindFirstChild "ControlFrame"
|
||||
game.CoreGui.RobloxGui.ControlFrame
|
||||
else
|
||||
gui = game.CoreGui.RobloxGui
|
||||
game.CoreGui.RobloxGui
|
||||
|
||||
currentTone = ->
|
||||
if currentConversationDialog
|
||||
|
|
|
|||
|
|
@ -432,8 +432,7 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
|
|||
val = scrollMouseCount
|
||||
wait 0.5
|
||||
while val == scrollMouseCount
|
||||
if scrollUp! == false
|
||||
break
|
||||
break if scrollUp! == false
|
||||
|
||||
wait 0.1
|
||||
|
||||
|
|
@ -458,8 +457,7 @@ t.CreateDropDownMenu = (items, onSelect, forRoblox) ->
|
|||
val = scrollMouseCount
|
||||
wait 0.5
|
||||
while val == scrollMouseCount
|
||||
if scrollDown! == false
|
||||
break
|
||||
break if scrollDown! == false
|
||||
|
||||
wait 0.1
|
||||
|
||||
|
|
@ -980,10 +978,10 @@ t.CreateTrueScrollingFrame = ->
|
|||
|
||||
percentFrame = 0
|
||||
if scrollbar.Position.Y.Scale > 0
|
||||
if scrollbar.Visible
|
||||
percentFrame = scrollbar.Position.Y.Scale / ((scrollTrack.AbsoluteSize.Y - scrollbar.AbsoluteSize.Y) / scrollTrack.AbsoluteSize.Y)
|
||||
percentFrame = if scrollbar.Visible
|
||||
scrollbar.Position.Y.Scale / ((scrollTrack.AbsoluteSize.Y - scrollbar.AbsoluteSize.Y) / scrollTrack.AbsoluteSize.Y)
|
||||
else
|
||||
percentFrame = 0
|
||||
0
|
||||
|
||||
|
||||
if percentFrame > 0.99
|
||||
|
|
@ -1101,16 +1099,13 @@ t.CreateTrueScrollingFrame = ->
|
|||
w = 0.1
|
||||
while scrollStamp == current
|
||||
doScrollUp!
|
||||
if mouseYPos and mouseYPos > scrollbar.AbsolutePosition.y
|
||||
break
|
||||
break if mouseYPos and mouseYPos > scrollbar.AbsolutePosition.y
|
||||
break if not scrollUpButton.Active
|
||||
|
||||
if not scrollUpButton.Active
|
||||
break
|
||||
|
||||
if tick! - t > 5
|
||||
w = 0
|
||||
w = if tick! - t > 5
|
||||
0
|
||||
elseif tick! - t > 2
|
||||
w = 0.06
|
||||
0.06
|
||||
|
||||
wait w
|
||||
|
||||
|
|
@ -1132,16 +1127,14 @@ t.CreateTrueScrollingFrame = ->
|
|||
w = 0.1
|
||||
while scrollStamp == current
|
||||
doScrollDown!
|
||||
if mouseYPos and mouseYPos < (scrollbar.AbsolutePosition.y + scrollbar.AbsoluteSize.x)
|
||||
break
|
||||
break if mouseYPos and mouseYPos < (scrollbar.AbsolutePosition.y + scrollbar.AbsoluteSize.x)
|
||||
break if not scrollDownButton.Active
|
||||
|
||||
|
||||
if not scrollDownButton.Active
|
||||
break
|
||||
|
||||
if tick! - t > 5
|
||||
w = 0
|
||||
w = if tick! - t > 5
|
||||
0
|
||||
elseif tick! - t > 2
|
||||
w = 0.06
|
||||
0.06
|
||||
|
||||
wait w
|
||||
|
||||
|
|
@ -1569,10 +1562,10 @@ t.CreateScrollingFrame = (orderList, scrollStyle) ->
|
|||
scrollDrag.Size = UDim2.new scrollDrag.Size.X.Scale, scrollDrag.Size.X.Offset, scrollDrag.Size.Y.Scale, dragSizeY
|
||||
|
||||
relativeYPos = (scrollPosition - 1) / (guiObjects - howManyDisplayed)
|
||||
if relativeYPos > 1
|
||||
relativeYPos = 1
|
||||
relativeYPos = if relativeYPos > 1
|
||||
1
|
||||
elseif relativeYPos < 0
|
||||
relativeYPos = 0
|
||||
0
|
||||
|
||||
absYPos = 0
|
||||
|
||||
|
|
@ -1637,10 +1630,10 @@ t.CreateScrollingFrame = (orderList, scrollStyle) ->
|
|||
doScrollUp!
|
||||
break if mouseYPos and mouseYPos > scrollDrag.AbsolutePosition.y
|
||||
break if not scrollUpButton.Active
|
||||
if tick! - t > 5
|
||||
w = 0
|
||||
w = if tick! - t > 5
|
||||
0
|
||||
elseif tick! - t > 2
|
||||
w = 0.06
|
||||
0.06
|
||||
|
||||
wait w
|
||||
|
||||
|
|
@ -1664,10 +1657,10 @@ t.CreateScrollingFrame = (orderList, scrollStyle) ->
|
|||
doScrollDown!
|
||||
break if mouseYPos and mouseYPos < (scrollDrag.AbsolutePosition.y + scrollDrag.AbsoluteSize.x)
|
||||
break if not scrollDownButton.Active
|
||||
if tick! - t > 5
|
||||
w = 0
|
||||
w = if tick! - t > 5
|
||||
0
|
||||
elseif tick! - t > 2
|
||||
w = 0.06
|
||||
0.06
|
||||
|
||||
wait w
|
||||
|
||||
|
|
@ -2765,16 +2758,17 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
|
|||
if insertButtons[index]
|
||||
if contents[index]
|
||||
-- we don't want water to have a drop down button
|
||||
if contents[index].Name == "Water"
|
||||
if Data.Category[Data.CurrentCategory].SetName == "High Scalability"
|
||||
insertButtons[index]\FindFirstChild("DropDownButton", true)\Destroy!
|
||||
if (contents[index].Name == "Water") and
|
||||
(Data.Category[Data.CurrentCategory].SetName == "High Scalability")
|
||||
|
||||
insertButtons[index]\FindFirstChild("DropDownButton", true)\Destroy!
|
||||
|
||||
|
||||
local assetId
|
||||
if useAssetVersionId
|
||||
assetId = contents[index].AssetVersionId
|
||||
assetId = if useAssetVersionId
|
||||
contents[index].AssetVersionId
|
||||
else
|
||||
assetId = contents[index].AssetId
|
||||
contents[index].AssetId
|
||||
|
||||
setInsertButtonImageBehavior insertButtons[index], true, contents[index].Name, assetId
|
||||
else break
|
||||
|
|
|
|||
|
|
@ -942,12 +942,12 @@ createGameSettingsMenu = (baseZIndex, _) ->
|
|||
setGraphicsQualityLevel = (newLevel) ->
|
||||
percentage = newLevel / GraphicsQualityLevels
|
||||
newSetting = math.floor((settings!.Rendering\GetMaxQualityLevel! - 1) * percentage)
|
||||
if newSetting == 20 -- Level 20 is the same as level 21, except it doesn't render ambient occlusion
|
||||
newSetting = 21
|
||||
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)
|
||||
newSetting = 1
|
||||
1
|
||||
elseif newSetting > settings!.Rendering\GetMaxQualityLevel!
|
||||
newSetting = settings!.Rendering\GetMaxQualityLevel! - 1
|
||||
settings!.Rendering\GetMaxQualityLevel! - 1
|
||||
|
||||
|
||||
UserSettings!.GameSettings.SavedQualityLevel = newLevel
|
||||
|
|
@ -1052,10 +1052,10 @@ createGameSettingsMenu = (baseZIndex, _) ->
|
|||
return
|
||||
|
||||
|
||||
if newGraphicsValue < 1
|
||||
newGraphicsValue = 1
|
||||
newGraphicsValue = if newGraphicsValue < 1
|
||||
1
|
||||
elseif newGraphicsValue >= settings!.Rendering\GetMaxQualityLevel!
|
||||
newGraphicsValue = settings!.Rendering\GetMaxQualityLevel! - 1
|
||||
settings!.Rendering\GetMaxQualityLevel! - 1
|
||||
|
||||
|
||||
graphicsLevel.Value = newGraphicsValue
|
||||
|
|
|
|||
|
|
@ -323,8 +323,7 @@ enlargeButton = (button) ->
|
|||
return if not button.Selected
|
||||
|
||||
for i = 1, #gearSlots
|
||||
if gearSlots[i] == "empty"
|
||||
break
|
||||
break if gearSlots[i] == "empty"
|
||||
|
||||
if gearSlots[i] ~= button
|
||||
normalizeButton gearSlots[i]
|
||||
|
|
@ -429,9 +428,7 @@ activateGear = (num) ->
|
|||
|
||||
normalizeAllButtons = ->
|
||||
for i = 1, #gearSlots
|
||||
if gearSlots[i] == "empty"
|
||||
break
|
||||
|
||||
break if gearSlots[i] == "empty"
|
||||
if gearSlots[i] ~= button
|
||||
normalizeButton gearSlots[i], 0.1
|
||||
|
||||
|
|
@ -528,8 +525,7 @@ resolveDrag = (gearClone, x, y) ->
|
|||
|
||||
unequipAllItems = (dontEquipThis) ->
|
||||
for i = 1, #gearSlots
|
||||
if gearSlots[i] == "empty"
|
||||
break
|
||||
break if gearSlots[i] == "empty"
|
||||
|
||||
with gearSlots[i]
|
||||
if .GearReference.Value and .GearReference.Value ~= dontEquipThis
|
||||
|
|
|
|||
|
|
@ -441,10 +441,10 @@ findConfigAtMouseTarget = (Mouse, stampData) ->
|
|||
diagBB = maxBB - minBB
|
||||
|
||||
local insertCFrame
|
||||
if stampData.CurrentParts\IsA"Model" or stampData.CurrentParts\IsA "Tool"
|
||||
insertCFrame = stampData.CurrentParts\GetModelCFrame!
|
||||
insertCFrame = if stampData.CurrentParts\IsA"Model" or stampData.CurrentParts\IsA "Tool"
|
||||
stampData.CurrentParts\GetModelCFrame!
|
||||
else
|
||||
insertCFrame = stampData.CurrentParts.CFrame
|
||||
stampData.CurrentParts.CFrame
|
||||
|
||||
|
||||
if Mouse
|
||||
|
|
@ -1093,10 +1093,10 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
|
|||
|
||||
-- need to offset by distance to be dragged
|
||||
local currModelCFrame
|
||||
if stampData.CurrentParts\IsA "Model"
|
||||
currModelCFrame = stampData.CurrentParts\GetModelCFrame!
|
||||
currModelCFrame = if stampData.CurrentParts\IsA "Model"
|
||||
stampData.CurrentParts\GetModelCFrame!
|
||||
else
|
||||
currModelCFrame = stampData.CurrentParts.CFrame
|
||||
stampData.CurrentParts.CFrame
|
||||
|
||||
|
||||
minBB += targetCFrame.p - currModelCFrame.p
|
||||
|
|
@ -1902,10 +1902,10 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
|
|||
--cellPos = cluster\WorldToCell targetCFrame.p
|
||||
|
||||
local cellPos
|
||||
if stampData.CurrentParts\IsA "Model"
|
||||
cellPos = cluster\WorldToCell stampData.CurrentParts\GetModelCFrame!.p
|
||||
cellPos = if stampData.CurrentParts\IsA "Model"
|
||||
cluster\WorldToCell stampData.CurrentParts\GetModelCFrame!.p
|
||||
else
|
||||
cellPos = cluster\WorldToCell stampData.CurrentParts.CFrame.p
|
||||
cluster\WorldToCell stampData.CurrentParts.CFrame.p
|
||||
|
||||
|
||||
cMax = game.Workspace.Terrain.MaxExtents.Max
|
||||
|
|
|
|||
|
|
@ -1165,10 +1165,10 @@ Chat.UpdateChat = (cPlayer, message) =>
|
|||
-- NOTE: Temporarily disabled ring buffer to allow for chat to always wrap around
|
||||
Chat.CreateMessage = (cPlayer, message) =>
|
||||
local pName
|
||||
if not cPlayer
|
||||
pName = ""
|
||||
pName = if not cPlayer
|
||||
""
|
||||
else
|
||||
pName = cPlayer.Name
|
||||
cPlayer.Name
|
||||
message = StringTrim message
|
||||
local pLabel
|
||||
local mLabel
|
||||
|
|
@ -1293,10 +1293,10 @@ Chat.FindButtonTree = (scButton, rootList) =>
|
|||
list = {}
|
||||
rootList = rootList or @SafeChatTree
|
||||
for button, _ in pairs rootList
|
||||
if button == scButton
|
||||
list = rootList[button]
|
||||
list = if button == scButton
|
||||
rootList[button]
|
||||
elseif type(rootList[button]) == "table"
|
||||
list = Chat\FindButtonTree scButton, rootList[button]
|
||||
Chat\FindButtonTree scButton, rootList[button]
|
||||
list
|
||||
|
||||
Chat.ToggleSafeChatMenu = (scButton) =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue