From 7abbbdc65bd0689ff1ad155bdf51fd8509e18b39 Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Wed, 1 Dec 2021 21:14:55 +0000 Subject: [PATCH 1/8] Communications Centre & Notifications update. !nh and similar aliases exist Notifications look better, function way better, and function using ScrollingFrames. Commiting to only the default theme because of conflicts in *some* other themes (You cannot tween a frames position under the influence of UIListLayout). No screenshot provided. Look in #development. <3 --- MainModule/Client/Core/Variables.lua | 1 + MainModule/Client/UI/Default/CommsCentre.lua | 153 +++++++++++++ MainModule/Client/UI/Default/Hint.rbxmx | 12 + MainModule/Client/UI/Default/Message.rbxmx | 12 + MainModule/Client/UI/Default/Notif.rbxmx | 13 ++ .../Client/UI/Default/Notification.rbxmx | 206 +++++++++--------- .../UI/Default/NotificationHolder.rbxmx | 195 +++++++++++++++++ MainModule/Client/UI/Default/Notify.rbxmx | 12 + 8 files changed, 504 insertions(+), 100 deletions(-) create mode 100644 MainModule/Client/UI/Default/CommsCentre.lua create mode 100644 MainModule/Client/UI/Default/NotificationHolder.rbxmx diff --git a/MainModule/Client/Core/Variables.lua b/MainModule/Client/Core/Variables.lua index 4a1aacc109..7a3195ab4f 100644 --- a/MainModule/Client/Core/Variables.lua +++ b/MainModule/Client/Core/Variables.lua @@ -112,6 +112,7 @@ return function() savedUI = {}; localSounds = {}; ESPObjects = {}; + CommunicationsHistory = {}; LightingSettings = { Ambient = service.Lighting.Ambient; Brightness = service.Lighting.Brightness; diff --git a/MainModule/Client/UI/Default/CommsCentre.lua b/MainModule/Client/UI/Default/CommsCentre.lua new file mode 100644 index 0000000000..7fb3fd1569 --- /dev/null +++ b/MainModule/Client/UI/Default/CommsCentre.lua @@ -0,0 +1,153 @@ + +client = nil +service = nil + +return function(data) + local gTable, window, commslog, layout; + local messageObjs = {}; + + local function newMessage(Type, Title, Message, Icon, Time, Function) + print(Icon) + + local newMsg = commslog:Add("Frame", { + Size = UDim2.new(1, 0, 0, 50); + BackgroundTransparency = 1; + AutomaticSize = "Y"; + Children = { + {ClassName = "Frame"; + Name = "LoggedItem"; + Size = UDim2.new(1, -10, 1, -10); + Position = UDim2.new(0, 5, 0, 5); + BackgroundTransparency = 0.5; + AutomaticSize = "Y"; + Children = { + {ClassName = "ImageButton"; + Name = "Icon"; + Size = UDim2.new(0, 48, 0, 48); + Position = UDim2.new(0, 1, 0, 1); + Image = Icon; + OnClick = Function; + BackgroundTransparency = 1; + }; + + {ClassName = "TextButton"; + Name = "Title"; + Size = UDim2.new(1, -55, 0, 15); + Position = UDim2.new(0, 55, 0, 0); + Text = Title; + TextSize = "14"; + TextXAlignment = "Left"; + BackgroundTransparency = 1; + OnClick = Function; + }; + + {ClassName = "TextButton"; + Name = "Type"; + Size = UDim2.new(1, -55, 0, 15); + Position = UDim2.new(0, 55, 0, 0); + Text = Type; + TextSize = "14"; + TextXAlignment = "Right"; + BackgroundTransparency = 1; + OnClick = Function; + }; + + {ClassName = "TextButton"; + Name = "Time"; + Size = UDim2.new(1, -55, 0, 15); + Position = UDim2.new(0, 55, 0, 15); + Text = Time; + TextSize = "14"; + TextXAlignment = "Right"; + BackgroundTransparency = 1; + OnClick = Function; + }; + + {ClassName = "TextButton"; + Name = "Function"; + Size = UDim2.new(1, -55, 0, 15); + Position = UDim2.new(0, 55, 0, 30); + Text = Function and "Clickable" or "Not clickable"; + TextSize = "14"; + TextXAlignment = "Right"; + BackgroundTransparency = 1; + OnClick = Function; + }; + + {ClassName = "TextButton"; + Name = "Message"; + Size = UDim2.new(1, -55, 0, 10); + Position = UDim2.new(0, 55, 0, 15); + Text = Message; + TextXAlignment = "Left"; + TextYAlignment = "Top"; + AutomaticSize = "Y"; + TextWrapped = true; + TextScaled = false; + RichText = true; + BackgroundTransparency = 1; + OnClick = Function; + }; + } + } + } + }) + + table.insert(messageObjs, newMsg); + + if #messageObjs > 200 then + messageObjs[1]:Destroy(); + table.remove(messageObjs, 1); + end + end + + local result, code = pcall(function() + service.LocalizationService:GetCountryRegionForPlayerAsync(game.Players.LocalPlayer) + end) + + window = client.UI.Make("Window",{ + Name = "CommunicationsCentre"; + Title = (result and code == "US") and "Communications Center" or "Communications Centre"; + Icon = client.MatIcons.Forum; + Size = {500,300}; + OnClose = function() + client.Variables.CommsCentreBindableEvent = nil; + end; + }) + + commslog = window:Add("ScrollingFrame",{ + Size = UDim2.new(1, 0, 1, 0); + Position = UDim2.new(0, 0, 0, 0); + CanvasSize = UDim2.new(0, 0, 0, 0); + BackgroundTransparency = 0.9; + }) + + layout = service.New("UIListLayout", { + Parent = commslog; + FillDirection = "Vertical"; + HorizontalAlignment = "Left"; + VerticalAlignment = "Bottom"; + SortOrder = "LayoutOrder"; + }) + + layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() + commslog.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y) + commslog.CanvasPosition = Vector2.new(0, layout.AbsoluteContentSize.Y) + end) + + if client.Variables.CommunicationsHistory then + for i,v in ipairs(client.Variables.CommunicationsHistory) do + newMessage(v.Type, v.Title, v.Message, v.Icon, v.Time, v.Function); + end + end + + client.Variables.CommsCentreBindableEvent = service.New("BindableEvent"); + + client.Variables.CommsCentreBindableEvent.Event:Connect(function(v) + print(v) + newMessage(v.Type, v.Title, v.Message, v.Icon, v.Time, v.Function) + end) + + gTable = window.gTable + window:Ready(); +end diff --git a/MainModule/Client/UI/Default/Hint.rbxmx b/MainModule/Client/UI/Default/Hint.rbxmx index 56c9590c51..eba2420240 100644 --- a/MainModule/Client/UI/Default/Hint.rbxmx +++ b/MainModule/Client/UI/Default/Hint.rbxmx @@ -217,6 +217,18 @@ return function(data) local str = data.Message local time = data.Time or 15 + local log = { + Type = "Hint"; + Title = "Hint"; + Message = str; + Icon = "rbxassetid://7501175708"; + Time = os.date("%X"); + Function = nil; + } + + table.insert(client.Variables.CommunicationsHistory, log) + if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + --client.UI.Make("HintHolder") local container = client.UI.Get("HintHolder",nil,true) if not container then diff --git a/MainModule/Client/UI/Default/Message.rbxmx b/MainModule/Client/UI/Default/Message.rbxmx index 13175d85cb..7e9dbf4fa7 100644 --- a/MainModule/Client/UI/Default/Message.rbxmx +++ b/MainModule/Client/UI/Default/Message.rbxmx @@ -271,6 +271,18 @@ return function(data) msg.TextStrokeTransparency = 1 frame.BackgroundTransparency = 1 + local log = { + Type = "Full Screen Message"; + Title = title; + Message = message; + Icon = "rbxassetid://7501175708"; + Time = os.date("%X"); + Function = nil; + } + + table.insert(client.Variables.CommunicationsHistory, log) + if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + local blur = service.New("BlurEffect") blur.Enabled = false diff --git a/MainModule/Client/UI/Default/Notif.rbxmx b/MainModule/Client/UI/Default/Notif.rbxmx index 1c23d4be4d..b09c6747cf 100644 --- a/MainModule/Client/UI/Default/Notif.rbxmx +++ b/MainModule/Client/UI/Default/Notif.rbxmx @@ -47,6 +47,19 @@ return function(data) client.UI.Remove("Notif",script.Parent.Parent) + local log = { + Type = "Notif"; + Title = "Notif"; + Message = str; + Icon = "rbxassetid://7501175708"; + Time = os.date("%X"); + Function = nil; + } + + table.insert(client.Variables.CommunicationsHistory, log) + if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + + if str and type(str)=="string" then label.Text = str label.Position = UDim2.new(0, 0, 0, ((topbar and 40) or 0) - 35) diff --git a/MainModule/Client/UI/Default/Notification.rbxmx b/MainModule/Client/UI/Default/Notification.rbxmx index df940d0400..d2e2e0d04b 100644 --- a/MainModule/Client/UI/Default/Notification.rbxmx +++ b/MainModule/Client/UI/Default/Notification.rbxmx @@ -2,7 +2,7 @@ true null nil - + false @@ -36,8 +36,8 @@ 0 0 - 1 - -65 + 0 + 0 null 0 @@ -47,7 +47,7 @@ 1 -5 0 - 60 + 35 0 -1 @@ -56,19 +56,19 @@ true 9 - + Config -1 - + Code - {E696A2BA-1BCA-4FEE-8F31-220766604DE3} + {B359869B-A20E-459D-B091-42AD15D4E219} -1 - + AllowMultiple @@ -236,7 +197,7 @@ end]]> true - + CanKeepAlive @@ -246,7 +207,7 @@ end]]> - + false @@ -300,7 +261,7 @@ end]]> true 1 - + true @@ -381,7 +342,7 @@ end]]> 10 - + true @@ -421,7 +382,7 @@ end]]> 0 5 0 - 26 + 35 false null @@ -432,7 +393,7 @@ end]]> 1 -10 - 0.519999981 + 0 0 0 @@ -445,7 +406,7 @@ end]]> 1 1 - true + false 20 0 @@ -461,18 +422,8 @@ end]]> true 10 - - - - 20 - 12 - UITextSizeConstraint - -1 - - - - + false @@ -519,7 +470,7 @@ end]]> null 1 - -25 + -60 0 15 @@ -539,7 +490,7 @@ end]]> 0.352941185 0.352941185 - 0.800000012 + 1 0 0 true @@ -549,7 +500,7 @@ end]]> 10 - + false @@ -626,7 +577,7 @@ end]]> 10 - + false @@ -714,6 +665,61 @@ end]]> 10 + + + false + + 0 + 0 + + + true + 0 + + 1 + 1 + 1 + + 0 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 1 + false + false + 0 + Frame + null + null + null + null + + 0 + 5 + 0 + 30 + + null + 0 + false + null + + 1 + -10 + 0 + 1 + + 0 + -1 + 0 + + true + 1 + + - + \ No newline at end of file diff --git a/MainModule/Client/UI/Default/NotificationHolder.rbxmx b/MainModule/Client/UI/Default/NotificationHolder.rbxmx new file mode 100644 index 0000000000..dc74b92f0b --- /dev/null +++ b/MainModule/Client/UI/Default/NotificationHolder.rbxmx @@ -0,0 +1,195 @@ + + true + null + nil + + + + true + 0 + true + false + NotificationHolder + true + null + -1 + + 1 + + + + + Config + -1 + + + + + + + Code + {871328FA-5293-4B38-9242-013510D79BEF} + ScrollingFrame.AbsoluteCanvasSize.Y - ScrollingFrame.AbsoluteWindowSize.Y then + ScrollingFrame.CanvasPosition = ScrollingFrame.CanvasPosition + child.AbsoluteSize + Vector2.new(0,5) + end + end) + + ScrollingFrame.ChildRemoved:Connect(function(child) + currentChildren -= 1 + if currentChildren == 0 then + gui:Destroy() + end + end) + gTable:Ready() +end]]> + -1 + + + + + + + AllowMultiple + -1 + + false + + + + + + CanKeepAlive + -1 + + true + + + + + + true + + 0 + 0 + + + true + 2 + 0 + + 1 + 1 + 1 + + 1 + + 0.105882362 + 0.164705887 + 0.207843155 + + 0 + 0 + rbxasset://textures/ui/Scroll/scroll-bottom.png + + 0 + 0 + + + 0 + 0 + 0 + 0 + + true + false + 0 + 0 + 0 + rbxasset://textures/ui/Scroll/scroll-middle.png + ScrollingFrame + null + null + null + null + + 1 + -255 + 1 + -350 + + null + 0 + + 0 + 0 + 0 + + 0 + 6 + 2 + true + true + null + + 0 + 250 + 0 + 300 + + 0 + -1 + + rbxasset://textures/ui/Scroll/scroll-top.png + 2 + 0 + true + 1 + + + + + 1 + 1 + UIListLayout + + 0 + 5 + + 2 + -1 + + 2 + + + + + \ No newline at end of file diff --git a/MainModule/Client/UI/Default/Notify.rbxmx b/MainModule/Client/UI/Default/Notify.rbxmx index 1f0342b231..a1b5083ec1 100644 --- a/MainModule/Client/UI/Default/Notify.rbxmx +++ b/MainModule/Client/UI/Default/Notify.rbxmx @@ -64,6 +64,18 @@ return function(data) msg.TextStrokeTransparency = 1 frame.BackgroundTransparency = 1 + local log = { + Type = "Small Screen Message"; + Title = title; + Message = message; + Icon = "rbxassetid://7501175708"; + Time = os.date("%X"); + Function = nil; + } + + table.insert(client.Variables.CommunicationsHistory, log) + if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + local fadeSteps = 10 local blurSize = 10 local textFade = 0.1 From ef3263b4b343e1f486dfbb5abafff2bb3d6013ff Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:31:36 +0000 Subject: [PATCH 2/8] Update CommsCentre.lua --- MainModule/Client/UI/Default/CommsCentre.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MainModule/Client/UI/Default/CommsCentre.lua b/MainModule/Client/UI/Default/CommsCentre.lua index 7fb3fd1569..5d93a61cd5 100644 --- a/MainModule/Client/UI/Default/CommsCentre.lua +++ b/MainModule/Client/UI/Default/CommsCentre.lua @@ -141,10 +141,7 @@ return function(data) end end - client.Variables.CommsCentreBindableEvent = service.New("BindableEvent"); - - client.Variables.CommsCentreBindableEvent.Event:Connect(function(v) - print(v) + service.HookEvent('ToggleConsole', function() newMessage(v.Type, v.Title, v.Message, v.Icon, v.Time, v.Function) end) From bf2b5e0784007156a9706e29f2b3b31194ed8e4e Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:34:02 +0000 Subject: [PATCH 3/8] Update Hint.rbxmx --- MainModule/Client/UI/Default/Hint.rbxmx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MainModule/Client/UI/Default/Hint.rbxmx b/MainModule/Client/UI/Default/Hint.rbxmx index eba2420240..50ab0b5bb7 100644 --- a/MainModule/Client/UI/Default/Hint.rbxmx +++ b/MainModule/Client/UI/Default/Hint.rbxmx @@ -227,7 +227,7 @@ return function(data) } table.insert(client.Variables.CommunicationsHistory, log) - if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + service.Events.CommsCentre:fire(log) --client.UI.Make("HintHolder") local container = client.UI.Get("HintHolder",nil,true) @@ -333,4 +333,4 @@ end]]> - \ No newline at end of file + From 32c39a52a3bfc406a08eaa832e1c0b233edfc658 Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:34:27 +0000 Subject: [PATCH 4/8] Update CommsCentre.lua --- MainModule/Client/UI/Default/CommsCentre.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MainModule/Client/UI/Default/CommsCentre.lua b/MainModule/Client/UI/Default/CommsCentre.lua index 5d93a61cd5..590cdc539c 100644 --- a/MainModule/Client/UI/Default/CommsCentre.lua +++ b/MainModule/Client/UI/Default/CommsCentre.lua @@ -141,7 +141,7 @@ return function(data) end end - service.HookEvent('ToggleConsole', function() + service.HookEvent('CommsCentre', function(v) newMessage(v.Type, v.Title, v.Message, v.Icon, v.Time, v.Function) end) From 69f6e1fef84b50f8376c809851d3af0c0ffa2f3d Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:34:57 +0000 Subject: [PATCH 5/8] Update Message.rbxmx --- MainModule/Client/UI/Default/Message.rbxmx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MainModule/Client/UI/Default/Message.rbxmx b/MainModule/Client/UI/Default/Message.rbxmx index 7e9dbf4fa7..8711ab954d 100644 --- a/MainModule/Client/UI/Default/Message.rbxmx +++ b/MainModule/Client/UI/Default/Message.rbxmx @@ -281,7 +281,7 @@ return function(data) } table.insert(client.Variables.CommunicationsHistory, log) - if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + service.Events.CommsCentre:fire(log) local blur = service.New("BlurEffect") From 0b2deb8f98059abe99b557d13eb0485741bb6b37 Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:35:12 +0000 Subject: [PATCH 6/8] Update Notif.rbxmx --- MainModule/Client/UI/Default/Notif.rbxmx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MainModule/Client/UI/Default/Notif.rbxmx b/MainModule/Client/UI/Default/Notif.rbxmx index b09c6747cf..2567915aac 100644 --- a/MainModule/Client/UI/Default/Notif.rbxmx +++ b/MainModule/Client/UI/Default/Notif.rbxmx @@ -57,7 +57,7 @@ return function(data) } table.insert(client.Variables.CommunicationsHistory, log) - if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + service.Events.CommsCentre:fire(log) if str and type(str)=="string" then @@ -169,4 +169,4 @@ end]]> - \ No newline at end of file + From 33fc2493f277b530cece9b04606bae691bc47e51 Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:35:49 +0000 Subject: [PATCH 7/8] Update Notification.rbxmx --- MainModule/Client/UI/Default/Notification.rbxmx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MainModule/Client/UI/Default/Notification.rbxmx b/MainModule/Client/UI/Default/Notification.rbxmx index d2e2e0d04b..bf72b481a2 100644 --- a/MainModule/Client/UI/Default/Notification.rbxmx +++ b/MainModule/Client/UI/Default/Notification.rbxmx @@ -135,7 +135,7 @@ return function(data) } table.insert(client.Variables.CommunicationsHistory, log) - if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + service.Events.CommsCentre:fire(log) main.MouseButton1Click:Connect(function() if frame and frame.Parent then @@ -722,4 +722,4 @@ end]]> - \ No newline at end of file + From 1e0069e293f6c0a0dc848735d3f3668689ddd551 Mon Sep 17 00:00:00 2001 From: P3tray <31691973+P3tray@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:36:37 +0000 Subject: [PATCH 8/8] Update Notify.rbxmx --- MainModule/Client/UI/Default/Notify.rbxmx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MainModule/Client/UI/Default/Notify.rbxmx b/MainModule/Client/UI/Default/Notify.rbxmx index a1b5083ec1..2af7bbcc4b 100644 --- a/MainModule/Client/UI/Default/Notify.rbxmx +++ b/MainModule/Client/UI/Default/Notify.rbxmx @@ -74,7 +74,7 @@ return function(data) } table.insert(client.Variables.CommunicationsHistory, log) - if client.Variables.CommsCentreBindableEvent then client.Variables.CommsCentreBindableEvent:Fire(log) end + service.Events.CommsCentre:fire(log) local fadeSteps = 10 local blurSize = 10 @@ -432,4 +432,4 @@ end]]> - \ No newline at end of file +