@quenty/basicpane 7.16.0 → 7.17.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 +11 -0
- package/package.json +2 -2
- package/src/Shared/BasicPane.lua +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +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
|
+
# [7.17.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/basicpane@7.16.0...@quenty/basicpane@7.17.0) (2023-07-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add BasicPane:ObserveVisible() ([03b7db5](https://github.com/Quenty/NevermoreEngine/commit/03b7db53a0ae793f70a7cf6abe6d92fc5de8679e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [7.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/basicpane@7.15.0...@quenty/basicpane@7.16.0) (2023-07-15)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/basicpane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/basicpane",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.17.0",
|
|
4
4
|
"description": "Base UI object with visibility and a maid",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d53b0ea25df6a45c600f32c9023c7e7d5ee93387"
|
|
38
38
|
}
|
package/src/Shared/BasicPane.lua
CHANGED
|
@@ -23,6 +23,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
23
23
|
|
|
24
24
|
local Signal = require("Signal")
|
|
25
25
|
local Maid = require("Maid")
|
|
26
|
+
local Observable = require("Observable")
|
|
26
27
|
|
|
27
28
|
local BasicPane = {}
|
|
28
29
|
BasicPane.__index = BasicPane
|
|
@@ -40,6 +41,7 @@ function BasicPane.isBasicPane(value)
|
|
|
40
41
|
and type(value.SetVisible) == "function"
|
|
41
42
|
and type(value.IsVisible) == "function"
|
|
42
43
|
and type(value.Show) == "function"
|
|
44
|
+
and type(value.ObserveVisible) == "function"
|
|
43
45
|
and type(value.Hide) == "function"
|
|
44
46
|
and type(value.Toggle) == "function"
|
|
45
47
|
and type(value.Destroy) == "function"
|
|
@@ -107,6 +109,19 @@ function BasicPane:SetVisible(isVisible, doNotAnimate)
|
|
|
107
109
|
end
|
|
108
110
|
end
|
|
109
111
|
|
|
112
|
+
function BasicPane:ObserveVisible()
|
|
113
|
+
return Observable.new(function(sub)
|
|
114
|
+
local maid = Maid.new()
|
|
115
|
+
|
|
116
|
+
maid:GiveTask(self.VisibleChanged:Connect(function(isVisible, doNotAnimate)
|
|
117
|
+
sub:Fire(isVisible, doNotAnimate)
|
|
118
|
+
end))
|
|
119
|
+
sub:Fire(self:IsVisible())
|
|
120
|
+
|
|
121
|
+
return maid
|
|
122
|
+
end)
|
|
123
|
+
end
|
|
124
|
+
|
|
110
125
|
--[=[
|
|
111
126
|
Shows the pane
|
|
112
127
|
@param doNotAnimate boolean? -- True if this visiblity should not animate
|