|
44 | 44 | 'ovr_Message_GetRequestID', |
45 | 45 | 'ovr_HttpTransferUpdate_GetID', |
46 | 46 |
|
| 47 | + # These functions should return PackedByteArray instead of String |
| 48 | + 'ovr_ChallengeEntry_GetExtraData', |
| 49 | + 'ovr_LeaderboardEntry_GetExtraData', |
| 50 | + |
47 | 51 | # Exclude the deprecated Platform VoIP functions. |
48 | 52 | # Note: We need to keep a few that are associated with System VoIP. |
49 | 53 | 'ovr_Voip_Accept', |
|
127 | 131 | 'ovr_RichPresence_Set', |
128 | 132 | ] |
129 | 133 |
|
130 | | -# Exclude these OVR functions from both source generation only (the headers will still be generated). |
| 134 | +# Exclude these OVR functions from source generation only (the headers will still be generated). |
131 | 135 | EXCLUDE_OVR_FUNCTION_SOURCE = [ |
132 | 136 | 'ovr_HttpTransferUpdate_GetBytes', |
133 | 137 | 'ovr_Packet_GetBytes', |
@@ -972,6 +976,8 @@ def make_null_value(type, plan): |
972 | 976 | def convert_argument_value_to_ovr(name, ovr_type, godot_type, plan): |
973 | 977 | if godot_type == 'const String &': |
974 | 978 | return f'{name}.utf8().ptr()' |
| 979 | + elif godot_type == 'const PackedStringArray &': |
| 980 | + return f'({ovr_type})CharStringList({name}).pointers.ptr(), {name}.size()' |
975 | 981 | elif godot_type.startswith('const Packed'): |
976 | 982 | return f'({ovr_type}){name}.ptr(), {name}.size()' |
977 | 983 | elif godot_type.startswith('MetaPlatformSDK::'): |
@@ -1145,6 +1151,12 @@ def generate_header(class_name, class_def, plan): |
1145 | 1151 | if class_name == 'MetaPlatformSDK_HttpTransferUpdate': |
1146 | 1152 | lines.append('\tuint64_t get_id() const;') |
1147 | 1153 | lines.append('') |
| 1154 | + if class_name == 'MetaPlatformSDK_ChallengeEntry': |
| 1155 | + lines.append('\tPackedByteArray get_extra_data() const;') |
| 1156 | + lines.append('') |
| 1157 | + if class_name == 'MetaPlatformSDK_LeaderboardEntry': |
| 1158 | + lines.append('\tPackedByteArray get_extra_data() const;') |
| 1159 | + lines.append('') |
1148 | 1160 |
|
1149 | 1161 | # Iterator functions for arrays. |
1150 | 1162 | if class_def['type'] == 'result' and class_def['is_array']: |
@@ -1180,6 +1192,8 @@ def generate_source(class_name, class_def, plan): |
1180 | 1192 |
|
1181 | 1193 | lines.append(f'#include "platform_sdk/{camel_to_snake_case(class_name)}.h"') |
1182 | 1194 | lines.append('') |
| 1195 | + lines.append('#include "util.h"') |
| 1196 | + lines.append('') |
1183 | 1197 | lines.append('#include <godot_cpp/core/class_db.hpp>') |
1184 | 1198 | lines.append('#include <godot_cpp/variant/utility_functions.hpp>') |
1185 | 1199 |
|
@@ -1244,13 +1258,20 @@ def generate_source(class_name, class_def, plan): |
1244 | 1258 | lines.append('\tClassDB::bind_method(D_METHOD("get_data"), &MetaPlatformSDK_Message::get_data);') |
1245 | 1259 | lines.append('\tADD_PROPERTY(PropertyInfo(Variant::INT, "type"), "", "get_type");') |
1246 | 1260 | lines.append('\tADD_PROPERTY(PropertyInfo(Variant::NIL, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT), "", "get_data");') |
| 1261 | + lines.append('\tADD_PROPERTY(PropertyInfo(Variant::NIL, "error", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT), "", "get_error");') |
1247 | 1262 | lines.append('\tClassDB::bind_method(D_METHOD("is_success"), &MetaPlatformSDK_Message::is_success);') |
1248 | 1263 | lines.append('\tClassDB::bind_method(D_METHOD("get_request_id"), &MetaPlatformSDK_Message::get_request_id);') |
1249 | 1264 | lines.append('\tADD_PROPERTY(PropertyInfo(Variant::INT, "request_id"), "", "get_request_id");') |
1250 | 1265 | lines.append('\tClassDB::bind_method(D_METHOD("get_type_as_string"), &MetaPlatformSDK_Message::get_type_as_string);') |
1251 | 1266 | elif class_name == 'MetaPlatformSDK_HttpTransferUpdate': |
1252 | 1267 | lines.append('\tClassDB::bind_method(D_METHOD("get_id"), &MetaPlatformSDK_HttpTransferUpdate::get_id);') |
1253 | 1268 | lines.append('\tADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "", "get_id");') |
| 1269 | + if class_name == 'MetaPlatformSDK_ChallengeEntry': |
| 1270 | + lines.append('\tClassDB::bind_method(D_METHOD("get_extra_data"), &MetaPlatformSDK_ChallengeEntry::get_extra_data);') |
| 1271 | + lines.append('\tADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "extra_data"), "", "get_extra_data");') |
| 1272 | + if class_name == 'MetaPlatformSDK_LeaderboardEntry': |
| 1273 | + lines.append('\tClassDB::bind_method(D_METHOD("get_extra_data"), &MetaPlatformSDK_LeaderboardEntry::get_extra_data);') |
| 1274 | + lines.append('\tADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "extra_data"), "", "get_extra_data");') |
1254 | 1275 | if class_def['type'] == 'result' and class_def['is_array']: |
1255 | 1276 | lines.append(f'\tClassDB::bind_method(D_METHOD("_iter_init"), &{class_name}::_iter_init);') |
1256 | 1277 | lines.append(f'\tClassDB::bind_method(D_METHOD("_iter_next"), &{class_name}::_iter_next);') |
|
0 commit comments