class_editorsettings.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the EditorSettings.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_EditorSettings:
  5. EditorSettings
  6. ==============
  7. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Object that holds the project-independent editor settings.
  12. Member Functions
  13. ----------------
  14. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_property_info<class_EditorSettings_add_property_info>` **(** :ref:`Dictionary<class_dictionary>` info **)** |
  16. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`erase<class_EditorSettings_erase>` **(** :ref:`String<class_string>` property **)** |
  18. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_favorite_dirs<class_EditorSettings_get_favorite_dirs>` **(** **)** const |
  20. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_project_settings_dir<class_EditorSettings_get_project_settings_dir>` **(** **)** const |
  22. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`PoolStringArray<class_poolstringarray>` | :ref:`get_recent_dirs<class_EditorSettings_get_recent_dirs>` **(** **)** const |
  24. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Variant<class_variant>` | :ref:`get_setting<class_EditorSettings_get_setting>` **(** :ref:`String<class_string>` name **)** const |
  26. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`String<class_string>` | :ref:`get_settings_dir<class_EditorSettings_get_settings_dir>` **(** **)** const |
  28. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`has_setting<class_EditorSettings_has_setting>` **(** :ref:`String<class_string>` name **)** const |
  30. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`property_can_revert<class_EditorSettings_property_can_revert>` **(** :ref:`String<class_string>` name **)** |
  32. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Variant<class_variant>` | :ref:`property_get_revert<class_EditorSettings_property_get_revert>` **(** :ref:`String<class_string>` name **)** |
  34. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_favorite_dirs<class_EditorSettings_set_favorite_dirs>` **(** :ref:`PoolStringArray<class_poolstringarray>` dirs **)** |
  36. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_initial_value<class_EditorSettings_set_initial_value>` **(** :ref:`String<class_string>` name, :ref:`Variant<class_variant>` value, :ref:`bool<class_bool>` update_current **)** |
  38. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_recent_dirs<class_EditorSettings_set_recent_dirs>` **(** :ref:`PoolStringArray<class_poolstringarray>` dirs **)** |
  40. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_setting<class_EditorSettings_set_setting>` **(** :ref:`String<class_string>` name, :ref:`Variant<class_variant>` value **)** |
  42. +------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Signals
  44. -------
  45. .. _class_EditorSettings_settings_changed:
  46. - **settings_changed** **(** **)**
  47. Description
  48. -----------
  49. Object that holds the project-independent editor settings. These settings are generally visible in the Editor Settings menu.
  50. Accessing the settings is done by using the regular :ref:`Object<class_object>` API, such as:
  51. ::
  52. settings.set(prop,value)
  53. settings.get(prop)
  54. list_of_settings = settings.get_property_list()
  55. Member Function Description
  56. ---------------------------
  57. .. _class_EditorSettings_add_property_info:
  58. - void **add_property_info** **(** :ref:`Dictionary<class_dictionary>` info **)**
  59. 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>`.
  60. Example:
  61. ::
  62. editor_settings.set("category/property_name", 0)
  63. var property_info = {
  64. "name": "category/property_name",
  65. "type": TYPE_INT,
  66. "hint": PROPERTY_HINT_ENUM,
  67. "hint_string": "one,two,three"
  68. }
  69. editor_settings.add_property_info(property_info)
  70. .. _class_EditorSettings_erase:
  71. - void **erase** **(** :ref:`String<class_string>` property **)**
  72. Erase a given setting (pass full property path).
  73. .. _class_EditorSettings_get_favorite_dirs:
  74. - :ref:`PoolStringArray<class_poolstringarray>` **get_favorite_dirs** **(** **)** const
  75. Get the list of favorite directories for this project.
  76. .. _class_EditorSettings_get_project_settings_dir:
  77. - :ref:`String<class_string>` **get_project_settings_dir** **(** **)** const
  78. Get the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved.
  79. .. _class_EditorSettings_get_recent_dirs:
  80. - :ref:`PoolStringArray<class_poolstringarray>` **get_recent_dirs** **(** **)** const
  81. Get the list of recently visited folders in the file dialog for this project.
  82. .. _class_EditorSettings_get_setting:
  83. - :ref:`Variant<class_variant>` **get_setting** **(** :ref:`String<class_string>` name **)** const
  84. .. _class_EditorSettings_get_settings_dir:
  85. - :ref:`String<class_string>` **get_settings_dir** **(** **)** const
  86. Get the global settings path for the engine. Inside this path you can find some standard paths such as:
  87. settings/tmp - used for temporary storage of files
  88. settings/templates - where export templates are located
  89. .. _class_EditorSettings_has_setting:
  90. - :ref:`bool<class_bool>` **has_setting** **(** :ref:`String<class_string>` name **)** const
  91. .. _class_EditorSettings_property_can_revert:
  92. - :ref:`bool<class_bool>` **property_can_revert** **(** :ref:`String<class_string>` name **)**
  93. .. _class_EditorSettings_property_get_revert:
  94. - :ref:`Variant<class_variant>` **property_get_revert** **(** :ref:`String<class_string>` name **)**
  95. .. _class_EditorSettings_set_favorite_dirs:
  96. - void **set_favorite_dirs** **(** :ref:`PoolStringArray<class_poolstringarray>` dirs **)**
  97. Set the list of favorite directories for this project.
  98. .. _class_EditorSettings_set_initial_value:
  99. - void **set_initial_value** **(** :ref:`String<class_string>` name, :ref:`Variant<class_variant>` value, :ref:`bool<class_bool>` update_current **)**
  100. .. _class_EditorSettings_set_recent_dirs:
  101. - void **set_recent_dirs** **(** :ref:`PoolStringArray<class_poolstringarray>` dirs **)**
  102. Set the list of recently visited folders in the file dialog for this project.
  103. .. _class_EditorSettings_set_setting:
  104. - void **set_setting** **(** :ref:`String<class_string>` name, :ref:`Variant<class_variant>` value **)**