@quenty/rogue-properties 2.2.0 → 2.3.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,22 @@
|
|
|
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.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@2.2.0...@quenty/rogue-properties@2.3.0) (2022-07-31)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* RogueProperties work in test mode ([e68b0e8](https://github.com/Quenty/NevermoreEngine/commit/e68b0e8fd883a2bdbd638d94656e35ecea6870e9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* RogueProperty has GetBaseValueObject API ([424d3d6](https://github.com/Quenty/NevermoreEngine/commit/424d3d6fb032ae7f50199e9da0536266d2a56bb4))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [2.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@2.1.0...@quenty/rogue-properties@2.2.0) (2022-07-02)
|
|
7
23
|
|
|
8
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rogue-properties",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Roguelike properties which can be modified by external provides",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
"Quenty"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@quenty/baseobject": "^5.
|
|
28
|
-
"@quenty/binder": "^6.
|
|
29
|
-
"@quenty/brio": "^6.
|
|
30
|
-
"@quenty/instanceutils": "^5.
|
|
31
|
-
"@quenty/jsonutils": "^5.
|
|
32
|
-
"@quenty/linkutils": "^5.
|
|
27
|
+
"@quenty/baseobject": "^5.1.0",
|
|
28
|
+
"@quenty/binder": "^6.3.0",
|
|
29
|
+
"@quenty/brio": "^6.2.0",
|
|
30
|
+
"@quenty/instanceutils": "^5.2.0",
|
|
31
|
+
"@quenty/jsonutils": "^5.1.0",
|
|
32
|
+
"@quenty/linkutils": "^5.2.0",
|
|
33
33
|
"@quenty/loader": "^5.0.0",
|
|
34
|
-
"@quenty/maid": "^2.
|
|
35
|
-
"@quenty/rx": "^5.
|
|
36
|
-
"@quenty/rxbinderutils": "^6.
|
|
37
|
-
"@quenty/servicebag": "^5.
|
|
34
|
+
"@quenty/maid": "^2.4.0",
|
|
35
|
+
"@quenty/rx": "^5.2.0",
|
|
36
|
+
"@quenty/rxbinderutils": "^6.3.0",
|
|
37
|
+
"@quenty/servicebag": "^5.1.0",
|
|
38
38
|
"@quenty/signal": "^2.2.0",
|
|
39
39
|
"@quenty/table": "^3.1.0",
|
|
40
|
-
"@quenty/valuebaseutils": "^5.
|
|
40
|
+
"@quenty/valuebaseutils": "^5.2.0",
|
|
41
41
|
"@quentystudios/t": "^1.2.5"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e31b3a35aa475bb5699a24898a8639e107165b36"
|
|
47
47
|
}
|
|
@@ -18,4 +18,8 @@ function RoguePropertyModifierUtils.observeSourceLinksBrio(modifier)
|
|
|
18
18
|
return RxLinkUtils.observeValidLinksBrio(RoguePropertyModifierConstants.PROPERTY_SOURCE_LINK_NAME, modifier)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
function RoguePropertyModifierUtils.getSourceFromModifier(modifier)
|
|
22
|
+
return LinkUtils.getLinkValue(RoguePropertyModifierConstants.PROPERTY_SOURCE_LINK_NAME, modifier)
|
|
23
|
+
end
|
|
24
|
+
|
|
21
25
|
return RoguePropertyModifierUtils
|
|
@@ -33,13 +33,13 @@ function RogueProperty.new(adornee, serviceBag, definition)
|
|
|
33
33
|
self._definition = assert(definition, "Bad definition")
|
|
34
34
|
|
|
35
35
|
if self._roguePropertyService:CanInitializeProperties() then
|
|
36
|
-
self:
|
|
36
|
+
self:GetBaseValueObject()
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
return self
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
function RogueProperty:
|
|
42
|
+
function RogueProperty:GetBaseValueObject()
|
|
43
43
|
local parent
|
|
44
44
|
local tableDefinition = self._definition:GetPropertyTableDefinition()
|
|
45
45
|
if tableDefinition then
|
|
@@ -81,7 +81,7 @@ function RogueProperty:_observeBaseValueBrio()
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
function RogueProperty:SetBaseValue(value)
|
|
84
|
-
local baseValue = self:
|
|
84
|
+
local baseValue = self:GetBaseValueObject()
|
|
85
85
|
if baseValue then
|
|
86
86
|
baseValue.Value = self:_encodeValue(value)
|
|
87
87
|
else
|
|
@@ -90,7 +90,7 @@ function RogueProperty:SetBaseValue(value)
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
function RogueProperty:GetBaseValue()
|
|
93
|
-
local baseValue = self:
|
|
93
|
+
local baseValue = self:GetBaseValueObject()
|
|
94
94
|
if baseValue then
|
|
95
95
|
return self:_decodeValue(baseValue.Value)
|
|
96
96
|
else
|
|
@@ -100,7 +100,7 @@ end
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
function RogueProperty:GetValue()
|
|
103
|
-
local propObj = self:
|
|
103
|
+
local propObj = self:GetBaseValueObject()
|
|
104
104
|
if not propObj then
|
|
105
105
|
return self._definition:GetDefaultValue()
|
|
106
106
|
end
|
|
@@ -169,6 +169,7 @@ function RogueProperty:Observe()
|
|
|
169
169
|
return current
|
|
170
170
|
end);
|
|
171
171
|
RxBrioUtils.emitOnDeath(self._definition:GetDefaultValue());
|
|
172
|
+
Rx.defaultsTo(self._definition:GetDefaultValue());
|
|
172
173
|
})
|
|
173
174
|
end
|
|
174
175
|
|
|
@@ -176,7 +177,7 @@ function RogueProperty:CreateMultiplier(amount, source)
|
|
|
176
177
|
assert(type(amount) == "number", "Bad amount")
|
|
177
178
|
|
|
178
179
|
local provider = self._serviceBag:GetService(RogueMultiplierProvider)
|
|
179
|
-
local baseValue = self:
|
|
180
|
+
local baseValue = self:GetBaseValueObject()
|
|
180
181
|
|
|
181
182
|
if not baseValue then
|
|
182
183
|
warn("Failed to get the baseValue to parent")
|
|
@@ -192,7 +193,7 @@ function RogueProperty:CreateAdditive(amount, source)
|
|
|
192
193
|
assert(type(amount) == "number", "Bad amount")
|
|
193
194
|
|
|
194
195
|
local provider = self._serviceBag:GetService(RogueAdditiveProvider)
|
|
195
|
-
local baseValue = self:
|
|
196
|
+
local baseValue = self:GetBaseValueObject()
|
|
196
197
|
|
|
197
198
|
if not baseValue then
|
|
198
199
|
warn("Failed to get the baseValue to parent")
|
|
@@ -208,7 +209,7 @@ function RogueProperty:CreateSetter(amount, source)
|
|
|
208
209
|
assert(type(amount) == "number", "Bad amount")
|
|
209
210
|
|
|
210
211
|
local provider = self._serviceBag:GetService(RogueSetterProvider)
|
|
211
|
-
local baseValue = self:
|
|
212
|
+
local baseValue = self:GetBaseValueObject()
|
|
212
213
|
|
|
213
214
|
if not baseValue then
|
|
214
215
|
warn("Failed to get the baseValue to parent")
|
|
@@ -42,10 +42,20 @@ function RoguePropertyService:AddProvider(provider)
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
function RoguePropertyService:GetProviders()
|
|
45
|
+
if not RunService:IsRunning() then
|
|
46
|
+
return {}
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
return self._providers
|
|
46
50
|
end
|
|
47
51
|
|
|
48
52
|
function RoguePropertyService:ObserveProviderList()
|
|
53
|
+
if not RunService:IsRunning() then
|
|
54
|
+
return Observable.new(function(sub)
|
|
55
|
+
sub:Fire({})
|
|
56
|
+
end)
|
|
57
|
+
end
|
|
58
|
+
|
|
49
59
|
return Observable.new(function(sub)
|
|
50
60
|
local maid = Maid.new()
|
|
51
61
|
|