@quenty/gameconfig 12.24.0 → 12.24.1-canary.545.2374fb2.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 +11 -0
- package/package.json +27 -27
- package/src/Client/Cmdr/GameConfigCommandServiceClient.lua +2 -1
- package/src/Client/Config/Asset/GameConfigAssetClient.lua +14 -3
- package/src/Client/GameConfigBindersClient.lua +2 -2
- package/src/Client/GameConfigServiceClient.lua +3 -2
- package/src/Server/Cmdr/GameConfigCommandService.lua +5 -4
- package/src/Server/Config/Config/GameConfig.lua +1 -1
- package/src/Server/GameConfigBindersServer.lua +2 -2
- package/src/Server/GameConfigService.lua +25 -12
- package/src/Server/Mantle/MantleConfigProvider.lua +4 -3
- package/src/Shared/Cmdr/GameConfigCmdrUtils.lua +7 -4
- package/src/Shared/Config/Asset/GameConfigAssetBase.lua +89 -48
- package/src/Shared/Config/Asset/GameConfigAssetUtils.lua +8 -2
- package/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.lua +1 -1
- package/src/Shared/Config/AssetTypes/GameConfigAssetTypes.lua +38 -17
- package/src/Shared/Config/Config/GameConfigBase.lua +86 -37
- package/src/Shared/Config/Config/GameConfigUtils.lua +9 -4
- package/src/Shared/Config/Picker/GameConfigPicker.lua +129 -69
- package/src/Shared/GameConfigDataService.lua +3 -1
- package/test/scripts/Client/ClientMain.client.lua +1 -1
- package/test/scripts/Server/ServerMain.server.lua +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.24.1-canary.545.2374fb2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.24.0...@quenty/gameconfig@12.24.1-canary.545.2374fb2.0) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [12.24.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.23.4...@quenty/gameconfig@12.24.0) (2025-04-02)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/gameconfig
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/gameconfig",
|
|
3
|
-
"version": "12.24.0",
|
|
3
|
+
"version": "12.24.1-canary.545.2374fb2.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": "
|
|
31
|
-
"@quenty/badgeutils": "
|
|
32
|
-
"@quenty/baseobject": "
|
|
33
|
-
"@quenty/binder": "
|
|
34
|
-
"@quenty/brio": "
|
|
35
|
-
"@quenty/clienttranslator": "
|
|
36
|
-
"@quenty/cmdrservice": "
|
|
37
|
-
"@quenty/instanceutils": "
|
|
38
|
-
"@quenty/loader": "
|
|
39
|
-
"@quenty/maid": "
|
|
40
|
-
"@quenty/marketplaceutils": "
|
|
41
|
-
"@quenty/observablecollection": "
|
|
42
|
-
"@quenty/playerutils": "
|
|
43
|
-
"@quenty/preferredparentutils": "
|
|
44
|
-
"@quenty/promise": "
|
|
45
|
-
"@quenty/pseudolocalize": "
|
|
46
|
-
"@quenty/remotefunctionutils": "
|
|
47
|
-
"@quenty/remoting": "
|
|
48
|
-
"@quenty/rx": "
|
|
49
|
-
"@quenty/rxbinderutils": "
|
|
50
|
-
"@quenty/servicebag": "
|
|
51
|
-
"@quenty/statestack": "
|
|
52
|
-
"@quenty/string": "
|
|
53
|
-
"@quenty/table": "
|
|
54
|
-
"@quenty/valueobject": "
|
|
30
|
+
"@quenty/attributeutils": "14.17.1-canary.545.2374fb2.0",
|
|
31
|
+
"@quenty/badgeutils": "10.10.2-canary.545.2374fb2.0",
|
|
32
|
+
"@quenty/baseobject": "10.8.1-canary.545.2374fb2.0",
|
|
33
|
+
"@quenty/binder": "14.19.1-canary.545.2374fb2.0",
|
|
34
|
+
"@quenty/brio": "14.17.1-canary.545.2374fb2.0",
|
|
35
|
+
"@quenty/clienttranslator": "14.19.1-canary.545.2374fb2.0",
|
|
36
|
+
"@quenty/cmdrservice": "13.22.1-canary.545.2374fb2.0",
|
|
37
|
+
"@quenty/instanceutils": "13.17.1-canary.545.2374fb2.0",
|
|
38
|
+
"@quenty/loader": "10.8.1-canary.545.2374fb2.0",
|
|
39
|
+
"@quenty/maid": "3.4.1-canary.545.2374fb2.0",
|
|
40
|
+
"@quenty/marketplaceutils": "11.11.2-canary.545.2374fb2.0",
|
|
41
|
+
"@quenty/observablecollection": "12.20.1-canary.545.2374fb2.0",
|
|
42
|
+
"@quenty/playerutils": "8.17.1-canary.545.2374fb2.0",
|
|
43
|
+
"@quenty/preferredparentutils": "4.3.1-canary.545.2374fb2.0",
|
|
44
|
+
"@quenty/promise": "10.10.2-canary.545.2374fb2.0",
|
|
45
|
+
"@quenty/pseudolocalize": "3.4.1-canary.545.2374fb2.0",
|
|
46
|
+
"@quenty/remotefunctionutils": "10.10.2-canary.545.2374fb2.0",
|
|
47
|
+
"@quenty/remoting": "12.18.1-canary.545.2374fb2.0",
|
|
48
|
+
"@quenty/rx": "13.17.1-canary.545.2374fb2.0",
|
|
49
|
+
"@quenty/rxbinderutils": "14.19.1-canary.545.2374fb2.0",
|
|
50
|
+
"@quenty/servicebag": "11.11.2-canary.545.2374fb2.0",
|
|
51
|
+
"@quenty/statestack": "14.18.1-canary.545.2374fb2.0",
|
|
52
|
+
"@quenty/string": "3.3.2-canary.545.2374fb2.0",
|
|
53
|
+
"@quenty/table": "3.7.2-canary.545.2374fb2.0",
|
|
54
|
+
"@quenty/valueobject": "13.17.1-canary.545.2374fb2.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "2374fb2b043cfbe0e9b507b3316eec46a4e353a0"
|
|
57
57
|
}
|
|
@@ -8,11 +8,12 @@ local GameConfigCmdrUtils = require("GameConfigCmdrUtils")
|
|
|
8
8
|
local Maid = require("Maid")
|
|
9
9
|
local RxStateStackUtils = require("RxStateStackUtils")
|
|
10
10
|
local Rx = require("Rx")
|
|
11
|
+
local _ServiceBag = require("ServiceBag")
|
|
11
12
|
|
|
12
13
|
local GameConfigCommandServiceClient = {}
|
|
13
14
|
GameConfigCommandServiceClient.ServiceName = "GameConfigCommandServiceClient"
|
|
14
15
|
|
|
15
|
-
function GameConfigCommandServiceClient:Init(serviceBag)
|
|
16
|
+
function GameConfigCommandServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
16
17
|
assert(not self._serviceBag, "Already initialized")
|
|
17
18
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
18
19
|
self._maid = Maid.new()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class GameConfigAssetClient
|
|
3
4
|
]=]
|
|
@@ -7,19 +8,29 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
8
|
local GameConfigAssetBase = require("GameConfigAssetBase")
|
|
8
9
|
local GameConfigTranslator = require("GameConfigTranslator")
|
|
9
10
|
local Rx = require("Rx")
|
|
11
|
+
local _ServiceBag = require("ServiceBag")
|
|
12
|
+
local _JSONTranslator = require("JSONTranslator")
|
|
10
13
|
|
|
11
14
|
local GameConfigAssetClient = setmetatable({}, GameConfigAssetBase)
|
|
12
15
|
GameConfigAssetClient.ClassName = "GameConfigAssetClient"
|
|
13
16
|
GameConfigAssetClient.__index = GameConfigAssetClient
|
|
14
17
|
|
|
18
|
+
export type GameConfigAssetClient = typeof(setmetatable(
|
|
19
|
+
{} :: {
|
|
20
|
+
_serviceBag: _ServiceBag.ServiceBag,
|
|
21
|
+
_configTranslator: _JSONTranslator.JSONTranslator,
|
|
22
|
+
},
|
|
23
|
+
GameConfigAssetClient
|
|
24
|
+
)) & GameConfigAssetBase.GameConfigAssetBase
|
|
25
|
+
|
|
15
26
|
--[=[
|
|
16
27
|
Constructs a new GameConfigAssetClient.
|
|
17
|
-
@param
|
|
28
|
+
@param folder Folder
|
|
18
29
|
@param serviceBag ServiceBag
|
|
19
30
|
@return GameConfigAssetClient
|
|
20
31
|
]=]
|
|
21
|
-
function GameConfigAssetClient.new(
|
|
22
|
-
local self = setmetatable(GameConfigAssetBase.new(
|
|
32
|
+
function GameConfigAssetClient.new(folder: Folder, serviceBag: _ServiceBag.ServiceBag): GameConfigAssetClient
|
|
33
|
+
local self = setmetatable(GameConfigAssetBase.new(folder, serviceBag) :: any, GameConfigAssetClient)
|
|
23
34
|
|
|
24
35
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
25
36
|
self._configTranslator = self._serviceBag:GetService(GameConfigTranslator)
|
|
@@ -8,6 +8,6 @@ local BinderProvider = require("BinderProvider")
|
|
|
8
8
|
local Binder = require("Binder")
|
|
9
9
|
|
|
10
10
|
return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
11
|
-
self:Add(Binder.new("GameConfig", require("GameConfigClient"), serviceBag))
|
|
12
|
-
self:Add(Binder.new("GameConfigAsset", require("GameConfigAssetClient"), serviceBag))
|
|
11
|
+
self:Add(Binder.new("GameConfig", (require :: any)("GameConfigClient"), serviceBag))
|
|
12
|
+
self:Add(Binder.new("GameConfigAsset", (require :: any)("GameConfigAssetClient"), serviceBag))
|
|
13
13
|
end)
|
|
@@ -6,11 +6,12 @@ local require = require(script.Parent.loader).load(script)
|
|
|
6
6
|
|
|
7
7
|
local Maid = require("Maid")
|
|
8
8
|
local GameConfigPicker = require("GameConfigPicker")
|
|
9
|
+
local _ServiceBag = require("ServiceBag")
|
|
9
10
|
|
|
10
11
|
local GameConfigServiceClient = {}
|
|
11
12
|
GameConfigServiceClient.ServiceName = "GameConfigServiceClient"
|
|
12
13
|
|
|
13
|
-
function GameConfigServiceClient:Init(serviceBag)
|
|
14
|
+
function GameConfigServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
14
15
|
assert(not self._serviceBag, "Already initialized")
|
|
15
16
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
16
17
|
self._maid = Maid.new()
|
|
@@ -20,7 +21,7 @@ function GameConfigServiceClient:Init(serviceBag)
|
|
|
20
21
|
self._serviceBag:GetService(require("MarketplaceServiceCache"))
|
|
21
22
|
|
|
22
23
|
-- Internal
|
|
23
|
-
self._serviceBag:GetService(require("GameConfigCommandServiceClient"))
|
|
24
|
+
self._serviceBag:GetService((require :: any)("GameConfigCommandServiceClient"))
|
|
24
25
|
self._serviceBag:GetService(require("GameConfigTranslator"))
|
|
25
26
|
self._serviceBag:GetService(require("GameConfigDataService"))
|
|
26
27
|
self._binders = self._serviceBag:GetService(require("GameConfigBindersClient"))
|
|
@@ -10,11 +10,12 @@ local TeleportService = game:GetService("TeleportService")
|
|
|
10
10
|
local GameConfigCmdrUtils = require("GameConfigCmdrUtils")
|
|
11
11
|
local BadgeUtils = require("BadgeUtils")
|
|
12
12
|
local PlayerUtils = require("PlayerUtils")
|
|
13
|
+
local _ServiceBag = require("ServiceBag")
|
|
13
14
|
|
|
14
15
|
local GameConfigCommandService = {}
|
|
15
16
|
GameConfigCommandService.ServiceName = "GameConfigCommandService"
|
|
16
17
|
|
|
17
|
-
function GameConfigCommandService:Init(serviceBag)
|
|
18
|
+
function GameConfigCommandService:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
18
19
|
assert(not self._serviceBag, "Already initialized")
|
|
19
20
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
20
21
|
|
|
@@ -54,8 +55,8 @@ function GameConfigCommandService:_registerCommands()
|
|
|
54
55
|
}, function(_context, players, badgeIds)
|
|
55
56
|
local givenTo = {}
|
|
56
57
|
|
|
57
|
-
for _, player in
|
|
58
|
-
for _, badgeId in
|
|
58
|
+
for _, player in players do
|
|
59
|
+
for _, badgeId in badgeIds do
|
|
59
60
|
BadgeUtils.promiseAwardBadge(player, badgeId)
|
|
60
61
|
table.insert(givenTo, string.format("%s badge %d", PlayerUtils.formatName(player), badgeId))
|
|
61
62
|
end
|
|
@@ -96,7 +97,7 @@ function GameConfigCommandService:_registerCommands()
|
|
|
96
97
|
context:Reply("Commencing teleport...")
|
|
97
98
|
|
|
98
99
|
if jobId then
|
|
99
|
-
for _, player in
|
|
100
|
+
for _, player in players do
|
|
100
101
|
TeleportService:TeleportToPlaceInstance(placeId, jobId, player)
|
|
101
102
|
end
|
|
102
103
|
else
|
|
@@ -15,7 +15,7 @@ local GameConfig = setmetatable({}, GameConfigBase)
|
|
|
15
15
|
GameConfig.ClassName = "GameConfig"
|
|
16
16
|
GameConfig.__index = GameConfig
|
|
17
17
|
|
|
18
|
-
function GameConfig.new(obj, serviceBag)
|
|
18
|
+
function GameConfig.new(obj: Instance, serviceBag)
|
|
19
19
|
local self = setmetatable(GameConfigBase.new(obj), GameConfig)
|
|
20
20
|
|
|
21
21
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
@@ -8,6 +8,6 @@ local BinderProvider = require("BinderProvider")
|
|
|
8
8
|
local Binder = require("Binder")
|
|
9
9
|
|
|
10
10
|
return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
11
|
-
self:Add(Binder.new("GameConfig", require("GameConfig"), serviceBag))
|
|
12
|
-
self:Add(Binder.new("GameConfigAsset", require("GameConfigAsset"), serviceBag))
|
|
11
|
+
self:Add(Binder.new("GameConfig", (require :: any)("GameConfig"), serviceBag))
|
|
12
|
+
self:Add(Binder.new("GameConfigAsset", (require :: any)("GameConfigAsset"), serviceBag))
|
|
13
13
|
end)
|
|
@@ -14,15 +14,27 @@ local GameConfigAssetUtils = require("GameConfigAssetUtils")
|
|
|
14
14
|
local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
|
|
15
15
|
local GameConfigAssetTypes = require("GameConfigAssetTypes")
|
|
16
16
|
local GameConfigServiceConstants = require("GameConfigServiceConstants")
|
|
17
|
+
local _ServiceBag = require("ServiceBag")
|
|
17
18
|
|
|
18
19
|
local GameConfigService = {}
|
|
19
20
|
GameConfigService.ServiceName = "GameConfigService"
|
|
20
21
|
|
|
22
|
+
export type GameConfigService = typeof(setmetatable(
|
|
23
|
+
{} :: {
|
|
24
|
+
_serviceBag: _ServiceBag.ServiceBag,
|
|
25
|
+
_maid: Maid.Maid,
|
|
26
|
+
_binders: any, -- Binders
|
|
27
|
+
_configPicker: GameConfigPicker.GameConfigPicker,
|
|
28
|
+
_getPreferredParent: () -> Instance,
|
|
29
|
+
},
|
|
30
|
+
{ __index = GameConfigService }
|
|
31
|
+
))
|
|
32
|
+
|
|
21
33
|
--[=[
|
|
22
34
|
Initializes the configuration service. Should be done via [ServiceBag].
|
|
23
35
|
@param serviceBag ServiceBag
|
|
24
36
|
]=]
|
|
25
|
-
function GameConfigService:Init(serviceBag)
|
|
37
|
+
function GameConfigService:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
26
38
|
assert(not self._serviceBag, "Already initialized")
|
|
27
39
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
28
40
|
self._maid = Maid.new()
|
|
@@ -32,13 +44,14 @@ function GameConfigService:Init(serviceBag)
|
|
|
32
44
|
self._serviceBag:GetService(require("MarketplaceServiceCache"))
|
|
33
45
|
|
|
34
46
|
-- Internal
|
|
35
|
-
self._serviceBag:GetService(require("GameConfigCommandService"))
|
|
47
|
+
self._serviceBag:GetService((require :: any)("GameConfigCommandService"))
|
|
36
48
|
self._serviceBag:GetService(require("GameConfigDataService"))
|
|
37
49
|
self._serviceBag:GetService(require("GameConfigTranslator"))
|
|
38
50
|
self._binders = self._serviceBag:GetService(require("GameConfigBindersServer"))
|
|
39
51
|
|
|
40
52
|
-- Setup picker
|
|
41
|
-
self._configPicker =
|
|
53
|
+
self._configPicker =
|
|
54
|
+
self._maid:Add(GameConfigPicker.new(self._serviceBag, self._binders.GameConfig, self._binders.GameConfigAsset))
|
|
42
55
|
|
|
43
56
|
self._getPreferredParent = PreferredParentUtils.createPreferredParentRetriever(ReplicatedStorage, "GameConfigs")
|
|
44
57
|
|
|
@@ -58,7 +71,7 @@ end
|
|
|
58
71
|
@param assetKey string -- Key name to use for the badge
|
|
59
72
|
@param badgeId number -- Cloud id
|
|
60
73
|
]=]
|
|
61
|
-
function GameConfigService:AddBadge(assetKey, badgeId)
|
|
74
|
+
function GameConfigService:AddBadge(assetKey: string, badgeId: number)
|
|
62
75
|
self:AddTypedAsset(GameConfigAssetTypes.BADGE, assetKey, badgeId)
|
|
63
76
|
end
|
|
64
77
|
|
|
@@ -67,7 +80,7 @@ end
|
|
|
67
80
|
@param assetKey string -- Key name to use for the product
|
|
68
81
|
@param productId number -- Cloud id
|
|
69
82
|
]=]
|
|
70
|
-
function GameConfigService:AddProduct(assetKey, productId)
|
|
83
|
+
function GameConfigService:AddProduct(assetKey: string, productId: number)
|
|
71
84
|
self:AddTypedAsset(GameConfigAssetTypes.PRODUCT, assetKey, productId)
|
|
72
85
|
end
|
|
73
86
|
|
|
@@ -76,7 +89,7 @@ end
|
|
|
76
89
|
@param assetKey string -- Key name to use for the pass
|
|
77
90
|
@param passId number -- Cloud id
|
|
78
91
|
]=]
|
|
79
|
-
function GameConfigService:AddPass(assetKey, passId)
|
|
92
|
+
function GameConfigService:AddPass(assetKey: string, passId: number)
|
|
80
93
|
self:AddTypedAsset(GameConfigAssetTypes.PASS, assetKey, passId)
|
|
81
94
|
end
|
|
82
95
|
|
|
@@ -85,7 +98,7 @@ end
|
|
|
85
98
|
@param assetKey string -- Key name to use for the place
|
|
86
99
|
@param placeId number -- Cloud id
|
|
87
100
|
]=]
|
|
88
|
-
function GameConfigService:AddPlace(assetKey, placeId)
|
|
101
|
+
function GameConfigService:AddPlace(assetKey: string, placeId: number)
|
|
89
102
|
self:AddTypedAsset(GameConfigAssetTypes.PLACE, assetKey, placeId)
|
|
90
103
|
end
|
|
91
104
|
|
|
@@ -94,7 +107,7 @@ end
|
|
|
94
107
|
@param assetKey string -- Key name to use for the asset
|
|
95
108
|
@param assetId number -- Cloud id
|
|
96
109
|
]=]
|
|
97
|
-
function GameConfigService:AddAsset(assetKey, assetId)
|
|
110
|
+
function GameConfigService:AddAsset(assetKey: string, assetId)
|
|
98
111
|
self:AddTypedAsset(GameConfigAssetTypes.ASSET, assetKey, assetId)
|
|
99
112
|
end
|
|
100
113
|
|
|
@@ -103,7 +116,7 @@ end
|
|
|
103
116
|
@param assetKey string -- Key name to use for the asset
|
|
104
117
|
@param subscriptionId string -- Cloud id
|
|
105
118
|
]=]
|
|
106
|
-
function GameConfigService:AddSubscription(assetKey, subscriptionId)
|
|
119
|
+
function GameConfigService:AddSubscription(assetKey: string, subscriptionId)
|
|
107
120
|
self:AddTypedAsset(GameConfigAssetTypes.SUBSCRIPTION, assetKey, subscriptionId)
|
|
108
121
|
end
|
|
109
122
|
|
|
@@ -112,7 +125,7 @@ end
|
|
|
112
125
|
@param assetKey string -- Key name to use for the bundle
|
|
113
126
|
@param bundleId number -- Cloud id
|
|
114
127
|
]=]
|
|
115
|
-
function GameConfigService:AddBundle(assetKey, bundleId)
|
|
128
|
+
function GameConfigService:AddBundle(assetKey: string, bundleId)
|
|
116
129
|
self:AddTypedAsset(GameConfigAssetTypes.BUNDLE, assetKey, bundleId)
|
|
117
130
|
end
|
|
118
131
|
|
|
@@ -123,7 +136,7 @@ end
|
|
|
123
136
|
@param assetKey string -- Key name to use for the bundle
|
|
124
137
|
@param assetId number -- Cloud id
|
|
125
138
|
]=]
|
|
126
|
-
function GameConfigService:AddTypedAsset(assetType, assetKey, assetId)
|
|
139
|
+
function GameConfigService:AddTypedAsset(assetType: GameConfigAssetTypes.GameConfigAssetType, assetKey: string, assetId: number)
|
|
127
140
|
assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
|
|
128
141
|
assert(type(assetKey) == "string", "Bad assetKey")
|
|
129
142
|
assert(type(assetId) == "number", "Bad assetId")
|
|
@@ -155,7 +168,7 @@ function GameConfigService:GetPreferredParent()
|
|
|
155
168
|
end
|
|
156
169
|
|
|
157
170
|
function GameConfigService:_getOrCreateDefaultGameConfig()
|
|
158
|
-
for _, item in
|
|
171
|
+
for _, item in self._binders.GameConfig:GetAll() do
|
|
159
172
|
if item:GetGameId() == game.GameId then
|
|
160
173
|
return item:GetFolder()
|
|
161
174
|
end
|
|
@@ -11,6 +11,7 @@ local GameConfigService = require("GameConfigService")
|
|
|
11
11
|
local GameConfigUtils = require("GameConfigUtils")
|
|
12
12
|
local String = require("String")
|
|
13
13
|
local Maid = require("Maid")
|
|
14
|
+
local _ServiceBag = require("ServiceBag")
|
|
14
15
|
|
|
15
16
|
local MantleConfigProvider = {}
|
|
16
17
|
MantleConfigProvider.ClassName = "MantleConfigProvider"
|
|
@@ -24,13 +25,13 @@ function MantleConfigProvider.new(container)
|
|
|
24
25
|
return self
|
|
25
26
|
end
|
|
26
27
|
|
|
27
|
-
function MantleConfigProvider:Init(serviceBag)
|
|
28
|
+
function MantleConfigProvider:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
28
29
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
29
30
|
self._gameConfigService = self._serviceBag:GetService(GameConfigService)
|
|
30
31
|
self._gameConfigBindersServer = self._serviceBag:GetService(GameConfigBindersServer)
|
|
31
32
|
self._maid = Maid.new()
|
|
32
33
|
|
|
33
|
-
for _, item in
|
|
34
|
+
for _, item in self._container:GetChildren() do
|
|
34
35
|
if item:IsA("ModuleScript") then
|
|
35
36
|
self:_loadConfig(item)
|
|
36
37
|
end
|
|
@@ -97,7 +98,7 @@ function MantleConfigProvider:_parseDataToConfig(mantleConfigData, name)
|
|
|
97
98
|
asset.Parent = GameConfigUtils.getOrCreateAssetFolder(gameConfig, assetType)
|
|
98
99
|
end
|
|
99
100
|
|
|
100
|
-
for key, value in
|
|
101
|
+
for key, value in mantleConfigData do
|
|
101
102
|
if type(value) == "table" then
|
|
102
103
|
addAsset("badge", GameConfigAssetTypes.BADGE, key, value)
|
|
103
104
|
addAsset("pass", GameConfigAssetTypes.PASS, key, value)
|
|
@@ -12,23 +12,24 @@ function GameConfigCmdrUtils.registerAssetTypes(cmdr, configPicker)
|
|
|
12
12
|
assert(cmdr, "Bad cmdr")
|
|
13
13
|
assert(configPicker, "Bad configPicker")
|
|
14
14
|
|
|
15
|
-
for _, assetType in
|
|
15
|
+
for _, assetType in GameConfigAssetTypes do
|
|
16
16
|
GameConfigCmdrUtils.registerAssetType(cmdr, configPicker, assetType)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
function GameConfigCmdrUtils.registerAssetType(cmdr, configPicker, assetType)
|
|
20
|
+
function GameConfigCmdrUtils.registerAssetType(cmdr, configPicker, assetType: GameConfigAssetTypes.GameConfigAssetType)
|
|
21
21
|
assert(cmdr, "Bad cmdr")
|
|
22
22
|
assert(type(assetType) == "string", "Bad assetType")
|
|
23
23
|
assert(configPicker, "Bad configPicker")
|
|
24
24
|
|
|
25
|
+
--stylua: ignore
|
|
25
26
|
local assetIdDefinition = {
|
|
26
27
|
Transform = function(text)
|
|
27
28
|
local allAssets = configPicker:GetAllActiveAssetsOfType(assetType)
|
|
28
29
|
local assetKeys = {}
|
|
29
30
|
|
|
30
31
|
-- TODO: Translate too?
|
|
31
|
-
for _, assetConfig in
|
|
32
|
+
for _, assetConfig in allAssets do
|
|
32
33
|
table.insert(assetKeys, assetConfig:GetAssetKey())
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -47,7 +48,7 @@ function GameConfigCmdrUtils.registerAssetType(cmdr, configPicker, assetType)
|
|
|
47
48
|
end,
|
|
48
49
|
Autocomplete = function(keys)
|
|
49
50
|
local stringified = {}
|
|
50
|
-
for _, item in
|
|
51
|
+
for _, item in keys do
|
|
51
52
|
table.insert(stringified, tostring(item))
|
|
52
53
|
end
|
|
53
54
|
return stringified
|
|
@@ -62,6 +63,8 @@ function GameConfigCmdrUtils.registerAssetType(cmdr, configPicker, assetType)
|
|
|
62
63
|
if asset then
|
|
63
64
|
return asset:GetAssetId()
|
|
64
65
|
end
|
|
66
|
+
|
|
67
|
+
return nil
|
|
65
68
|
end;
|
|
66
69
|
}
|
|
67
70
|
|