@quenty/highlight 2.3.1 → 2.4.0-canary.303.e87f9e5.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 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
+ # [2.4.0-canary.303.e87f9e5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/highlight@2.3.1...@quenty/highlight@2.4.0-canary.303.e87f9e5.0) (2022-11-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fix visiblity not transferring from animated highlight (and more specifically, the event binding between visibility and the spring) ([07ba419](https://github.com/Quenty/NevermoreEngine/commit/07ba41948bdefa6fec1d3ecd6fd185c256de6e5f))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/highlight@2.3.0...@quenty/highlight@2.3.1) (2022-11-04)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/highlight
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/highlight",
3
- "version": "2.3.1",
3
+ "version": "2.4.0-canary.303.e87f9e5.0",
4
4
  "description": "Animated highlight system for the Roblox highlight object",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,21 +26,21 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/baseobject": "^6.0.1",
30
- "@quenty/basicpane": "^7.1.1",
31
- "@quenty/blend": "^6.3.1",
32
- "@quenty/enumutils": "^3.0.0",
33
- "@quenty/instanceutils": "^7.1.1",
34
- "@quenty/loader": "^6.0.1",
35
- "@quenty/maid": "^2.4.0",
36
- "@quenty/math": "^2.2.0",
37
- "@quenty/selectionutils": "^2.1.1",
38
- "@quenty/signal": "^2.3.0",
39
- "@quenty/table": "^3.1.0",
40
- "@quenty/valueobject": "^7.1.1"
29
+ "@quenty/baseobject": "6.0.1",
30
+ "@quenty/basicpane": "7.1.1",
31
+ "@quenty/blend": "6.3.1",
32
+ "@quenty/enumutils": "3.0.0",
33
+ "@quenty/instanceutils": "7.1.1",
34
+ "@quenty/loader": "6.0.1",
35
+ "@quenty/maid": "2.4.0",
36
+ "@quenty/math": "2.2.0",
37
+ "@quenty/selectionutils": "2.1.1",
38
+ "@quenty/signal": "2.3.0",
39
+ "@quenty/table": "3.1.0",
40
+ "@quenty/valueobject": "7.1.1"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "8b9877c26a3fc753409a5114e56717837291279d"
45
+ "gitHead": "e87f9e5d380e78f29c5814ece49e2973eb966d0c"
46
46
  }
@@ -5,7 +5,6 @@
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
7
  local BasicPane = require("BasicPane")
8
- local BasicPaneUtils = require("BasicPaneUtils")
9
8
  local Blend = require("Blend")
10
9
  local SpringObject = require("SpringObject")
11
10
  local Math = require("Math")
@@ -42,9 +41,17 @@ function AnimatedHighlight.new()
42
41
  self._outlineTransparencySpring = SpringObject.new(0, 40)
43
42
  self._maid:GiveTask(self._outlineTransparencySpring)
44
43
 
45
- self._percentVisible = SpringObject.new(BasicPaneUtils.observePercentVisible(self), 20)
44
+ self._percentVisible = SpringObject.new(0, 20)
46
45
  self._maid:GiveTask(self._percentVisible)
47
46
 
47
+ self._maid:GiveTask(self.VisibleChanged:Connect(function(isVisible, doNotAnimate)
48
+ self._percentVisible.t = isVisible and 1 or 0
49
+ if doNotAnimate then
50
+ self._percentVisible.p = self._percentVisible.t
51
+ self._percentVisible.v = 0
52
+ end
53
+ end))
54
+
48
55
  self.Destroying = Signal.new()
49
56
  self._maid:GiveTask(function()
50
57
  self.Destroying:Fire()
@@ -93,6 +100,9 @@ function AnimatedHighlight:SetPropertiesFrom(sourceHighlight)
93
100
  target.Velocity = source.Velocity
94
101
  end
95
102
 
103
+ -- Transfer state before we set spring values
104
+ self:SetVisible(sourceHighlight:IsVisible(), true)
105
+
96
106
  transferSpringValue(self._fillTransparencySpring, sourceHighlight._fillTransparencySpring)
97
107
  transferSpringValue(self._outlineTransparencySpring, sourceHighlight._outlineTransparencySpring)
98
108
  transferSpringValue(self._percentVisible, sourceHighlight._percentVisible)
@@ -114,18 +124,11 @@ end
114
124
  function AnimatedHighlight:Finish(doNotAnimate, callback)
115
125
  if self._percentVisible.p == 0 and self._percentVisible.v == 0 then
116
126
  callback()
117
-
118
127
  return
119
128
  end
120
129
 
121
130
  local maid = Maid.new()
122
131
  local done = false
123
- maid:GiveTask(self._percentVisible:ObserveRenderStepped():Subscribe(function(position)
124
- if position == 0 then
125
- done = true
126
- callback()
127
- end
128
- end))
129
132
 
130
133
  self:Hide(doNotAnimate)
131
134
 
@@ -134,11 +137,18 @@ function AnimatedHighlight:Finish(doNotAnimate, callback)
134
137
  end)
135
138
  self._maid[maid] = maid
136
139
 
140
+ maid:GiveTask(self._percentVisible:ObserveRenderStepped():Subscribe(function(position)
141
+ if position == 0 and not done then
142
+ done = true
143
+ callback()
144
+ end
145
+ end))
146
+
137
147
  if not done then
138
148
  maid:GiveTask(self.VisibleChanged:Connect(function(isVisible)
139
149
  if isVisible then
140
150
  -- cancel
141
- self._maid[maid]:DoCleaning()
151
+ self._maid[maid] = nil
142
152
  end
143
153
  end))
144
154
  end