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