forked from OpenVicProject/OpenVic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameSingleton.xml
More file actions
238 lines (238 loc) · 11.5 KB
/
Copy pathGameSingleton.xml
File metadata and controls
238 lines (238 loc) · 11.5 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GameSingleton" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
</brief_description>
<description>
This is the GameSingleton
</description>
<tutorials>
</tutorials>
<methods>
<method name="end_game_session">
<return type="int" enum="Error" />
<description>
</description>
</method>
<method name="get_bookmark_info" qualifiers="const">
<return type="Dictionary[]" />
<description>
Returns an [Array] of [Dictionary] bookmark information entries, with each [Dictionary] containing values for the following [StringName] keys:
- [code]&"bookmark_name"[/code] - the bookmark's unlocalised identifier [String]
- [code]&"bookmark_date"[/code] - the bookmark's start date as a [code]"DD Month, YYYY"[/code] formatted [String]
</description>
</method>
<method name="get_bookmark_start_position" qualifiers="const">
<return type="Vector2" />
<description>
Returns the current bookmark's starting map position as a normalized [Vector2] (so each component should be in the range [code]0.0[/code] to [code]1.0[/code]).
</description>
</method>
<method name="get_current_mapmode_index" qualifiers="const">
<return type="int" />
<description>
Returns the currently selected mapmode's [int] index.
</description>
</method>
<method name="get_flag_dims" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the fixed [Vector2] size used by all flag images ([code](128, 64)[/code] by default).
</description>
</method>
<method name="get_flag_sheet_texture" qualifiers="const">
<return type="ImageTexture" />
<description>
Return an [ImageTexture] made up of all the loaded flag images for each country and flag variant combined together into a single spritesheet.
</description>
</method>
<method name="get_map_aspect_ratio" qualifiers="const">
<return type="float" />
<description>
Return the aspect ratio of the map's dimensions ([code]width / height[/code]).
</description>
</method>
<method name="get_map_dims" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the map's dimensions as a [Vector2i] ([code](width, height)[/code]).
</description>
</method>
<method name="get_map_height" qualifiers="const">
<return type="int" />
<description>
Returns the map's height in pixels.
</description>
</method>
<method name="get_map_width" qualifiers="const">
<return type="int" />
<description>
Returns the map's width in pixels.
</description>
</method>
<method name="get_mapmode_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of loaded mapmodes.
</description>
</method>
<method name="get_mapmode_identifier" qualifiers="const">
<return type="String" />
<param index="0" name="index" type="int" />
<description>
Returns the identifier [String] of the mapmode with the specified [param index].
</description>
</method>
<method name="get_mapmode_localisation_key" qualifiers="const">
<return type="String" />
<param index="0" name="index" type="int" />
<description>
Returns the localization key [String] of the mapmode with the specified [param index].
</description>
</method>
<method name="get_mod_info" qualifiers="const">
<return type="Dictionary[]" />
<description>
Returns an [Array] of [Dictionary] containing information about available mods, with each [Dictionary] containing values for the following [StringName] keys:
- [code]"identifier"[/code] - The mod's [String] name
- [code]"dependencies"[/code] - A [PackedStringArray] of dependency mod names
- [code]"is_loaded"[/code] - Is [code]true[/code] if the mod is a currently loaded mod, else [code]false[/code]
</description>
</method>
<method name="get_province_colour_texture" qualifiers="const">
<return type="ImageTexture" />
<description>
Returns an [ImageTexture] containing the current province color data, that is each province's base and stripe colors.
</description>
</method>
<method name="get_province_names" qualifiers="const">
<return type="Dictionary[]" />
<description>
Returns an [Array] of [Dictionary] province name label information entries, with each [Dictionary] containing values for the following [StringName] keys:
- [code]&"identifier"[/code] - the province's unlocalised identifier [String]
- [code]&"position"[/code] - the province label's normalised [Vector2] position on the map
- [code]&"rotation"[/code] - the province label's [float] rotation in radians ([code]0.0[/code] if not explicitly given)
- [code]&"scale"[/code] - the province label's [float] scale factor ([code]1.0[/code] if not explicitly given)
</description>
</method>
<method name="get_province_number_from_uv_coords" qualifiers="const">
<return type="int" />
<param index="0" name="coords" type="Vector2" />
<description>
Returns the province number [int] of the province at the specified position on the map. The [param coords] are expected to be normalised with respect to the map's dimensions, and they'll be modulo'd to ensure they lie in the [code]0.0[/code] to [code]1.0[/code] range (meaning they can wrap around the map).
</description>
</method>
<method name="get_province_shape_image_subdivisions" qualifiers="const">
<return type="Vector2i" />
<description>
Returns the number of textures the province shape image is split into horizontally and vertically (it is split to allow higher resolution maps as most GPUs limit individual textures' dimensions to at most 16,384 pixels).
</description>
</method>
<method name="get_province_shape_texture" qualifiers="const">
<return type="Texture2DArray" />
<description>
Return a [Texture2DArray] containing all the textures that the province shape image was split into.
</description>
</method>
<method name="get_terrain_texture" qualifiers="const">
<return type="Texture2DArray" />
<description>
Return a [Texture2DArray] containing all terrain textures, both the solid blue generated water texture and the loaded land terrain textures.
</description>
</method>
<method name="is_bookmark_loaded" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="is_game_instance_setup" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="is_game_session_active" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="is_parchment_mapmode_allowed" qualifiers="const">
<return type="bool" />
<description>
Returns a [bool] indicating whether or not the current mapmode uses the parchment style map when zoomed out.
</description>
</method>
<method name="load_defines_compatibility_mode">
<return type="int" enum="Error" />
<param index="0" name="mods" type="PackedStringArray" default="PackedStringArray()" />
<description>
Load compatibility mode text defines, localization string and map and flag images, loading data from [param mods] if not empty. Returns [code]FAILED[/code] if there are any problems when loading all this data, otherwise returns [code]OK[/code].
See [method get_mod_info] for a valid list of values.
</description>
</method>
<method name="lookup_file_path" qualifiers="const">
<return type="String" />
<param index="0" name="path" type="String" />
<description>
Converts [param path], given relative to the base game install, into a full filepath [String] by combining it with each registered dataloading root and seeing if a file exists at that location, returning the first valid path found when searching from the last added mod through to the first added mod and then the base game install itself. If none of the dataloading roots contain the file then this function returns an empty [String].
</description>
</method>
<method name="search_for_game_path" qualifiers="static">
<return type="String" />
<param index="0" name="hint_path" type="String" default="""" />
<description>
Searches for the base game's install path, checking the [param hint_path] if it's provided as well as the Steam install folder as identified by the [code]"libraryfolders.vdf"[/code] file. This function will return an empty [String] should it fail to find the base game's install path.
</description>
</method>
<method name="set_compatibility_mode_roots">
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
<description>
Set the dataloading roots to those provided in [param path] which should contain full filepaths to the base game's installation and where the search for mods will begin from. Returns [code]FAILED[/code] if there are any problems when setting the dataloading roots, otherwise returns [code]OK[/code].
</description>
</method>
<method name="set_mapmode">
<return type="int" enum="Error" />
<param index="0" name="index" type="int" />
<description>
Sets the active mapmode to that identified by [param index]. Returns [code]FAILED[/code] if the mapmode index is invalid, otherwise returns [code]OK[/code].
</description>
</method>
<method name="setup_game">
<return type="int" enum="Error" />
<param index="0" name="bookmark_index" type="int" />
<description>
Creates and initializes the game instance, using the bookmark identified by [param bookmark_index] to determine which history entries are applied to it. Returns [code]FAILED[/code] if [param bookmark_index] is invalid or there are problems when setting up the game instance, otherwise returns [code]OK[/code].
</description>
</method>
<method name="setup_logger" qualifiers="static">
<return type="void" />
<description>
Connects the [code]info[/code], [code]warning[/code] and [code]error[/code] loggers used in the game's simulation code to Godot's equivalents ([code]print[/code], [code]push_warning[/code], [code]push_error[/code]) so that their output can be seen alongside messages from the GDExtension and GDScript parts of the game.
</description>
</method>
<method name="start_game_session">
<return type="int" enum="Error" />
<description>
Sets up the simulation's clock and timestamps so that it can be unpaused, marking the move from the initialized but static game state used for the lobby to the dynamic game session that is ready to tick, update and simulate.
</description>
</method>
<method name="update_clock">
<return type="int" enum="Error" />
<description>
Progresses the game's clock, or rather makes it check if it's ready for a tick or gamestate update, both in terms of being allowed logically and enough time having passed since the last one, and executes such an action if it is ready.
</description>
</method>
</methods>
<signals>
<signal name="gamestate_updated">
<description>
Signal emitted when the simulation's gamestate is updated (this happens after any event that changes the gamestate, e.g. a day tick, a player taking a decision, etc).
</description>
</signal>
<signal name="mapmode_changed">
<param index="0" name="index" type="int" />
<description>
Signal emitted when the active mapmode changes, with the new mapmode's [param index] provided as a parameter.
</description>
</signal>
</signals>
</class>