@quenty/uiobjectutils 6.30.0 → 6.32.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 +15 -0
- package/package.json +6 -5
- package/src/Client/PlayerGuiUtils.lua +41 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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.32.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/uiobjectutils@6.31.0...@quenty/uiobjectutils@6.32.0) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- Cleanup code a bit ([fa8c596](https://github.com/Quenty/NevermoreEngine/commit/fa8c596544e45610e180f5ae3797154f35930ccd))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- Add baseline player-mock and support across Nevermore for mocked players. ([567d121](https://github.com/Quenty/NevermoreEngine/commit/567d121ffc014b42391554088189a1a6296dda83))
|
|
15
|
+
- Some more small cleanup ([1556cec](https://github.com/Quenty/NevermoreEngine/commit/1556cec4ae143160c915630be485b12576721c2e))
|
|
16
|
+
|
|
17
|
+
# [6.31.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/uiobjectutils@6.30.0...@quenty/uiobjectutils@6.31.0) (2026-07-18)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @quenty/uiobjectutils
|
|
20
|
+
|
|
6
21
|
# [6.30.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/uiobjectutils@6.29.1...@quenty/uiobjectutils@6.30.0) (2026-07-18)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @quenty/uiobjectutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/uiobjectutils",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.32.0",
|
|
4
4
|
"description": "UI object utils library for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@quenty/brio": "14.
|
|
34
|
+
"@quenty/brio": "14.33.0",
|
|
35
35
|
"@quenty/enumutils": "3.4.6",
|
|
36
|
-
"@quenty/instanceutils": "13.
|
|
36
|
+
"@quenty/instanceutils": "13.33.0",
|
|
37
37
|
"@quenty/loader": "10.11.0",
|
|
38
|
-
"@quenty/
|
|
38
|
+
"@quenty/playermock": "1.1.0",
|
|
39
|
+
"@quenty/rx": "13.31.0"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1de37218a2bedb8e3f8614a2e09bba9eddc812da"
|
|
41
42
|
}
|
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
@class PlayerGuiUtils
|
|
5
5
|
]=]
|
|
6
6
|
|
|
7
|
+
local require = require(script.Parent.loader).load(script)
|
|
8
|
+
|
|
7
9
|
local Players = game:GetService("Players")
|
|
8
10
|
|
|
11
|
+
local Observable = require("Observable")
|
|
12
|
+
local PlayerMock = require("PlayerMock")
|
|
13
|
+
local PlayerMockUtils = require("PlayerMockUtils")
|
|
14
|
+
local Rx = require("Rx")
|
|
15
|
+
|
|
9
16
|
local PlayerGuiUtils = {}
|
|
10
17
|
|
|
11
18
|
--[=[
|
|
@@ -19,11 +26,15 @@ local PlayerGuiUtils = {}
|
|
|
19
26
|
@return PlayerGui
|
|
20
27
|
]=]
|
|
21
28
|
function PlayerGuiUtils.getPlayerGui(): PlayerGui
|
|
22
|
-
local localPlayer = Players.LocalPlayer
|
|
29
|
+
local localPlayer = Players.LocalPlayer or PlayerMock.getMockedLocalPlayer()
|
|
23
30
|
if not localPlayer then
|
|
24
31
|
error("[PlayerGuiUtils.getPlayerGui] - No localPlayer")
|
|
25
32
|
end
|
|
26
33
|
|
|
34
|
+
if PlayerMock.isMock(localPlayer) then
|
|
35
|
+
return PlayerMock.getPlayerGui(localPlayer)
|
|
36
|
+
end
|
|
37
|
+
|
|
27
38
|
local playerGui = localPlayer:FindFirstChildOfClass("PlayerGui")
|
|
28
39
|
if not playerGui then
|
|
29
40
|
error("[PlayerGuiUtils.getPlayerGui] - No playerGui")
|
|
@@ -38,12 +49,40 @@ end
|
|
|
38
49
|
@return PlayerGui | nil
|
|
39
50
|
]=]
|
|
40
51
|
function PlayerGuiUtils.findPlayerGui(): PlayerGui?
|
|
41
|
-
local localPlayer = Players.LocalPlayer
|
|
52
|
+
local localPlayer = Players.LocalPlayer or PlayerMock.getMockedLocalPlayer()
|
|
42
53
|
if not localPlayer then
|
|
43
54
|
return nil
|
|
44
55
|
end
|
|
45
56
|
|
|
57
|
+
if PlayerMock.isMock(localPlayer) then
|
|
58
|
+
return PlayerMock.getPlayerGui(localPlayer)
|
|
59
|
+
end
|
|
60
|
+
|
|
46
61
|
return localPlayer:FindFirstChildOfClass("PlayerGui")
|
|
47
62
|
end
|
|
48
63
|
|
|
64
|
+
--[=[
|
|
65
|
+
Observes the current player gui. On a real client this is static -- the engine inserts the
|
|
66
|
+
PlayerGui before any client script runs and never replaces it. Headless (no `Players.LocalPlayer`)
|
|
67
|
+
it follows the [PlayerMock] local-player designation, which a test may make or change after
|
|
68
|
+
subscription (see [PlayerMock.setMockedLocalPlayer]).
|
|
69
|
+
|
|
70
|
+
@return Observable<PlayerGui | nil>
|
|
71
|
+
]=]
|
|
72
|
+
function PlayerGuiUtils.observePlayerGui(): Observable.Observable<PlayerGui?>
|
|
73
|
+
if Players.LocalPlayer then
|
|
74
|
+
return Rx.of(PlayerGuiUtils.findPlayerGui()) :: any
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
return PlayerMockUtils.observeMockedLocalPlayer():Pipe({
|
|
78
|
+
Rx.map(function(localPlayer: Player?): PlayerGui?
|
|
79
|
+
if localPlayer ~= nil then
|
|
80
|
+
return PlayerMock.getPlayerGui(localPlayer)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
return nil
|
|
84
|
+
end) :: any,
|
|
85
|
+
}) :: any
|
|
86
|
+
end
|
|
87
|
+
|
|
49
88
|
return PlayerGuiUtils
|