Further improve formatting of corescripts

This commit is contained in:
Lewin Kelly 2023-06-03 17:51:33 +01:00
parent f247c89ce3
commit 9c28950b36
18 changed files with 319 additions and 345 deletions

View File

@ -5,7 +5,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -299,7 +299,7 @@ setCurrencyAmountAndType = (priceInRobux, priceInTix) ->
return false
if not currentCurrencyAmount?
if currentCurrencyAmount == nil
return false
true
@ -357,7 +357,7 @@ updateAfterBalanceText = (playerBalance, notRightBc) ->
-- check to see if we have enough of the desired currency to allow a purchase, if not we need to prompt user to buy robux
if not notRightBc
if afterBalanceNumber < 0 and keyWord == "robux"
if not openBuyCurrencyWindowConnection?
if openBuyCurrencyWindowConnection == nil
openBuyCurrencyWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click\connect openBuyCurrencyWindow
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " ..
@ -400,7 +400,7 @@ canPurchaseItem = ->
currentProductInfo = game\GetService"MarketplaceService"\GetProductInfo currentAssetId
if not currentProductInfo? or not success
if currentProductInfo == nil or not success
descText = "In-game sales are temporarily disabled. Please try again later."
return true, nil, nil, true, descText

View File

@ -8,7 +8,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil

View File

@ -7,7 +7,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -465,7 +465,7 @@ setupCameraControl = (parentFrame, refreshCharacterMoveFunc) ->
resetCameraRotateState!
if not lastPinchScale? -- first pinch move, just set up scale
if lastPinchScale == nil -- first pinch move, just set up scale
if inputObject == firstTouch
lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude
firstTouch = inputObject
@ -517,7 +517,7 @@ setupCameraControl = (parentFrame, refreshCharacterMoveFunc) ->
pinchGestureReceivedTouch inputObject
if not cameraTouch? and not usedByThumbstick
if cameraTouch == nil and not usedByThumbstick
cameraTouch = inputObject
lastPos = Vector2.new cameraTouch.Position.x, cameraTouch.Position.y
-- lastTick = tick!

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil

View File

