@quenty/chatproviderservice 9.18.1-canary.520.f23602e.0 → 9.19.0-canary.4db9577.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* Create properties from metadata instead of caching ([f23602e](https://github.com/Quenty/NevermoreEngine/commit/f23602e73a41ce4135ca18bc4ab7f01e935b2cab))
|
|
6
|
+
# [9.19.0-canary.4db9577.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/chatproviderservice@9.18.0...@quenty/chatproviderservice@9.19.0-canary.4db9577.0) (2024-11-14)
|
|
12
7
|
|
|
13
8
|
|
|
14
9
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/chatproviderservice",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.19.0-canary.4db9577.0",
|
|
4
4
|
"description": "Provide wrapper around chat system to allow tags to be set",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "4db95775860f06b6e4cd9793c6a0e6457a27a0e1"
|
|
59
59
|
}
|
|
@@ -19,6 +19,8 @@ function ChatProviderServiceClient:Init(serviceBag)
|
|
|
19
19
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
20
20
|
self._maid = Maid.new()
|
|
21
21
|
|
|
22
|
+
self._systemMessageColors = {}
|
|
23
|
+
|
|
22
24
|
-- State
|
|
23
25
|
self.MessageIncoming = self._maid:Add(Signal.new())
|
|
24
26
|
|
|
@@ -38,10 +40,10 @@ function ChatProviderServiceClient:Start()
|
|
|
38
40
|
|
|
39
41
|
local metadata = textChatMessage.Metadata
|
|
40
42
|
if metadata then
|
|
41
|
-
local
|
|
42
|
-
if
|
|
43
|
+
local systemColorProperties = self._systemMessageColors[metadata]
|
|
44
|
+
if systemColorProperties then
|
|
43
45
|
local overrideProperties = Instance.new("TextChatMessageProperties")
|
|
44
|
-
overrideProperties.Text =
|
|
46
|
+
overrideProperties.Text = string.format(systemColorProperties.Text, textChatMessage.Text)
|
|
45
47
|
|
|
46
48
|
return overrideProperties
|
|
47
49
|
end
|
|
@@ -64,11 +66,25 @@ function ChatProviderServiceClient:Start()
|
|
|
64
66
|
end
|
|
65
67
|
end
|
|
66
68
|
|
|
67
|
-
function ChatProviderServiceClient:SendSystemMessage(channel
|
|
69
|
+
function ChatProviderServiceClient:SendSystemMessage(channel, message, color)
|
|
70
|
+
if not message then
|
|
71
|
+
return
|
|
72
|
+
end
|
|
73
|
+
|
|
68
74
|
assert(typeof(channel) == "Instance" and channel.ClassName == "TextChannel", "[ChatProviderServiceClient.SendSystemMessage] - Bad channel")
|
|
69
|
-
assert(typeof(message) == "string", "[ChatProviderServiceClient.SendSystemMessage] - Bad message")
|
|
70
75
|
assert(typeof(color) == "Color3" or color == nil, "[ChatProviderServiceClient.SendSystemMessage] - Bad color")
|
|
71
76
|
|
|
77
|
+
if color then
|
|
78
|
+
local hex = color:ToHex()
|
|
79
|
+
|
|
80
|
+
if not self._systemMessageColors[hex] then
|
|
81
|
+
local overrideProperties = Instance.new("TextChatMessageProperties")
|
|
82
|
+
overrideProperties.Text = `<font color="#{hex}">%s</font>`
|
|
83
|
+
|
|
84
|
+
self._systemMessageColors[hex] = overrideProperties
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
72
88
|
channel:DisplaySystemMessage(message, color and color:ToHex())
|
|
73
89
|
end
|
|
74
90
|
|