@quenty/gameconfig 12.24.3 → 12.24.4-canary.559.339cfa7.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +27 -27
  3. package/src/Client/Cmdr/GameConfigCommandServiceClient.lua +21 -19
  4. package/src/Client/Config/Asset/GameConfigAssetClient.lua +20 -19
  5. package/src/Client/Config/Config/GameConfigClient.lua +4 -4
  6. package/src/Client/GameConfigBindersClient.lua +2 -2
  7. package/src/Client/GameConfigServiceClient.lua +7 -8
  8. package/src/Server/Cmdr/GameConfigCommandService.lua +30 -30
  9. package/src/Server/Config/Asset/GameConfigAsset.lua +20 -9
  10. package/src/Server/Config/Config/GameConfig.lua +7 -6
  11. package/src/Server/GameConfigBindersServer.lua +2 -2
  12. package/src/Server/GameConfigService.lua +16 -11
  13. package/src/Server/GameConfigServiceConstants.lua +3 -2
  14. package/src/Server/Mantle/MantleConfigProvider.lua +6 -7
  15. package/src/Shared/Cmdr/GameConfigCmdrUtils.lua +1 -1
  16. package/src/Shared/Config/Asset/GameConfigAssetBase.lua +29 -29
  17. package/src/Shared/Config/Asset/GameConfigAssetConstants.lua +4 -3
  18. package/src/Shared/Config/Asset/GameConfigAssetUtils.lua +12 -6
  19. package/src/Shared/Config/AssetTypes/GameConfigAssetTypeUtils.lua +15 -14
  20. package/src/Shared/Config/AssetTypes/GameConfigAssetTypes.lua +1 -0
  21. package/src/Shared/Config/Config/GameConfigBase.lua +13 -13
  22. package/src/Shared/Config/Config/GameConfigConstants.lua +3 -2
  23. package/src/Shared/Config/Config/GameConfigUtils.lua +10 -7
  24. package/src/Shared/Config/Picker/GameConfigPicker.lua +25 -28
  25. package/src/Shared/GameConfigDataService.lua +18 -7
  26. package/src/Shared/GameConfigTranslator.lua +7 -6
  27. package/test/modules/Server/TestMantleConfigProvider/init.lua +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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.4-canary.559.339cfa7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.24.3...@quenty/gameconfig@12.24.4-canary.559.339cfa7.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
+ ### Features
15
+
16
+ * Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [12.24.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gameconfig@12.24.2...@quenty/gameconfig@12.24.3) (2025-04-10)
7
23
 
8
24
  **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.3",
3
+ "version": "12.24.4-canary.559.339cfa7.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.17.3",
31
- "@quenty/badgeutils": "^10.10.4",
32
- "@quenty/baseobject": "^10.8.3",
33
- "@quenty/binder": "^14.19.3",
34
- "@quenty/brio": "^14.17.3",
35
- "@quenty/clienttranslator": "^14.19.3",
36
- "@quenty/cmdrservice": "^13.22.3",
37
- "@quenty/instanceutils": "^13.17.3",
38
- "@quenty/loader": "^10.8.3",
39
- "@quenty/maid": "^3.4.3",
40
- "@quenty/marketplaceutils": "^11.11.4",
41
- "@quenty/observablecollection": "^12.20.3",
42
- "@quenty/playerutils": "^8.17.3",
43
- "@quenty/preferredparentutils": "^4.3.2",
44
- "@quenty/promise": "^10.10.4",
45
- "@quenty/pseudolocalize": "^3.4.2",
46
- "@quenty/remotefunctionutils": "^10.10.4",
47
- "@quenty/remoting": "^12.18.3",
48
- "@quenty/rx": "^13.17.3",
49
- "@quenty/rxbinderutils": "^14.19.3",
50
- "@quenty/servicebag": "^11.11.4",
51
- "@quenty/statestack": "^14.18.3",
52
- "@quenty/string": "^3.3.3",
53
- "@quenty/table": "^3.7.4",
54
- "@quenty/valueobject": "^13.17.3"
30
+ "@quenty/attributeutils": "14.17.4-canary.559.339cfa7.0",
31
+ "@quenty/badgeutils": "10.10.5-canary.559.339cfa7.0",
32
+ "@quenty/baseobject": "10.8.4-canary.559.339cfa7.0",
33
+ "@quenty/binder": "14.19.4-canary.559.339cfa7.0",
34
+ "@quenty/brio": "14.17.4-canary.559.339cfa7.0",
35
+ "@quenty/clienttranslator": "14.19.4-canary.559.339cfa7.0",
36
+ "@quenty/cmdrservice": "13.22.4-canary.559.339cfa7.0",
37
+ "@quenty/instanceutils": "13.17.4-canary.559.339cfa7.0",
38
+ "@quenty/loader": "10.8.4-canary.559.339cfa7.0",
39
+ "@quenty/maid": "3.4.4-canary.559.339cfa7.0",
40
+ "@quenty/marketplaceutils": "11.11.5-canary.559.339cfa7.0",
41
+ "@quenty/observablecollection": "12.20.4-canary.559.339cfa7.0",
42
+ "@quenty/playerutils": "8.17.4-canary.559.339cfa7.0",
43
+ "@quenty/preferredparentutils": "4.3.3-canary.559.339cfa7.0",
44
+ "@quenty/promise": "10.10.5-canary.559.339cfa7.0",
45
+ "@quenty/pseudolocalize": "3.4.3-canary.559.339cfa7.0",
46
+ "@quenty/remotefunctionutils": "10.10.5-canary.559.339cfa7.0",
47
+ "@quenty/remoting": "12.18.4-canary.559.339cfa7.0",
48
+ "@quenty/rx": "13.17.4-canary.559.339cfa7.0",
49
+ "@quenty/rxbinderutils": "14.19.4-canary.559.339cfa7.0",
50
+ "@quenty/servicebag": "11.11.5-canary.559.339cfa7.0",
51
+ "@quenty/statestack": "14.18.4-canary.559.339cfa7.0",
52
+ "@quenty/string": "3.3.3",
53
+ "@quenty/table": "3.7.5-canary.559.339cfa7.0",
54
+ "@quenty/valueobject": "13.17.4-canary.559.339cfa7.0"
55
55
  },
