@quenty/buttonhighlightmodel 14.18.2 → 14.18.3-canary.550.afa1b3b.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 +8 -0
- package/package.json +12 -12
- package/src/Client/ButtonHighlightModel.lua +13 -12
- package/src/Client/HandleHighlightModel.lua +31 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [14.18.3-canary.550.afa1b3b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/buttonhighlightmodel@14.18.2...@quenty/buttonhighlightmodel@14.18.3-canary.550.afa1b3b.0) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/buttonhighlightmodel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [14.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/buttonhighlightmodel@14.18.0...@quenty/buttonhighlightmodel@14.18.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/buttonhighlightmodel",
|
|
3
|
-
"version": "14.18.
|
|
3
|
+
"version": "14.18.3-canary.550.afa1b3b.0",
|
|
4
4
|
"description": "Contains model information for the current button",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/acceltween": "
|
|
30
|
-
"@quenty/baseobject": "
|
|
31
|
-
"@quenty/blend": "
|
|
32
|
-
"@quenty/instanceutils": "
|
|
33
|
-
"@quenty/loader": "
|
|
34
|
-
"@quenty/maid": "
|
|
35
|
-
"@quenty/rectutils": "
|
|
36
|
-
"@quenty/rx": "
|
|
37
|
-
"@quenty/steputils": "
|
|
38
|
-
"@quenty/valueobject": "
|
|
29
|
+
"@quenty/acceltween": "2.5.3-canary.550.afa1b3b.0",
|
|
30
|
+
"@quenty/baseobject": "10.8.3-canary.550.afa1b3b.0",
|
|
31
|
+
"@quenty/blend": "12.18.3-canary.550.afa1b3b.0",
|
|
32
|
+
"@quenty/instanceutils": "13.17.3-canary.550.afa1b3b.0",
|
|
33
|
+
"@quenty/loader": "10.8.3-canary.550.afa1b3b.0",
|
|
34
|
+
"@quenty/maid": "3.4.3-canary.550.afa1b3b.0",
|
|
35
|
+
"@quenty/rectutils": "1.2.3-canary.550.afa1b3b.0",
|
|
36
|
+
"@quenty/rx": "13.17.3-canary.550.afa1b3b.0",
|
|
37
|
+
"@quenty/steputils": "3.5.5",
|
|
38
|
+
"@quenty/valueobject": "13.17.3-canary.550.afa1b3b.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "afa1b3b99b862698c3ab46009497bd507150867c"
|
|
44
44
|
}
|
|
@@ -116,8 +116,8 @@ export type ButtonHighlightModel = typeof(setmetatable(
|
|
|
116
116
|
]=]
|
|
117
117
|
IsPressedChanged: _Signal.Signal<boolean>,
|
|
118
118
|
},
|
|
119
|
-
{ __index = ButtonHighlightModel }
|
|
120
|
-
))
|
|
119
|
+
{} :: typeof({ __index = ButtonHighlightModel })
|
|
120
|
+
)) & BaseObject.BaseObject
|
|
121
121
|
|
|
122
122
|
--[=[
|
|
123
123
|
A model that dictates the current state of a button.
|
|
@@ -264,7 +264,7 @@ function ButtonHighlightModel.SetButton(self: ButtonHighlightModel, button: GuiO
|
|
|
264
264
|
self._maid._buttonMaid = maid
|
|
265
265
|
|
|
266
266
|
return function()
|
|
267
|
-
if self._maid._buttonMaid == maid then
|
|
267
|
+
if (self._maid._buttonMaid :: any) == maid then
|
|
268
268
|
self._maid._buttonMaid = nil
|
|
269
269
|
end
|
|
270
270
|
end
|
|
@@ -358,8 +358,8 @@ function ButtonHighlightModel.ObservePercentPressedTarget(self: ButtonHighlightM
|
|
|
358
358
|
return self._isPressed:Observe():Pipe({
|
|
359
359
|
Rx.map(function(value)
|
|
360
360
|
return value and 1 or 0
|
|
361
|
-
end),
|
|
362
|
-
})
|
|
361
|
+
end) :: any,
|
|
362
|
+
}) :: any
|
|
363
363
|
end
|
|
364
364
|
|
|
365
365
|
--[=[
|
|
@@ -388,10 +388,10 @@ function ButtonHighlightModel.ObservePercentHighlightedTarget(
|
|
|
388
388
|
self: ButtonHighlightModel
|
|
389
389
|
): _Observable.Observable<number>
|
|
390
390
|
return self._isHighlighted:Observe():Pipe({
|
|
391
|
-
Rx.map(function(value)
|
|
391
|
+
Rx.map(function(value: boolean): number
|
|
392
392
|
return value and 1 or 0
|
|
393
|
-
end),
|
|
394
|
-
})
|
|
393
|
+
end) :: any,
|
|
394
|
+
}) :: any
|
|
395
395
|
end
|
|
396
396
|
|
|
397
397
|
--[=[
|
|
@@ -482,8 +482,8 @@ function ButtonHighlightModel.ObservePercentChoosenTarget(self: ButtonHighlightM
|
|
|
482
482
|
return self._isChoosen:Observe():Pipe({
|
|
483
483
|
Rx.map(function(value)
|
|
484
484
|
return value and 1 or 0
|
|
485
|
-
end),
|
|
486
|
-
})
|
|
485
|
+
end) :: any,
|
|
486
|
+
}) :: any
|
|
487
487
|
end
|
|
488
488
|
|
|
489
489
|
--[=[
|
|
@@ -496,11 +496,12 @@ function ButtonHighlightModel.ObservePercentChoosen(
|
|
|
496
496
|
self: ButtonHighlightModel,
|
|
497
497
|
acceleration: number?
|
|
498
498
|
): _Observable.Observable<number>
|
|
499
|
+
-- stylua: ignore
|
|
499
500
|
return Blend.AccelTween(
|
|
500
501
|
self._isChoosen:Observe():Pipe({
|
|
501
|
-
Rx.map(function(value)
|
|
502
|
+
Rx.map(function(value): number
|
|
502
503
|
return value and 1 or 0
|
|
503
|
-
end),
|
|
504
|
+
end) :: any,
|
|
504
505
|
}),
|
|
505
506
|
acceleration or 200
|
|
506
507
|
)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class HandleHighlightModel
|
|
3
4
|
]=]
|
|
@@ -11,13 +12,23 @@ local Maid = require("Maid")
|
|
|
11
12
|
local Blend = require("Blend")
|
|
12
13
|
local Rx = require("Rx")
|
|
13
14
|
local ValueObject = require("ValueObject")
|
|
15
|
+
local _Observable = require("Observable")
|
|
14
16
|
|
|
15
17
|
local HandleHighlightModel = setmetatable({}, BaseObject)
|
|
16
18
|
HandleHighlightModel.ClassName = "HandleHighlightModel"
|
|
17
19
|
HandleHighlightModel.__index = HandleHighlightModel
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
export type HandleHighlightModel = typeof(setmetatable(
|
|
22
|
+
{} :: {
|
|
23
|
+
IsMouseOver: ValueObject.ValueObject<boolean>,
|
|
24
|
+
IsMouseDown: ValueObject.ValueObject<boolean>,
|
|
25
|
+
IsHighlighted: ValueObject.ValueObject<boolean>,
|
|
26
|
+
},
|
|
27
|
+
{} :: typeof({ __index = HandleHighlightModel })
|
|
28
|
+
)) & BaseObject.BaseObject
|
|
29
|
+
|
|
30
|
+
function HandleHighlightModel.new(): HandleHighlightModel
|
|
31
|
+
local self: HandleHighlightModel = setmetatable(BaseObject.new() :: any, HandleHighlightModel)
|
|
21
32
|
|
|
22
33
|
self.IsMouseOver = self._maid:Add(ValueObject.new(false, "boolean"))
|
|
23
34
|
|
|
@@ -40,7 +51,7 @@ end
|
|
|
40
51
|
Sets the handle for the highlight model.
|
|
41
52
|
@param handle
|
|
42
53
|
]=]
|
|
43
|
-
function HandleHighlightModel
|
|
54
|
+
function HandleHighlightModel.SetHandle(self: HandleHighlightModel, handle: HandleAdornment)
|
|
44
55
|
assert(typeof(handle) == "Instance" or handle == nil, "Bad handle")
|
|
45
56
|
|
|
46
57
|
local maid = Maid.new()
|
|
@@ -69,25 +80,26 @@ function HandleHighlightModel:SetHandle(handle: HandleAdornment)
|
|
|
69
80
|
self._maid._buttonMaid = maid
|
|
70
81
|
end
|
|
71
82
|
|
|
72
|
-
|
|
73
83
|
--[=[
|
|
74
84
|
Observes how pressed down the button is
|
|
75
85
|
@return Observable<number>
|
|
76
86
|
]=]
|
|
77
|
-
function HandleHighlightModel
|
|
78
|
-
return Blend.AccelTween(
|
|
79
|
-
:Pipe({
|
|
87
|
+
function HandleHighlightModel.ObservePercentPressed(self: HandleHighlightModel): _Observable.Observable<number>
|
|
88
|
+
return Blend.AccelTween(
|
|
89
|
+
Blend.toPropertyObservable(self.IsMouseDown):Pipe({
|
|
80
90
|
Rx.map(function(value)
|
|
81
91
|
return value and 1 or 0
|
|
82
|
-
end)
|
|
83
|
-
}),
|
|
92
|
+
end),
|
|
93
|
+
}),
|
|
94
|
+
200
|
|
95
|
+
)
|
|
84
96
|
end
|
|
85
97
|
|
|
86
98
|
--[=[
|
|
87
99
|
Observes how highlighted the button is
|
|
88
100
|
@return Observable<number>
|
|
89
101
|
]=]
|
|
90
|
-
function HandleHighlightModel
|
|
102
|
+
function HandleHighlightModel.ObservePercentHighlighted(self: HandleHighlightModel): _Observable.Observable<number>
|
|
91
103
|
return Blend.AccelTween(self:ObservePercentHighlightedTarget(), 200)
|
|
92
104
|
end
|
|
93
105
|
|
|
@@ -95,16 +107,17 @@ end
|
|
|
95
107
|
Observes target for how highlighted the button is
|
|
96
108
|
@return Observable<number>
|
|
97
109
|
]=]
|
|
98
|
-
function HandleHighlightModel
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
function HandleHighlightModel.ObservePercentHighlightedTarget(
|
|
111
|
+
self: HandleHighlightModel
|
|
112
|
+
): _Observable.Observable<number>
|
|
113
|
+
return Blend.toPropertyObservable(self.IsHighlighted):Pipe({
|
|
114
|
+
Rx.map(function(value)
|
|
115
|
+
return value and 1 or 0
|
|
116
|
+
end),
|
|
117
|
+
})
|
|
105
118
|
end
|
|
106
119
|
|
|
107
|
-
function HandleHighlightModel
|
|
120
|
+
function HandleHighlightModel._updateHighlighted(self: HandleHighlightModel): ()
|
|
108
121
|
self.IsHighlighted.Value = self.IsMouseOver.Value or self.IsMouseDown.Value
|
|
109
122
|
end
|
|
110
123
|
|