mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 13:15:54 +00:00
Broken graph editor
This commit is contained in:
parent
6215008db7
commit
f996513dca
16 changed files with 1033 additions and 12 deletions
46
addons/bullet_script_graph_editor/inspector_plugin.gd
Normal file
46
addons/bullet_script_graph_editor/inspector_plugin.gd
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
@tool
|
||||
extends EditorInspectorPlugin
|
||||
|
||||
var _plugin: EditorPlugin
|
||||
|
||||
func setup(plugin: EditorPlugin) -> void:
|
||||
_plugin = plugin
|
||||
|
||||
func _can_handle(object: Object) -> bool:
|
||||
return object is Resource and _is_supported_resource(object)
|
||||
|
||||
func _parse_begin(object: Object) -> void:
|
||||
if not (object is Resource):
|
||||
return
|
||||
|
||||
var button := Button.new()
|
||||
button.text = "Open In Bullet Graph Editor"
|
||||
button.pressed.connect(_on_open_pressed.bind(object))
|
||||
add_custom_control(button)
|
||||
|
||||
func _on_open_pressed(resource: Resource) -> void:
|
||||
if _plugin == null:
|
||||
return
|
||||
_plugin.call("open_resource_in_graph", resource)
|
||||
|
||||
func _is_supported_resource(resource: Resource) -> bool:
|
||||
var script: Script = resource.get_script()
|
||||
if script == null:
|
||||
return false
|
||||
|
||||
var path := script.resource_path
|
||||
if path.contains("/Scripts/AttackPatterns/"):
|
||||
return true
|
||||
if path.contains("/Scripts/Resources/") and path.contains("Pattern"):
|
||||
return true
|
||||
|
||||
if path.ends_with("BossScript.cs") \
|
||||
or path.ends_with("BossPhase.cs") \
|
||||
or path.ends_with("BulletScript3D.cs") \
|
||||
or path.ends_with("BulletScript.cs") \
|
||||
or path.ends_with("AttackPattern.cs") \
|
||||
or path.ends_with("PatternGroup.cs") \
|
||||
or path.ends_with("ParallelPatternGroup.cs"):
|
||||
return true
|
||||
|
||||
return resource.get("WaitForCompletion") != null
|
||||
Loading…
Add table
Add a link
Reference in a new issue