56
- "gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
56
+ "gitHead": "339cfa778736f08768ed7305041f6221faa35bfc"
57
57
  }
@@ -6,14 +6,14 @@ local require = require(script.Parent.loader).load(script)
6
6
 
7
7
  local GameConfigCmdrUtils = require("GameConfigCmdrUtils")
8
8
  local Maid = require("Maid")
9
- local RxStateStackUtils = require("RxStateStackUtils")
10
9
  local Rx = require("Rx")
11
- local _ServiceBag = require("ServiceBag")
10
+ local RxStateStackUtils = require("RxStateStackUtils")
11
+ local ServiceBag = require("ServiceBag")
12
12
 
13
13
  local GameConfigCommandServiceClient = {}
14
14
  GameConfigCommandServiceClient.ServiceName = "GameConfigCommandServiceClient"
15
15
 
16
- function GameConfigCommandServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
16
+ function GameConfigCommandServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
17
17
  assert(not self._serviceBag, "Already initialized")
18
18
  self._serviceBag = assert(serviceBag, "No serviceBag")
19
19
  self._maid = Maid.new()
@@ -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:Observe():Pipe({
41
- Rx.switchMap(function(config)
42
- if config then
43
- return config:ObserveConfigName()
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
- return Rx.of(nil)
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
@@ -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
- local _ServiceBag = require("ServiceBag")
12
- local _JSONTranslator = require("JSONTranslator")
12
+ local ServiceBag = require("ServiceBag")
13
13
 
14
14
  local GameConfigAssetClient = setmetatable({}, GameConfigAssetBase)
15
15
  GameConfigAssetClient.ClassName = "GameConfigAssetClient"
@@ -17,8 +17,8 @@ GameConfigAssetClient.__index = GameConfigAssetClient
17
17
 
18
18
  export type GameConfigAssetClient = typeof(setmetatable(
19
19
  {} :: {
20
- _serviceBag: _ServiceBag.ServiceBag,
21
- _configTranslator: _JSONTranslator.JSONTranslator,
20
+ _serviceBag: ServiceBag.ServiceBag,
21
+ _configTranslator: JSONTranslator.JSONTranslator,
22
22
  },
23
23
  GameConfigAssetClient
24
24
  )) & GameConfigAssetBase.GameConfigAssetBase
@@ -29,7 +29,7 @@ export type GameConfigAssetClient = typeof(setmetatable(
29
29
  @param serviceBag ServiceBag
30
30
  @return GameConfigAssetClient
31
31
  ]=]
32
- function GameConfigAssetClient.new(folder: Folder, serviceBag: _ServiceBag.ServiceBag): GameConfigAssetClient
32
+ function GameConfigAssetClient.new(folder: Folder, serviceBag: ServiceBag.ServiceBag): GameConfigAssetClient
33
33
  local self = setmetatable(GameConfigAssetBase.new(folder, serviceBag) :: any, GameConfigAssetClient)
34
34
 
35
35
  self._serviceBag = assert(serviceBag, "No serviceBag")
@@ -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
- if type(state.translationKey) == "string"
48
- and type(state.text) == "string"
49
- and #state.text > 0
50
- and state.assetKey then
51
-
52
- local context = string.format("GameConfigAsset.%s", state.assetKey)
53
- local localeId = "en"
54
-
55
- self._configTranslator:SetEntryValue(state.translationKey, state.text, context, localeId, state.text)
56
- end
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
@@ -9,7 +9,7 @@ local require = require(script.Parent.loader).load(script)
9
9
 
10
10
  local GameConfigBase = require("GameConfigBase")
11
11
  local GameConfigBindersClient = require("GameConfigBindersClient")
12
- local _ServiceBag = require("ServiceBag")
12
+ local ServiceBag = require("ServiceBag")
13
13
 
14
14
  local GameConfigClient = setmetatable({}, GameConfigBase)
15
15
  GameConfigClient.ClassName = "GameConfigClient"
@@ -17,13 +17,13 @@ GameConfigClient.__index = GameConfigClient
17
17
 
18
18
  export type GameConfigClient = typeof(setmetatable(
19
19
  {} :: {
20
- _serviceBag: _ServiceBag.ServiceBag,
20
+ _serviceBag: ServiceBag.ServiceBag,
21
21
  _gameConfigBindersClient: any,
22
22
  },
23
23
  {} :: typeof({ __index = GameConfigClient })
24
24
  )) & GameConfigBase.GameConfigBase
25
25
 
26
- function GameConfigClient.new(folder: Folder, serviceBag: _ServiceBag.ServiceBag): GameConfigClient
26
+ function GameConfigClient.new(folder: Folder, serviceBag: ServiceBag.ServiceBag): GameConfigClient
27
27
  local self = setmetatable(GameConfigBase.new(folder), GameConfigClient)
28
28
 
29
29
  self._serviceBag = assert(serviceBag, "No serviceBag")
@@ -38,4 +38,4 @@ function GameConfigClient.GetGameConfigAssetBinder(self: GameConfigClient)
38
38
  return self._gameConfigBindersClient.GameConfigAsset
39
39
  end
40
40
 
41
- return GameConfigClient
41
+ return GameConfigClient
@@ -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,14 +4,14 @@
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")
9
- local _ServiceBag = require("ServiceBag")
8
+ local Maid = require("Maid")
9
+ local ServiceBag = require("ServiceBag")
10
10
 
11
11
  local GameConfigServiceClient = {}
12
12
  GameConfigServiceClient.ServiceName = "GameConfigServiceClient"
13
13
 
14
- function GameConfigServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
14
+ function GameConfigServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
15
15
  assert(not self._serviceBag, "Already initialized")
16
16
  self._serviceBag = assert(serviceBag, "No serviceBag")
17
17
  self._maid = Maid.new()
@@ -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 = self._maid:Add(GameConfigPicker.new(self._serviceBag, self._binders.GameConfig, self._binders.GameConfigAsset))
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,15 +7,15 @@ 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
- local _ServiceBag = require("ServiceBag")
13
+ local ServiceBag = require("ServiceBag")
14
14
 
15
15
  local GameConfigCommandService = {}
16
16
  GameConfigCommandService.ServiceName = "GameConfigCommandService"
17
17
 
18
- function GameConfigCommandService:Init(serviceBag: _ServiceBag.ServiceBag)
18
+ function GameConfigCommandService:Init(serviceBag: ServiceBag.ServiceBag)
19
19
  assert(not self._serviceBag, "Already initialized")
20
20
  self._serviceBag = assert(serviceBag, "No serviceBag")
21
21
 
@@ -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
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class GameConfigAsset
3
4
  ]=]
@@ -6,22 +7,32 @@ local require = require(script.Parent.loader).load(script)
6
7
 
7
8
  local GameConfigAssetBase = require("GameConfigAssetBase")
8
9
  local GameConfigTranslator = require("GameConfigTranslator")
10
+ local JSONTranslator = require("JSONTranslator")
9
11
  local Rx = require("Rx")
12
+ local ServiceBag = require("ServiceBag")
10
13
 
11
14
  local GameConfigAsset = setmetatable({}, GameConfigAssetBase)
12
15
  GameConfigAsset.ClassName = "GameConfigAsset"
13
16
  GameConfigAsset.__index = GameConfigAsset
14
17
 
15
- function GameConfigAsset.new(obj, serviceBag)
16
- local self = setmetatable(GameConfigAssetBase.new(obj, serviceBag), GameConfigAsset)
18
+ export type GameConfigAsset = typeof(setmetatable(
19
+ {} :: {
20
+ _serviceBag: ServiceBag.ServiceBag,
21
+ _translator: JSONTranslator.JSONTranslator,
22
+ },
23
+ {} :: typeof({ __index = GameConfigAsset })
24
+ )) & GameConfigAssetBase.GameConfigAssetBase
25
+
26
+ function GameConfigAsset.new(obj: Folder, serviceBag: ServiceBag.ServiceBag): GameConfigAsset
27
+ local self: GameConfigAsset = setmetatable(GameConfigAssetBase.new(obj, serviceBag) :: any, GameConfigAsset)
17
28
 
18
29
  self._serviceBag = assert(serviceBag, "No serviceBag")
19
30
  self._translator = self._serviceBag:GetService(GameConfigTranslator)
20
31
 
21
32
  self._maid:GiveTask(Rx.combineLatest({
22
- assetKey = self:ObserveAssetKey();
23
- assetType = self:ObserveAssetType();
24
- text = self:ObserveCloudName();
33
+ assetKey = self:ObserveAssetKey(),
34
+ assetType = self:ObserveAssetType(),
35
+ text = self:ObserveCloudName(),
25
36
  }):Subscribe(function(state)
26
37
  if state.text and state.text ~= "" then
27
38
  local prefix = string.format("assets.%s.%s.name", state.assetType, state.assetKey)
@@ -32,9 +43,9 @@ function GameConfigAsset.new(obj, serviceBag)
32
43
  end))
33
44
 
34
45
  self._maid:GiveTask(Rx.combineLatest({
35
- assetKey = self:ObserveAssetKey();
36
- assetType = self:ObserveAssetType();
37
- text = self:ObserveCloudDescription();
46
+ assetKey = self:ObserveAssetKey(),
47
+ assetType = self:ObserveAssetType(),
48
+ text = self:ObserveCloudDescription(),
38
49
  }):Subscribe(function(state)
39
50
  if state.text and state.text ~= "" then
40
51
  local prefix = string.format("assets.%s.%s.description", state.assetType, state.assetKey)
@@ -47,4 +58,4 @@ function GameConfigAsset.new(obj, serviceBag)
47
58
  return self
48
59
  end
49
60
 
50
- return GameConfigAsset
61
+ return GameConfigAsset
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  See [GameConfigBase] for API and [GameConfigService] for usage.
3
4
  @class GameConfig
@@ -6,11 +7,11 @@
6
7
 
7
8
  local require = require(script.Parent.loader).load(script)
8
9
 
10
+ local GameConfigAssetTypes = require("GameConfigAssetTypes")
9
11
  local GameConfigBase = require("GameConfigBase")
10
12
  local GameConfigBindersServer = require("GameConfigBindersServer")
11
- local GameConfigAssetTypes = require("GameConfigAssetTypes")
12
13
  local GameConfigUtils = require("GameConfigUtils")
13
- local _ServiceBag = require("ServiceBag")
14
+ local ServiceBag = require("ServiceBag")
14
15
 
15
16
  local GameConfig = setmetatable({}, GameConfigBase)
16
17
  GameConfig.ClassName = "GameConfig"
@@ -18,19 +19,19 @@ GameConfig.__index = GameConfig
18
19
 
19
20
  export type GameConfig = typeof(setmetatable(
20
21
  {} :: {
21
- _serviceBag: any,
22
+ _serviceBag: ServiceBag.ServiceBag,
22
23
  _gameConfigBindersServer: any,
23
24
  },
24
25
  {} :: typeof({ __index = GameConfig })
25
26
  )) & GameConfigBase.GameConfigBase
26
27
 
27
- function GameConfig.new(obj: Instance, serviceBag: _ServiceBag.ServiceBag): GameConfig
28
+ function GameConfig.new(obj: Instance, serviceBag: ServiceBag.ServiceBag): GameConfig
28
29
  local self: GameConfig = setmetatable(GameConfigBase.new(obj) :: any, GameConfig)
29
30
 
30
31
  self._serviceBag = assert(serviceBag, "No serviceBag")
31
32
  self._gameConfigBindersServer = self._serviceBag:GetService(GameConfigBindersServer)
32
33
 
33
- for _, assetType in GameConfigAssetTypes do
34
+ for _, assetType: any in GameConfigAssetTypes do
34
35
  GameConfigUtils.getOrCreateAssetFolder(self._obj, assetType)
35
36
  end
36
37
 
@@ -43,4 +44,4 @@ function GameConfig.GetGameConfigAssetBinder(self: GameConfig)
43
44
  return self._gameConfigBindersServer.GameConfigAsset
44
45
  end
45
46
 
46
- 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)
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class GameConfigService
3
4
  ]=]
