|
1 | 1 | extends Object
|
2 | 2 |
|
3 | 3 | const BlockDefinition = preload("res://addons/block_code/code_generation/block_definition.gd")
|
4 |
| -const OptionData = preload("res://addons/block_code/code_generation/option_data.gd") |
5 | 4 | const Types = preload("res://addons/block_code/types/types.gd")
|
6 | 5 | const Util = preload("res://addons/block_code/code_generation/util.gd")
|
7 | 6 | const VariableDefinition = preload("res://addons/block_code/code_generation/variable_definition.gd")
|
@@ -153,67 +152,20 @@ static func _add_property_definitions(_class_name: String, property_list: Array[
|
153 | 152 | _catalog[block_definition.name] = block_definition
|
154 | 153 |
|
155 | 154 |
|
156 |
| -static func _get_inputmap_actions() -> Array[StringName]: |
157 |
| - var inputmap_actions: Array[StringName] |
158 |
| - |
159 |
| - var editor_input_actions: Dictionary = {} |
160 |
| - var editor_input_action_deadzones: Dictionary = {} |
161 |
| - if Engine.is_editor_hint(): |
162 |
| - var actions := InputMap.get_actions() |
163 |
| - for action in actions: |
164 |
| - if action.begins_with("spatial_editor"): |
165 |
| - var events := InputMap.action_get_events(action) |
166 |
| - editor_input_actions[action] = events |
167 |
| - editor_input_action_deadzones[action] = InputMap.action_get_deadzone(action) |
168 |
| - |
169 |
| - InputMap.load_from_project_settings() |
170 |
| - |
171 |
| - inputmap_actions = InputMap.get_actions() |
172 |
| - |
173 |
| - if Engine.is_editor_hint(): |
174 |
| - for action in editor_input_actions.keys(): |
175 |
| - InputMap.add_action(action, editor_input_action_deadzones[action]) |
176 |
| - for event in editor_input_actions[action]: |
177 |
| - InputMap.action_add_event(action, event) |
178 |
| - |
179 |
| - return inputmap_actions |
180 |
| - |
181 |
| - |
182 | 155 | static func _setup_properties_for_class():
|
183 | 156 | for _class_name in _SETTINGS_FOR_CLASS_PROPERTY:
|
184 | 157 | var property_list = ClassDB.class_get_property_list(_class_name, true)
|
185 | 158 | var property_settings = _SETTINGS_FOR_CLASS_PROPERTY[_class_name]
|
186 | 159 | _add_property_definitions(_class_name, property_list, property_settings)
|
187 | 160 |
|
188 | 161 |
|
189 |
| -static func _setup_input_block(): |
190 |
| - var inputmap_actions = _get_inputmap_actions() |
191 |
| - |
192 |
| - var block_definition: BlockDefinition = ( |
193 |
| - BlockDefinition |
194 |
| - . new( |
195 |
| - &"is_input_actioned", |
196 |
| - "", |
197 |
| - "", |
198 |
| - "Input", |
199 |
| - Types.BlockType.VALUE, |
200 |
| - TYPE_BOOL, |
201 |
| - "Is action {action_name: STRING_NAME} {action: NIL}", |
202 |
| - "Input.is_action_{{action}}('{{action_name}}')", |
203 |
| - {"action_name": OptionData.new(inputmap_actions), "action": OptionData.new(["pressed", "just_pressed", "just_released"])}, |
204 |
| - ) |
205 |
| - ) |
206 |
| - _catalog[block_definition.name] = block_definition |
207 |
| - |
208 |
| - |
209 | 162 | static func setup():
|
210 | 163 | if _catalog:
|
211 | 164 | return
|
212 | 165 |
|
213 | 166 | _catalog = {}
|
214 | 167 | _setup_definitions_from_files()
|
215 | 168 | _setup_properties_for_class()
|
216 |
| - _setup_input_block() |
217 | 169 |
|
218 | 170 |
|
219 | 171 | static func get_block(block_name: StringName):
|
|
0 commit comments