@quenty/gameconfig 12.25.0-canary.ae8d76d.0 → 12.25.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 +2 -2
- package/package.json +27 -27
- package/src/Client/Cmdr/GameConfigCommandServiceClient.lua +18 -16
- package/src/Client/Config/Asset/GameConfigAssetClient.lua +15 -14
- package/src/Client/Config/Config/GameConfigClient.lua +1 -1
- package/src/Client/GameConfigBindersClient.lua +2 -2
- package/src/Client/GameConfigServiceClient.lua +5 -6
- package/src/Server/Cmdr/GameConfigCommandService.lua +28 -28
- package/src/Server/Config/Asset/GameConfigAsset.lua +8 -8
- package/src/Server/Config/Config/GameConfig.lua +2 -2
- package/src/Server/GameConfigBindersServer.lua +2 -2
- package/src/Server/GameConfigService.lua +11 -7
- package/src/Server/GameConfigServiceConstants.lua +2 -2
- package/src/Server/Mantle/MantleConfigProvider.lua +4 -5
- package/src/Shared/Cmdr/GameConfigCmdrUtils.lua +1 -1
- package/src/Shared/Config/Asset/GameConfigAssetBase.lua +1 -1
- package/src/Shared/Config/Asset/GameConfigAssetConstants.lua +3 -3
- package/src/Shared/Config/Asset/GameConfigAssetUtils.lua +11 -5
- package/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.lua +1 -1
- package/src/Shared/Config/Config/GameConfigBase.lua +1 -1
- package/src/Shared/Config/Config/GameConfigConstants.lua +2 -2
- package/src/Shared/Config/Config/GameConfigUtils.lua +10 -7
- package/src/Shared/GameConfigDataService.lua +2 -2
- package/src/Shared/GameConfigTranslator.lua +6 -6
- package/test/modules/Server/TestMantleConfigProvider/init.lua +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +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
|
-
# [12.25.0
|
|
6
|
+
# [12.25.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.24.3...@quenty/gameconfig@12.25.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -13,7 +13,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/gameconfig",
|
|
3
|
-
"version": "12.25.0
|
|
3
|
+
"version": "12.25.0",
|
|
4
4
|
"description": "Configuration service to specify Roblox badges, products, and other specific assets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,31 +27,31 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@quenty/attributeutils": "14.18.0
|
|
31
|
-
"@quenty/badgeutils": "10.11.0
|
|
32
|
-
"@quenty/baseobject": "10.
|
|
33
|
-
"@quenty/binder": "14.20.0
|
|
34
|
-
"@quenty/brio": "14.18.0
|
|
35
|
-
"@quenty/clienttranslator": "14.20.0
|
|
36
|
-
"@quenty/cmdrservice": "13.23.0
|
|
37
|
-
"@quenty/instanceutils": "13.18.0
|
|
38
|
-
"@quenty/loader": "10.
|
|
39
|
-
"@quenty/maid": "3.
|
|
40
|
-
"@quenty/marketplaceutils": "11.12.0
|
|
41
|
-
"@quenty/observablecollection": "12.21.0
|
|
42
|
-
"@quenty/playerutils": "8.18.0
|
|
43
|
-
"@quenty/preferredparentutils": "4.4.0
|
|
44
|
-
"@quenty/promise": "10.11.0
|
|
45
|
-
"@quenty/pseudolocalize": "3.
|
|
46
|
-
"@quenty/remotefunctionutils": "10.11.0
|
|
47
|
-
"@quenty/remoting": "12.19.0
|
|
48
|
-
"@quenty/rx": "13.18.0
|
|
49
|
-
"@quenty/rxbinderutils": "14.20.0
|
|
50
|
-
"@quenty/servicebag": "11.12.0
|
|
51
|
-
"@quenty/statestack": "14.19.0
|
|
52
|
-
"@quenty/string": "3.3.3",
|
|
53
|
-
"@quenty/table": "3.
|
|
54
|
-
"@quenty/valueobject": "13.18.0
|
|
30
|
+
"@quenty/attributeutils": "^14.18.0",
|
|
31
|
+
"@quenty/badgeutils": "^10.11.0",
|
|
32
|
+
"@quenty/baseobject": "^10.9.0",
|
|
33
|
+
"@quenty/binder": "^14.20.0",
|
|
34
|
+
"@quenty/brio": "^14.18.0",
|
|
35
|
+
"@quenty/clienttranslator": "^14.20.0",
|
|
36
|
+
"@quenty/cmdrservice": "^13.23.0",
|
|
37
|
+
"@quenty/instanceutils": "^13.18.0",
|
|
38
|
+
"@quenty/loader": "^10.9.0",
|
|
39
|
+
"@quenty/maid": "^3.5.0",
|
|
40
|
+
"@quenty/marketplaceutils": "^11.12.0",
|
|
41
|
+
"@quenty/observablecollection": "^12.21.0",
|
|
42
|
+
"@quenty/playerutils": "^8.18.0",
|
|
43
|
+
"@quenty/preferredparentutils": "^4.4.0",
|
|
44
|
+
"@quenty/promise": "^10.11.0",
|
|
45
|
+
"@quenty/pseudolocalize": "^3.5.0",
|
|
46
|
+
"@quenty/remotefunctionutils": "^10.11.0",
|
|
47
|
+
"@quenty/remoting": "^12.19.0",
|
|
48
|
+
"@quenty/rx": "^13.18.0",
|
|
49
|
+
"@quenty/rxbinderutils": "^14.20.0",
|
|
50
|
+
"@quenty/servicebag": "^11.12.0",
|
|
51
|
+
"@quenty/statestack": "^14.19.0",
|
|
52
|
+
"@quenty/string": "^3.3.3",
|
|
53
|
+
"@quenty/table": "^3.8.0",
|
|
54
|
+
"@quenty/valueobject": "^13.18.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
|
|
57
57
|
}
|
|
@@ -30,29 +30,31 @@ function GameConfigCommandServiceClient:_setupCommands()
|
|
|
30
30
|
local picker = self._gameConfigServiceClient:GetConfigPicker()
|
|
31
31
|
-- TODO: Determine production vs. staging and set cmdr annotation accordingly.
|
|
32
32
|
|
|
33
|
-
|
|
34
33
|
self._maid:GivePromise(self._cmdrService:PromiseCmdr()):Then(function(cmdr)
|
|
35
34
|
GameConfigCmdrUtils.registerAssetTypes(cmdr, picker)
|
|
36
35
|
|
|
37
36
|
local latestConfig = RxStateStackUtils.createStateStack(picker:ObserveActiveConfigsBrio())
|
|
38
37
|
self._maid:GiveTask(latestConfig)
|
|
39
38
|
|
|
40
|
-
self._maid:GiveTask(latestConfig
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
self._maid:GiveTask(latestConfig
|
|
40
|
+
:Observe()
|
|
41
|
+
:Pipe({
|
|
42
|
+
Rx.switchMap(function(config)
|
|
43
|
+
if config then
|
|
44
|
+
return config:ObserveConfigName()
|
|
45
|
+
else
|
|
46
|
+
return Rx.of(nil)
|
|
47
|
+
end
|
|
48
|
+
end),
|
|
49
|
+
})
|
|
50
|
+
:Subscribe(function(name)
|
|
51
|
+
if name then
|
|
52
|
+
cmdr:SetPlaceName(name)
|
|
44
53
|
else
|
|
45
|
-
|
|
54
|
+
-- Default value
|
|
55
|
+
cmdr:SetPlaceName("Cmdr")
|
|
46
56
|
end
|
|
47
|
-
end)
|
|
48
|
-
}):Subscribe(function(name)
|
|
49
|
-
if name then
|
|
50
|
-
cmdr:SetPlaceName(name)
|
|
51
|
-
else
|
|
52
|
-
-- Default value
|
|
53
|
-
cmdr:SetPlaceName("Cmdr")
|
|
54
|
-
end
|
|
55
|
-
end))
|
|
57
|
+
end))
|
|
56
58
|
end)
|
|
57
59
|
end
|
|
58
60
|
|
|
@@ -60,4 +62,4 @@ function GameConfigCommandServiceClient:Destroy()
|
|
|
60
62
|
self._maid:DoCleaning()
|
|
61
63
|
end
|
|
62
64
|
|
|
63
|
-
return GameConfigCommandServiceClient
|
|
65
|
+
return GameConfigCommandServiceClient
|
|
@@ -40,21 +40,22 @@ end
|
|
|
40
40
|
|
|
41
41
|
function GameConfigAssetClient:_setupEntrySet(observeTranslationKey, observeTranslationValue)
|
|
42
42
|
self._maid:GiveTask(Rx.combineLatestDefer({
|
|
43
|
-
assetKey = self:ObserveAssetKey()
|
|
44
|
-
translationKey = observeTranslationKey
|
|
45
|
-
text = observeTranslationValue
|
|
43
|
+
assetKey = self:ObserveAssetKey(),
|
|
44
|
+
translationKey = observeTranslationKey,
|
|
45
|
+
text = observeTranslationValue,
|
|
46
46
|
}):Subscribe(function(state)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
if
|
|
48
|
+
type(state.translationKey) == "string"
|
|
49
|
+
and type(state.text) == "string"
|
|
50
|
+
and #state.text > 0
|
|
51
|
+
and state.assetKey
|
|
52
|
+
then
|
|
53
|
+
local context = string.format("GameConfigAsset.%s", state.assetKey)
|
|
54
|
+
local localeId = "en"
|
|
55
|
+
|
|
56
|
+
self._configTranslator:SetEntryValue(state.translationKey, state.text, context, localeId, state.text)
|
|
57
|
+
end
|
|
57
58
|
end))
|
|
58
59
|
end
|
|
59
60
|
|
|
60
|
-
return GameConfigAssetClient
|
|
61
|
+
return GameConfigAssetClient
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local BinderProvider = require("BinderProvider")
|
|
8
7
|
local Binder = require("Binder")
|
|
8
|
+
local BinderProvider = require("BinderProvider")
|
|
9
9
|
|
|
10
10
|
return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
11
11
|
self:Add(Binder.new("GameConfig", (require :: any)("GameConfigClient"), serviceBag))
|
|
12
12
|
self:Add(Binder.new("GameConfigAsset", (require :: any)("GameConfigAssetClient"), serviceBag))
|
|
13
|
-
end)
|
|
13
|
+
end)
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local Maid = require("Maid")
|
|
8
7
|
local GameConfigPicker = require("GameConfigPicker")
|
|
8
|
+
local Maid = require("Maid")
|
|
9
9
|
local ServiceBag = require("ServiceBag")
|
|
10
10
|
|
|
11
11
|
local GameConfigServiceClient = {}
|
|
@@ -26,14 +26,13 @@ function GameConfigServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
|
26
26
|
self._serviceBag:GetService(require("GameConfigDataService"))
|
|
27
27
|
self._binders = self._serviceBag:GetService(require("GameConfigBindersClient"))
|
|
28
28
|
|
|
29
|
-
self._configPicker =
|
|
29
|
+
self._configPicker =
|
|
30
|
+
self._maid:Add(GameConfigPicker.new(self._serviceBag, self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
30
31
|
|
|
31
32
|
self._serviceBag:GetService(require("GameConfigDataService")):SetConfigPicker(self._configPicker)
|
|
32
33
|
end
|
|
33
34
|
|
|
34
|
-
function GameConfigServiceClient:Start()
|
|
35
|
-
|
|
36
|
-
end
|
|
35
|
+
function GameConfigServiceClient:Start() end
|
|
37
36
|
|
|
38
37
|
--[=[
|
|
39
38
|
Retrieves the game configuration picker for the config service.
|
|
@@ -47,4 +46,4 @@ function GameConfigServiceClient:Destroy()
|
|
|
47
46
|
self._maid:DoCleaning()
|
|
48
47
|
end
|
|
49
48
|
|
|
50
|
-
return GameConfigServiceClient
|
|
49
|
+
return GameConfigServiceClient
|
|
@@ -7,8 +7,8 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local TeleportService = game:GetService("TeleportService")
|
|
9
9
|
|
|
10
|
-
local GameConfigCmdrUtils = require("GameConfigCmdrUtils")
|
|
11
10
|
local BadgeUtils = require("BadgeUtils")
|
|
11
|
+
local GameConfigCmdrUtils = require("GameConfigCmdrUtils")
|
|
12
12
|
local PlayerUtils = require("PlayerUtils")
|
|
13
13
|
local ServiceBag = require("ServiceBag")
|
|
14
14
|
|
|
@@ -36,22 +36,22 @@ function GameConfigCommandService:_registerCommands()
|
|
|
36
36
|
end)
|
|
37
37
|
|
|
38
38
|
self._cmdrService:RegisterCommand({
|
|
39
|
-
Name = "give-badge"
|
|
40
|
-
Aliases = { "award-badge" }
|
|
41
|
-
Description = "Awards the player a badge."
|
|
42
|
-
Group = "GameConfig"
|
|
39
|
+
Name = "give-badge",
|
|
40
|
+
Aliases = { "award-badge" },
|
|
41
|
+
Description = "Awards the player a badge.",
|
|
42
|
+
Group = "GameConfig",
|
|
43
43
|
Args = {
|
|
44
44
|
{
|
|
45
|
-
Name = "Targets"
|
|
46
|
-
Type = "players"
|
|
47
|
-
Description = "The player to award."
|
|
45
|
+
Name = "Targets",
|
|
46
|
+
Type = "players",
|
|
47
|
+
Description = "The player to award.",
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
Name = "Badge"
|
|
51
|
-
Type = "badgeIds"
|
|
52
|
-
Description = "Badge to award."
|
|
50
|
+
Name = "Badge",
|
|
51
|
+
Type = "badgeIds",
|
|
52
|
+
Description = "Badge to award.",
|
|
53
53
|
},
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
55
|
}, function(_context, players, badgeIds)
|
|
56
56
|
local givenTo = {}
|
|
57
57
|
|
|
@@ -66,27 +66,27 @@ function GameConfigCommandService:_registerCommands()
|
|
|
66
66
|
end)
|
|
67
67
|
|
|
68
68
|
self._cmdrService:RegisterCommand({
|
|
69
|
-
Name = "goto-named-place"
|
|
70
|
-
Description = "Teleport to a Roblox place."
|
|
71
|
-
Group = "GameConfig"
|
|
69
|
+
Name = "goto-named-place",
|
|
70
|
+
Description = "Teleport to a Roblox place.",
|
|
71
|
+
Group = "GameConfig",
|
|
72
72
|
Args = {
|
|
73
73
|
{
|
|
74
|
-
Type = "players"
|
|
75
|
-
Name = "Players"
|
|
76
|
-
Description = "The players you want to teleport"
|
|
74
|
+
Type = "players",
|
|
75
|
+
Name = "Players",
|
|
76
|
+
Description = "The players you want to teleport",
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
Type = "placeId"
|
|
80
|
-
Name = "Place"
|
|
81
|
-
Description = "The Place you want to teleport to"
|
|
79
|
+
Type = "placeId",
|
|
80
|
+
Name = "Place",
|
|
81
|
+
Description = "The Place you want to teleport to",
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
|
-
Type = "string"
|
|
85
|
-
Name = "JobId"
|
|
86
|
-
Description = "The specific JobId you want to teleport to"
|
|
87
|
-
Optional = true
|
|
88
|
-
}
|
|
89
|
-
}
|
|
84
|
+
Type = "string",
|
|
85
|
+
Name = "JobId",
|
|
86
|
+
Description = "The specific JobId you want to teleport to",
|
|
87
|
+
Optional = true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
90
|
}, function(context, players, placeId, jobId)
|
|
91
91
|
if placeId <= 0 then
|
|
92
92
|
return "Invalid place ID"
|
|
@@ -108,4 +108,4 @@ function GameConfigCommandService:_registerCommands()
|
|
|
108
108
|
end)
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
return GameConfigCommandService
|
|
111
|
+
return GameConfigCommandService
|
|
@@ -7,9 +7,9 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local GameConfigAssetBase = require("GameConfigAssetBase")
|
|
9
9
|
local GameConfigTranslator = require("GameConfigTranslator")
|
|
10
|
+
local JSONTranslator = require("JSONTranslator")
|
|
10
11
|
local Rx = require("Rx")
|
|
11
12
|
local ServiceBag = require("ServiceBag")
|
|
12
|
-
local JSONTranslator = require("JSONTranslator")
|
|
13
13
|
|
|
14
14
|
local GameConfigAsset = setmetatable({}, GameConfigAssetBase)
|
|
15
15
|
GameConfigAsset.ClassName = "GameConfigAsset"
|
|
@@ -30,9 +30,9 @@ function GameConfigAsset.new(obj: Folder, serviceBag: ServiceBag.ServiceBag): Ga
|
|
|
30
30
|
self._translator = self._serviceBag:GetService(GameConfigTranslator)
|
|
31
31
|
|
|
32
32
|
self._maid:GiveTask(Rx.combineLatest({
|
|
33
|
-
assetKey = self:ObserveAssetKey()
|
|
34
|
-
assetType = self:ObserveAssetType()
|
|
35
|
-
text = self:ObserveCloudName()
|
|
33
|
+
assetKey = self:ObserveAssetKey(),
|
|
34
|
+
assetType = self:ObserveAssetType(),
|
|
35
|
+
text = self:ObserveCloudName(),
|
|
36
36
|
}):Subscribe(function(state)
|
|
37
37
|
if state.text and state.text ~= "" then
|
|
38
38
|
local prefix = string.format("assets.%s.%s.name", state.assetType, state.assetKey)
|
|
@@ -43,9 +43,9 @@ function GameConfigAsset.new(obj: Folder, serviceBag: ServiceBag.ServiceBag): Ga
|
|
|
43
43
|
end))
|
|
44
44
|
|
|
45
45
|
self._maid:GiveTask(Rx.combineLatest({
|
|
46
|
-
assetKey = self:ObserveAssetKey()
|
|
47
|
-
assetType = self:ObserveAssetType()
|
|
48
|
-
text = self:ObserveCloudDescription()
|
|
46
|
+
assetKey = self:ObserveAssetKey(),
|
|
47
|
+
assetType = self:ObserveAssetType(),
|
|
48
|
+
text = self:ObserveCloudDescription(),
|
|
49
49
|
}):Subscribe(function(state)
|
|
50
50
|
if state.text and state.text ~= "" then
|
|
51
51
|
local prefix = string.format("assets.%s.%s.description", state.assetType, state.assetKey)
|
|
@@ -58,4 +58,4 @@ function GameConfigAsset.new(obj: Folder, serviceBag: ServiceBag.ServiceBag): Ga
|
|
|
58
58
|
return self
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
return GameConfigAsset
|
|
61
|
+
return GameConfigAsset
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
local require = require(script.Parent.loader).load(script)
|
|
9
9
|
|
|
10
|
+
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
10
11
|
local GameConfigBase = require("GameConfigBase")
|
|
11
12
|
local GameConfigBindersServer = require("GameConfigBindersServer")
|
|
12
|
-
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
13
13
|
local GameConfigUtils = require("GameConfigUtils")
|
|
14
14
|
local ServiceBag = require("ServiceBag")
|
|
15
15
|
|
|
@@ -44,4 +44,4 @@ function GameConfig.GetGameConfigAssetBinder(self: GameConfig)
|
|
|
44
44
|
return self._gameConfigBindersServer.GameConfigAsset
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
return GameConfig
|
|
47
|
+
return GameConfig
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local BinderProvider = require("BinderProvider")
|
|
8
7
|
local Binder = require("Binder")
|
|
8
|
+
local BinderProvider = require("BinderProvider")
|
|
9
9
|
|
|
10
10
|
return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
11
11
|
self:Add(Binder.new("GameConfig", (require :: any)("GameConfig"), serviceBag))
|
|
12
12
|
self:Add(Binder.new("GameConfigAsset", (require :: any)("GameConfigAsset"), serviceBag))
|
|
13
|
-
end)
|
|
13
|
+
end)
|
|
@@ -7,14 +7,14 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
|
|
8
8
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|
9
9
|
|
|
10
|
-
local GameConfigUtils = require("GameConfigUtils")
|
|
11
|
-
local GameConfigPicker = require("GameConfigPicker")
|
|
12
|
-
local Maid = require("Maid")
|
|
13
|
-
local PreferredParentUtils = require("PreferredParentUtils")
|
|
14
|
-
local GameConfigAssetUtils = require("GameConfigAssetUtils")
|
|
15
10
|
local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
|
|
16
11
|
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
12
|
+
local GameConfigAssetUtils = require("GameConfigAssetUtils")
|
|
13
|
+
local GameConfigPicker = require("GameConfigPicker")
|
|
17
14
|
local GameConfigServiceConstants = require("GameConfigServiceConstants")
|
|
15
|
+
local GameConfigUtils = require("GameConfigUtils")
|
|
16
|
+
local Maid = require("Maid")
|
|
17
|
+
local PreferredParentUtils = require("PreferredParentUtils")
|
|
18
18
|
local ServiceBag = require("ServiceBag")
|
|
19
19
|
|
|
20
20
|
local GameConfigService = {}
|
|
@@ -137,7 +137,11 @@ end
|
|
|
137
137
|
@param assetKey string -- Key name to use for the bundle
|
|
138
138
|
@param assetId number -- Cloud id
|
|
139
139
|
]=]
|
|
140
|
-
function GameConfigService:AddTypedAsset(
|
|
140
|
+
function GameConfigService:AddTypedAsset(
|
|
141
|
+
assetType: GameConfigAssetTypes.GameConfigAssetType,
|
|
142
|
+
assetKey: string,
|
|
143
|
+
assetId: number
|
|
144
|
+
)
|
|
141
145
|
assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
|
|
142
146
|
assert(type(assetKey) == "string", "Bad assetKey")
|
|
143
147
|
assert(type(assetId) == "number", "Bad assetId")
|
|
@@ -189,4 +193,4 @@ function GameConfigService:Destroy()
|
|
|
189
193
|
self._maid:DoCleaning()
|
|
190
194
|
end
|
|
191
195
|
|
|
192
|
-
return GameConfigService
|
|
196
|
+
return GameConfigService
|
|
@@ -9,9 +9,9 @@ local GameConfigAssetUtils = require("GameConfigAssetUtils")
|
|
|
9
9
|
local GameConfigBindersServer = require("GameConfigBindersServer")
|
|
10
10
|
local GameConfigService = require("GameConfigService")
|
|
11
11
|
local GameConfigUtils = require("GameConfigUtils")
|
|
12
|
-
local String = require("String")
|
|
13
12
|
local Maid = require("Maid")
|
|
14
13
|
local ServiceBag = require("ServiceBag")
|
|
14
|
+
local String = require("String")
|
|
15
15
|
|
|
16
16
|
local MantleConfigProvider = {}
|
|
17
17
|
MantleConfigProvider.ClassName = "MantleConfigProvider"
|
|
@@ -52,7 +52,6 @@ function MantleConfigProvider:_loadConfig(item)
|
|
|
52
52
|
assert(coroutine.status(current) == "dead", "Loading the mantle config yielded")
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
|
|
56
55
|
function MantleConfigProvider:_parseDataToConfig(mantleConfigData, name)
|
|
57
56
|
assert(type(mantleConfigData) == "table", "Bad mantleConfigData")
|
|
58
57
|
|
|
@@ -94,7 +93,8 @@ function MantleConfigProvider:_parseDataToConfig(mantleConfigData, name)
|
|
|
94
93
|
return
|
|
95
94
|
end
|
|
96
95
|
|
|
97
|
-
local asset =
|
|
96
|
+
local asset =
|
|
97
|
+
GameConfigAssetUtils.create(self._gameConfigBindersServer.GameConfigAsset, assetType, assetName, assetId)
|
|
98
98
|
asset.Parent = GameConfigUtils.getOrCreateAssetFolder(gameConfig, assetType)
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -117,5 +117,4 @@ function MantleConfigProvider:Destroy()
|
|
|
117
117
|
self._maid:DoCleaning()
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
return MantleConfigProvider
|
|
120
|
+
return MantleConfigProvider
|
|
@@ -303,4 +303,4 @@ function GameConfigAssetBase:_promiseCloudDataForState(state: GameConfigAssetSta
|
|
|
303
303
|
return GameConfigAssetUtils.promiseCloudDataForAssetType(self._serviceBag, state.assetType, state.assetId)
|
|
304
304
|
end
|
|
305
305
|
|
|
306
|
-
return GameConfigAssetBase
|
|
306
|
+
return GameConfigAssetBase
|
|
@@ -8,6 +8,6 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local Table = require("Table")
|
|
9
9
|
|
|
10
10
|
return Table.readonly({
|
|
11
|
-
ASSET_TYPE_ATTRIBUTE = "AssetType"
|
|
12
|
-
ASSET_ID_ATTRIBUTE = "AssetId"
|
|
13
|
-
})
|
|
11
|
+
ASSET_TYPE_ATTRIBUTE = "AssetType",
|
|
12
|
+
ASSET_ID_ATTRIBUTE = "AssetId",
|
|
13
|
+
})
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
7
|
local AttributeUtils = require("AttributeUtils")
|
|
8
|
-
local GameConfigAssetConstants = require("GameConfigAssetConstants")
|
|
9
8
|
local BadgeUtils = require("BadgeUtils")
|
|
9
|
+
local GameConfigAssetConstants = require("GameConfigAssetConstants")
|
|
10
10
|
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
11
11
|
local MarketplaceServiceCache = require("MarketplaceServiceCache")
|
|
12
12
|
local Promise = require("Promise")
|
|
@@ -47,7 +47,11 @@ end
|
|
|
47
47
|
@param assetId number
|
|
48
48
|
@return Promise<any>
|
|
49
49
|
]=]
|
|
50
|
-
function GameConfigAssetUtils.promiseCloudDataForAssetType(
|
|
50
|
+
function GameConfigAssetUtils.promiseCloudDataForAssetType(
|
|
51
|
+
serviceBag: ServiceBag.ServiceBag,
|
|
52
|
+
assetType: GameConfigAssetTypes.GameConfigAssetType,
|
|
53
|
+
assetId: number
|
|
54
|
+
): Promise.Promise<any>
|
|
51
55
|
assert(type(assetType) == "string", "Bad assetType")
|
|
52
56
|
assert(type(assetId) == "number", "Bad assetId")
|
|
53
57
|
|
|
@@ -67,11 +71,13 @@ function GameConfigAssetUtils.promiseCloudDataForAssetType(serviceBag: ServiceBa
|
|
|
67
71
|
elseif assetType == GameConfigAssetTypes.BUNDLE then
|
|
68
72
|
return marketplaceServiceCache:PromiseProductInfo(assetId, Enum.InfoType.Bundle)
|
|
69
73
|
else
|
|
70
|
-
local errorMessage = string.format(
|
|
71
|
-
|
|
74
|
+
local errorMessage = string.format(
|
|
75
|
+
"[GameConfigAssetUtils.promiseCloudDataForAssetType] - Unknown GameConfigAssetType %q. Ignoring asset.",
|
|
76
|
+
tostring(assetType)
|
|
77
|
+
)
|
|
72
78
|
|
|
73
79
|
return Promise.rejected(errorMessage)
|
|
74
80
|
end
|
|
75
81
|
end
|
|
76
82
|
|
|
77
|
-
return GameConfigAssetUtils
|
|
83
|
+
return GameConfigAssetUtils
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
7
|
local AttributeUtils = require("AttributeUtils")
|
|
8
|
-
local GameConfigConstants = require("GameConfigConstants")
|
|
9
|
-
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
10
|
-
local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
|
|
11
8
|
local Binder = require("Binder")
|
|
12
|
-
local RxInstanceUtils = require("RxInstanceUtils")
|
|
13
|
-
local Observable = require("Observable")
|
|
14
9
|
local Brio = require("Brio")
|
|
10
|
+
local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
|
|
11
|
+
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
12
|
+
local GameConfigConstants = require("GameConfigConstants")
|
|
13
|
+
local Observable = require("Observable")
|
|
14
|
+
local RxInstanceUtils = require("RxInstanceUtils")
|
|
15
15
|
|
|
16
16
|
local GameConfigUtils = {}
|
|
17
17
|
|
|
@@ -52,7 +52,10 @@ function GameConfigUtils.getOrCreateAssetFolder(
|
|
|
52
52
|
return folder
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
function GameConfigUtils.observeAssetFolderBrio(
|
|
55
|
+
function GameConfigUtils.observeAssetFolderBrio(
|
|
56
|
+
config: Folder,
|
|
57
|
+
assetType: GameConfigAssetTypes.GameConfigAssetType
|
|
58
|
+
): Observable.Observable<Brio.Brio<Folder>>
|
|
56
59
|
assert(typeof(config) == "Instance", "Bad config")
|
|
57
60
|
assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
|
|
58
61
|
|
|
@@ -61,4 +64,4 @@ function GameConfigUtils.observeAssetFolderBrio(config: Folder, assetType: GameC
|
|
|
61
64
|
return RxInstanceUtils.observeLastNamedChildBrio(config, "Folder", folderName)
|
|
62
65
|
end
|
|
63
66
|
|
|
64
|
-
return GameConfigUtils
|
|
67
|
+
return GameConfigUtils
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
-
local ServiceBag = require("ServiceBag")
|
|
9
8
|
local GameConfigPicker = require("GameConfigPicker")
|
|
9
|
+
local ServiceBag = require("ServiceBag")
|
|
10
10
|
|
|
11
11
|
local GameConfigDataService = {}
|
|
12
12
|
GameConfigDataService.ServiceName = "GameConfigDataService"
|
|
@@ -35,4 +35,4 @@ function GameConfigDataService.GetConfigPicker(self: GameConfigDataService): Gam
|
|
|
35
35
|
return self._configPicker
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
return GameConfigDataService
|
|
38
|
+
return GameConfigDataService
|
|
@@ -9,10 +9,10 @@ local require = require(script.Parent.loader).load(script)
|
|
|
9
9
|
return require("JSONTranslator").new("GameConfigTranslator", "en", {
|
|
10
10
|
assetKeys = {
|
|
11
11
|
name = {
|
|
12
|
-
unknown = "???"
|
|
13
|
-
}
|
|
12
|
+
unknown = "???",
|
|
13
|
+
},
|
|
14
14
|
description = {
|
|
15
|
-
unknown = "???"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
})
|
|
15
|
+
unknown = "???",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|