class_scriptcreatedialog.rst 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ScriptCreateDialog.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ScriptCreateDialog:
  6. ScriptCreateDialog
  7. ==================
  8. **Inherits:** :ref:`ConfirmationDialog<class_ConfirmationDialog>` **<** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. The Editor's popup dialog for creating new :ref:`Script<class_Script>` files.
  10. Description
  11. -----------
  12. 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 :ref:`Window.popup<class_Window_method_popup>` methods.
  13. .. tabs::
  14. .. code-tab:: gdscript
  15. func _ready():
  16. var dialog = ScriptCreateDialog.new();
  17. dialog.config("Node", "res://new_node.gd") # For in-engine types.
  18. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types.
  19. dialog.popup_centered()
  20. .. code-tab:: csharp
  21. public override void _Ready()
  22. {
  23. var dialog = new ScriptCreateDialog();
  24. dialog.Config("Node", "res://NewNode.cs"); // For in-engine types.
  25. dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types.
  26. dialog.PopupCentered();
  27. }
  28. Properties
  29. ----------
  30. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  32. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  33. | :ref:`String<class_String>` | ok_button_text | ``"Create"`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_ok_button_text>`) |
  34. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  35. | :ref:`String<class_String>` | title | ``"Attach Node Script"`` (overrides :ref:`Window<class_Window_property_title>`) |
  36. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  37. Methods
  38. -------
  39. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`config<class_ScriptCreateDialog_method_config>` **(** :ref:`String<class_String>` inherits, :ref:`String<class_String>` path, :ref:`bool<class_bool>` built_in_enabled=true, :ref:`bool<class_bool>` load_enabled=true **)** |
  41. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. Signals
  43. -------
  44. .. _class_ScriptCreateDialog_signal_script_created:
  45. - **script_created** **(** :ref:`Script<class_Script>` script **)**
  46. Emitted when the user clicks the OK button.
  47. Method Descriptions
  48. -------------------
  49. .. _class_ScriptCreateDialog_method_config:
  50. - void **config** **(** :ref:`String<class_String>` inherits, :ref:`String<class_String>` path, :ref:`bool<class_bool>` built_in_enabled=true, :ref:`bool<class_bool>` load_enabled=true **)**
  51. Prefills required fields to configure the ScriptCreateDialog for use.
  52. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  53. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  54. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  55. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  56. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  57. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`