@quenty/rogue-properties 11.21.3 → 11.21.4
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,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
|
+
## [11.21.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@11.21.3...@quenty/rogue-properties@11.21.4) (2025-03-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/rogue-properties
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.21.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@11.21.2...@quenty/rogue-properties@11.21.3) (2025-03-13)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/rogue-properties
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rogue-properties",
|
|
3
|
-
"version": "11.21.
|
|
3
|
+
"version": "11.21.4",
|
|
4
4
|
"description": "Roguelike properties which can be modified by external provides",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -24,33 +24,33 @@
|
|
|
24
24
|
"Quenty"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@quenty/adorneedata": "^7.17.
|
|
27
|
+
"@quenty/adorneedata": "^7.17.1",
|
|
28
28
|
"@quenty/baseobject": "^10.8.0",
|
|
29
|
-
"@quenty/binder": "^14.18.
|
|
30
|
-
"@quenty/brio": "^14.16.
|
|
29
|
+
"@quenty/binder": "^14.18.1",
|
|
30
|
+
"@quenty/brio": "^14.16.1",
|
|
31
31
|
"@quenty/defaultvalueutils": "^1.2.0",
|
|
32
|
-
"@quenty/ducktype": "^5.8.
|
|
33
|
-
"@quenty/instanceutils": "^13.16.
|
|
34
|
-
"@quenty/jsonutils": "^10.10.
|
|
35
|
-
"@quenty/linkutils": "^13.16.
|
|
32
|
+
"@quenty/ducktype": "^5.8.1",
|
|
33
|
+
"@quenty/instanceutils": "^13.16.1",
|
|
34
|
+
"@quenty/jsonutils": "^10.10.1",
|
|
35
|
+
"@quenty/linkutils": "^13.16.1",
|
|
36
36
|
"@quenty/loader": "^10.8.0",
|
|
37
37
|
"@quenty/maid": "^3.4.0",
|
|
38
|
-
"@quenty/observablecollection": "^12.19.
|
|
39
|
-
"@quenty/rx": "^13.16.
|
|
40
|
-
"@quenty/rxbinderutils": "^14.18.
|
|
41
|
-
"@quenty/rxsignal": "^7.16.
|
|
42
|
-
"@quenty/servicebag": "^11.11.
|
|
38
|
+
"@quenty/observablecollection": "^12.19.3",
|
|
39
|
+
"@quenty/rx": "^13.16.1",
|
|
40
|
+
"@quenty/rxbinderutils": "^14.18.1",
|
|
41
|
+
"@quenty/rxsignal": "^7.16.1",
|
|
42
|
+
"@quenty/servicebag": "^11.11.1",
|
|
43
43
|
"@quenty/signal": "^7.10.0",
|
|
44
|
-
"@quenty/spring": "^10.8.
|
|
45
|
-
"@quenty/string": "^3.3.
|
|
46
|
-
"@quenty/table": "^3.7.
|
|
47
|
-
"@quenty/tie": "^10.19.
|
|
48
|
-
"@quenty/valuebaseutils": "^13.16.
|
|
49
|
-
"@quenty/valueobject": "^13.16.
|
|
44
|
+
"@quenty/spring": "^10.8.1",
|
|
45
|
+
"@quenty/string": "^3.3.1",
|
|
46
|
+
"@quenty/table": "^3.7.1",
|
|
47
|
+
"@quenty/tie": "^10.19.1",
|
|
48
|
+
"@quenty/valuebaseutils": "^13.16.1",
|
|
49
|
+
"@quenty/valueobject": "^13.16.1",
|
|
50
50
|
"@quentystudios/t": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
|
|
56
56
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
--[=[
|
|
2
|
+
Utility class that helps cache rogue properties per an instance
|
|
3
|
+
|
|
2
4
|
@class RoguePropertyCache
|
|
3
5
|
]=]
|
|
4
6
|
|
|
@@ -11,21 +13,33 @@ RoguePropertyCache.__index = RoguePropertyCache
|
|
|
11
13
|
function RoguePropertyCache.new()
|
|
12
14
|
local self = setmetatable({}, RoguePropertyCache)
|
|
13
15
|
|
|
14
|
-
self._cache = setmetatable({}, {__mode="v"})
|
|
16
|
+
self._cache = setmetatable({}, { __mode = "v" })
|
|
15
17
|
|
|
16
18
|
return self
|
|
17
19
|
end
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
--[=[
|
|
22
|
+
Caches the implementation for a given instance
|
|
23
|
+
|
|
24
|
+
@param adornee Instance
|
|
25
|
+
@param roguePropertyTable RoguePropertyTable
|
|
26
|
+
]=]
|
|
27
|
+
function RoguePropertyCache:Store(adornee: Instance, roguePropertyTable)
|
|
20
28
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
21
29
|
|
|
22
30
|
self._cache[adornee] = roguePropertyTable
|
|
23
31
|
end
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
--[=[
|
|
34
|
+
Retrieves the cached item
|
|
35
|
+
|
|
36
|
+
@param adornee Instance
|
|
37
|
+
@return RoguePropertyTable
|
|
38
|
+
]=]
|
|
39
|
+
function RoguePropertyCache:Find(adornee: Instance)
|
|
26
40
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
27
41
|
|
|
28
42
|
return self._cache[adornee]
|
|
29
43
|
end
|
|
30
44
|
|
|
31
|
-
return RoguePropertyCache
|
|
45
|
+
return RoguePropertyCache
|
|
@@ -35,7 +35,7 @@ function RoguePropertyTableDefinition.new(tableName, defaultValueTable)
|
|
|
35
35
|
return self
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
function RoguePropertyTableDefinition.isRoguePropertyTableDefinition(value)
|
|
38
|
+
function RoguePropertyTableDefinition.isRoguePropertyTableDefinition(value): boolean
|
|
39
39
|
return DuckTypeUtils.isImplementation(RoguePropertyTableDefinition, value)
|
|
40
40
|
end
|
|
41
41
|
|
|
@@ -72,22 +72,34 @@ function RoguePropertyTableDefinition:SetDefaultValue(defaultValueTable)
|
|
|
72
72
|
|
|
73
73
|
if next(defaultArrayData) ~= nil then
|
|
74
74
|
-- Enforce array data types for sanity
|
|
75
|
-
local requiredPropertyDefinitionTemplate, message =
|
|
75
|
+
local requiredPropertyDefinitionTemplate, message =
|
|
76
|
+
RoguePropertyArrayUtils.createRequiredPropertyDefinitionFromArray(defaultArrayData, self)
|
|
76
77
|
|
|
77
78
|
if requiredPropertyDefinitionTemplate then
|
|
78
|
-
self._arrayDefinitionHelper =
|
|
79
|
+
self._arrayDefinitionHelper =
|
|
80
|
+
RoguePropertyDefinitionArrayHelper.new(self, defaultArrayData, requiredPropertyDefinitionTemplate)
|
|
79
81
|
else
|
|
80
|
-
error(
|
|
82
|
+
error(
|
|
83
|
+
string.format(
|
|
84
|
+
"[RoguePropertyTableDefinition] - Could not create infer array type definition. Error: %s",
|
|
85
|
+
message
|
|
86
|
+
)
|
|
87
|
+
)
|
|
81
88
|
end
|
|
82
89
|
end
|
|
83
90
|
end
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
function RoguePropertyTableDefinition:CanAssign(mainValue, strict)
|
|
92
|
+
function RoguePropertyTableDefinition:CanAssign(mainValue, strict: boolean): boolean
|
|
87
93
|
assert(type(strict) == "boolean", "Bad strict")
|
|
88
94
|
|
|
89
95
|
if type(mainValue) ~= "table" then
|
|
90
|
-
return false,
|
|
96
|
+
return false,
|
|
97
|
+
string.format(
|
|
98
|
+
"got %q, expected %q when assigning to %q",
|
|
99
|
+
self._valueType,
|
|
100
|
+
typeof(mainValue),
|
|
101
|
+
self:GetFullName()
|
|
102
|
+
)
|
|
91
103
|
end
|
|
92
104
|
|
|
93
105
|
local remainingKeys
|
|
@@ -107,7 +119,13 @@ function RoguePropertyTableDefinition:CanAssign(mainValue, strict)
|
|
|
107
119
|
if message then
|
|
108
120
|
return false, message
|
|
109
121
|
else
|
|
110
|
-
return false,
|
|
122
|
+
return false,
|
|
123
|
+
string.format(
|
|
124
|
+
"Bad index %q of %q due to %s",
|
|
125
|
+
tostring(key),
|
|
126
|
+
self:GetFullName(),
|
|
127
|
+
tostring(message)
|
|
128
|
+
)
|
|
111
129
|
end
|
|
112
130
|
end
|
|
113
131
|
else
|
|
@@ -120,7 +138,13 @@ function RoguePropertyTableDefinition:CanAssign(mainValue, strict)
|
|
|
120
138
|
if message then
|
|
121
139
|
return false, message
|
|
122
140
|
else
|
|
123
|
-
return false,
|
|
141
|
+
return false,
|
|
142
|
+
string.format(
|
|
143
|
+
"Bad index %q of %q due to %s",
|
|
144
|
+
tostring(key),
|
|
145
|
+
self:GetFullName(),
|
|
146
|
+
tostring(message)
|
|
147
|
+
)
|
|
124
148
|
end
|
|
125
149
|
end
|
|
126
150
|
else
|
|
@@ -131,7 +155,13 @@ function RoguePropertyTableDefinition:CanAssign(mainValue, strict)
|
|
|
131
155
|
|
|
132
156
|
-- We missed some keys
|
|
133
157
|
if next(remainingKeys) ~= nil then
|
|
134
|
-
return false,
|
|
158
|
+
return false,
|
|
159
|
+
string.format(
|
|
160
|
+
"Had %d unassigned keys %q while assigning to %q",
|
|
161
|
+
#remainingKeys,
|
|
162
|
+
table.concat(remainingKeys, ", "),
|
|
163
|
+
self:GetFullName()
|
|
164
|
+
)
|
|
135
165
|
end
|
|
136
166
|
|
|
137
167
|
return true
|
|
@@ -196,7 +226,7 @@ RoguePropertyTableDefinition.GetPropertyTable = RoguePropertyTableDefinition.Get
|
|
|
196
226
|
@param canInitialize boolean
|
|
197
227
|
@return Observable<Brio<Folder>>
|
|
198
228
|
]=]
|
|
199
|
-
function RoguePropertyTableDefinition:ObserveContainerBrio(adornee, canInitialize)
|
|
229
|
+
function RoguePropertyTableDefinition:ObserveContainerBrio(adornee: Instance, canInitialize)
|
|
200
230
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
201
231
|
assert(type(canInitialize) == "boolean", "Bad canInitialize")
|
|
202
232
|
|
|
@@ -205,12 +235,11 @@ function RoguePropertyTableDefinition:ObserveContainerBrio(adornee, canInitializ
|
|
|
205
235
|
|
|
206
236
|
local parentDefinition = self:GetParentPropertyDefinition()
|
|
207
237
|
if parentDefinition then
|
|
208
|
-
return parentDefinition:ObserveContainerBrio(adornee, canInitialize)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
})
|
|
238
|
+
return parentDefinition:ObserveContainerBrio(adornee, canInitialize):Pipe({
|
|
239
|
+
RxBrioUtils.switchMapBrio(function(parent)
|
|
240
|
+
return RxInstanceUtils.observeLastNamedChildBrio(parent, "Folder", self:GetName())
|
|
241
|
+
end),
|
|
242
|
+
})
|
|
214
243
|
else
|
|
215
244
|
return RxInstanceUtils.observeLastNamedChildBrio(adornee, "Folder", self:GetName())
|
|
216
245
|
end
|
|
@@ -222,7 +251,7 @@ end
|
|
|
222
251
|
@param canInitialize boolean
|
|
223
252
|
@return Folder?
|
|
224
253
|
]=]
|
|
225
|
-
function RoguePropertyTableDefinition:GetContainer(adornee, canInitialize)
|
|
254
|
+
function RoguePropertyTableDefinition:GetContainer(adornee: Instance, canInitialize): Folder?
|
|
226
255
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
227
256
|
assert(type(canInitialize) == "boolean", "Bad canInitialize")
|
|
228
257
|
|
|
@@ -292,4 +321,4 @@ function RoguePropertyTableDefinition:__index(index)
|
|
|
292
321
|
end
|
|
293
322
|
end
|
|
294
323
|
|
|
295
|
-
return RoguePropertyTableDefinition
|
|
324
|
+
return RoguePropertyTableDefinition
|