@@ -6,22 +7,22 @@ local require = require(script.Parent.loader).load(script)
6
7
 
7
8
  local ReplicatedStorage = game:GetService("ReplicatedStorage")
8
9
 
9
- local GameConfigUtils = require("GameConfigUtils")
10
- local GameConfigPicker = require("GameConfigPicker")
11
- local Maid = require("Maid")
12
- local PreferredParentUtils = require("PreferredParentUtils")
13
- local GameConfigAssetUtils = require("GameConfigAssetUtils")
14
10
  local GameConfigAssetTypeUtils = require("GameConfigAssetTypeUtils")
15
11
  local GameConfigAssetTypes = require("GameConfigAssetTypes")
12
+ local GameConfigAssetUtils = require("GameConfigAssetUtils")
13
+ local GameConfigPicker = require("GameConfigPicker")
16
14
  local GameConfigServiceConstants = require("GameConfigServiceConstants")
17
- local _ServiceBag = require("ServiceBag")
15
+ local GameConfigUtils = require("GameConfigUtils")
16
+ local Maid = require("Maid")
17
+ local PreferredParentUtils = require("PreferredParentUtils")
18
+ local ServiceBag = require("ServiceBag")
18
19
 
19
20
  local GameConfigService = {}
20
21
  GameConfigService.ServiceName = "GameConfigService"
