@quenty/playerinputmode 9.19.3 → 9.19.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 +16 -0
- package/package.json +13 -13
- package/src/Client/PlayerInputModeServiceClient.lua +31 -29
- package/src/Server/PlayerInputModeService.lua +4 -5
- package/src/Shared/PlayerInputModeServiceConstants.lua +5 -4
- package/src/Shared/PlayerInputModeTypes.lua +4 -4
- package/src/Shared/PlayerInputModeUtils.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
|
+
## [9.19.4-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerinputmode@9.19.3...@quenty/playerinputmode@9.19.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
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [9.19.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerinputmode@9.19.2...@quenty/playerinputmode@9.19.3) (2025-04-10)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @quenty/playerinputmode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/playerinputmode",
|
|
3
|
-
"version": "9.19.
|
|
3
|
+
"version": "9.19.4-canary.11a5dcf.0",
|
|
4
4
|
"description": "Service that takes active input modes from the player and exposes it to every other player via the server.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/attributeutils": "
|
|
30
|
-
"@quenty/brio": "
|
|
31
|
-
"@quenty/inputmode": "
|
|
32
|
-
"@quenty/loader": "
|
|
33
|
-
"@quenty/maid": "
|
|
34
|
-
"@quenty/playerutils": "
|
|
35
|
-
"@quenty/promise": "
|
|
36
|
-
"@quenty/remoting": "
|
|
37
|
-
"@quenty/rx": "
|
|
38
|
-
"@quenty/servicebag": "
|
|
39
|
-
"@quenty/table": "
|
|
29
|
+
"@quenty/attributeutils": "14.17.4-canary.11a5dcf.0",
|
|
30
|
+
"@quenty/brio": "14.17.4-canary.11a5dcf.0",
|
|
31
|
+
"@quenty/inputmode": "13.18.4-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
33
|
+
"@quenty/maid": "3.4.4-canary.11a5dcf.0",
|
|
34
|
+
"@quenty/playerutils": "8.17.4-canary.11a5dcf.0",
|
|
35
|
+
"@quenty/promise": "10.10.5-canary.11a5dcf.0",
|
|
36
|
+
"@quenty/remoting": "12.18.4-canary.11a5dcf.0",
|
|
37
|
+
"@quenty/rx": "13.17.4-canary.11a5dcf.0",
|
|
38
|
+
"@quenty/servicebag": "11.11.5-canary.11a5dcf.0",
|
|
39
|
+
"@quenty/table": "3.7.5-canary.11a5dcf.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
45
45
|
}
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
-
local InputModeTypes = require("InputModeTypes")
|
|
12
11
|
local InputModeTypeSelector = require("InputModeTypeSelector")
|
|
12
|
+
local InputModeTypes = require("InputModeTypes")
|
|
13
13
|
local Maid = require("Maid")
|
|
14
14
|
local PlayerInputModeServiceConstants = require("PlayerInputModeServiceConstants")
|
|
15
|
+
local PlayerInputModeTypes = require("PlayerInputModeTypes")
|
|
16
|
+
local PlayerInputModeUtils = require("PlayerInputModeUtils")
|
|
15
17
|
local PromiseGetRemoteEvent = require("PromiseGetRemoteEvent")
|
|
16
18
|
local Rx = require("Rx")
|
|
17
|
-
local PlayerInputModeUtils = require("PlayerInputModeUtils")
|
|
18
|
-
local PlayerInputModeTypes = require("PlayerInputModeTypes")
|
|
19
|
-
local RxPlayerUtils = require("RxPlayerUtils")
|
|
20
19
|
local RxBrioUtils = require("RxBrioUtils")
|
|
21
|
-
local
|
|
20
|
+
local RxPlayerUtils = require("RxPlayerUtils")
|
|
21
|
+
local ServiceBag = require("ServiceBag")
|
|
22
22
|
|
|
23
23
|
local PlayerInputModeServiceClient = {}
|
|
24
24
|
PlayerInputModeServiceClient.ServiceName = "PlayerInputModeServiceClient"
|
|
25
25
|
|
|
26
|
-
function PlayerInputModeServiceClient:Init(serviceBag:
|
|
26
|
+
function PlayerInputModeServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
27
27
|
assert(not self._serviceBag, "Already initialized")
|
|
28
28
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
29
29
|
|
|
@@ -36,32 +36,34 @@ function PlayerInputModeServiceClient:Start()
|
|
|
36
36
|
self._selector = self._maid:Add(InputModeTypeSelector.new(self._serviceBag, {
|
|
37
37
|
InputModeTypes.Gamepads,
|
|
38
38
|
InputModeTypes.Keyboard,
|
|
39
|
-
InputModeTypes.Touch
|
|
39
|
+
InputModeTypes.Touch,
|
|
40
40
|
}))
|
|
41
41
|
|
|
42
42
|
self:_promiseRemoteEvent():Then(function(remoteEvent)
|
|
43
43
|
self._maid:GiveTask(RxBrioUtils.flatCombineLatest({
|
|
44
|
-
activeMode = self._selector:ObserveActiveInputType()
|
|
45
|
-
localPlayer = RxPlayerUtils.observeLocalPlayerBrio()
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
modeType
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
activeMode = self._selector:ObserveActiveInputType(),
|
|
45
|
+
localPlayer = RxPlayerUtils.observeLocalPlayerBrio(),
|
|
46
|
+
})
|
|
47
|
+
:Pipe({
|
|
48
|
+
Rx.throttleTime(1, { leading = true, trailing = true }),
|
|
49
|
+
})
|
|
50
|
+
:Subscribe(function(state)
|
|
51
|
+
local modeType
|
|
52
|
+
if state.activeMode == InputModeTypes.Gamepads then
|
|
53
|
+
modeType = PlayerInputModeTypes.GAMEPAD
|
|
54
|
+
elseif state.activeMode == InputModeTypes.Keyboard then
|
|
55
|
+
modeType = PlayerInputModeTypes.KEYBOARD
|
|
56
|
+
elseif state.activeMode == InputModeTypes.Touch then
|
|
57
|
+
modeType = PlayerInputModeTypes.TOUCH
|
|
58
|
+
else
|
|
59
|
+
error("Bad activeMode")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
if state.localPlayer then
|
|
63
|
+
PlayerInputModeUtils.setPlayerInputModeType(state.localPlayer, modeType)
|
|
64
|
+
remoteEvent:FireServer(PlayerInputModeServiceConstants.REQUEST_SET_INPUT_MODE, modeType)
|
|
65
|
+
end
|
|
66
|
+
end))
|
|
65
67
|
end)
|
|
66
68
|
end
|
|
67
69
|
|
|
@@ -97,4 +99,4 @@ function PlayerInputModeServiceClient:Destroy()
|
|
|
97
99
|
self._maid:DoCleaning()
|
|
98
100
|
end
|
|
99
101
|
|
|
100
|
-
return PlayerInputModeServiceClient
|
|
102
|
+
return PlayerInputModeServiceClient
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
-
local GetRemoteEvent
|
|
11
|
+
local GetRemoteEvent = require("GetRemoteEvent")
|
|
12
12
|
local Maid = require("Maid")
|
|
13
13
|
local PlayerInputModeServiceConstants = require("PlayerInputModeServiceConstants")
|
|
14
14
|
local PlayerInputModeUtils = require("PlayerInputModeUtils")
|
|
15
|
-
local
|
|
15
|
+
local ServiceBag = require("ServiceBag")
|
|
16
16
|
|
|
17
17
|
local PlayerInputModeService = {}
|
|
18
18
|
PlayerInputModeService.ServiceName = "PlayerInputModeService"
|
|
19
19
|
|
|
20
|
-
function PlayerInputModeService:Init(serviceBag:
|
|
20
|
+
function PlayerInputModeService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
21
21
|
assert(not self._serviceBag, "Already initialized")
|
|
22
22
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
23
23
|
|
|
@@ -83,5 +83,4 @@ function PlayerInputModeService:_setPlayerInputModeType(player: Player, inputMod
|
|
|
83
83
|
PlayerInputModeUtils.setPlayerInputModeType(player, inputModeType)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
return PlayerInputModeService
|
|
86
|
+
return PlayerInputModeService
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class PlayerInputModeServiceConstants
|
|
3
4
|
]=]
|
|
@@ -7,7 +8,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
8
|
local Table = require("Table")
|
|
8
9
|
|
|
9
10
|
return Table.readonly({
|
|
10
|
-
REMOTE_EVENT_NAME = "PlayerInputModeRemoteEvent"
|
|
11
|
-
INPUT_MODE_ATTRIBUTE = "PlayerInputMode"
|
|
12
|
-
REQUEST_SET_INPUT_MODE = "requestSetInputMode"
|
|
13
|
-
})
|
|
11
|
+
REMOTE_EVENT_NAME = "PlayerInputModeRemoteEvent",
|
|
12
|
+
INPUT_MODE_ATTRIBUTE = "PlayerInputMode",
|
|
13
|
+
REQUEST_SET_INPUT_MODE = "requestSetInputMode",
|
|
14
|
+
})
|
|
@@ -7,7 +7,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
local Table = require("Table")
|
|
8
8
|
|
|
9
9
|
return Table.readonly({
|
|
10
|
-
GAMEPAD = "gamepad"
|
|
11
|
-
TOUCH = "touch"
|
|
12
|
-
KEYBOARD = "keyboard"
|
|
13
|
-
})
|
|
10
|
+
GAMEPAD = "gamepad",
|
|
11
|
+
TOUCH = "touch",
|
|
12
|
+
KEYBOARD = "keyboard",
|
|
13
|
+
})
|