ile-de-test/addons/waterways/inspector_plugin.gd

19 lines
673 B
GDScript3
Raw Permalink Normal View History

2024-01-26 20:00:32 +00:00
# Copyright © 2023 Kasper Arnklit Frandsen - MIT License
2023-10-05 18:02:23 +00:00
# See `LICENSE.md` included in the source distribution for details.
extends EditorInspectorPlugin
const RiverManager = preload("res://addons/waterways/river_manager.gd")
var _editor = load("res://addons/waterways/editor_property.gd")
func _can_handle(object) -> bool:
return object is RiverManager
2024-01-26 20:00:32 +00:00
func _parse_property(object: Object, type: Variant.Type, name: String, hint_type: PropertyHint, hint_string: String, usage_flags, wide: bool) -> bool:
2023-10-05 18:02:23 +00:00
if type == TYPE_PROJECTION and "color" in name:
var editor_property = _editor.new()
add_property_editor(name, editor_property)
return true
return false