summaryrefslogtreecommitdiff
path: root/doc/classes/ProjectSettings.xml
blob: e28860a5772eee243877a55af7ddc57f47a33756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ProjectSettings" inherits="Object" category="Core" version="3.0-beta">
	<brief_description>
		Contains global variables accessible from everywhere.
	</brief_description>
	<description>
		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.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="add_property_info">
			<return type="void">
			</return>
			<argument index="0" name="hint" type="Dictionary">
			</argument>
			<description>
				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 [@GlobalScope]), and optionally hint:[int](see PROPERTY_HINT_* in [@GlobalScope]), hint_string:[String].
				Example:
				[codeblock]
				ProjectSettings.set("category/property_name", 0)

				var property_info = {
				    "name": "category/property_name",
				    "type": TYPE_INT,
				    "hint": PROPERTY_HINT_ENUM,
				    "hint_string": "one,two,three"
				}

				ProjectSettings.add_property_info(property_info)
				[/codeblock]
			</description>
		</method>
		<method name="clear">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
				Clear the whole configuration (not recommended, may break things).
			</description>
		</method>
		<method name="get_order" qualifiers="const">
			<return type="int">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
				Return the order of a configuration value (influences when saved to the config file).
			</description>
		</method>
		<method name="get_setting" qualifiers="const">
			<return type="Variant">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
			</description>
		</method>
		<method name="globalize_path" qualifiers="const">
			<return type="String">
			</return>
			<argument index="0" name="path" type="String">
			</argument>
			<description>
				Convert a localized path (res://) to a full native OS path.
			</description>
		</method>
		<method name="has_setting" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
				Return true if a configuration value is present.
			</description>
		</method>
		<method name="load_resource_pack">
			<return type="bool">
			</return>
			<argument index="0" name="pack" type="String">
			</argument>
			<description>
			</description>
		</method>
		<method name="localize_path" qualifiers="const">
			<return type="String">
			</return>
			<argument index="0" name="path" type="String">
			</argument>
			<description>
				Convert a path to a localized path (res:// path).
			</description>
		</method>
		<method name="property_can_revert">
			<return type="bool">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
			</description>
		</method>
		<method name="property_get_revert">
			<return type="Variant">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<description>
			</description>
		</method>
		<method name="save">
			<return type="int" enum="Error">
			</return>
			<description>
			</description>
		</method>
		<method name="save_custom">
			<return type="int" enum="Error">
			</return>
			<argument index="0" name="file" type="String">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_initial_value">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="value" type="Variant">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_order">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="position" type="int">
			</argument>
			<description>
				Set the order of a configuration value (influences when saved to the config file).
			</description>
		</method>
		<method name="set_setting">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="value" type="Variant">
			</argument>
			<description>
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>