0.2.0-dev Download ZIP
54 lines ·2.2 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ScriptCreateDialog" inherits="ConfirmationDialog" api_type="editor" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Godot editor's popup dialog for creating new [Script] files. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | The [ScriptCreateDialog] creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the [method Window.popup] methods. |
| 8 | [codeblocks] |
| 9 | [gdscript] |
| 10 | func _ready(): |
| 11 | var dialog = ScriptCreateDialog.new(); |
| 12 | dialog.config("Node", "res://new_node.gd") # For in-engine types. |
| 13 | dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types. |
| 14 | dialog.popup_centered() |
| 15 | [/gdscript] |
| 16 | [csharp] |
| 17 | public override void _Ready() |
| 18 | { |
| 19 | var dialog = new ScriptCreateDialog(); |
| 20 | dialog.Config("Node", "res://NewNode.cs"); // For in-engine types. |
| 21 | dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types. |
| 22 | dialog.PopupCentered(); |
| 23 | } |
| 24 | [/csharp] |
| 25 | [/codeblocks] |
| 26 | </description> |
| 27 | <tutorials> |
| 28 | </tutorials> |
| 29 | <methods> |
| 30 | <method name="config"> |
| 31 | <return type="void" /> |
| 32 | <param index="0" name="inherits" type="String" /> |
| 33 | <param index="1" name="path" type="String" /> |
| 34 | <param index="2" name="built_in_enabled" type="bool" default="true" /> |
| 35 | <param index="3" name="load_enabled" type="bool" default="true" /> |
| 36 | <description> |
| 37 | Prefills required fields to configure the ScriptCreateDialog for use. |
| 38 | </description> |
| 39 | </method> |
| 40 | </methods> |
| 41 | <members> |
| 42 | <member name="dialog_hide_on_ok" type="bool" setter="set_hide_on_ok" getter="get_hide_on_ok" overrides="AcceptDialog" default="false" /> |
| 43 | <member name="ok_button_text" type="String" setter="set_ok_button_text" getter="get_ok_button_text" overrides="AcceptDialog" default=""Create"" /> |
| 44 | <member name="title" type="String" setter="set_title" getter="get_title" overrides="Window" default=""Attach Node Script"" /> |
| 45 | </members> |
| 46 | <signals> |
| 47 | <signal name="script_created"> |
| 48 | <param index="0" name="script" type="Script" /> |
| 49 | <description> |
| 50 | Emitted when the user clicks the OK button. |
| 51 | </description> |
| 52 | </signal> |
| 53 | </signals> |
| 54 | </class> |