1 /** 2 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.visualscripteditor; 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.script; 23 /** 24 25 */ 26 @GodotBaseClass struct VisualScriptEditorSingleton 27 { 28 enum string _GODOT_internal_name = "_VisualScriptEditor"; 29 public: 30 @nogc nothrow: 31 union { godot_object _godot_object; GodotObject _GODOT_base; } 32 alias _GODOT_base this; 33 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 34 package(godot) __gshared bool _classBindingInitialized = false; 35 package(godot) static struct _classBinding 36 { 37 __gshared: 38 godot_object _singleton; 39 immutable char* _singletonName = "VisualScriptEditor"; 40 @GodotName("add_custom_node") GodotMethod!(void, String, String, Script) addCustomNode; 41 @GodotName("remove_custom_node") GodotMethod!(void, String, String) removeCustomNode; 42 } 43 bool opEquals(in VisualScriptEditorSingleton other) const { return _godot_object.ptr is other._godot_object.ptr; } 44 VisualScriptEditorSingleton opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 45 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 46 mixin baseCasts; 47 static VisualScriptEditorSingleton _new() 48 { 49 static godot_class_constructor constructor; 50 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("_VisualScriptEditor"); 51 if(constructor is null) return typeof(this).init; 52 return cast(VisualScriptEditorSingleton)(constructor()); 53 } 54 @disable new(size_t s); 55 /** 56 Add a custom Visual Script node to the editor. It'll be placed under "Custom Nodes" with the `category` as the parameter. 57 */ 58 void addCustomNode(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 category, Script script) 59 { 60 checkClassBinding!(typeof(this))(); 61 ptrcall!(void)(_classBinding.addCustomNode, _godot_object, name, category, script); 62 } 63 /** 64 Remove a custom Visual Script node from the editor. Custom nodes already placed on scripts won't be removed. 65 */ 66 void removeCustomNode(StringArg0, StringArg1)(in StringArg0 name, in StringArg1 category) 67 { 68 checkClassBinding!(typeof(this))(); 69 ptrcall!(void)(_classBinding.removeCustomNode, _godot_object, name, category); 70 } 71 } 72 /// Returns: the VisualScriptEditorSingleton 73 @property @nogc nothrow pragma(inline, true) 74 VisualScriptEditorSingleton VisualScriptEditor() 75 { 76 checkClassBinding!VisualScriptEditorSingleton(); 77 return VisualScriptEditorSingleton(VisualScriptEditorSingleton._classBinding._singleton); 78 }