@quenty/chatproviderservice 9.25.3-canary.550.afa1b3b.0 → 9.25.4-canary.11a5dcf.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 +12 -1
- package/package.json +27 -27
- package/src/Client/Binders/ChatTagClient.lua +12 -3
- package/src/Client/Binders/HasChatTagsClient.lua +3 -3
- package/src/Client/ChatProviderServiceClient.lua +9 -5
- package/src/Client/Commands/ChatProviderCommandServiceClient.lua +5 -5
- package/src/Server/Binders/ChatTag.lua +8 -8
- package/src/Server/Binders/HasChatTags.lua +4 -4
- package/src/Server/ChatProviderService.lua +5 -5
- package/src/Server/Commands/ChatProviderCommandService.lua +63 -56
- package/src/Shared/Binders/ChatTagBase.lua +4 -4
- package/src/Shared/Binders/HasChatTagsBase.lua +17 -15
- package/src/Shared/ChatProviderTranslator.lua +4 -4
- package/src/Shared/ChatTagConstants.lua +7 -7
- package/src/Shared/Commands/ChatTagCmdrUtils.lua +3 -3
- package/src/Shared/Data/ChatTagDataUtils.lua +1 -1
- package/src/Shared/HasChatTagsConstants.lua +2 -2
- package/src/Shared/TextChannelUtils.lua +1 -1
- package/test/scripts/Client/ClientMain.client.lua +1 -1
- package/test/scripts/Server/ServerMain.server.lua +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
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
|
-
## [9.25.
|
|
6
|
+
## [9.25.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/chatproviderservice@9.25.3...@quenty/chatproviderservice@9.25.4-canary.11a5dcf.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [9.25.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/chatproviderservice@9.25.2...@quenty/chatproviderservice@9.25.3) (2025-04-10)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/chatproviderservice
|
|
9
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/chatproviderservice",
|
|
3
|
-
"version": "9.25.
|
|
3
|
+
"version": "9.25.4-canary.11a5dcf.0",
|
|
4
4
|
"description": "Provide wrapper around chat system to allow tags to be set",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,35 +25,35 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/attributeutils": "14.17.
|
|
29
|
-
"@quenty/baseobject": "10.8.
|
|
30
|
-
"@quenty/binder": "14.19.
|
|
31
|
-
"@quenty/brio": "14.17.
|
|
32
|
-
"@quenty/clienttranslator": "14.19.
|
|
33
|
-
"@quenty/cmdrservice": "13.22.
|
|
34
|
-
"@quenty/color3utils": "11.18.
|
|
35
|
-
"@quenty/datastore": "13.20.
|
|
36
|
-
"@quenty/instanceutils": "13.17.
|
|
37
|
-
"@quenty/loader": "10.8.
|
|
38
|
-
"@quenty/localizedtextutils": "12.17.
|
|
39
|
-
"@quenty/maid": "3.4.
|
|
40
|
-
"@quenty/permissionprovider": "14.19.
|
|
41
|
-
"@quenty/playerbinder": "14.19.
|
|
42
|
-
"@quenty/playerutils": "8.17.
|
|
43
|
-
"@quenty/preferredparentutils": "4.3.
|
|
44
|
-
"@quenty/promise": "10.10.
|
|
45
|
-
"@quenty/remoting": "12.18.
|
|
46
|
-
"@quenty/richtext": "1.3.
|
|
47
|
-
"@quenty/rx": "13.17.
|
|
48
|
-
"@quenty/rxbinderutils": "14.19.
|
|
49
|
-
"@quenty/servicebag": "11.11.
|
|
50
|
-
"@quenty/signal": "7.10.
|
|
28
|
+
"@quenty/attributeutils": "14.17.4-canary.11a5dcf.0",
|
|
29
|
+
"@quenty/baseobject": "10.8.4-canary.11a5dcf.0",
|
|
30
|
+
"@quenty/binder": "14.19.4-canary.11a5dcf.0",
|
|
31
|
+
"@quenty/brio": "14.17.4-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/clienttranslator": "14.19.4-canary.11a5dcf.0",
|
|
33
|
+
"@quenty/cmdrservice": "13.22.4-canary.11a5dcf.0",
|
|
34
|
+
"@quenty/color3utils": "11.18.4-canary.11a5dcf.0",
|
|
35
|
+
"@quenty/datastore": "13.20.4-canary.11a5dcf.0",
|
|
36
|
+
"@quenty/instanceutils": "13.17.4-canary.11a5dcf.0",
|
|
37
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
38
|
+
"@quenty/localizedtextutils": "12.17.4-canary.11a5dcf.0",
|
|
39
|
+
"@quenty/maid": "3.4.4-canary.11a5dcf.0",
|
|
40
|
+
"@quenty/permissionprovider": "14.19.4-canary.11a5dcf.0",
|
|
41
|
+
"@quenty/playerbinder": "14.19.4-canary.11a5dcf.0",
|
|
42
|
+
"@quenty/playerutils": "8.17.4-canary.11a5dcf.0",
|
|
43
|
+
"@quenty/preferredparentutils": "4.3.3-canary.11a5dcf.0",
|
|
44
|
+
"@quenty/promise": "10.10.5-canary.11a5dcf.0",
|
|
45
|
+
"@quenty/remoting": "12.18.4-canary.11a5dcf.0",
|
|
46
|
+
"@quenty/richtext": "1.3.3-canary.11a5dcf.0",
|
|
47
|
+
"@quenty/rx": "13.17.4-canary.11a5dcf.0",
|
|
48
|
+
"@quenty/rxbinderutils": "14.19.4-canary.11a5dcf.0",
|
|
49
|
+
"@quenty/servicebag": "11.11.5-canary.11a5dcf.0",
|
|
50
|
+
"@quenty/signal": "7.10.4-canary.11a5dcf.0",
|
|
51
51
|
"@quenty/string": "3.3.3",
|
|
52
|
-
"@quenty/table": "3.7.
|
|
53
|
-
"@quenty/valueobject": "13.17.
|
|
52
|
+
"@quenty/table": "3.7.5-canary.11a5dcf.0",
|
|
53
|
+
"@quenty/valueobject": "13.17.4-canary.11a5dcf.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
59
59
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class ChatTagClient
|
|
3
4
|
]=]
|
|
@@ -6,17 +7,25 @@ local require = require(script.Parent.loader).load(script)
|
|
|
6
7
|
|
|
7
8
|
local Binder = require("Binder")
|
|
8
9
|
local ChatTagBase = require("ChatTagBase")
|
|
10
|
+
local ServiceBag = require("ServiceBag")
|
|
9
11
|
|
|
10
12
|
local ChatTagClient = setmetatable({}, ChatTagBase)
|
|
11
13
|
ChatTagClient.ClassName = "ChatTagClient"
|
|
12
14
|
ChatTagClient.__index = ChatTagClient
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
export type ChatTagClient = typeof(setmetatable(
|
|
17
|
+
{} :: {
|
|
18
|
+
_serviceBag: ServiceBag.ServiceBag,
|
|
19
|
+
},
|
|
20
|
+
{} :: typeof({ __index = ChatTagClient })
|
|
21
|
+
)) & ChatTagBase.ChatTagBase
|
|
22
|
+
|
|
23
|
+
function ChatTagClient.new(folder: Folder, serviceBag: ServiceBag.ServiceBag): ChatTagClient
|
|
24
|
+
local self: ChatTagClient = setmetatable(ChatTagBase.new(folder) :: any, ChatTagClient)
|
|
16
25
|
|
|
17
26
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
18
27
|
|
|
19
28
|
return self
|
|
20
29
|
end
|
|
21
30
|
|
|
22
|
-
return Binder.new("ChatTag", ChatTagClient)
|
|
31
|
+
return Binder.new("ChatTag", ChatTagClient :: any) :: Binder.Binder<ChatTagClient>
|
|
@@ -11,12 +11,13 @@ local Color3Utils = require("Color3Utils")
|
|
|
11
11
|
local HasChatTagsBase = require("HasChatTagsBase")
|
|
12
12
|
local LocalizedTextUtils = require("LocalizedTextUtils")
|
|
13
13
|
local RichTextUtils = require("RichTextUtils")
|
|
14
|
+
local ServiceBag = require("ServiceBag")
|
|
14
15
|
|
|
15
16
|
local HasChatTagsClient = setmetatable({}, HasChatTagsBase)
|
|
16
17
|
HasChatTagsClient.ClassName = "HasChatTagsClient"
|
|
17
18
|
HasChatTagsClient.__index = HasChatTagsClient
|
|
18
19
|
|
|
19
|
-
function HasChatTagsClient.new(player: Player, serviceBag)
|
|
20
|
+
function HasChatTagsClient.new(player: Player, serviceBag: ServiceBag.ServiceBag)
|
|
20
21
|
local self = setmetatable(HasChatTagsBase.new(player), HasChatTagsClient)
|
|
21
22
|
|
|
22
23
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
@@ -61,5 +62,4 @@ function HasChatTagsClient:GetAsRichText(): string?
|
|
|
61
62
|
return output
|
|
62
63
|
end
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
return Binder.new("HasChatTags", HasChatTagsClient)
|
|
65
|
+
return Binder.new("HasChatTags", HasChatTagsClient)
|
|
@@ -9,15 +9,15 @@ local Players = game:GetService("Players")
|
|
|
9
9
|
local TextChatService = game:GetService("TextChatService")
|
|
10
10
|
|
|
11
11
|
local Maid = require("Maid")
|
|
12
|
+
local ServiceBag = require("ServiceBag")
|
|
12
13
|
local Signal = require("Signal")
|
|
13
14
|
local String = require("String")
|
|
14
15
|
local TextChannelUtils = require("TextChannelUtils")
|
|
15
|
-
local _ServiceBag = require("ServiceBag")
|
|
16
16
|
|
|
17
17
|
local ChatProviderServiceClient = {}
|
|
18
18
|
ChatProviderServiceClient.ServiceName = "ChatProviderServiceClient"
|
|
19
19
|
|
|
20
|
-
function ChatProviderServiceClient:Init(serviceBag:
|
|
20
|
+
function ChatProviderServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
21
21
|
assert(not self._serviceBag, "Already initialized")
|
|
22
22
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
23
23
|
self._maid = Maid.new()
|
|
@@ -60,7 +60,7 @@ function ChatProviderServiceClient:Start()
|
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
local textSource =
|
|
63
|
+
local textSource = textChatMessage.TextSource
|
|
64
64
|
if not textSource then
|
|
65
65
|
return
|
|
66
66
|
end
|
|
@@ -84,7 +84,11 @@ end
|
|
|
84
84
|
@param encodedMessageData string
|
|
85
85
|
@param channel TextChannel?
|
|
86
86
|
]=]
|
|
87
|
-
function ChatProviderServiceClient:SendSystemMessage(
|
|
87
|
+
function ChatProviderServiceClient:SendSystemMessage(
|
|
88
|
+
message: string,
|
|
89
|
+
encodedMessageData: string?,
|
|
90
|
+
channel: TextChannel?
|
|
91
|
+
)
|
|
88
92
|
assert(typeof(message) == "string", "[ChatProviderServiceClient.SendSystemMessage] - Bad message")
|
|
89
93
|
|
|
90
94
|
if not channel then
|
|
@@ -118,4 +122,4 @@ function ChatProviderServiceClient:Destroy()
|
|
|
118
122
|
self._maid:DoCleaning()
|
|
119
123
|
end
|
|
120
124
|
|
|
121
|
-
return ChatProviderServiceClient
|
|
125
|
+
return ChatProviderServiceClient
|
|
@@ -7,15 +7,15 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
local Players = game:GetService("Players")
|
|
8
8
|
|
|
9
9
|
local ChatTagCmdrUtils = require("ChatTagCmdrUtils")
|
|
10
|
-
local Set = require("Set")
|
|
11
10
|
local Maid = require("Maid")
|
|
11
|
+
local ServiceBag = require("ServiceBag")
|
|
12
|
+
local Set = require("Set")
|
|
12
13
|
local String = require("String")
|
|
13
|
-
local _ServiceBag = require("ServiceBag")
|
|
14
14
|
|
|
15
15
|
local ChatProviderCommandServiceClient = {}
|
|
16
16
|
ChatProviderCommandServiceClient.ServiceName = "ChatProviderCommandServiceClient"
|
|
17
17
|
|
|
18
|
-
function ChatProviderCommandServiceClient:Init(serviceBag:
|
|
18
|
+
function ChatProviderCommandServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
19
19
|
assert(not self._serviceBag, "Already initialized")
|
|
20
20
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
21
21
|
self._maid = Maid.new()
|
|
@@ -39,7 +39,7 @@ function ChatProviderCommandServiceClient:_registerChatCommand(cmdr)
|
|
|
39
39
|
return
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
if String.startsWith(textChatMessage.Text, "/cmdr")
|
|
42
|
+
if String.startsWith(textChatMessage.Text, "/cmdr") then
|
|
43
43
|
cmdr:Show()
|
|
44
44
|
end
|
|
45
45
|
end))
|
|
@@ -54,4 +54,4 @@ function ChatProviderCommandServiceClient:GetChatTagKeyList()
|
|
|
54
54
|
return Set.toList(tagSet)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
return ChatProviderCommandServiceClient
|
|
57
|
+
return ChatProviderCommandServiceClient
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local ChatTagBase = require("ChatTagBase")
|
|
8
7
|
local Binder = require("Binder")
|
|
8
|
+
local ChatTagBase = require("ChatTagBase")
|
|
9
9
|
|
|
10
10
|
local ChatTag = setmetatable({}, ChatTagBase)
|
|
11
11
|
ChatTag.ClassName = "ChatTag"
|
|
@@ -37,18 +37,18 @@ function ChatTag:_loadData()
|
|
|
37
37
|
return
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
self._maid
|
|
40
|
+
self._maid
|
|
41
|
+
:GivePromise(self._playerDataStoreService:PromiseDataStore(player))
|
|
41
42
|
:Then(function(dataStore)
|
|
42
43
|
return dataStore:GetSubStore("chatTags"):GetSubStore(tagKey)
|
|
43
44
|
end)
|
|
44
45
|
:Then(function(dataStore)
|
|
45
|
-
return dataStore:Load("UserDisabled", false)
|
|
46
|
-
|
|
47
|
-
self.UserDisabled.Value = userDisabled
|
|
46
|
+
return dataStore:Load("UserDisabled", false):Then(function(userDisabled)
|
|
47
|
+
self.UserDisabled.Value = userDisabled
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
self._maid:GiveTask(dataStore:StoreOnValueChange("UserDisabled", self.UserDisabled))
|
|
50
|
+
end)
|
|
51
51
|
end)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
return Binder.new("ChatTag", ChatTag)
|
|
54
|
+
return Binder.new("ChatTag", ChatTag)
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
+
local BinderUtils = require("BinderUtils")
|
|
7
8
|
local ChatTagConstants = require("ChatTagConstants")
|
|
8
9
|
local ChatTagDataUtils = require("ChatTagDataUtils")
|
|
9
10
|
local HasChatTagsBase = require("HasChatTagsBase")
|
|
10
11
|
local HasChatTagsConstants = require("HasChatTagsConstants")
|
|
11
12
|
local LocalizedTextUtils = require("LocalizedTextUtils")
|
|
12
13
|
local PlayerBinder = require("PlayerBinder")
|
|
14
|
+
local ServiceBag = require("ServiceBag")
|
|
13
15
|
local String = require("String")
|
|
14
|
-
local BinderUtils = require("BinderUtils")
|
|
15
|
-
local _ServiceBag = require("ServiceBag")
|
|
16
16
|
|
|
17
17
|
local HasChatTags = setmetatable({}, HasChatTagsBase)
|
|
18
18
|
HasChatTags.ClassName = "HasChatTags"
|
|
@@ -26,7 +26,7 @@ export type HasChatTags = typeof(setmetatable(
|
|
|
26
26
|
{} :: typeof({ __index = HasChatTags })
|
|
27
27
|
)) & HasChatTagsBase.HasChatTagsBase
|
|
28
28
|
|
|
29
|
-
function HasChatTags.new(player: Player, serviceBag:
|
|
29
|
+
function HasChatTags.new(player: Player, serviceBag: ServiceBag.ServiceBag): HasChatTags
|
|
30
30
|
local self: HasChatTags = setmetatable(HasChatTagsBase.new(player) :: any, HasChatTags)
|
|
31
31
|
|
|
32
32
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
@@ -101,4 +101,4 @@ function HasChatTags:ClearTags()
|
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
return PlayerBinder.new("HasChatTags", HasChatTags)
|
|
104
|
+
return PlayerBinder.new("HasChatTags", HasChatTags)
|
|
@@ -8,23 +8,23 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local ServerScriptService = game:GetService("ServerScriptService")
|
|
9
9
|
local TextChatService = game:GetService("TextChatService")
|
|
10
10
|
|
|
11
|
+
local Brio = require("Brio")
|
|
11
12
|
local ChatTagDataUtils = require("ChatTagDataUtils")
|
|
12
13
|
local LocalizedTextUtils = require("LocalizedTextUtils")
|
|
13
14
|
local Maid = require("Maid")
|
|
15
|
+
local Observable = require("Observable")
|
|
14
16
|
local PermissionLevel = require("PermissionLevel")
|
|
15
17
|
local PreferredParentUtils = require("PreferredParentUtils")
|
|
16
18
|
local Promise = require("Promise")
|
|
17
19
|
local Rx = require("Rx")
|
|
18
20
|
local RxBrioUtils = require("RxBrioUtils")
|
|
21
|
+
local ServiceBag = require("ServiceBag")
|
|
19
22
|
local Signal = require("Signal")
|
|
20
|
-
local _Observable = require("Observable")
|
|
21
|
-
local _Brio = require("Brio")
|
|
22
|
-
local _ServiceBag = require("ServiceBag")
|
|
23
23
|
|
|
24
24
|
local ChatProviderService = {}
|
|
25
25
|
ChatProviderService.ServiceName = "ChatProviderService"
|
|
26
26
|
|
|
27
|
-
function ChatProviderService:Init(serviceBag:
|
|
27
|
+
function ChatProviderService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
28
28
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
29
29
|
self._maid = Maid.new()
|
|
30
30
|
|
|
@@ -118,7 +118,7 @@ function ChatProviderService:SetAdminTag(chatTagData: ChatTagDataUtils.ChatTagDa
|
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
function ChatProviderService:_addObservablePlayerTag(
|
|
121
|
-
observePlayersBrio:
|
|
121
|
+
observePlayersBrio: Observable.Observable<Brio.Brio<Player>>,
|
|
122
122
|
chatTagData: ChatTagDataUtils.ChatTagData
|
|
123
123
|
)
|
|
124
124
|
assert(ChatTagDataUtils.isChatTagData(chatTagData), "Bad chatTagData")
|
|
@@ -8,15 +8,15 @@ local Players = game:GetService("Players")
|
|
|
8
8
|
|
|
9
9
|
local ChatTagCmdrUtils = require("ChatTagCmdrUtils")
|
|
10
10
|
local ChatTagDataUtils = require("ChatTagDataUtils")
|
|
11
|
+
local Maid = require("Maid")
|
|
11
12
|
local PlayerUtils = require("PlayerUtils")
|
|
13
|
+
local ServiceBag = require("ServiceBag")
|
|
12
14
|
local Set = require("Set")
|
|
13
|
-
local Maid = require("Maid")
|
|
14
|
-
local _ServiceBag = require("ServiceBag")
|
|
15
15
|
|
|
16
16
|
local ChatProviderCommandService = {}
|
|
17
17
|
ChatProviderCommandService.ServiceName = "ChatProviderCommandService"
|
|
18
18
|
|
|
19
|
-
function ChatProviderCommandService:Init(serviceBag:
|
|
19
|
+
function ChatProviderCommandService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
20
20
|
assert(not self._serviceBag, "Already initialized")
|
|
21
21
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
22
22
|
self._maid = Maid.new()
|
|
@@ -58,7 +58,6 @@ function ChatProviderCommandService:_createActivateChatCommand()
|
|
|
58
58
|
self._chatProviderService:AddChatCommand(command)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
|
|
62
61
|
function ChatProviderCommandService:GetChatTagKeyList()
|
|
63
62
|
local tagSet = {}
|
|
64
63
|
for chatTag, _ in pairs(self._chatTagBinder:GetAllSet()) do
|
|
@@ -75,58 +74,61 @@ function ChatProviderCommandService:_registerCommands()
|
|
|
75
74
|
end)
|
|
76
75
|
|
|
77
76
|
self._cmdrService:RegisterCommand({
|
|
78
|
-
Name = "add-chat-tag"
|
|
79
|
-
Aliases = {
|
|
80
|
-
Description = "Adds a tag to a player"
|
|
81
|
-
Group = "ChatTags"
|
|
77
|
+
Name = "add-chat-tag",
|
|
78
|
+
Aliases = {},
|
|
79
|
+
Description = "Adds a tag to a player",
|
|
80
|
+
Group = "ChatTags",
|
|
82
81
|
Args = {
|
|
83
82
|
{
|
|
84
|
-
Name = "Target"
|
|
85
|
-
Type = "player"
|
|
86
|
-
Description = "Player to add a tag for"
|
|
83
|
+
Name = "Target",
|
|
84
|
+
Type = "player",
|
|
85
|
+
Description = "Player to add a tag for",
|
|
87
86
|
},
|
|
88
87
|
{
|
|
89
|
-
Name = "TagText"
|
|
90
|
-
Type = "string"
|
|
91
|
-
Description = "Text for the tag to have"
|
|
88
|
+
Name = "TagText",
|
|
89
|
+
Type = "string",
|
|
90
|
+
Description = "Text for the tag to have",
|
|
92
91
|
},
|
|
93
92
|
{
|
|
94
|
-
Name = "TagColor"
|
|
95
|
-
Type = "color3"
|
|
96
|
-
Description = "Color for the tag to have"
|
|
97
|
-
Optional = true
|
|
98
|
-
Default = Color3.fromRGB(255, 170, 0)
|
|
93
|
+
Name = "TagColor",
|
|
94
|
+
Type = "color3",
|
|
95
|
+
Description = "Color for the tag to have",
|
|
96
|
+
Optional = true,
|
|
97
|
+
Default = Color3.fromRGB(255, 170, 0),
|
|
99
98
|
},
|
|
100
99
|
{
|
|
101
|
-
Name = "TagPriority"
|
|
102
|
-
Type = "number"
|
|
103
|
-
Description = "Priority for the tag to have"
|
|
104
|
-
Optional = true
|
|
105
|
-
Default = 0
|
|
100
|
+
Name = "TagPriority",
|
|
101
|
+
Type = "number",
|
|
102
|
+
Description = "Priority for the tag to have",
|
|
103
|
+
Optional = true,
|
|
104
|
+
Default = 0,
|
|
106
105
|
},
|
|
107
|
-
}
|
|
106
|
+
},
|
|
108
107
|
}, function(_context, player, tagText, tagColor, priority)
|
|
109
|
-
self._chatProviderService:PromiseAddChatTag(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
self._chatProviderService:PromiseAddChatTag(
|
|
109
|
+
player,
|
|
110
|
+
ChatTagDataUtils.createChatTagData({
|
|
111
|
+
TagText = tagText,
|
|
112
|
+
TagPriority = priority or 0,
|
|
113
|
+
TagColor = tagColor or Color3.fromRGB(255, 170, 0),
|
|
114
|
+
})
|
|
115
|
+
)
|
|
114
116
|
|
|
115
117
|
return string.format("Added tag %q to player %q", tagText, PlayerUtils.formatName(player))
|
|
116
118
|
end)
|
|
117
119
|
|
|
118
120
|
self._cmdrService:RegisterCommand({
|
|
119
|
-
Name = "clear-chat-tags"
|
|
120
|
-
Aliases = {
|
|
121
|
-
Description = "Clears chat tags on a player"
|
|
122
|
-
Group = "ChatTags"
|
|
121
|
+
Name = "clear-chat-tags",
|
|
122
|
+
Aliases = {},
|
|
123
|
+
Description = "Clears chat tags on a player",
|
|
124
|
+
Group = "ChatTags",
|
|
123
125
|
Args = {
|
|
124
126
|
{
|
|
125
|
-
Name = "Target"
|
|
126
|
-
Type = "player"
|
|
127
|
-
Description = "Player to add a tag for"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
127
|
+
Name = "Target",
|
|
128
|
+
Type = "player",
|
|
129
|
+
Description = "Player to add a tag for",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
130
132
|
}, function(_context, player)
|
|
131
133
|
self._chatProviderService:ClearChatTags(player)
|
|
132
134
|
|
|
@@ -134,28 +136,28 @@ function ChatProviderCommandService:_registerCommands()
|
|
|
134
136
|
end)
|
|
135
137
|
|
|
136
138
|
self._cmdrService:RegisterCommand({
|
|
137
|
-
Name = "set-chat-tag-disabled"
|
|
138
|
-
Aliases = {
|
|
139
|
-
Description = "Sets if a chat tag is disabled for a player. This will save."
|
|
140
|
-
Group = "ChatTags"
|
|
139
|
+
Name = "set-chat-tag-disabled",
|
|
140
|
+
Aliases = {},
|
|
141
|
+
Description = "Sets if a chat tag is disabled for a player. This will save.",
|
|
142
|
+
Group = "ChatTags",
|
|
141
143
|
Args = {
|
|
142
144
|
{
|
|
143
|
-
Name = "Target"
|
|
144
|
-
Type = "player"
|
|
145
|
-
Description = "Player to disable or enable the tag for"
|
|
145
|
+
Name = "Target",
|
|
146
|
+
Type = "player",
|
|
147
|
+
Description = "Player to disable or enable the tag for",
|
|
146
148
|
},
|
|
147
149
|
{
|
|
148
|
-
Name = "TagKey"
|
|
149
|
-
Type = "chatTagKey"
|
|
150
|
-
Description = "Chat tag to disable"
|
|
150
|
+
Name = "TagKey",
|
|
151
|
+
Type = "chatTagKey",
|
|
152
|
+
Description = "Chat tag to disable",
|
|
151
153
|
},
|
|
152
154
|
{
|
|
153
|
-
Name = "ChatTagDisabled"
|
|
154
|
-
Type = "boolean"
|
|
155
|
-
Description = "Whether or not the tag is disabled"
|
|
156
|
-
Default = true
|
|
155
|
+
Name = "ChatTagDisabled",
|
|
156
|
+
Type = "boolean",
|
|
157
|
+
Description = "Whether or not the tag is disabled",
|
|
158
|
+
Default = true,
|
|
157
159
|
},
|
|
158
|
-
}
|
|
160
|
+
},
|
|
159
161
|
}, function(_context, player, chatTagKey, chatTagDisabled)
|
|
160
162
|
local hasChatTags = self._hasChatTagsBinder:Get(player)
|
|
161
163
|
|
|
@@ -170,7 +172,12 @@ function ChatProviderCommandService:_registerCommands()
|
|
|
170
172
|
|
|
171
173
|
chatTag.UserDisabled.Value = chatTagDisabled
|
|
172
174
|
|
|
173
|
-
return string.format(
|
|
175
|
+
return string.format(
|
|
176
|
+
"Chat tag %q on player %q `UserDisabled` set to %s",
|
|
177
|
+
chatTagKey,
|
|
178
|
+
PlayerUtils.formatName(player),
|
|
179
|
+
tostring(chatTagDisabled)
|
|
180
|
+
)
|
|
174
181
|
end)
|
|
175
182
|
end
|
|
176
183
|
|
|
@@ -178,4 +185,4 @@ function ChatProviderCommandService:Destroy()
|
|
|
178
185
|
self._maid:DoCleaning()
|
|
179
186
|
end
|
|
180
187
|
|
|
181
|
-
return ChatProviderCommandService
|
|
188
|
+
return ChatProviderCommandService
|
|
@@ -8,10 +8,10 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local AttributeValue = require("AttributeValue")
|
|
9
9
|
local BaseObject = require("BaseObject")
|
|
10
10
|
local ChatTagConstants = require("ChatTagConstants")
|
|
11
|
+
local ChatTagDataUtils = require("ChatTagDataUtils")
|
|
11
12
|
local LocalizedTextUtils = require("LocalizedTextUtils")
|
|
13
|
+
local Observable = require("Observable")
|
|
12
14
|
local Rx = require("Rx")
|
|
13
|
-
local _ChatTagDataUtils = require("ChatTagDataUtils")
|
|
14
|
-
local _Observable = require("Observable")
|
|
15
15
|
|
|
16
16
|
local ChatTagBase = setmetatable({}, BaseObject)
|
|
17
17
|
ChatTagBase.ClassName = "ChatTagBase"
|
|
@@ -46,7 +46,7 @@ function ChatTagBase.new(obj: Folder): ChatTagBase
|
|
|
46
46
|
return self
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
function ChatTagBase.ObserveChatTagData(self: ChatTagBase):
|
|
49
|
+
function ChatTagBase.ObserveChatTagData(self: ChatTagBase): Observable.Observable<ChatTagDataUtils.ChatTagData>
|
|
50
50
|
return Rx.combineLatest({
|
|
51
51
|
UserDisabled = self.UserDisabled:Observe(),
|
|
52
52
|
TagText = self._chatTagText:Observe(),
|
|
@@ -64,4 +64,4 @@ function ChatTagBase.ObserveChatTagData(self: ChatTagBase): _Observable.Observab
|
|
|
64
64
|
}) :: any
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
return ChatTagBase
|
|
67
|
+
return ChatTagBase
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
8
|
local BaseObject = require("BaseObject")
|
|
9
|
+
local Brio = require("Brio")
|
|
10
|
+
local ChatTagDataUtils = require("ChatTagDataUtils")
|
|
11
|
+
local HasChatTagsConstants = require("HasChatTagsConstants")
|
|
12
|
+
local Observable = require("Observable")
|
|
9
13
|
local RxBinderUtils = require("RxBinderUtils")
|
|
10
14
|
local RxBrioUtils = require("RxBrioUtils")
|
|
11
15
|
local RxInstanceUtils = require("RxInstanceUtils")
|
|
12
16
|
local ValueObject = require("ValueObject")
|
|
13
|
-
local HasChatTagsConstants = require("HasChatTagsConstants")
|
|
14
|
-
local _ChatTagDataUtils = require("ChatTagDataUtils")
|
|
15
|
-
local _Observable = require("Observable")
|
|
16
|
-
local _Brio = require("Brio")
|
|
17
17
|
|
|
18
18
|
local HasChatTagsBase = setmetatable({}, BaseObject)
|
|
19
19
|
HasChatTagsBase.ClassName = "HasChatTagsBase"
|
|
@@ -22,7 +22,7 @@ HasChatTagsBase.__index = HasChatTagsBase
|
|
|
22
22
|
export type HasChatTagsBase = typeof(setmetatable(
|
|
23
23
|
{} :: {
|
|
24
24
|
_obj: Player,
|
|
25
|
-
_lastChatTags: ValueObject.ValueObject<{
|
|
25
|
+
_lastChatTags: ValueObject.ValueObject<{ ChatTagDataUtils.ChatTagData }?>,
|
|
26
26
|
},
|
|
27
27
|
{} :: typeof({ __index = HasChatTagsBase })
|
|
28
28
|
)) & BaseObject.BaseObject
|
|
@@ -60,13 +60,13 @@ function HasChatTagsBase.new(player: Player): HasChatTagsBase
|
|
|
60
60
|
return self
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
function HasChatTagsBase.GetLastChatTags(self: HasChatTagsBase): {
|
|
63
|
+
function HasChatTagsBase.GetLastChatTags(self: HasChatTagsBase): { ChatTagDataUtils.ChatTagData }?
|
|
64
64
|
return self._lastChatTags.Value
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
function HasChatTagsBase.ObserveLastChatTags(
|
|
68
68
|
self: HasChatTagsBase
|
|
69
|
-
):
|
|
69
|
+
): Observable.Observable<{ ChatTagDataUtils.ChatTagData }?>
|
|
70
70
|
return self._lastChatTags:Observe()
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -74,7 +74,9 @@ function HasChatTagsBase.GetChatTagBinder(_self: HasChatTagsBase)
|
|
|
74
74
|
error("Not implemented")
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
function HasChatTagsBase._observeTagDataListBrio(
|
|
77
|
+
function HasChatTagsBase._observeTagDataListBrio(
|
|
78
|
+
self: HasChatTagsBase
|
|
79
|
+
): Observable.Observable<Brio.Brio<{ ChatTagDataUtils.ChatTagData }>>
|
|
78
80
|
local chatTagBinder = self:GetChatTagBinder()
|
|
79
81
|
|
|
80
82
|
return RxInstanceUtils.observeLastNamedChildBrio(
|
|
@@ -85,18 +87,18 @@ function HasChatTagsBase._observeTagDataListBrio(self: HasChatTagsBase): _Observ
|
|
|
85
87
|
:Pipe({
|
|
86
88
|
RxBrioUtils.switchMapBrio(function(child)
|
|
87
89
|
return RxBinderUtils.observeChildrenBrio(chatTagBinder, child)
|
|
88
|
-
end),
|
|
90
|
+
end) :: any,
|
|
89
91
|
RxBrioUtils.flatMapBrio(function(chatTag)
|
|
90
92
|
return chatTag:ObserveChatTagData():Pipe({
|
|
91
|
-
RxBrioUtils.toBrio(),
|
|
92
|
-
RxBrioUtils.onlyLastBrioSurvives(),
|
|
93
|
+
RxBrioUtils.toBrio() :: any,
|
|
94
|
+
RxBrioUtils.onlyLastBrioSurvives() :: any,
|
|
93
95
|
})
|
|
94
|
-
end),
|
|
96
|
+
end) :: any,
|
|
95
97
|
RxBrioUtils.where(function(chatTagData)
|
|
96
98
|
return not chatTagData.UserDisabled
|
|
97
|
-
end),
|
|
98
|
-
RxBrioUtils.reduceToAliveList(),
|
|
99
|
+
end) :: any,
|
|
100
|
+
RxBrioUtils.reduceToAliveList() :: any,
|
|
99
101
|
}) :: any
|
|
100
102
|
end
|
|
101
103
|
|
|
102
|
-
return HasChatTagsBase
|
|
104
|
+
return HasChatTagsBase
|
|
@@ -8,10 +8,10 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local Table = require("Table")
|
|
9
9
|
|
|
10
10
|
return Table.readonly({
|
|
11
|
-
TAG_TEXT_ATTRIBUTE = "TagText"
|
|
12
|
-
TAG_COLOR_ATTRIBUTE = "TagColor"
|
|
13
|
-
TAG_KEY_ATTRIBUTE = "ChatTagKey"
|
|
14
|
-
TAG_LOCALIZED_TEXT_ATTRIBUTE = "TagLocalizedText"
|
|
15
|
-
TAG_PRIORITY_ATTRIBUTE = "TagPriority"
|
|
16
|
-
USER_DISABLED_ATTRIBUTE = "UserDisabled"
|
|
17
|
-
})
|
|
11
|
+
TAG_TEXT_ATTRIBUTE = "TagText",
|
|
12
|
+
TAG_COLOR_ATTRIBUTE = "TagColor",
|
|
13
|
+
TAG_KEY_ATTRIBUTE = "ChatTagKey",
|
|
14
|
+
TAG_LOCALIZED_TEXT_ATTRIBUTE = "TagLocalizedText",
|
|
15
|
+
TAG_PRIORITY_ATTRIBUTE = "TagPriority",
|
|
16
|
+
USER_DISABLED_ATTRIBUTE = "UserDisabled",
|
|
17
|
+
})
|
|
@@ -11,7 +11,7 @@ function ChatTagCmdrUtils.registerChatTagKeys(cmdr, chatProviderService)
|
|
|
11
11
|
local chatTagKeyList = chatProviderService:GetChatTagKeyList()
|
|
12
12
|
local find = cmdr.Util.MakeFuzzyFinder(chatTagKeyList)
|
|
13
13
|
return find(text)
|
|
14
|
-
end
|
|
14
|
+
end,
|
|
15
15
|
Validate = function(keys)
|
|
16
16
|
return #keys > 0, "No chat tag with that key could be found."
|
|
17
17
|
end,
|
|
@@ -20,11 +20,11 @@ function ChatTagCmdrUtils.registerChatTagKeys(cmdr, chatProviderService)
|
|
|
20
20
|
end,
|
|
21
21
|
Parse = function(keys)
|
|
22
22
|
return keys[1]
|
|
23
|
-
end
|
|
23
|
+
end,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
cmdr.Registry:RegisterType("chatTagKey", chatTagKey)
|
|
27
27
|
cmdr.Registry:RegisterType("chatTagKeys", cmdr.Util.MakeListableType(chatTagKey))
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
return ChatTagCmdrUtils
|
|
30
|
+
return ChatTagCmdrUtils
|