diff --git a/extensions/community/FirebaseNumberType.json b/extensions/community/FirebaseNumberType.json new file mode 100644 index 000000000..28c3cf36f --- /dev/null +++ b/extensions/community/FirebaseNumberType.json @@ -0,0 +1,76 @@ +{ + "author": "", + "category": "Network", + "extensionNamespace": "", + "fullName": "Firebase", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpcmViYXNlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLDE4LjY5TDEyLjcsMjIuNzRDMTIuMiwyMyAxMS43LDIzIDExLjIsMjIuNzRMNCwxOC42OUwxNy4wNSw1LjU0TDE3LjQsNS40NEMxNy43LDUuNDQgMTcuODcsNS41NyAxNy45LDUuODRMMjAsMTguNjlNOS4zNSw1Ljc0TDQuOCwxMy4yOUw2LjcsMS4zNEM2LjczLDEuMDcgNi45LDAuOTQgNy4yLDAuOTRDNy40LDAuOTQgNy41MywxIDcuNiwxLjE5TDkuNzUsNS4xNEw5LjM1LDUuNzRNMTMuODUsN0w0LjMsMTYuNTlMMTEuNTUsNC4yOUMxMS42NSw0LjA5IDExLjgsNCAxMiw0QzEyLjIsNCAxMi4zMyw0LjA5IDEyLjQsNC4yOUwxMy44NSw3WiIgLz48L3N2Zz4=", + "name": "FirebaseNumberType", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/ee5e58c7db038efea3f7696e4d3433746814bc34497a148068522da45176c121_firebase.svg", + "shortDescription": "Update a field of a docment with a number type instead of a string.", + "version": "0.1.0", + "description": "This functions exactly the same as the original \"Update a field\" built in function, but this sends a number instead of a string. The built in update function forced you to send strings only which then requires you convert types when you read back from the database. Now you can just send numbers, no conversion needed. ", + "tags": [ + "firebase", + "network" + ], + "authorIds": [ + "3L4MIEb0WdbHratJYzkq1pFqZfw2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Update Firebase Field with Number since the built in function seems to take your number and send it as a string.", + "fullName": "Update a number field of a document", + "functionType": "Action", + "group": "Cloud Firestore Database/Fields", + "name": "FirebaseUpdateNumber", + "sentence": "Update field _PARAM1_ of firestore document _PARAM2_ in collection _PARAM3_ with the number _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const num = eventsFunctionContext.getArgument(\"num\");", + "const db = firebase.firestore();", + "const doc = eventsFunctionContext.getArgument(\"doc\");", + "const col = eventsFunctionContext.getArgument(\"col\");", + "const docRef = db.doc(col+\"/\"+doc);", + "const field = eventsFunctionContext.getArgument(\"field\");", + "docRef.update({[field]: num})" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Field", + "name": "field", + "type": "string" + }, + { + "description": "Document", + "name": "doc", + "type": "string" + }, + { + "description": "Collection", + "name": "col", + "type": "string" + }, + { + "description": "Number", + "name": "num", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] +} \ No newline at end of file