class_scriptcreatedialog.rst 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. The Editor's popup dialog for creating new :ref:`Script<class_Script>` files.
  11. Description
  12. -----------
  13. 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.
  14. .. tabs::
  15. .. code-tab:: gdscript
  16. func _ready():
  17. var dialog = ScriptCreateDialog.new();
  18. dialog.config("Node", "res://new_node.gd") # For in-engine types.
  19. dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types.
  20. dialog.popup_centered()
  21. .. code-tab:: csharp
  22. public override void _Ready()
  23. {
  24. var dialog = new ScriptCreateDialog();
  25. dialog.Config("Node", "res://NewNode.cs"); // For in-engine types.
  26. dialog.Config("\"res://BaseNode.cs\"", "res://DerivedNode.cs"); // For script types.
  27. dialog.PopupCentered();
  28. }
  29. Properties
  30. ----------
  31. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  33. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  34. | :ref:`String<class_String>` | ok_button_text | ``"Create"`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_ok_button_text>`) |
  35. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  36. | :ref:`String<class_String>` | title | ``"Attach Node Script"`` (overrides :ref:`Window<class_Window_property_title>`) |
  37. +-----------------------------+-------------------+------------------------------------------------------------------------------------------+
  38. Methods
  39. -------
  40. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | 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 **)** |
  42. +------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Signals
  44. -------
  45. .. _class_ScriptCreateDialog_signal_script_created:
  46. - **script_created** **(** :ref:`Script<class_Script>` script **)**
  47. Emitted when the user clicks the OK button.
  48. Method Descriptions
  49. -------------------
  50. .. _class_ScriptCreateDialog_method_config:
  51. - 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 **)**
  52. Prefills required fields to configure the ScriptCreateDialog for use.
  53. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  54. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  55. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  56. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  57. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  58. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`