ProjectSettings.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ProjectSettings" inherits="Object" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Contains global variables accessible from everywhere.
  5. </brief_description>
  6. <description>
  7. Contains global variables accessible from everywhere. Use the normal [Object] API, such as "ProjectSettings.get(variable)", "ProjectSettings.set(variable,value)" or "ProjectSettings.has(variable)" to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="add_property_info">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="hint" type="Dictionary">
  18. </argument>
  19. <description>
  20. Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String].
  21. Example:
  22. [codeblock]
  23. ProjectSettings.set("category/property_name", 0)
  24. var property_info = {
  25. "name": "category/property_name",
  26. "type": TYPE_INT,
  27. "hint": PROPERTY_HINT_ENUM,
  28. "hint_string": "one,two,three"
  29. }
  30. ProjectSettings.add_property_info(property_info)
  31. [/codeblock]
  32. </description>
  33. </method>
  34. <method name="clear">
  35. <return type="void">
  36. </return>
  37. <argument index="0" name="name" type="String">
  38. </argument>
  39. <description>
  40. Clear the whole configuration (not recommended, may break things).
  41. </description>
  42. </method>
  43. <method name="get_order" qualifiers="const">
  44. <return type="int">
  45. </return>
  46. <argument index="0" name="name" type="String">
  47. </argument>
  48. <description>
  49. Return the order of a configuration value (influences when saved to the config file).
  50. </description>
  51. </method>
  52. <method name="get_setting" qualifiers="const">
  53. <return type="Variant">
  54. </return>
  55. <argument index="0" name="name" type="String">
  56. </argument>
  57. <description>
  58. </description>
  59. </method>
  60. <method name="get_singleton" qualifiers="const">
  61. <return type="Object">
  62. </return>
  63. <argument index="0" name="name" type="String">
  64. </argument>
  65. <description>
  66. </description>
  67. </method>
  68. <method name="globalize_path" qualifiers="const">
  69. <return type="String">
  70. </return>
  71. <argument index="0" name="path" type="String">
  72. </argument>
  73. <description>
  74. Convert a localized path (res://) to a full native OS path.
  75. </description>
  76. </method>
  77. <method name="has_setting" qualifiers="const">
  78. <return type="bool">
  79. </return>
  80. <argument index="0" name="name" type="String">
  81. </argument>
  82. <description>
  83. Return true if a configuration value is present.
  84. </description>
  85. </method>
  86. <method name="has_singleton" qualifiers="const">
  87. <return type="bool">
  88. </return>
  89. <argument index="0" name="name" type="String">
  90. </argument>
  91. <description>
  92. </description>
  93. </method>
  94. <method name="load_resource_pack">
  95. <return type="bool">
  96. </return>
  97. <argument index="0" name="pack" type="String">
  98. </argument>
  99. <description>
  100. </description>
  101. </method>
  102. <method name="localize_path" qualifiers="const">
  103. <return type="String">
  104. </return>
  105. <argument index="0" name="path" type="String">
  106. </argument>
  107. <description>
  108. Convert a path to a localized path (res:// path).
  109. </description>
  110. </method>
  111. <method name="property_can_revert">
  112. <return type="bool">
  113. </return>
  114. <argument index="0" name="name" type="String">
  115. </argument>
  116. <description>
  117. </description>
  118. </method>
  119. <method name="property_get_revert">
  120. <return type="Variant">
  121. </return>
  122. <argument index="0" name="name" type="String">
  123. </argument>
  124. <description>
  125. </description>
  126. </method>
  127. <method name="save">
  128. <return type="int" enum="Error">
  129. </return>
  130. <description>
  131. </description>
  132. </method>
  133. <method name="save_custom">
  134. <return type="int" enum="Error">
  135. </return>
  136. <argument index="0" name="file" type="String">
  137. </argument>
  138. <description>
  139. </description>
  140. </method>
  141. <method name="set_initial_value">
  142. <return type="void">
  143. </return>
  144. <argument index="0" name="name" type="String">
  145. </argument>
  146. <argument index="1" name="value" type="Variant">
  147. </argument>
  148. <description>
  149. </description>
  150. </method>
  151. <method name="set_order">
  152. <return type="void">
  153. </return>
  154. <argument index="0" name="name" type="String">
  155. </argument>
  156. <argument index="1" name="position" type="int">
  157. </argument>
  158. <description>
  159. Set the order of a configuration value (influences when saved to the config file).
  160. </description>
  161. </method>
  162. <method name="set_setting">
  163. <return type="void">
  164. </return>
  165. <argument index="0" name="name" type="String">
  166. </argument>
  167. <argument index="1" name="value" type="Variant">
  168. </argument>
  169. <description>
  170. </description>
  171. </method>
  172. </methods>
  173. <constants>
  174. </constants>
  175. </class>