@ -7,7 +7,7 @@ return if not controlFrame
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -73,7 +73,7 @@ setUpListeners = (frameToListen) ->
killTip frameToListen
createSettingsButtonTip = (parent) ->
if not parent?
if parent == nil
parent = bottomLeftControl\FindFirstChild "SettingsButton"

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -51,12 +51,12 @@ inCharTag = New "BoolValue"
hider = New "BoolValue"
Name: "RobloxBuildTool"
if not config?
if config == nil
config = New "Configuration", "PlayerStats"
Parent: Figure
myHealth = config\FindFirstChild "MaxHealth"
if not myHealth?
if myHealth == nil
myHealth = New "NumberValue", "MaxHealth"
Value: 100
Parent: config
@ -75,7 +75,7 @@ myHealth.Changed\connect onMaxHealthChange
vPlayer = game.Players\GetPlayerFromCharacter script.Parent
dotGui = vPlayer.PlayerGui\FindFirstChild "DamageOverTimeGui"
if not dotGui?
if dotGui == nil
dotGui = New "BillboardGui", "DamageOverTimeGui"
Parent: vPlayer.PlayerGui
Adornee: script.Parent\FindFirstChild "Head"

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -241,10 +241,10 @@ presentDialogChoices = (talkingPart, dialogChoices) ->
return if not currentConversationDialog
currentConversationPartner = talkingPart
sortedDialogChoices = {}
for _, obj in pairs dialogChoices
if obj\IsA "DialogChoice"
table.insert sortedDialogChoices, obj
sortedDialogChoices = [obj \
for _, obj in pairs sortedDialogChoices \
when obj\IsA "DialogChoice"]
table.sort sortedDialogChoices, (a, b) -> a.Name < b.Name
@ -341,13 +341,9 @@ newChoice = (numberText) ->
TextWrap: true
RobloxLocked: true
frame.MouseEnter\connect ->
highlightColor frame, currentTone!
frame.MouseLeave\connect ->
resetColor frame, currentTone!
frame.MouseButton1Click\connect ->
selectChoice frame
frame.MouseEnter\connect -> highlightColor frame, currentTone!
frame.MouseLeave\connect -> resetColor frame, currentTone!
frame.MouseButton1Click\connect -> selectChoice frame
frame
initialize = (parent) ->

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -1400,8 +1400,8 @@ t.CreateScrollingFrame = (orderList, scrollStyle) ->
xOffset = yOffset = 0
if guiObjects[1]
yOffset = math.ceil math.floor(math.fmod(totalPixelsY, guiObjects[1].AbsoluteSize.X)) / 2
xOffset = math.ceil math.floor(math.fmod(totalPixelsX, guiObjects[1].AbsoluteSize.Y)) / 2
yOffset = math.ceil math.floor(math.fmod totalPixelsY, guiObjects[1].AbsoluteSize.X) / 2
xOffset = math.ceil math.floor(math.fmod totalPixelsX, guiObjects[1].AbsoluteSize.Y) / 2
for i, child in ipairs guiObjects
@ -2369,14 +2369,8 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
* New "Frame", "SetPanel"
Active: true
BackgroundTransparency: 1
Position: if position
position
else
UDim2.new 0.2, 29, 0.1, 24
Size: if size
size
else
UDim2.new 0.6, -58, 0.64, 0
Position: position or UDim2.new 0.2, 29, 0.1, 24
Size: size or UDim2.new 0.6, -58, 0.64, 0
Style: Enum.FrameStyle.RobloxRound
ZIndex: 6
Parent: setGui
@ -2466,10 +2460,7 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
createSetButton = (text) ->
New "TextButton"
Text: if text
text
else
""
Text: text or ""
AutoButtonColor: false
BackgroundTransparency: 1
BackgroundColor3: Color3.new 1, 1, 1
@ -2931,10 +2922,10 @@ t.CreateSetPanel = (userIdsForSets, objectSelected, dialogClosed, size, position
if newUserData and #newUserData > 2
-- start at #3 to skip over My Decals and My Models for each account
for category = 3, #newUserData
if newUserData[category].Name == "High Scalability" -- we want high scalability parts to show first
table.insert userData, 1, newUserData[category]
table.insert userData, if newUserData[category].Name == "High Scalability" -- we want high scalability parts to show first
1, newUserData[category]
else
table.insert userData, newUserData[category]
newUserData[category]
if userData
@ -2975,10 +2966,7 @@ t.CreateTerrainMaterialSelector = (size, position) ->
local selectedButton
frame = New "Frame", "TerrainMaterialSelector"
Size: if size
size
else
UDim2.new 0, 245, 0, 230
Size: size or UDim2.new 0, 245, 0, 230
BorderSizePixel: 0
BackgroundColor3: Color3.new 0, 0, 0
Active: true
@ -3186,15 +3174,8 @@ t.CreateLoadingFrame = (name, size, position) ->
loadingFrame = New "Frame", "LoadingFrame"
Style: Enum.FrameStyle.RobloxRound
Size: if size
size
else
UDim2.new 0, 300, 0, 160
Position: if position
position
else
UDim2.new 0.5, -150, 0.5, -80
Size: size or UDim2.new 0, 300, 0, 160
Position: position or UDim2.new 0.5, -150, 0.5, -80
* New "TextLabel", "loadingName"
BackgroundTransparency: 1

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -1710,9 +1710,9 @@ if LoadLibrary
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)),
0.5 + 0.3 * math.cos(math.rad 45 * spinnerNum),
-8,
0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)),
0.5 + 0.3 * math.sin(math.rad 45 * spinnerNum),
-8
)
BackgroundTransparency: 1

View File

