From ef74699fe8c1110689aff062564b52f04d806ca2 Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Sun, 3 Mar 2024 12:05:49 +0000 Subject: [PATCH] Formatting improvement etc --- luau/60595695.luau | 35 ++++++++++++++++++++++------------- luau/97188756.luau | 8 ++++---- luau/join.luau | 1 - 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/luau/60595695.luau b/luau/60595695.luau index c58ef64..8457295 100644 --- a/luau/60595695.luau +++ b/luau/60595695.luau @@ -5,23 +5,32 @@ print "[Mercury]: Loaded corescript 60595695" -- This script is used to register RbxLua libraries on game servers, so game scripts have -- access to all of the libraries (otherwise only local scripts do) -local sc = game:GetService "ScriptContext" -local tries = 0 +local ScriptContext -while not sc and tries < 3 do - tries += 1 - sc = game:GetService "ScriptContext" +for i = 1, 4 do + ScriptContext = game:GetService "ScriptContext" + if ScriptContext then + break + end wait(0.2) end -if sc then - sc:RegisterLibrary("Libraries/RbxFusion", "10000001") - sc:RegisterLibrary("Libraries/RbxRed", "10000002") - sc:RegisterLibrary("Libraries/RbxGui", "45284430") - sc:RegisterLibrary("Libraries/RbxGear", "45374389") - sc:RegisterLibrary("Libraries/RbxUtility", "60595411") - sc:RegisterLibrary("Libraries/RbxStamper", "73157242") - sc:LibraryRegistrationComplete() +local function RegisterLibraries(t: { [string]: number }) + for name, id in pairs(t) do + ScriptContext:RegisterLibrary(`Libraries/Rbx{name}`, tostring(id)) + end +end + +if ScriptContext then + RegisterLibraries { + Fusion = 10000001, + Red = 10000002, + Gui = 45284430, + Gear = 45374389, + Utility = 60595411, + Stamper = 73157242, + } + ScriptContext:LibraryRegistrationComplete() else print "failed to find script context, libraries did not load" end diff --git a/luau/97188756.luau b/luau/97188756.luau index f1c9d5f..420c4fc 100644 --- a/luau/97188756.luau +++ b/luau/97188756.luau @@ -1148,8 +1148,8 @@ function Chat:UpdateChat(cPlayer, message) end end -function Chat:RecalculateSpacing() - --[[for i = 1, #self.MessageQueue do +-- function Chat:RecalculateSpacing() +--[[for i = 1, #self.MessageQueue do local pLabel = self.MessageQueue[i]['Player'] local mLabel = self.MessageQueue[i]['Message'] @@ -1166,7 +1166,7 @@ function Chat:RecalculateSpacing() Chat:UpdateQueue(self.MessageQueue[i], diff) end ]] -end +-- end -- function Chat:ApplyFilter(str) -- --[[for _, word in pair(self.Filter_List) do @@ -1316,7 +1316,7 @@ function Chat:ScreenSizeChanged() while self.Frame.AbsoluteSize.Y > 120 do self.Frame.Size -= UDim2.new(0, 0, 0.005, 0) end - Chat:RecalculateSpacing() + -- Chat:RecalculateSpacing() end function Chat:FindButtonTree(scButton, rootList) diff --git a/luau/join.luau b/luau/join.luau index 58729ee..a94d201 100644 --- a/luau/join.luau +++ b/luau/join.luau @@ -93,7 +93,6 @@ end) -- functions --------------------------------------- local loadingState = 0 local function setLoadingMessage(message: string) - -- todo: animated "..." local dots = "" loadingState += 1 local currentLoadingState = loadingState