@@ -132,54 +132,18 @@ static func _add_property_definitions(_class_name: String, property_list: Array[
132
132
# Setter
133
133
var block_definition : BlockDefinition
134
134
if block_settings .get ("has_setter" , true ):
135
- block_definition = (
136
- BlockDefinition
137
- . new (
138
- & "% s_set_% s" % [_class_name , property .name ],
139
- _class_name ,
140
- "Set the %s property" % property .name ,
141
- block_settings .category ,
142
- Types .BlockType .STATEMENT ,
143
- TYPE_NIL ,
144
- "set %s to {value: %s} " % [property .name .capitalize ().to_lower (), type_string ],
145
- "%s = {value} " % property .name ,
146
- {"value" : block_settings .get ("default_set" , _FALLBACK_SET_FOR_TYPE [property .type ])},
147
- )
148
- )
135
+ var default_value : Variant = block_settings .get ("default_set" , _FALLBACK_SET_FOR_TYPE [property .type ])
136
+ block_definition = BlockDefinition .new_property_setter (_class_name , property , block_settings .category , default_value )
149
137
_catalog [block_definition .name ] = block_definition
150
138
151
139
# Changer
152
140
if block_settings .get ("has_change" , true ):
153
- block_definition = (
154
- BlockDefinition
155
- . new (
156
- & "% s_change_% s" % [_class_name , property .name ],
157
- _class_name ,
158
- "Change the %s property" % property .name ,
159
- block_settings .category ,
160
- Types .BlockType .STATEMENT ,
161
- TYPE_NIL ,
162
- "change %s by {value: %s} " % [property .name .capitalize ().to_lower (), type_string ],
163
- "%s += {value} " % property .name ,
164
- {"value" : block_settings .get ("default_change" , _FALLBACK_CHANGE_FOR_TYPE [property .type ])},
165
- )
166
- )
141
+ var default_value : Variant = block_settings .get ("default_change" , _FALLBACK_CHANGE_FOR_TYPE [property .type ])
142
+ block_definition = BlockDefinition .new_property_changer (_class_name , property , block_settings .category , default_value )
167
143
_catalog [block_definition .name ] = block_definition
168
144
169
145
# Getter
170
- block_definition = (
171
- BlockDefinition
172
- . new (
173
- & "% s_get_% s" % [_class_name , property .name ],
174
- _class_name ,
175
- "The %s property" % property .name ,
176
- block_settings .category ,
177
- Types .BlockType .VALUE ,
178
- property .type ,
179
- "%s " % property .name .capitalize ().to_lower (),
180
- "%s " % property .name ,
181
- )
182
- )
146
+ block_definition = BlockDefinition .new_property_getter (_class_name , property , block_settings .category )
183
147
_catalog [block_definition .name ] = block_definition
184
148
185
149
0 commit comments