class_scriptcreatedialog.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ScriptCreateDialog.xml.
  6. .. _class_ScriptCreateDialog:
  7. ScriptCreateDialog
  8. ==================
  9. **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>`
  10. Godot editor's popup dialog for creating new :ref:`Script<class_Script>` files.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. tabs::
  16. .. code-tab:: gdscript
  17. func _ready():
  18. var dialog = ScriptCreateDialog.new();
  19. dialog.config("Node", "res://new_node.gd") # For in-engine types.
  20. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types.
  21. dialog.popup_centered()
  22. .. code-tab:: csharp
  23. public override void _Ready()
  24. {
  25. var dialog = new ScriptCreateDialog();
  26. dialog.Config("Node", "res://NewNode.cs"); // For in-engine types.
  27. dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types.
  28. dialog.PopupCentered();
  29. }
  30. .. rst-class:: classref-reftable-group
  31. Properties
  32. ----------
  33. .. table::
  34. :widths: auto
  35. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  37. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  38. | :ref:`String<class_String>` | ok_button_text | ``"Create"`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_ok_button_text>`) |
  39. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  40. | :ref:`String<class_String>` | title | ``"Attach Node Script"`` (overrides :ref:`Window<class_Window_property_title>`) |
  41. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-reftable-group
  43. Methods
  44. -------
  45. .. table::
  46. :widths: auto
  47. +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | |void| | :ref:`config<class_ScriptCreateDialog_method_config>`\ (\ inherits\: :ref:`String<class_String>`, path\: :ref:`String<class_String>`, built_in_enabled\: :ref:`bool<class_bool>` = true, load_enabled\: :ref:`bool<class_bool>` = true\ ) |
  49. +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Signals
  54. -------
  55. .. _class_ScriptCreateDialog_signal_script_created:
  56. .. rst-class:: classref-signal
  57. **script_created**\ (\ script\: :ref:`Script<class_Script>`\ ) :ref:`🔗<class_ScriptCreateDialog_signal_script_created>`
  58. Emitted when the user clicks the OK button.
  59. .. rst-class:: classref-section-separator
  60. ----
  61. .. rst-class:: classref-descriptions-group
  62. Method Descriptions
  63. -------------------
  64. .. _class_ScriptCreateDialog_method_config:
  65. .. rst-class:: classref-method
  66. |void| **config**\ (\ inherits\: :ref:`String<class_String>`, path\: :ref:`String<class_String>`, built_in_enabled\: :ref:`bool<class_bool>` = true, load_enabled\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_ScriptCreateDialog_method_config>`
  67. Prefills required fields to configure the ScriptCreateDialog for use.
  68. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  69. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  70. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  71. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  73. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  74. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  75. .. |void| replace:: :abbr:`void (No return value.)`