@quenty/playerinputmode 9.19.4-canary.559.9f38947.0 → 9.20.0-canary.0a5db80.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 +3 -11
- package/package.json +13 -13
- package/src/Client/PlayerInputModeServiceClient.lua +27 -29
- package/src/Server/PlayerInputModeService.lua +3 -2
- 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,25 +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
|
-
|
|
6
|
+
# [9.20.0-canary.0a5db80.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerinputmode@9.19.2...@quenty/playerinputmode@9.20.0-canary.0a5db80.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
* Additional type checking updates ([
|
|
11
|
+
* Additional type checking updates ([7e008c5](https://github.com/Quenty/NevermoreEngine/commit/7e008c58547bd00b5904e56541454a38c8d72ccc))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [9.19.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerinputmode@9.19.2...@quenty/playerinputmode@9.19.3) (2025-04-10)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @quenty/playerinputmode
|
|
16
|
+
* Add even more types ([0a5db80](https://github.com/Quenty/NevermoreEngine/commit/0a5db8004684dc3e76fd5944599a22602d48cfa9))
|
|
25
17
|
|
|
26
18
|
|
|
27
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/playerinputmode",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.20.0-canary.0a5db80.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.
|
|
30
|
-
"@quenty/brio": "14.
|
|
31
|
-
"@quenty/inputmode": "13.
|
|
32
|
-
"@quenty/loader": "10.
|
|
33
|
-
"@quenty/maid": "3.
|
|
34
|
-
"@quenty/playerutils": "8.
|
|
35
|
-
"@quenty/promise": "10.
|
|
36
|
-
"@quenty/remoting": "12.
|
|
37
|
-
"@quenty/rx": "13.
|
|
38
|
-
"@quenty/servicebag": "11.
|
|
39
|
-
"@quenty/table": "3.
|
|
29
|
+
"@quenty/attributeutils": "14.18.0-canary.0a5db80.0",
|
|
30
|
+
"@quenty/brio": "14.18.0-canary.0a5db80.0",
|
|
31
|
+
"@quenty/inputmode": "13.19.0-canary.0a5db80.0",
|
|
32
|
+
"@quenty/loader": "10.9.0-canary.0a5db80.0",
|
|
33
|
+
"@quenty/maid": "3.5.0-canary.0a5db80.0",
|
|
34
|
+
"@quenty/playerutils": "8.18.0-canary.0a5db80.0",
|
|
35
|
+
"@quenty/promise": "10.11.0-canary.0a5db80.0",
|
|
36
|
+
"@quenty/remoting": "12.19.0-canary.0a5db80.0",
|
|
37
|
+
"@quenty/rx": "13.18.0-canary.0a5db80.0",
|
|
38
|
+
"@quenty/servicebag": "11.12.0-canary.0a5db80.0",
|
|
39
|
+
"@quenty/table": "3.8.0-canary.0a5db80.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0a5db8004684dc3e76fd5944599a22602d48cfa9"
|
|
45
45
|
}
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
-
local InputModeTypeSelector = require("InputModeTypeSelector")
|
|
12
11
|
local InputModeTypes = require("InputModeTypes")
|
|
12
|
+
local InputModeTypeSelector = require("InputModeTypeSelector")
|
|
13
13
|
local Maid = require("Maid")
|
|
14
14
|
local PlayerInputModeServiceConstants = require("PlayerInputModeServiceConstants")
|
|
15
|
-
local PlayerInputModeTypes = require("PlayerInputModeTypes")
|
|
16
|
-
local PlayerInputModeUtils = require("PlayerInputModeUtils")
|
|
17
15
|
local PromiseGetRemoteEvent = require("PromiseGetRemoteEvent")
|
|
18
16
|
local Rx = require("Rx")
|
|
19
|
-
local
|
|
17
|
+
local PlayerInputModeUtils = require("PlayerInputModeUtils")
|
|
18
|
+
local PlayerInputModeTypes = require("PlayerInputModeTypes")
|
|
20
19
|
local RxPlayerUtils = require("RxPlayerUtils")
|
|
20
|
+
local RxBrioUtils = require("RxBrioUtils")
|
|
21
21
|
local ServiceBag = require("ServiceBag")
|
|
22
22
|
|
|
23
23
|
local PlayerInputModeServiceClient = {}
|
|
@@ -36,34 +36,32 @@ 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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
end
|
|
66
|
-
end))
|
|
44
|
+
activeMode = self._selector:ObserveActiveInputType();
|
|
45
|
+
localPlayer = RxPlayerUtils.observeLocalPlayerBrio();
|
|
46
|
+
}):Pipe({
|
|
47
|
+
Rx.throttleTime(1, { leading = true; trailing = true });
|
|
48
|
+
}):Subscribe(function(state)
|
|
49
|
+
local modeType
|
|
50
|
+
if state.activeMode == InputModeTypes.Gamepads then
|
|
51
|
+
modeType = PlayerInputModeTypes.GAMEPAD
|
|
52
|
+
elseif state.activeMode == InputModeTypes.Keyboard then
|
|
53
|
+
modeType = PlayerInputModeTypes.KEYBOARD
|
|
54
|
+
elseif state.activeMode == InputModeTypes.Touch then
|
|
55
|
+
modeType = PlayerInputModeTypes.TOUCH
|
|
56
|
+
else
|
|
57
|
+
error("Bad activeMode")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if state.localPlayer then
|
|
61
|
+
PlayerInputModeUtils.setPlayerInputModeType(state.localPlayer, modeType)
|
|
62
|
+
remoteEvent:FireServer(PlayerInputModeServiceConstants.REQUEST_SET_INPUT_MODE, modeType)
|
|
63
|
+
end
|
|
64
|
+
end))
|
|
67
65
|
end)
|
|
68
66
|
end
|
|
69
67
|
|
|
@@ -99,4 +97,4 @@ function PlayerInputModeServiceClient:Destroy()
|
|
|
99
97
|
self._maid:DoCleaning()
|
|
100
98
|
end
|
|
101
99
|
|
|
102
|
-
return PlayerInputModeServiceClient
|
|
100
|
+
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,4 +83,5 @@ function PlayerInputModeService:_setPlayerInputModeType(player: Player, inputMod
|
|
|
83
83
|
PlayerInputModeUtils.setPlayerInputModeType(player, inputModeType)
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
|
|
87
|
+
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
|
+
})
|