class_editorsettings.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorSettings.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorSettings:
  6. EditorSettings
  7. ==============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Object that holds the project-independent editor settings.
  13. Methods
  14. -------
  15. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`add_property_info<class_EditorSettings_method_add_property_info>` **(** :ref:`Dictionary<class_Dictionary>` info **)** |
  17. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`erase<class_EditorSettings_method_erase>` **(** :ref:`String<class_String>` property **)** |
  19. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_favorites<class_EditorSettings_method_get_favorites>` **(** **)** const |
  21. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`Variant<class_Variant>` | :ref:`get_project_metadata<class_EditorSettings_method_get_project_metadata>` **(** :ref:`String<class_String>` section, :ref:`String<class_String>` key, :ref:`Variant<class_Variant>` default=null **)** const |
  23. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`String<class_String>` | :ref:`get_project_settings_dir<class_EditorSettings_method_get_project_settings_dir>` **(** **)** const |
  25. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_recent_dirs<class_EditorSettings_method_get_recent_dirs>` **(** **)** const |
  27. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Variant<class_Variant>` | :ref:`get_setting<class_EditorSettings_method_get_setting>` **(** :ref:`String<class_String>` name **)** const |
  29. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`String<class_String>` | :ref:`get_settings_dir<class_EditorSettings_method_get_settings_dir>` **(** **)** const |
  31. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`has_setting<class_EditorSettings_method_has_setting>` **(** :ref:`String<class_String>` name **)** const |
  33. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`property_can_revert<class_EditorSettings_method_property_can_revert>` **(** :ref:`String<class_String>` name **)** |
  35. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`Variant<class_Variant>` | :ref:`property_get_revert<class_EditorSettings_method_property_get_revert>` **(** :ref:`String<class_String>` name **)** |
  37. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_favorites<class_EditorSettings_method_set_favorites>` **(** :ref:`PoolStringArray<class_PoolStringArray>` dirs **)** |
  39. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_initial_value<class_EditorSettings_method_set_initial_value>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` update_current **)** |
  41. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_project_metadata<class_EditorSettings_method_set_project_metadata>` **(** :ref:`String<class_String>` section, :ref:`String<class_String>` key, :ref:`Variant<class_Variant>` data **)** |
  43. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_recent_dirs<class_EditorSettings_method_set_recent_dirs>` **(** :ref:`PoolStringArray<class_PoolStringArray>` dirs **)** |
  45. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`set_setting<class_EditorSettings_method_set_setting>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
  47. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. Signals
  49. -------
  50. .. _class_EditorSettings_signal_settings_changed:
  51. - **settings_changed** **(** **)**
  52. Description
  53. -----------
  54. Object that holds the project-independent editor settings. These settings are generally visible in the Editor Settings menu.
  55. Accessing the settings is done by using the regular :ref:`Object<class_Object>` API, such as:
  56. ::
  57. settings.set(prop,value)
  58. settings.get(prop)
  59. list_of_settings = settings.get_property_list()
  60. Method Descriptions
  61. -------------------
  62. .. _class_EditorSettings_method_add_property_info:
  63. - void **add_property_info** **(** :ref:`Dictionary<class_Dictionary>` info **)**
  64. Add a custom property info to a property. The dictionary must contain: name::ref:`String<class_String>`\ (the name of the property) and type::ref:`int<class_int>`\ (see TYPE\_\* in :ref:`@GlobalScope<class_@GlobalScope>`), and optionally hint::ref:`int<class_int>`\ (see PROPERTY_HINT\_\* in :ref:`@GlobalScope<class_@GlobalScope>`), hint_string::ref:`String<class_String>`.
  65. Example:
  66. ::
  67. editor_settings.set("category/property_name", 0)
  68. var property_info = {
  69. "name": "category/property_name",
  70. "type": TYPE_INT,
  71. "hint": PROPERTY_HINT_ENUM,
  72. "hint_string": "one,two,three"
  73. }
  74. editor_settings.add_property_info(property_info)
  75. ----
  76. .. _class_EditorSettings_method_erase:
  77. - void **erase** **(** :ref:`String<class_String>` property **)**
  78. Erase a given setting (pass full property path).
  79. ----
  80. .. _class_EditorSettings_method_get_favorites:
  81. - :ref:`PoolStringArray<class_PoolStringArray>` **get_favorites** **(** **)** const
  82. Get the list of favorite files and directories for this project.
  83. ----
  84. .. _class_EditorSettings_method_get_project_metadata:
  85. - :ref:`Variant<class_Variant>` **get_project_metadata** **(** :ref:`String<class_String>` section, :ref:`String<class_String>` key, :ref:`Variant<class_Variant>` default=null **)** const
  86. ----
  87. .. _class_EditorSettings_method_get_project_settings_dir:
  88. - :ref:`String<class_String>` **get_project_settings_dir** **(** **)** const
  89. Get the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved.
  90. ----
  91. .. _class_EditorSettings_method_get_recent_dirs:
  92. - :ref:`PoolStringArray<class_PoolStringArray>` **get_recent_dirs** **(** **)** const
  93. Get the list of recently visited folders in the file dialog for this project.
  94. ----
  95. .. _class_EditorSettings_method_get_setting:
  96. - :ref:`Variant<class_Variant>` **get_setting** **(** :ref:`String<class_String>` name **)** const
  97. ----
  98. .. _class_EditorSettings_method_get_settings_dir:
  99. - :ref:`String<class_String>` **get_settings_dir** **(** **)** const
  100. Get the global settings path for the engine. Inside this path you can find some standard paths such as:
  101. settings/tmp - used for temporary storage of files
  102. settings/templates - where export templates are located
  103. ----
  104. .. _class_EditorSettings_method_has_setting:
  105. - :ref:`bool<class_bool>` **has_setting** **(** :ref:`String<class_String>` name **)** const
  106. ----
  107. .. _class_EditorSettings_method_property_can_revert:
  108. - :ref:`bool<class_bool>` **property_can_revert** **(** :ref:`String<class_String>` name **)**
  109. ----
  110. .. _class_EditorSettings_method_property_get_revert:
  111. - :ref:`Variant<class_Variant>` **property_get_revert** **(** :ref:`String<class_String>` name **)**
  112. ----
  113. .. _class_EditorSettings_method_set_favorites:
  114. - void **set_favorites** **(** :ref:`PoolStringArray<class_PoolStringArray>` dirs **)**
  115. Set the list of favorite files and directories for this project.
  116. ----
  117. .. _class_EditorSettings_method_set_initial_value:
  118. - void **set_initial_value** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` update_current **)**
  119. ----
  120. .. _class_EditorSettings_method_set_project_metadata:
  121. - void **set_project_metadata** **(** :ref:`String<class_String>` section, :ref:`String<class_String>` key, :ref:`Variant<class_Variant>` data **)**
  122. ----
  123. .. _class_EditorSettings_method_set_recent_dirs:
  124. - void **set_recent_dirs** **(** :ref:`PoolStringArray<class_PoolStringArray>` dirs **)**
  125. Set the list of recently visited folders in the file dialog for this project.
  126. ----
  127. .. _class_EditorSettings_method_set_setting:
  128. - void **set_setting** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**