@ -156,7 +156,7 @@ MOUSE_DRAG_DISTANCE = 15
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -318,65 +318,72 @@ ScreenGui = New "Frame", "PlayerListScreen"
BackgroundTransparency: 1
Parent: script.Parent
MainFrame = New "Frame", "LeaderBoardFrame"
Position: UDim2.new 1, -150, 0.005, 0
Size: UDim2.new 0, 150, 0, 800
BackgroundTransparency: 1
Parent: ScreenGui
* New "Frame", "LeaderBoardFrame"
Position: UDim2.new 1, -150, 0.005, 0
Size: UDim2.new 0, 150, 0, 800
BackgroundTransparency: 1
--frame used for expanding leaderstats when frame is 'focused'
FocusFrame = New "Frame", "FocusFrame"
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0, 100
BackgroundTransparency: 1
Active: true
Parent: MainFrame
--frame used for expanding leaderstats when frame is 'focused'
* New "Frame", "FocusFrame"
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0, 100
BackgroundTransparency: 1
Active: true
-- HEADER
HeaderFrame = New "Frame", "Header"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0.07, 0
Parent: MainFrame
-- HEADER
* New "Frame", "Header"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0.07, 0
* MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94692054"
* MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94692054"
* New "ImageButton", "MaximizeButton"
Active: true
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 1, 0
* New "TextLabel", "PlayerName"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.01, 0
Size: UDim2.new 0.98, 0, 0.38, 0
Font: "ArialBold"
Text: LocalPlayer.Name
FontSize: "Size24"
--TextScaled: true
TextColor3: Color3.new 1, 1, 1
TextStrokeColor3: Color3.new 0, 0, 0
TextStrokeTransparency: 0
TextXAlignment: "Right"
TextYAlignment: "Center"
* New "TextLabel", "PlayerScore"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.4, 0
Size: UDim2.new 0.98, 0, 0, 30
Font: "ArialBold"
Text: ""
FontSize: "Size24"
TextYAlignment: "Top"
-- TextScaled: true
TextColor3: Color3.new 1, 1, 1
TextStrokeTransparency: 1
TextXAlignment: "Right"
{
LeaderBoardFrame: MainFrame
MainFrame:
:FocusFrame
Header: HeaderFrame
HeaderFrame:
:MaximizeButton
PlayerName: HeaderName
PlayerScore: HeaderScore
:BottomShiftFrame
} = ScreenGui
HeaderFrameHeight = HeaderFrame.Size.Y.Scale
MaximizeButton = New "ImageButton", "MaximizeButton"
Active: true
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 1, 0
Parent: HeaderFrame
HeaderName = New "TextLabel", "PlayerName"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.01, 0
Size: UDim2.new 0.98, 0, 0.38, 0
Parent: HeaderFrame
Font: "ArialBold"
Text: LocalPlayer.Name
FontSize: "Size24"
--TextScaled: true
TextColor3: Color3.new 1, 1, 1
TextStrokeColor3: Color3.new 0, 0, 0
TextStrokeTransparency: 0
TextXAlignment: "Right"
TextYAlignment: "Center"
HeaderScore = New "TextLabel", "PlayerScore"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.4, 0
Size: UDim2.new 0.98, 0, 0, 30
Parent: HeaderFrame
Font: "ArialBold"
Text: ""
FontSize: "Size24"
TextYAlignment: "Top"
-- TextScaled: true
TextColor3: Color3.new 1, 1, 1
TextStrokeTransparency: 1
TextXAlignment: "Right"
-- BOTTOM
--used for shifting bottom frame for mouse over effects
@ -386,29 +393,35 @@ BottomShiftFrame = New "Frame", "BottomShiftFrame"
Size: UDim2.new 1, 0, 1, 0
Parent: MainFrame
BottomFrame = New "Frame", "Bottom"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.07, 0
Size: UDim2.new 1, 0, 0.03, 0
Parent: BottomShiftFrame
* New "Frame", "Bottom"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.07, 0
Size: UDim2.new 1, 0, 0.03, 0
Parent: BottomShiftFrame
* MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94754966"
* MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94754966"
ExtendButton = New "ImageButton", "bigbutton"
Active: true
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 1.5, 0
ZIndex: 3
Parent: BottomFrame
* New "ImageButton", "bigbutton"
Active: true
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 1.5, 0
ZIndex: 3
* New "ImageButton", "extendTab"
Active: true
BackgroundTransparency: 1
Image: "http://www.roblox.com/asset/?id=94692731"
Position: UDim2.new 0.608, 0, 0.3, 0
Size: UDim2.new 0.3, 0, 0.7, 0
{
Bottom: BottomFrame
Bottom:
bigbutton: ExtendButton
extendTab: ExtendTab
} = BottomShiftFrame
ExtendTab = New "ImageButton", "extendTab"
Active: true
BackgroundTransparency: 1
Image: "http://www.roblox.com/asset/?id=94692731"
Position: UDim2.new 0.608, 0, 0.3, 0
Size: UDim2.new 0.3, 0, 0.7, 0
Parent: BottomFrame
TopClipFrame = New "Frame", "ListFrame"
BackgroundTransparency: 1
@ -417,32 +430,37 @@ TopClipFrame = New "Frame", "ListFrame"
Parent: MainFrame
ClipsDescendants: true
BottomClipFrame = New "Frame", "BottomFrame"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, -0.8, 0
Size: UDim2.new 1, 0, 1, 0
Parent: TopClipFrame
ClipsDescendants: true
* New "Frame", "BottomFrame"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, -0.8, 0
Size: UDim2.new 1, 0, 1, 0
ClipsDescendants: true
ScrollBarFrame = New "Frame", "ScrollBarFrame"
BackgroundTransparency: 1
Position: UDim2.new 0.987, 0, 0.8, 0
Size: UDim2.new 0.01, 0, 0.2, 0
Parent: BottomClipFrame
* New "Frame", "ScrollBarFrame"
BackgroundTransparency: 1
Position: UDim2.new 0.987, 0, 0.8, 0
Size: UDim2.new 0.01, 0, 0.2, 0
ScrollBar = New "Frame", "ScrollBar"
BackgroundTransparency: 0
BackgroundColor3: Color3.new 0.2, 0.2, 0.2
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0.5, 0
ZIndex: 5
Parent: ScrollBarFrame
* New "Frame", "ScrollBar"
BackgroundTransparency: 0
BackgroundColor3: Color3.new 0.2, 0.2, 0.2
Position: UDim2.new 0, 0, 0, 0
Size: UDim2.new 1, 0, 0.5, 0
ZIndex: 5
ListFrame = New "Frame", "SubFrame"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.8, 0
Size: UDim2.new 1, 0, 1, 0
Parent: BottomClipFrame
* New "Frame", "SubFrame"
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 0.8, 0
Size: UDim2.new 1, 0, 1, 0
{
BottomFrame: BottomClipFrame
BottomClipFrame:
:ScrollBarFrame
ScrollBarFrame:
:ScrollBar
SubFrame: ListFrame
} = TopClipFrame
PopUpClipFrame = New "Frame", "PopUpFrame",
BackgroundTransparency: 1
@ -461,10 +479,10 @@ PopUpPanelTemplate = New "Frame", "Panel"
Parent: PopUpClipFrame
StatTitles = New "Frame", "StatTitles",
BackgroundTransparency: 1,
Position: UDim2.new 0, 0, 1, -10,
Size: UDim2.new 1, 0, 0, 0,
Parent: HeaderFrame,
BackgroundTransparency: 1
Position: UDim2.new 0, 0, 1, -10
Size: UDim2.new 1, 0, 0, 0
Parent: HeaderFrame
IsMinimized = Instance.new "BoolValue"
IsMaximized = Instance.new "BoolValue"
@ -1209,15 +1227,13 @@ OnFriendRefuseButtonSelect = ->
PlayerSortFunction = (a, b) ->
-- prevents flipping out leaderboard
if a["Score"] == b["Score"]
return a["Player"].Name\upper! < b["Player"].Name\upper!
if not a["Score"]
return false
if not b["Score"]
return true
a["Score"] < b["Score"]
a["Player"].Name\upper! < b["Player"].Name\upper!
elseif not a["Score"]
false
elseif not b["Score"]
true
else
a["Score"] < b["Score"]
---------------------------------
-- Stat Handling
@ -2626,13 +2642,12 @@ TeamSortFunc = (a, b) ->
team team entry to sum the scores of
--]]
AddTeamScores = (team) ->
for j = 1, #ScoreNames
i = ScoreNames[j]
for i in *ScoreNames
tscore = 0
for _, j in ipairs team["MyPlayers"]
tval = j["Player"]\FindFirstChild "leaderstats" and j["Player"].leaderstats\FindFirstChild i["Name"]
if tval and not tval\IsA "StringValue"
tscore += GetScoreValue (j["Player"].leaderstats)[i["Name"]]
tscore += GetScoreValue j["Player"].leaderstats[i["Name"]]
if team["Frame"]\FindFirstChild i["Name"]
--team['Frame'][i['Name'] ].Size = UDim2.new(1 - (ScrollBarFrame.Size.X.Scale * 2),- ((j-1) * SpacingPerStat),1,0)
@ -2781,71 +2796,74 @@ InsertTeamFrame = (nteam) ->
AddingFrameLock = true
--for _,i in pairs TeamFrames
nentry = {}
nentry["MyTeam"] = nteam
nentry["MyPlayers"] = {}
nentry["Frame"] = MiddleTemplate\Clone!
WaitForChild(WaitForChild(nentry["Frame"], "TitleFrame"), "Title").Text = nteam.Name
nentry["Frame"].TitleFrame.Title.Font = "ArialBold"
nentry["Frame"].TitleFrame.Title.FontSize = "Size18"
nentry["Frame"].TitleFrame.Position = UDim2.new(
nentry["Frame"].TitleFrame.Position.X.Scale,
nentry["Frame"].TitleFrame.Position.X.Offset,
0.1,
0
)
nentry["Frame"].TitleFrame.Size = UDim2.new(
nentry["Frame"].TitleFrame.Size.X.Scale,
nentry["Frame"].TitleFrame.Size.X.Offset,
0.8,
0
)
nentry["Frame"].Position = UDim2.new(1, 0, (#MiddleFrames * nentry["Frame"].Size.Y.Scale), 0)
WaitForChild(nentry["Frame"], "ClickListener").MouseButton1Down\connect (nx, ny) ->
StartDrag nentry, nx, ny
nentry["Frame"].ClickListener.BackgroundColor3 = nteam.TeamColor.Color
nentry["Frame"].ClickListener.BackgroundTransparency = 0.7
nentry["Frame"].ClickListener.AutoButtonColor = false
AddId += 1
nentry["ID"] = AddId
nentry["AutoHide"] = false
if nteam\FindFirstChild "AutoHide"
nentry["AutoHide"] = true
if nteam\FindFirstChild "TeamScore"
TeamChildAdded nentry, nteam.TeamScore
nteam.ChildAdded\connect (nchild) -> TeamChildAdded nentry, nchild
nteam.ChildRemoved\connect (nchild) -> TeamChildRemoved nentry, nchild
nteam.Changed\connect (prop) -> TeamChanged nentry, prop
for _, i in pairs PlayerFrames
if not i["Player"].Neutral and i["Player"].TeamColor == nteam.TeamColor
AddPlayerToTeam nentry, i
nentry["IsHidden"] = false
if not nentry["AutoHide"] or #nentry["MyPlayers"] > 0
nentry["Frame"].Parent = ListFrame
nentry["Frame"]\TweenPosition(
UDim2.new(0.5, 0, (#MiddleFrames * nentry["Frame"].Size.Y.Scale), 0),
"Out",
"Linear",
BASE_TWEEN,
true
with n = nentry["Frame"]
nentry = {}
nentry["MyTeam"] = nteam
nentry["MyPlayers"] = {}
nentry["Frame"] = MiddleTemplate\Clone!
WaitForChild(WaitForChild(nentry["Frame"], "TitleFrame"), "Title").Text = nteam.Name
.TitleFrame.Title.Font = "ArialBold"
.TitleFrame.Title.FontSize = "Size18"
.TitleFrame.Position = UDim2.new(
.TitleFrame.Position.X.Scale,
.TitleFrame.Position.X.Offset,
0.1,
0
)
AddMiddleBGFrame!
else
nentry["IsHidden"] = true
nentry["Frame"].Parent = nil
.TitleFrame.Size = UDim2.new(
.TitleFrame.Size.X.Scale,
.TitleFrame.Size.X.Offset,
0.8,
0
)
.Position = UDim2.new(1, 0, (#MiddleFrames * .Size.Y.Scale), 0)
WaitForChild(n, "ClickListener").MouseButton1Down\connect (nx, ny) ->
StartDrag nentry, nx, ny
table.insert TeamFrames, nentry
UpdateMinimize!
BaseUpdate!
if #TeamFrames == 1 and not NeutralTeam
AddNeutralTeam!
.ClickListener.BackgroundColor3 = nteam.TeamColor.Color
.ClickListener.BackgroundTransparency = 0.7
.ClickListener.AutoButtonColor = false
AddId += 1
nentry["ID"] = AddId
nentry["AutoHide"] = false
AddingFrameLock = false
if nteam\FindFirstChild "AutoHide"
nentry["AutoHide"] = true
if nteam\FindFirstChild "TeamScore"
TeamChildAdded nentry, nteam.TeamScore
nteam.ChildAdded\connect (nchild) -> TeamChildAdded nentry, nchild
nteam.ChildRemoved\connect (nchild) -> TeamChildRemoved nentry, nchild
nteam.Changed\connect (prop) -> TeamChanged nentry, prop
for _, i in pairs PlayerFrames
if not i["Player"].Neutral and i["Player"].TeamColor == nteam.TeamColor
AddPlayerToTeam nentry, i
nentry["IsHidden"] = false
if not nentry["AutoHide"] or #nentry["MyPlayers"] > 0
.Parent = ListFrame
nentry["Frame"]\TweenPosition(
UDim2.new(0.5, 0, (#MiddleFrames * .Size.Y.Scale), 0),
"Out",
"Linear",
BASE_TWEEN,
true
)
AddMiddleBGFrame!
else
nentry["IsHidden"] = true
.Parent = nil
table.insert TeamFrames, nentry
UpdateMinimize!
BaseUpdate!
if #TeamFrames == 1 and not NeutralTeam
AddNeutralTeam!
AddingFrameLock = false
TeamAdded = (nteam) -> InsertTeamFrame nteam
TeamRemoved = (nteam) -> RemoveTeamFrame nteam

View File

@ -41,7 +41,7 @@ makePopupInvisible = ->
makeFriend = (fromPlayer, toPlayer) ->
popup = script.Parent\FindFirstChild "Popup"
return if not popup? -- there is no popup!
return if popup == nil -- there is no popup!
return if popup.Visible -- currently popping something, abort!
return if friendRequestBlacklist[fromPlayer] -- previously cancelled friend request, we don't want it!

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil

View File

@ -9,7 +9,7 @@ return if game.CoreGui.Version < 3
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil

View File

@ -101,10 +101,7 @@ firstInstanceOfLoadout = false
inventory = {}
gearSlots = {}
for i = 1, maxNumLoadoutItems
gearSlots[i] = "empty"
gearSlots = ["empty" for _ = 1, maxNumLoadoutItems]
backpackWasOpened = false
--- End Locals
@ -152,17 +149,17 @@ removeGear = (gear) ->
if emptySlot
with gearSlots[emptySlot]
if .GearReference.Value
if .GearReference.Value.Parent == game.Players.LocalPlayer.Character -- if we currently have this equipped, unequip it
.GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
with g = gearSlots[emptySlot].GearReference.Value
if g
if .Parent == game.Players.LocalPlayer.Character -- if we currently have this equipped, unequip it
.Parent = game.Players.LocalPlayer.Backpack
if .GearReference.Value\IsA"HopperBin" and
.GearReference.Value.Active
if \IsA"HopperBin" and
.Active
-- this is an active hopperbin
.GearReference.Value\Disable!
.GearReference.Value.Active = false
\Disable!
.Active = false
gearSlots[emptySlot] = "empty"
@ -171,9 +168,7 @@ removeGear = (gear) ->
--[[gear\TweenSizeAndPosition(UDim2.new 0,0,0,0,
UDim2.new(gear.Position.X.Scale + centerizeX,gear.Position.X.Offset,gear.Position.Y.Scale + centerizeY,gear.Position.Y.Offset),
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/4,true)]]
delay 0, ->
gear\remove!
delay 0, -> gear\remove!
Spawn ->
while backpackIsOpen!
@ -184,6 +179,7 @@ removeGear = (gear) ->
for i in *gearSlots
if i ~= "empty"
allEmpty = false
break
if allEmpty
if #player.Backpack\GetChildren! < 1
@ -218,10 +214,9 @@ insertGear = (gear, addToSlot) ->
for i = start, pos + 1, -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"
else
i
@ -236,8 +231,8 @@ insertGear = (gear, addToSlot) ->
gear.SlotNumberUpShadow.Text = posString
else -- tenth gear doesn't follow mathematical pattern :(
gear.SlotNumber.Text = "0"
gear.SlotNumberDownShadow.Text = "0"
gear.SlotNumber.Text = \
gear.SlotNumberDownShadow.Text = \
gear.SlotNumberUpShadow.Text = "0"
gear.Visible = true
@ -262,7 +257,7 @@ checkToolAncestry = (child, parent) ->
if child\IsA"Tool" or child\IsA "HopperBin"
for i in *gearSlots
if i ~= "empty" and i.GearReference.Value == child
if not parent?
if parent == nil
i.Kill.Value = true
return false
elseif child.Parent == player.Character
@ -295,7 +290,7 @@ normalizeButton = (button, speed) ->
return if not button.Parent
moveSpeed = speed
if not moveSpeed? or type(moveSpeed) ~= "number"
if moveSpeed == nil or type(moveSpeed) ~= "number"
moveSpeed = guiTweenSpeed / 5
if button\FindFirstChild "Highlight"
@ -374,7 +369,7 @@ toolSwitcher = (numKey) ->
return if not gearSlots[numKey]
physGear = gearSlots[numKey].GearReference.Value
return if not physGear?
return if physGear == nil
removeAllEquippedGear physGear -- we don't remove this gear, as then we get a double switcheroo
@ -422,7 +417,7 @@ activateGear = (num) ->
else
tonumber num
return if not numKey?
return if numKey == nil
if gearSlots[numKey] ~= "empty"
toolSwitcher numKey

View File

@ -5,7 +5,7 @@ t = {}
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -213,7 +213,7 @@ JsonReader.New = (s) =>
JsonReader.Read ==>
@\SkipWhiteSpace!
peek = @\Peek!
return if not peek?
return if peek == nil
error string.format "Nil string: '%s'", @\All!
elseif peek == "{"
@\ReadObject!
@ -261,7 +261,7 @@ JsonReader.ReadNumber ==>
peek = @\Peek!
result = tonumber result
if not result?
if result == nil
error string.format "Invalid number: '%s'", result
else
return result
@ -451,10 +451,7 @@ t.SelectTerrainRegion = (regionToSelect, color, selectEmptyCells, selectionParen
-- container for all adornments, passed back to user
selectionContainer = New "Model", "SelectionContainer"
Archivable: false
Parent: if selectionParent
selectionParent
else
game.Workspace
Parent: selectiorParent or game.Workspace
local updateSelection -- function we return to allow user to update selection
local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -188,9 +188,8 @@ setSeatEnabledStatus = (model, isEnabled) ->
autoAlignToFace = (parts) ->
if aatf = parts\FindFirstChild "AutoAlignToFace"
aatf.Value
else
false
return aatf.Value
false
getClosestAlignedWorldDirection = (aVector3InWorld) ->
@ -372,25 +371,17 @@ getMouseTargetCFrame = (targetPart) -> with targetPart
isBlocker = (part) -> -- returns whether or not we want to cancel the stamp because we're blocked by this part
if not part
return false
if (not part) or
(not part.Parent) or
part\FindFirstChild "Humanoid"
if not part.Parent
return false
if part\FindFirstChild "Humanoid"
return false
if part\FindFirstChild"RobloxStamper" or part\FindFirstChild "RobloxModel"
return true
if part\IsA"Part" and not part.CanCollide
return false
if part == game.Lighting
return false
isBlocker part.Parent
false
elseif part\FindFirstChild"RobloxStamper" or part\FindFirstChild "RobloxModel"
true
elseif (part\IsA"Part" and not part.CanCollide) or part == game.Lighting
false
else
isBlocker part.Parent
-- helper function to determine if a character can be pushed upwards by a certain amount
-- character is 5 studs tall, we'll check a 1.5 x 1.5 x 4.5 box around char, with center .5 studs below torsocenter
@ -463,9 +454,10 @@ findConfigAtMouseTarget = (Mouse, stampData) ->
return admissibleConfig, targetConfig
mouseHitInWorld = Vector3.new 0, 0, 0
if Mouse
mouseHitInWorld = Vector3.new Mouse.Hit.x, Mouse.Hit.y, Mouse.Hit.z
mouseHitInWorld = Vector3.new if Mouse
Mouse.Hit.x, Mouse.Hit.y, Mouse.Hit.z
else
0, 0, 0
local cellPos
@ -505,7 +497,7 @@ findConfigAtMouseTarget = (Mouse, stampData) ->
if Mouse
-- DON'T WANT THIS IN TERMS OF THE MODEL CFRAME! (.TargetSurface is in terms of the part CFrame, so this would break, right? [HotThoth])
-- (ideally, we would want to make the Mouse.TargetSurface a model-targetsurface instead, but for testing will be using the converse)
--targetVectorInWorld = targetCFrame\vectorToWorldSpace(Vector3.FromNormalId(Mouse.TargetSurface))
--targetVectorInWorld = targetCFrame\vectorToWorldSpace Vector3.FromNormalId Mouse.TargetSurface
targetVectorInWorld = targetPart.CFrame\vectorToWorldSpace Vector3.FromNormalId Mouse.TargetSurface -- better, but model cframe would be best
--[[if targetPart.Parent\IsA "Model"
hitFace = modelTargetSurface(targetPart.Parent, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) -- best, if you get it right
@ -983,16 +975,16 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
tempCFrame = CFrame.new HighScalabilityLine.Start, HighScalabilityLine.Start + line
-- then zero out whichever is the smaller component
yAxis = tempCFrame\vectorToWorldSpace(Vector3.new(0, 1, 0))
xAxis = tempCFrame\vectorToWorldSpace(Vector3.new(1, 0, 0))
yAxis = tempCFrame\vectorToWorldSpace Vector3.new 0, 1, 0
xAxis = tempCFrame\vectorToWorldSpace Vector3.new 1, 0, 0
xComp = xAxis\Dot line2
yComp = yAxis\Dot line2
if math.abs(yComp) > math.abs xComp
line2 -= xAxis * xComp
line2 -= if math.abs(yComp) > math.abs xComp
xAxis * xComp
else
line2 -= yAxis * yComp
yAxis * yComp
HighScalabilityLine.InternalLine = line2
@ -1018,7 +1010,7 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
else
boxSize = tempCFrame\vectorToObjectSpace line + line2 + line3
HighScalabilityLine.AdornPart.Size = Vector3.new(4, 4, 4) +
Vector3.new(math.abs(boxSize.X), math.abs(boxSize.Y), math.abs(boxSize.Z))
Vector3.new(math.abs(boxSize.X), math.abs(boxSize.Y), math.abs boxSize.Z)
HighScalabilityLine.AdornPart.CFrame = tempCFrame + tempCFrame\vectorToWorldSpace boxSize / 2
@ -1035,7 +1027,7 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
HighScalabilityLine.Adorn.Parent = gui
if not gui? -- we are in studio
if gui == nil -- we are in studio
gui = game\GetService "CoreGui"
if (HighScalabilityLine.Dimensions == 1 and line.magnitude > 3) or HighScalabilityLine.Dimensions > 1 -- don't show if mouse hasn't moved enough
HighScalabilityLine.Adorn.Parent = gui
@ -1068,14 +1060,13 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
numRotations = 0 -- update this according to how many rotations you need to get it to target surface
if autoAlignToFace(stampData.CurrentParts) and targetSurface ~= 1 and targetSurface ~= 4 -- pre-rotate the flag or portrait so it's aligned correctly
numRotations = if targetSurface == 3
0 - gInitial90DegreeRotations + autoAlignToFace stampData.CurrentParts
elseif targetSurface == 0
2 - gInitial90DegreeRotations + autoAlignToFace stampData.CurrentParts
elseif targetSurface == 5
3 - gInitial90DegreeRotations + autoAlignToFace stampData.CurrentParts
elseif targetSurface == 2
1 - gInitial90DegreeRotations + autoAlignToFace stampData.CurrentParts
numRotations = (
switch targetSurface
when 3 then 0
when 0 then 2
when 5 then 3
when 2 then 1
) - gInitial90DegreeRotations + autoAlignToFace stampData.CurrentParts
ry = math.pi / 2
@ -1543,14 +1534,16 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
if checkHighScalabilityStamp -- check to see if cell is in region, if not we'll skip set
if allowedStampRegion
cellPos = cellCenterToWorld game.Workspace.Terrain, cellPos.X, cellPos.Y, cellPos.Z
if (cellPos.X + 2 > allowedStampRegion.CFrame.p.X + allowedStampRegion.Size.X / 2) or
(cellPos.X - 2 < allowedStampRegion.CFrame.p.X - allowedStampRegion.Size.X / 2) or
(cellPos.Y + 2 > allowedStampRegion.CFrame.p.Y + allowedStampRegion.Size.Y / 2) or
(cellPos.Y - 2 < allowedStampRegion.CFrame.p.Y - allowedStampRegion.Size.Y / 2) or
(cellPos.Z + 2 > allowedStampRegion.CFrame.p.Z + allowedStampRegion.Size.Z / 2) or
(cellPos.Z - 2 < allowedStampRegion.CFrame.p.Z - allowedStampRegion.Size.Z / 2)
with allowedStampRegion
if (cellPos.X + 2 > .CFrame.p.X + .Size.X / 2) or
(cellPos.X - 2 < .CFrame.p.X - .Size.X / 2) or
(cellPos.Y + 2 > .CFrame.p.Y + .Size.Y / 2) or
(cellPos.Y - 2 < .CFrame.p.Y - .Size.Y / 2) or
(cellPos.Z + 2 > .CFrame.p.Z + .Size.Z / 2) or
(cellPos.Z - 2 < .CFrame.p.Z - .Size.Z / 2)
canSetCell = false
canSetCell = false
return canSetCell
false
@ -2071,11 +2064,11 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
setSeatEnabledStatus stampData.CurrentParts, true
with stampData
.TransparencyTable = nil
.ArchivableTable = nil
.MaterialTable = nil
.CanCollideTable = nil
.AnchoredTable = nil
.TransparencyTable = \
.ArchivableTable = \
.MaterialTable = \
.CanCollideTable = \
.AnchoredTable = \
.SurfaceTypeTable = nil
-- ...and tag all inserted models for subsequent origin identification
@ -2103,8 +2096,8 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
-- clear out more data
stampData.DisabledScripts = nil
stampData.Dragger = nil
stampData.DisabledScripts = \
stampData.Dragger = \
stampData.CurrentParts = nil
try
@ -2113,9 +2106,9 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
true
pauseStamper = ->
for i in *mouseCons -- stop the mouse from doing anything
i\disconnect!
i = nil
for i = 1, #mouseCons -- stop the mouse from doing anything
mouseCons[i]\disconnect!
mouseCons[i] = nil
mouseCons = {}
@ -2189,10 +2182,7 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
stampData.ErrorBox = errorBox
clone.Parent = if stampInModel
stampInModel
else
game.Workspace
clone.Parent = stampInModel or game.Workspace
if clone\FindFirstChild "ClusterMaterial", true -- extract all info from vector
clusterMaterial = clone\FindFirstChild "ClusterMaterial", true
@ -2314,9 +2304,9 @@ t.SetupStamperDragger = (modelToStamp, Mouse, StampInModel, AllowedStampRegion,
-- High-Scalability and with the new model orientation setting methods (model\ResetOrientationToIdentity!) [HotThoth]
control.Destroy = -> -- Stops current Stamp operation and destroys control construct
for i in *mouseCons
i\disconnect!
i = nil
for i = 1, #mouseCons
mouseCons[i]\disconnect!
mouseCons[i] = nil
keyCon?\disconnect!

View File

@ -3,7 +3,7 @@ $load $FILE
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil
@ -681,11 +681,8 @@ filterGear = (terms) ->
splitByWhitespace = (text) ->
return if type(text) ~= "string"
terms = {}
for token in string.gmatch text, "[^%s]+"
if string.len(token) > 0
table.insert terms, token
terms
[token for token in string.gmatch text,
"[^%s]+" when string.len(token) > 0]
showSearchGear = (searchTerms) ->
return if not backpack.Gear.Visible
@ -699,7 +696,7 @@ showSearchGear = (searchTerms) ->
else
nil
if not searchTermTable?
if searchTermTable == nil
showEntireGrid!
return
@ -809,7 +806,7 @@ if not backpack.Visible
-- make sure that inventory is listening to gear reparenting
if not characterChildAddedCon? and game.Players.LocalPlayer["Character"]
if characterChildAddedCon == nil and game.Players.LocalPlayer["Character"]
setupCharacterConnections!
if not backpackAddCon

View File

@ -45,7 +45,7 @@ Camera = Game.Workspace.CurrentCamera
-- Heliodex's basic New function (basically a simplified version of melt)
New = (className, name, props) ->
if not props? -- no name was provided
if props == nil -- no name was provided
props = name
name = nil