@@ -111,11 +111,9 @@ func _add_property(name: StringName, property_script: Script) -> Object:
111
111
112
112
func add_exclusivity (property_names : Array [StringName ], one_is_required := false ) -> void :
113
113
assert (property_names .all (func (name : StringName ) -> bool : return _property_exists (name )))
114
- assert (
115
- property_names .all (
116
- func (name : StringName ) -> bool : return _get_property_by_name (name )._required == false
117
- )
118
- )
114
+ assert (property_names .all (
115
+ func (name : StringName ) -> bool : return _get_property_by_name (name )._required == false
116
+ ))
119
117
120
118
_exclusivity_relations .append (_ExclusivityRelation .new (property_names , one_is_required ))
121
119
@@ -220,49 +218,38 @@ func _parse(value: Variant, json_config_file_path := "") -> Dictionary:
220
218
221
219
222
220
static func _not_allowed_property_error (property : StringName ) -> _ValidationMsg:
223
- return (
224
- _ValidationMsg
225
- . new_error (
226
- _type_name + ":not_allowed_property" ,
227
- "Unkown property: '%s ', this property is not allowed" % property ,
228
- {"property" : property },
229
- )
221
+ return _ValidationMsg .new_error (
222
+ _type_name + ":not_allowed_property" ,
223
+ "Unkown property: '%s ', this property is not allowed" % property ,
224
+ {"property" : property },
230
225
)
231
226
232
227
233
228
static func _required_property_error (property : StringName ) -> _ValidationMsg:
234
- return (
235
- _ValidationMsg
236
- . new_error (
237
- _type_name + ":required_property" ,
238
- "Missing property: '%s ', this property is required" % property ,
239
- {"property" : property },
240
- )
229
+ return _ValidationMsg .new_error (
230
+ _type_name + ":required_property" ,
231
+ "Missing property: '%s ', this property is required" % property ,
232
+ {"property" : property },
241
233
)
242
234
243
235
244
236
static func _required_dependent_property_error (
245
237
main_property : StringName , dependent_property : StringName
246
238
) -> _ValidationMsg:
247
- return (
248
- _ValidationMsg
249
- . new_error (
250
- _type_name + ":required_dependent_property" ,
251
- (
252
- "Missing property: '%s ', this property is required if '%s ' has been specified"
253
- % [dependent_property , main_property ]
254
- ),
255
- {"main_property" : main_property , "dependent_property" : dependent_property },
256
- )
239
+ return _ValidationMsg .new_error (
240
+ _type_name + ":required_dependent_property" ,
241
+ "Missing property: '%s ', this property is required if '%s ' has been specified" % [
242
+ dependent_property , main_property
243
+ ],
244
+ {"main_property" : main_property , "dependent_property" : dependent_property },
257
245
)
258
246
259
247
260
248
static func _one_property_is_required_error (properties : Array [StringName ]) -> _ValidationMsg:
261
249
return _ValidationMsg .new_error (
262
250
_type_name + ":one_property_is_required" ,
263
- (
264
- "One of this properties needs to be specified: %s "
265
- % _ValidationMsg ._array_as_text (properties )
251
+ "One of this properties needs to be specified: %s " % _ValidationMsg ._array_as_text (
252
+ properties
266
253
),
267
254
{"properties" : properties }
268
255
)
@@ -271,9 +258,8 @@ static func _one_property_is_required_error(properties: Array[StringName]) -> _V
271
258
static func _exclusive_properties_error (properties : Array [StringName ]) -> _ValidationMsg:
272
259
return _ValidationMsg .new_error (
273
260
_type_name + ":exclusive_properties" ,
274
- (
275
- "This properties can not be defined at the same time: %s "
276
- % _ValidationMsg ._array_as_text (properties )
261
+ "This properties can not be defined at the same time: %s " % _ValidationMsg ._array_as_text (
262
+ properties
277
263
),
278
264
{"properties" : properties }
279
265
)
0 commit comments