1 /** 2 Used by the editor to extend its functionality. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.editorplugin; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.node; 24 import godot.inputevent; 25 import godot.control; 26 import godot.camera; 27 import godot.configfile; 28 import godot.toolbutton; 29 import godot.script; 30 import godot.texture; 31 import godot.undoredo; 32 import godot.editorimportplugin; 33 import godot.editorsceneimporter; 34 import godot.editorexportplugin; 35 import godot.editorinspectorplugin; 36 import godot.editorinterface; 37 import godot.scriptcreatedialog; 38 /** 39 Used by the editor to extend its functionality. 40 41 Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. Also see $(D EditorScript) to add functions to the editor. 42 */ 43 @GodotBaseClass struct EditorPlugin 44 { 45 enum string _GODOT_internal_name = "EditorPlugin"; 46 public: 47 @nogc nothrow: 48 union { godot_object _godot_object; Node _GODOT_base; } 49 alias _GODOT_base this; 50 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 51 package(godot) __gshared bool _classBindingInitialized = false; 52 package(godot) static struct _classBinding 53 { 54 __gshared: 55 @GodotName("forward_canvas_gui_input") GodotMethod!(bool, InputEvent) forwardCanvasGuiInput; 56 @GodotName("forward_canvas_draw_over_viewport") GodotMethod!(void, Control) forwardCanvasDrawOverViewport; 57 @GodotName("forward_canvas_force_draw_over_viewport") GodotMethod!(void, Control) forwardCanvasForceDrawOverViewport; 58 @GodotName("forward_spatial_gui_input") GodotMethod!(bool, Camera, InputEvent) forwardSpatialGuiInput; 59 @GodotName("get_plugin_name") GodotMethod!(String) getPluginName; 60 @GodotName("get_plugin_icon") GodotMethod!(GodotObject) getPluginIcon; 61 @GodotName("has_main_screen") GodotMethod!(bool) hasMainScreen; 62 @GodotName("make_visible") GodotMethod!(void, bool) makeVisible; 63 @GodotName("edit") GodotMethod!(void, GodotObject) edit; 64 @GodotName("handles") GodotMethod!(bool, GodotObject) handles; 65 @GodotName("get_state") GodotMethod!(Dictionary) getState; 66 @GodotName("set_state") GodotMethod!(void, Dictionary) setState; 67 @GodotName("clear") GodotMethod!(void) clear; 68 @GodotName("save_external_data") GodotMethod!(void) saveExternalData; 69 @GodotName("apply_changes") GodotMethod!(void) applyChanges; 70 @GodotName("get_breakpoints") GodotMethod!(PoolStringArray) getBreakpoints; 71 @GodotName("set_window_layout") GodotMethod!(void, ConfigFile) setWindowLayout; 72 @GodotName("get_window_layout") GodotMethod!(void, ConfigFile) getWindowLayout; 73 @GodotName("build") GodotMethod!(bool) build; 74 @GodotName("add_control_to_container") GodotMethod!(void, long, GodotObject) addControlToContainer; 75 @GodotName("add_control_to_bottom_panel") GodotMethod!(ToolButton, GodotObject, String) addControlToBottomPanel; 76 @GodotName("add_control_to_dock") GodotMethod!(void, long, GodotObject) addControlToDock; 77 @GodotName("remove_control_from_docks") GodotMethod!(void, GodotObject) removeControlFromDocks; 78 @GodotName("remove_control_from_bottom_panel") GodotMethod!(void, GodotObject) removeControlFromBottomPanel; 79 @GodotName("remove_control_from_container") GodotMethod!(void, long, GodotObject) removeControlFromContainer; 80 @GodotName("add_tool_menu_item") GodotMethod!(void, String, GodotObject, String, Variant) addToolMenuItem; 81 @GodotName("add_tool_submenu_item") GodotMethod!(void, String, GodotObject) addToolSubmenuItem; 82 @GodotName("remove_tool_menu_item") GodotMethod!(void, String) removeToolMenuItem; 83 @GodotName("add_custom_type") GodotMethod!(void, String, String, Script, Texture) addCustomType; 84 @GodotName("remove_custom_type") GodotMethod!(void, String) removeCustomType; 85 @GodotName("add_autoload_singleton") GodotMethod!(void, String, String) addAutoloadSingleton; 86 @GodotName("remove_autoload_singleton") GodotMethod!(void, String) removeAutoloadSingleton; 87 @GodotName("update_overlays") GodotMethod!(long) updateOverlays; 88 @GodotName("make_bottom_panel_item_visible") GodotMethod!(void, GodotObject) makeBottomPanelItemVisible; 89 @GodotName("hide_bottom_panel") GodotMethod!(void) hideBottomPanel; 90 @GodotName("get_undo_redo") GodotMethod!(UndoRedo) getUndoRedo; 91 @GodotName("queue_save_layout") GodotMethod!(void) queueSaveLayout; 92 @GodotName("add_import_plugin") GodotMethod!(void, EditorImportPlugin) addImportPlugin; 93 @GodotName("remove_import_plugin") GodotMethod!(void, EditorImportPlugin) removeImportPlugin; 94 @GodotName("add_scene_import_plugin") GodotMethod!(void, EditorSceneImporter) addSceneImportPlugin; 95 @GodotName("remove_scene_import_plugin") GodotMethod!(void, EditorSceneImporter) removeSceneImportPlugin; 96 @GodotName("add_export_plugin") GodotMethod!(void, EditorExportPlugin) addExportPlugin; 97 @GodotName("remove_export_plugin") GodotMethod!(void, EditorExportPlugin) removeExportPlugin; 98 @GodotName("add_inspector_plugin") GodotMethod!(void, EditorInspectorPlugin) addInspectorPlugin; 99 @GodotName("remove_inspector_plugin") GodotMethod!(void, EditorInspectorPlugin) removeInspectorPlugin; 100 @GodotName("set_input_event_forwarding_always_enabled") GodotMethod!(void) setInputEventForwardingAlwaysEnabled; 101 @GodotName("set_force_draw_over_forwarding_enabled") GodotMethod!(void) setForceDrawOverForwardingEnabled; 102 @GodotName("get_editor_interface") GodotMethod!(EditorInterface) getEditorInterface; 103 @GodotName("get_script_create_dialog") GodotMethod!(ScriptCreateDialog) getScriptCreateDialog; 104 } 105 bool opEquals(in EditorPlugin other) const { return _godot_object.ptr is other._godot_object.ptr; } 106 EditorPlugin opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 107 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 108 mixin baseCasts; 109 static EditorPlugin _new() 110 { 111 static godot_class_constructor constructor; 112 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("EditorPlugin"); 113 if(constructor is null) return typeof(this).init; 114 return cast(EditorPlugin)(constructor()); 115 } 116 @disable new(size_t s); 117 /// 118 enum DockSlot : int 119 { 120 /** 121 122 */ 123 dockSlotLeftUl = 0, 124 /** 125 126 */ 127 dockSlotLeftBl = 1, 128 /** 129 130 */ 131 dockSlotLeftUr = 2, 132 /** 133 134 */ 135 dockSlotLeftBr = 3, 136 /** 137 138 */ 139 dockSlotRightUl = 4, 140 /** 141 142 */ 143 dockSlotRightBl = 5, 144 /** 145 146 */ 147 dockSlotRightUr = 6, 148 /** 149 150 */ 151 dockSlotRightBr = 7, 152 /** 153 154 */ 155 dockSlotMax = 8, 156 } 157 /// 158 enum CustomControlContainer : int 159 { 160 /** 161 162 */ 163 containerToolbar = 0, 164 /** 165 166 */ 167 containerSpatialEditorMenu = 1, 168 /** 169 170 */ 171 containerSpatialEditorSideLeft = 2, 172 /** 173 174 */ 175 containerSpatialEditorSideRight = 3, 176 /** 177 178 */ 179 containerSpatialEditorBottom = 4, 180 /** 181 182 */ 183 containerCanvasEditorMenu = 5, 184 /** 185 186 */ 187 containerCanvasEditorSideLeft = 6, 188 /** 189 190 */ 191 containerCanvasEditorSideRight = 7, 192 /** 193 194 */ 195 containerCanvasEditorBottom = 8, 196 /** 197 198 */ 199 containerPropertyEditorBottom = 9, 200 } 201 /// 202 enum Constants : int 203 { 204 containerToolbar = 0, 205 dockSlotLeftUl = 0, 206 containerSpatialEditorMenu = 1, 207 dockSlotLeftBl = 1, 208 containerSpatialEditorSideLeft = 2, 209 dockSlotLeftUr = 2, 210 containerSpatialEditorSideRight = 3, 211 dockSlotLeftBr = 3, 212 containerSpatialEditorBottom = 4, 213 dockSlotRightUl = 4, 214 containerCanvasEditorMenu = 5, 215 dockSlotRightBl = 5, 216 containerCanvasEditorSideLeft = 6, 217 dockSlotRightUr = 6, 218 containerCanvasEditorSideRight = 7, 219 dockSlotRightBr = 7, 220 containerCanvasEditorBottom = 8, 221 dockSlotMax = 8, 222 containerPropertyEditorBottom = 9, 223 } 224 /** 225 226 */ 227 bool forwardCanvasGuiInput(InputEvent event) 228 { 229 Array _GODOT_args = Array.empty_array; 230 _GODOT_args.append(event); 231 String _GODOT_method_name = String("forward_canvas_gui_input"); 232 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 233 } 234 /** 235 This method is called when there is an input event in the 2D viewport, e.g. the user clicks with the mouse in the 2D space (canvas GUI). Keep in mind that for this method to be called you have to first declare the virtual method $(D handles) so the editor knows that you want to work with the workspace: 236 237 238 func handles(object): 239 return true 240 241 242 Also note that the edited scene must have a root node. 243 */ 244 void forwardCanvasDrawOverViewport(Control overlay) 245 { 246 Array _GODOT_args = Array.empty_array; 247 _GODOT_args.append(overlay); 248 String _GODOT_method_name = String("forward_canvas_draw_over_viewport"); 249 this.callv(_GODOT_method_name, _GODOT_args); 250 } 251 /** 252 253 */ 254 void forwardCanvasForceDrawOverViewport(Control overlay) 255 { 256 Array _GODOT_args = Array.empty_array; 257 _GODOT_args.append(overlay); 258 String _GODOT_method_name = String("forward_canvas_force_draw_over_viewport"); 259 this.callv(_GODOT_method_name, _GODOT_args); 260 } 261 /** 262 This method is called when there is an input event in the 3D viewport, e.g. the user clicks with the mouse in the 3D space (spatial GUI). Keep in mind that for this method to be called you have to first declare the virtual method $(D handles) so the editor knows that you want to work with the workspace: 263 264 265 func handles(object): 266 return true 267 268 269 Also note that the edited scene must have a root node. 270 */ 271 bool forwardSpatialGuiInput(Camera camera, InputEvent event) 272 { 273 Array _GODOT_args = Array.empty_array; 274 _GODOT_args.append(camera); 275 _GODOT_args.append(event); 276 String _GODOT_method_name = String("forward_spatial_gui_input"); 277 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 278 } 279 /** 280 281 */ 282 String getPluginName() 283 { 284 Array _GODOT_args = Array.empty_array; 285 String _GODOT_method_name = String("get_plugin_name"); 286 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!String); 287 } 288 /** 289 290 */ 291 GodotObject getPluginIcon() 292 { 293 Array _GODOT_args = Array.empty_array; 294 String _GODOT_method_name = String("get_plugin_icon"); 295 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!GodotObject); 296 } 297 /** 298 Return true if this is a main screen editor plugin (it goes in the workspaces selector together with '2D', '3D', and 'Script'). 299 */ 300 bool hasMainScreen() 301 { 302 Array _GODOT_args = Array.empty_array; 303 String _GODOT_method_name = String("has_main_screen"); 304 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 305 } 306 /** 307 This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. 308 Remember that you have to manage the visibility of all your editor controls manually. 309 */ 310 void makeVisible(in bool visible) 311 { 312 Array _GODOT_args = Array.empty_array; 313 _GODOT_args.append(visible); 314 String _GODOT_method_name = String("make_visible"); 315 this.callv(_GODOT_method_name, _GODOT_args); 316 } 317 /** 318 This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. 319 */ 320 void edit(GodotObject object) 321 { 322 Array _GODOT_args = Array.empty_array; 323 _GODOT_args.append(object); 324 String _GODOT_method_name = String("edit"); 325 this.callv(_GODOT_method_name, _GODOT_args); 326 } 327 /** 328 Implement this function if your plugin edits a specific type of object (Resource or Node). If you return true, then you will get the functions $(D EditorPlugin.edit) and $(D EditorPlugin.makeVisible) called when the editor requests them. If you have declared the methods $(D forwardCanvasGuiInput) and $(D forwardSpatialGuiInput) these will be called too. 329 */ 330 bool handles(GodotObject object) 331 { 332 Array _GODOT_args = Array.empty_array; 333 _GODOT_args.append(object); 334 String _GODOT_method_name = String("handles"); 335 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 336 } 337 /** 338 Get the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). 339 */ 340 Dictionary getState() 341 { 342 Array _GODOT_args = Array.empty_array; 343 String _GODOT_method_name = String("get_state"); 344 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!Dictionary); 345 } 346 /** 347 Restore the state saved by $(D EditorPlugin.getState). 348 */ 349 void setState(in Dictionary state) 350 { 351 Array _GODOT_args = Array.empty_array; 352 _GODOT_args.append(state); 353 String _GODOT_method_name = String("set_state"); 354 this.callv(_GODOT_method_name, _GODOT_args); 355 } 356 /** 357 Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. 358 */ 359 void clear() 360 { 361 Array _GODOT_args = Array.empty_array; 362 String _GODOT_method_name = String("clear"); 363 this.callv(_GODOT_method_name, _GODOT_args); 364 } 365 /** 366 This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. 367 */ 368 void saveExternalData() 369 { 370 Array _GODOT_args = Array.empty_array; 371 String _GODOT_method_name = String("save_external_data"); 372 this.callv(_GODOT_method_name, _GODOT_args); 373 } 374 /** 375 This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency. 376 This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. 377 */ 378 void applyChanges() 379 { 380 Array _GODOT_args = Array.empty_array; 381 String _GODOT_method_name = String("apply_changes"); 382 this.callv(_GODOT_method_name, _GODOT_args); 383 } 384 /** 385 This is for editors that edit script based objects. You can return a list of breakpoints in the format (script:line), for example: res://path_to_script.gd:25 386 */ 387 PoolStringArray getBreakpoints() 388 { 389 Array _GODOT_args = Array.empty_array; 390 String _GODOT_method_name = String("get_breakpoints"); 391 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!PoolStringArray); 392 } 393 /** 394 Restore the plugin GUI layout saved by $(D EditorPlugin.getWindowLayout). 395 */ 396 void setWindowLayout(ConfigFile layout) 397 { 398 Array _GODOT_args = Array.empty_array; 399 _GODOT_args.append(layout); 400 String _GODOT_method_name = String("set_window_layout"); 401 this.callv(_GODOT_method_name, _GODOT_args); 402 } 403 /** 404 Get the GUI layout of the plugin. This is used to save the project's editor layout when $(D queueSaveLayout) is called or the editor layout was changed(For example changing the position of a dock). 405 */ 406 void getWindowLayout(ConfigFile layout) 407 { 408 Array _GODOT_args = Array.empty_array; 409 _GODOT_args.append(layout); 410 String _GODOT_method_name = String("get_window_layout"); 411 this.callv(_GODOT_method_name, _GODOT_args); 412 } 413 /** 414 415 */ 416 bool build() 417 { 418 Array _GODOT_args = Array.empty_array; 419 String _GODOT_method_name = String("build"); 420 return this.callv(_GODOT_method_name, _GODOT_args).as!(RefOrT!bool); 421 } 422 /** 423 Add a custom control to a container (see CONTAINER_* enum). There are many locations where custom controls can be added in the editor UI. 424 Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). 425 When your plugin is deactivated, make sure to remove your custom control with $(D removeControlFromContainer) and free it with `queue_free()`. 426 */ 427 void addControlToContainer(in long container, GodotObject control) 428 { 429 checkClassBinding!(typeof(this))(); 430 ptrcall!(void)(_classBinding.addControlToContainer, _godot_object, container, control); 431 } 432 /** 433 Add a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with $(D removeControlFromBottomPanel) and free it with `queue_free()`. 434 */ 435 ToolButton addControlToBottomPanel(StringArg1)(GodotObject control, in StringArg1 title) 436 { 437 checkClassBinding!(typeof(this))(); 438 return ptrcall!(ToolButton)(_classBinding.addControlToBottomPanel, _godot_object, control, title); 439 } 440 /** 441 Add the control to a specific dock slot (see DOCK_* enum for options). 442 If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. 443 When your plugin is deactivated, make sure to remove your custom control with $(D removeControlFromDocks) and free it with `queue_free()`. 444 */ 445 void addControlToDock(in long slot, GodotObject control) 446 { 447 checkClassBinding!(typeof(this))(); 448 ptrcall!(void)(_classBinding.addControlToDock, _godot_object, slot, control); 449 } 450 /** 451 Remove the control from the dock. You have to manually `queue_free()` the control. 452 */ 453 void removeControlFromDocks(GodotObject control) 454 { 455 checkClassBinding!(typeof(this))(); 456 ptrcall!(void)(_classBinding.removeControlFromDocks, _godot_object, control); 457 } 458 /** 459 Remove the control from the bottom panel. You have to manually `queue_free()` the control. 460 */ 461 void removeControlFromBottomPanel(GodotObject control) 462 { 463 checkClassBinding!(typeof(this))(); 464 ptrcall!(void)(_classBinding.removeControlFromBottomPanel, _godot_object, control); 465 } 466 /** 467 Remove the control from the specified container. You have to manually `queue_free()` the control. 468 */ 469 void removeControlFromContainer(in long container, GodotObject control) 470 { 471 checkClassBinding!(typeof(this))(); 472 ptrcall!(void)(_classBinding.removeControlFromContainer, _godot_object, container, control); 473 } 474 /** 475 Add a custom menu to 'Project > Tools' as `name` that calls `callback` on an instance of `handler` with a parameter `ud` when user activates it. 476 */ 477 void addToolMenuItem(StringArg0, StringArg2, VariantArg3)(in StringArg0 name, GodotObject handler, in StringArg2 callback, in VariantArg3 ud = Variant.nil) 478 { 479 checkClassBinding!(typeof(this))(); 480 ptrcall!(void)(_classBinding.addToolMenuItem, _godot_object, name, handler, callback, ud); 481 } 482 /** 483 Like $(D addToolMenuItem) but adds the `submenu` item inside the `name` menu. 484 */ 485 void addToolSubmenuItem(StringArg0)(in StringArg0 name, GodotObject submenu) 486 { 487 checkClassBinding!(typeof(this))(); 488 ptrcall!(void)(_classBinding.addToolSubmenuItem, _godot_object, name, submenu); 489 } 490 /** 491 Removes a menu `name` from 'Project > Tools'. 492 */ 493 void removeToolMenuItem(StringArg0)(in StringArg0 name) 494 { 495 checkClassBinding!(typeof(this))(); 496 ptrcall!(void)(_classBinding.removeToolMenuItem, _godot_object, name); 497 } 498 /** 499 Add a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed. 500 When given node or resource is selected, the base type will be instanced (ie, "Spatial", "Control", "Resource"), then the script will be loaded and set to this object. 501 You can use the virtual method $(D handles) to check if your custom object is being edited by checking the script or using 'is' keyword. 502 During run-time, this will be a simple object with a script so this function does not need to be called then. 503 */ 504 void addCustomType(StringArg0, StringArg1)(in StringArg0 type, in StringArg1 base, Script script, Texture icon) 505 { 506 checkClassBinding!(typeof(this))(); 507 ptrcall!(void)(_classBinding.addCustomType, _godot_object, type, base, script, icon); 508 } 509 /** 510 Remove a custom type added by $(D addCustomType) 511 */ 512 void removeCustomType(StringArg0)(in StringArg0 type) 513 { 514 checkClassBinding!(typeof(this))(); 515 ptrcall!(void)(_classBinding.removeCustomType, _godot_object, type); 516 } 517 /** 518 Add a script at `path` to the Autoload list as `name`. 519 */ 520 void addAutoloadSingleton(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 path) 521 { 522 checkClassBinding!(typeof(this))(); 523 ptrcall!(void)(_classBinding.addAutoloadSingleton, _godot_object, name, path); 524 } 525 /** 526 Remove an Autoload `name` from the list. 527 */ 528 void removeAutoloadSingleton(StringArg0)(in StringArg0 name) 529 { 530 checkClassBinding!(typeof(this))(); 531 ptrcall!(void)(_classBinding.removeAutoloadSingleton, _godot_object, name); 532 } 533 /** 534 535 */ 536 long updateOverlays() const 537 { 538 checkClassBinding!(typeof(this))(); 539 return ptrcall!(long)(_classBinding.updateOverlays, _godot_object); 540 } 541 /** 542 543 */ 544 void makeBottomPanelItemVisible(GodotObject item) 545 { 546 checkClassBinding!(typeof(this))(); 547 ptrcall!(void)(_classBinding.makeBottomPanelItemVisible, _godot_object, item); 548 } 549 /** 550 551 */ 552 void hideBottomPanel() 553 { 554 checkClassBinding!(typeof(this))(); 555 ptrcall!(void)(_classBinding.hideBottomPanel, _godot_object); 556 } 557 /** 558 Get the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. 559 */ 560 UndoRedo getUndoRedo() 561 { 562 checkClassBinding!(typeof(this))(); 563 return ptrcall!(UndoRedo)(_classBinding.getUndoRedo, _godot_object); 564 } 565 /** 566 Queue save the project's editor layout. 567 */ 568 void queueSaveLayout() const 569 { 570 checkClassBinding!(typeof(this))(); 571 ptrcall!(void)(_classBinding.queueSaveLayout, _godot_object); 572 } 573 /** 574 575 */ 576 void addImportPlugin(EditorImportPlugin importer) 577 { 578 checkClassBinding!(typeof(this))(); 579 ptrcall!(void)(_classBinding.addImportPlugin, _godot_object, importer); 580 } 581 /** 582 583 */ 584 void removeImportPlugin(EditorImportPlugin importer) 585 { 586 checkClassBinding!(typeof(this))(); 587 ptrcall!(void)(_classBinding.removeImportPlugin, _godot_object, importer); 588 } 589 /** 590 591 */ 592 void addSceneImportPlugin(EditorSceneImporter scene_importer) 593 { 594 checkClassBinding!(typeof(this))(); 595 ptrcall!(void)(_classBinding.addSceneImportPlugin, _godot_object, scene_importer); 596 } 597 /** 598 599 */ 600 void removeSceneImportPlugin(EditorSceneImporter scene_importer) 601 { 602 checkClassBinding!(typeof(this))(); 603 ptrcall!(void)(_classBinding.removeSceneImportPlugin, _godot_object, scene_importer); 604 } 605 /** 606 607 */ 608 void addExportPlugin(EditorExportPlugin plugin) 609 { 610 checkClassBinding!(typeof(this))(); 611 ptrcall!(void)(_classBinding.addExportPlugin, _godot_object, plugin); 612 } 613 /** 614 615 */ 616 void removeExportPlugin(EditorExportPlugin plugin) 617 { 618 checkClassBinding!(typeof(this))(); 619 ptrcall!(void)(_classBinding.removeExportPlugin, _godot_object, plugin); 620 } 621 /** 622 623 */ 624 void addInspectorPlugin(EditorInspectorPlugin plugin) 625 { 626 checkClassBinding!(typeof(this))(); 627 ptrcall!(void)(_classBinding.addInspectorPlugin, _godot_object, plugin); 628 } 629 /** 630 631 */ 632 void removeInspectorPlugin(EditorInspectorPlugin plugin) 633 { 634 checkClassBinding!(typeof(this))(); 635 ptrcall!(void)(_classBinding.removeInspectorPlugin, _godot_object, plugin); 636 } 637 /** 638 Use this method if you always want to receive inputs from 3D view screen inside $(D forwardSpatialGuiInput). It might be especially usable if your plugin will want to use raycast in the scene. 639 */ 640 void setInputEventForwardingAlwaysEnabled() 641 { 642 checkClassBinding!(typeof(this))(); 643 ptrcall!(void)(_classBinding.setInputEventForwardingAlwaysEnabled, _godot_object); 644 } 645 /** 646 647 */ 648 void setForceDrawOverForwardingEnabled() 649 { 650 checkClassBinding!(typeof(this))(); 651 ptrcall!(void)(_classBinding.setForceDrawOverForwardingEnabled, _godot_object); 652 } 653 /** 654 Return the $(D EditorInterface) object that gives you control over Godot editor's window and its functionalities. 655 */ 656 EditorInterface getEditorInterface() 657 { 658 checkClassBinding!(typeof(this))(); 659 return ptrcall!(EditorInterface)(_classBinding.getEditorInterface, _godot_object); 660 } 661 /** 662 Gets the Editor's dialogue used for making scripts. Note that users can configure it before use. 663 */ 664 ScriptCreateDialog getScriptCreateDialog() 665 { 666 checkClassBinding!(typeof(this))(); 667 return ptrcall!(ScriptCreateDialog)(_classBinding.getScriptCreateDialog, _godot_object); 668 } 669 }