21
22
 
22
23
  export type GameConfigService = typeof(setmetatable(
23
24
  {} :: {
24
- _serviceBag: _ServiceBag.ServiceBag,
25
+ _serviceBag: ServiceBag.ServiceBag,
25
26
  _maid: Maid.Maid,
26
27
  _binders: any, -- Binders
27
28
  _configPicker: GameConfigPicker.GameConfigPicker,
@@ -34,7 +35,7 @@ export type GameConfigService = typeof(setmetatable(
34
35
  Initializes the configuration service. Should be done via [ServiceBag].
35
36
  @param serviceBag ServiceBag
36
37
  ]=]
37
- function GameConfigService:Init(serviceBag: _ServiceBag.ServiceBag)
38
+ function GameConfigService:Init(serviceBag: ServiceBag.ServiceBag)
38
39
  assert(not self._serviceBag, "Already initialized")
39
40
  self._serviceBag = assert(serviceBag, "No serviceBag")
40
41
  self._maid = Maid.new()
@@ -55,7 +56,7 @@ function GameConfigService:Init(serviceBag: _ServiceBag.ServiceBag)
55
56
 
56
57
  self._getPreferredParent = PreferredParentUtils.createPreferredParentRetriever(ReplicatedStorage, "GameConfigs")
57
58
 
58
- self._serviceBag:GetService(require("GameConfigDataService")):SetConfigPicker(self._configPicker)
59
+ self._serviceBag:GetService(require("GameConfigDataService") :: any):SetConfigPicker(self._configPicker)
59
60
  end
60
61
 
61
62
  --[=[
@@ -136,7 +137,11 @@ end
136
137
  @param assetKey string -- Key name to use for the bundle
137
138
  @param assetId number -- Cloud id
138
139
  ]=]
139
- function GameConfigService:AddTypedAsset(assetType: GameConfigAssetTypes.GameConfigAssetType, assetKey: string, assetId: number)
140
+ function GameConfigService:AddTypedAsset(
141
+ assetType: GameConfigAssetTypes.GameConfigAssetType,
142
+ assetKey: string,
143
+ assetId: number
144
+ )
140
145
  assert(GameConfigAssetTypeUtils.isAssetType(assetType), "Bad assetType")
141
146
  assert(type(assetKey) == "string", "Bad assetKey")
142
147
  assert(type(assetId) == "number", "Bad assetId")
@@ -188,4 +193,4 @@ function GameConfigService:Destroy()
188
193
  self._maid:DoCleaning()
189
194
  end
190
195
 
191
- return GameConfigService
196
+ return GameConfigService
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  @class GameConfigServiceConstants
3
4
  ]=]
@@ -7,5 +8,5 @@ local require = require(script.Parent.loader).load(script)
7
8
  local Table = require("Table")
8
9
 
9
10
  return Table.readonly({
10
- DEFAULT_CONFIG_NAME = "DefaultGameConfig";
11
- })
11
+ DEFAULT_CONFIG_NAME = "DefaultGameConfig",
12
+ })