inspector_plugin.gd 564 B

1234567891011121314151617
  1. # Copyright (C) 2022-2023 John Pennycook
  2. # SPDX-License-Identifier: MIT
  3. @tool
  4. extends EditorInspectorPlugin
  5. func _can_handle(object):
  6. var types := [
  7. ActionPrompt, JoypadButtonPrompt, JoypadMotionPrompt, KeyPrompt, MouseButtonPrompt
  8. ]
  9. return types.any(func(t): return is_instance_of(object, t))
  10. func _parse_property(_object, _type, name, _hint_type, _hint_string, _usage_flags, _wide):
  11. # Hide the texture property of TextureRect to ensure that user can only
  12. # modify it indirectly (e.g. via setting key, button, action or icon)
  13. return name == "texture"