@quenty/mouseshiftlockservice 11.18.1 → 11.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 +14 -0
- package/package.json +3 -3
- package/src/Client/MouseShiftLockService.lua +35 -19
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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
|
+
# [11.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/mouseshiftlockservice@11.19.0...@quenty/mouseshiftlockservice@11.20.0) (2026-07-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/mouseshiftlockservice
|
|
9
|
+
|
|
10
|
+
# [11.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/mouseshiftlockservice@11.18.1...@quenty/mouseshiftlockservice@11.19.0) (2026-07-14)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **lint:** resolve selene and moonwave issues from strict conversions ([d427005](https://github.com/Quenty/NevermoreEngine/commit/d42700569ecb085fee4166c5bfdad382dd8442c2))
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- **mouseshiftlockservice:** convert package to --!strict ([e99a28f](https://github.com/Quenty/NevermoreEngine/commit/e99a28f5acfba27b5c48516e5f6f0dc2fb78700a))
|
|
19
|
+
|
|
6
20
|
## [11.18.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/mouseshiftlockservice@11.18.0...@quenty/mouseshiftlockservice@11.18.1) (2026-05-30)
|
|
7
21
|
|
|
8
22
|
**Note:** Version bump only for package @quenty/mouseshiftlockservice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/mouseshiftlockservice",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.20.0",
|
|
4
4
|
"description": "Utility service to enable or disable mouse shift lock on the fly on Roblox.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@quenty/loader": "10.11.0",
|
|
34
|
-
"@quenty/promise": "10.
|
|
34
|
+
"@quenty/promise": "10.19.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "cbbb89635bfdcbf32f26a40422ac736292917cca"
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Utility service to enable or disable mouse shift lock on the fly on Roblox.
|
|
4
4
|
|
|
@@ -23,13 +23,25 @@ local Promise = require("Promise")
|
|
|
23
23
|
local MouseShiftLockService = {}
|
|
24
24
|
MouseShiftLockService.ServiceName = "MouseShiftLockService"
|
|
25
25
|
|
|
26
|
+
export type MouseShiftLockService = typeof(setmetatable(
|
|
27
|
+
{} :: {
|
|
28
|
+
_enabled: BoolValue,
|
|
29
|
+
_promiseReady: Promise.Promise<()>?,
|
|
30
|
+
_boundKeys: StringValue,
|
|
31
|
+
_lastBoundKeyValues: string,
|
|
32
|
+
_playerModule: any,
|
|
33
|
+
_wasMouseLockEnabled: boolean?,
|
|
34
|
+
},
|
|
35
|
+
{} :: typeof({ __index = MouseShiftLockService })
|
|
36
|
+
))
|
|
37
|
+
|
|
26
38
|
--[=[
|
|
27
39
|
Initializes the mouse shift lock service. Should be done via [ServiceBag].
|
|
28
40
|
]=]
|
|
29
41
|
|
|
30
|
-
function MouseShiftLockService
|
|
31
|
-
assert(self ~= MouseShiftLockService, "Call via serviceBag")
|
|
32
|
-
assert(not self._enabled, "Not enabled")
|
|
42
|
+
function MouseShiftLockService.Init(self: MouseShiftLockService): ()
|
|
43
|
+
assert((self :: any) ~= MouseShiftLockService, "Call via serviceBag")
|
|
44
|
+
assert(not (self :: any)._enabled, "Not enabled")
|
|
33
45
|
self._enabled = Instance.new("BoolValue")
|
|
34
46
|
self._enabled.Value = true
|
|
35
47
|
|
|
@@ -37,9 +49,10 @@ function MouseShiftLockService:Init()
|
|
|
37
49
|
return
|
|
38
50
|
end
|
|
39
51
|
|
|
40
|
-
|
|
52
|
+
local promiseReady = self:_buildPromiseReady()
|
|
53
|
+
self._promiseReady = promiseReady
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
promiseReady:Then(function()
|
|
43
56
|
self._enabled.Changed:Connect(function()
|
|
44
57
|
self:_update()
|
|
45
58
|
end)
|
|
@@ -50,10 +63,10 @@ function MouseShiftLockService:Init()
|
|
|
50
63
|
end)
|
|
51
64
|
end
|
|
52
65
|
|
|
53
|
-
function MouseShiftLockService
|
|
66
|
+
function MouseShiftLockService._buildPromiseReady(self: MouseShiftLockService): Promise.Promise<()>
|
|
54
67
|
if not UserInputService.MouseEnabled then
|
|
55
68
|
-- TODO: Handle mouse being plugged in later
|
|
56
|
-
return Promise.rejected()
|
|
69
|
+
return Promise.rejected() :: Promise.Promise<()>
|
|
57
70
|
end
|
|
58
71
|
|
|
59
72
|
return Promise.spawn(function(resolve, reject)
|
|
@@ -62,11 +75,12 @@ function MouseShiftLockService:_buildPromiseReady()
|
|
|
62
75
|
local cameraModuleScript = playerModuleScript:WaitForChild("CameraModule")
|
|
63
76
|
|
|
64
77
|
local mouseLockControllerScript = cameraModuleScript:WaitForChild("MouseLockController")
|
|
65
|
-
|
|
66
|
-
self.
|
|
78
|
+
local boundKeys = mouseLockControllerScript:WaitForChild("BoundKeys") :: StringValue
|
|
79
|
+
self._boundKeys = boundKeys
|
|
80
|
+
self._lastBoundKeyValues = boundKeys.Value
|
|
67
81
|
|
|
68
82
|
local ok, err = pcall(function()
|
|
69
|
-
self._playerModule = require(playerModuleScript)
|
|
83
|
+
self._playerModule = (require :: any)(playerModuleScript)
|
|
70
84
|
end)
|
|
71
85
|
|
|
72
86
|
if not ok then
|
|
@@ -80,8 +94,8 @@ end
|
|
|
80
94
|
--[=[
|
|
81
95
|
Enables mouse shift lock
|
|
82
96
|
]=]
|
|
83
|
-
function MouseShiftLockService
|
|
84
|
-
assert(self ~= MouseShiftLockService, "Call via serviceBag")
|
|
97
|
+
function MouseShiftLockService.EnableShiftLock(self: MouseShiftLockService): ()
|
|
98
|
+
assert((self :: any) ~= MouseShiftLockService, "Call via serviceBag")
|
|
85
99
|
assert(self._enabled, "Not enabled")
|
|
86
100
|
|
|
87
101
|
self._enabled.Value = true
|
|
@@ -91,15 +105,17 @@ end
|
|
|
91
105
|
Disables mouse shift lock
|
|
92
106
|
]=]
|
|
93
107
|
|
|
94
|
-
function MouseShiftLockService
|
|
95
|
-
assert(self ~= MouseShiftLockService, "Call via serviceBag")
|
|
108
|
+
function MouseShiftLockService.DisableShiftLock(self: MouseShiftLockService): ()
|
|
109
|
+
assert((self :: any) ~= MouseShiftLockService, "Call via serviceBag")
|
|
96
110
|
assert(self._enabled, "Not enabled")
|
|
97
111
|
|
|
98
112
|
self._enabled.Value = false
|
|
99
113
|
end
|
|
100
114
|
|
|
101
|
-
function MouseShiftLockService
|
|
102
|
-
|
|
115
|
+
function MouseShiftLockService._update(self: MouseShiftLockService): ()
|
|
116
|
+
local promiseReady = self._promiseReady
|
|
117
|
+
assert(promiseReady, "Not initialized")
|
|
118
|
+
assert(promiseReady:IsFulfilled())
|
|
103
119
|
|
|
104
120
|
if self._enabled.Value then
|
|
105
121
|
self:_updateEnable()
|
|
@@ -108,7 +124,7 @@ function MouseShiftLockService:_update()
|
|
|
108
124
|
end
|
|
109
125
|
end
|
|
110
126
|
|
|
111
|
-
function MouseShiftLockService
|
|
127
|
+
function MouseShiftLockService._updateEnable(self: MouseShiftLockService): ()
|
|
112
128
|
local cameras = self._playerModule:GetCameras()
|
|
113
129
|
local cameraController = cameras.activeCameraController
|
|
114
130
|
if not cameraController then
|
|
@@ -129,7 +145,7 @@ function MouseShiftLockService:_updateEnable()
|
|
|
129
145
|
end
|
|
130
146
|
end
|
|
131
147
|
|
|
132
|
-
function MouseShiftLockService
|
|
148
|
+
function MouseShiftLockService._updateDisable(self: MouseShiftLockService): ()
|
|
133
149
|
local cameras = self._playerModule:GetCameras()
|
|
134
150
|
local cameraController = cameras.activeCameraController
|
|
135
151
|
if not cameraController then
|