@quenty/playerinputmode 9.20.0-canary.ae8d76d.0 → 9.20.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 +13 -13
- package/src/Client/PlayerInputModeServiceClient.lua +29 -27
- package/src/Server/PlayerInputModeService.lua +2 -3
- package/src/Shared/PlayerInputModeServiceConstants.lua +4 -4
- package/src/Shared/PlayerInputModeTypes.lua +4 -4
- package/src/Shared/PlayerInputModeUtils.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
|
-
# [9.20.0
|
|
6
|
+
# [9.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerinputmode@9.19.3...@quenty/playerinputmode@9.20.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/playerinputmode",
|
|
3
|
-
"version": "9.20.0
|
|
3
|
+
"version": "9.20.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": "14.18.0
|
|
30
|
-
"@quenty/brio": "14.18.0
|
|
31
|
-
"@quenty/inputmode": "13.19.0
|
|
32
|
-
"@quenty/loader": "10.
|
|
33
|
-
"@quenty/maid": "3.
|
|
34
|
-
"@quenty/playerutils": "8.18.0
|
|
35
|
-
"@quenty/promise": "10.11.0
|
|
36
|
-
"@quenty/remoting": "12.19.0
|
|
37
|
-
"@quenty/rx": "13.18.0
|
|
38
|
-
"@quenty/servicebag": "11.12.0
|
|
39
|
-
"@quenty/table": "3.
|
|
29
|
+
"@quenty/attributeutils": "^14.18.0",
|
|
30
|
+
"@quenty/brio": "^14.18.0",
|
|
31
|
+
"@quenty/inputmode": "^13.19.0",
|
|
32
|
+
"@quenty/loader": "^10.9.0",
|
|
33
|
+
"@quenty/maid": "^3.5.0",
|
|
34
|
+
"@quenty/playerutils": "^8.18.0",
|
|
35
|
+
"@quenty/promise": "^10.11.0",
|
|
36
|
+
"@quenty/remoting": "^12.19.0",
|
|
37
|
+
"@quenty/rx": "^13.18.0",
|
|
38
|
+
"@quenty/servicebag": "^11.12.0",
|
|
39
|
+
"@quenty/table": "^3.8.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
|
|
45
45
|
}
|
|
@@ -8,16 +8,16 @@
|
|
|
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")
|
|
20
|
+
local RxPlayerUtils = require("RxPlayerUtils")
|
|
21
21
|
local ServiceBag = require("ServiceBag")
|
|
22
22
|
|
|
23
23
|
local PlayerInputModeServiceClient = {}
|
|
@@ -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,7 +8,7 @@
|
|
|
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")
|
|
@@ -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
|
|
@@ -8,7 +8,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
8
8
|
local Table = require("Table")
|
|
9
9
|
|
|
10
10
|
return Table.readonly({
|
|
11
|
-
REMOTE_EVENT_NAME = "PlayerInputModeRemoteEvent"
|
|
12
|
-
INPUT_MODE_ATTRIBUTE = "PlayerInputMode"
|
|
13
|
-
REQUEST_SET_INPUT_MODE = "requestSetInputMode"
|
|
14
|
-
})
|
|
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
|
+
})
|