diff --git a/extensions/reviewed/ExtendedVariables.json b/extensions/reviewed/ExtendedVariables.json index 0219efa9e..2a37f0477 100644 --- a/extensions/reviewed/ExtendedVariables.json +++ b/extensions/reviewed/ExtendedVariables.json @@ -1,47 +1,29 @@ { "author": "@Bouh, D8H", "category": "General", + "dimension": "", "extensionNamespace": "", + "fullName": "Variables copier", "gdevelopVersion": ">=5.5.222", - "fullName": "Extended variables support", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZhcmlhYmxlLWJveCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOSAzSDVDMy45IDMgMyAzLjkgMyA1VjE5QzMgMjAuMSAzLjkgMjEgNSAyMUgxOUMyMC4xIDIxIDIxIDIwLjEgMjEgMTlWNUMyMSAzLjkgMjAuMSAzIDE5IDNNNy40IDE4QzUuOSAxNi41IDUgMTQuMyA1IDEyUzUuOSA3LjUgNy40IDZMOSA2LjdDNy43IDcuOSA3IDkuOSA3IDEyUzcuNyAxNi4xIDkgMTcuM0w3LjQgMThNMTIuNyAxNUwxMS45IDEzTDEwLjUgMTVIOUwxMS4zIDExLjlMMTAgOUgxMS4zTDEyLjEgMTFMMTMuNSA5SDE1TDEyLjggMTJMMTQuMSAxNUgxMi43TTE2LjYgMThMMTUgMTcuM0MxNi4zIDE2IDE3IDE0LjEgMTcgMTJTMTYuMyA3LjkgMTUgNi43TDE2LjYgNkMxOC4xIDcuNSAxOSA5LjcgMTkgMTJTMTguMSAxNi41IDE2LjYgMThaIiAvPjwvc3ZnPg==", "name": "ExtendedVariables", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/variable-box.svg", - "shortDescription": "Check variable existence, copy, delete, and create dynamic variables at runtime.", - "version": "1.0.4", - "description": [ - "This extension provides: ", - "- Conditions to check if a global/scene/object variable exists.", - "- Actions to copy object variables, global and scene variables.", - "- Actions to delete an existing global/scene variable from memory.", - "- Actions to create a global/scene variable using a text expression, rather than a variable name input.", - "- Expressions to get the value or text from a global/scene variable using a text expression, rather than a variable name.", - "", - "Text expressions allows to enter the name of the variable with an expression like `\"MyVar\"+ ToString(Variable(Health))`" - ], + "shortDescription": "Copy structure and array variables.", + "version": "1.1.0", + "description": "Copy all the children of a structure or an array into another variable.", "origin": { "identifier": "ExtendedVariables", "name": "gdevelop-extension-store" }, - "tags": [ - "variable", - "scene", - "global", - "object", - "remove", - "expression", - "copy", - "structure", - "array", - "boolean", - "duplication" - ], + "tags": [], "authorIds": [ "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [ { "description": "Check if a global variable exists.", @@ -107,6 +89,7 @@ "functionType": "Condition", "group": "Global variables", "name": "GlobalVariableExist", + "private": true, "sentence": "If the global variable _PARAM1_ exist", "events": [ { @@ -193,6 +176,7 @@ "functionType": "Condition", "group": "Scene variables", "name": "SceneVariableExist", + "private": true, "sentence": "If the scene variable _PARAM1_ exist", "events": [ { @@ -285,6 +269,7 @@ "functionType": "Condition", "group": "Variables", "name": "ObjectVariableExist", + "private": true, "sentence": "Object _PARAM1_ has object variable _PARAM2_", "events": [ { @@ -366,6 +351,7 @@ "functionType": "Action", "group": "Global variables", "name": "DeleteGlobalVariable", + "private": true, "sentence": "Delete the global variable _PARAM1_ from memory", "events": [ { @@ -432,6 +418,7 @@ "functionType": "Action", "group": "Scene variables", "name": "ModifySceneVariableString", + "private": true, "sentence": "Change the text of scene variable _PARAM1_ to _PARAM2_", "events": [ { @@ -465,6 +452,7 @@ "functionType": "Action", "group": "Global variables", "name": "ModifyGlobalVariableString", + "private": true, "sentence": "Change the text of global variable _PARAM1_ to _PARAM2_", "events": [ { @@ -580,6 +568,7 @@ "functionType": "Action", "group": "Global variables", "name": "ModifyGlobalVariable", + "private": true, "sentence": "Change the global variable _PARAM1_ with value: _PARAM2_", "events": [ { @@ -654,6 +643,7 @@ "functionType": "Action", "group": "Scene variables", "name": "ModifySceneVariable", + "private": true, "sentence": "Change the scene variable _PARAM1_ with value: _PARAM2_", "events": [ { @@ -722,6 +712,7 @@ "functionType": "Action", "group": "Scene variables", "name": "DeleteSceneVariable", + "private": true, "sentence": "Delete the scene variable _PARAM1_ from memory", "events": [ { @@ -964,6 +955,7 @@ "functionType": "Action", "group": "Variables", "name": "DeleteObjectVariable", + "private": true, "sentence": "Delete for the object _PARAM1_ the object variable _PARAM2_ from the memory", "events": [ { @@ -999,6 +991,7 @@ "functionType": "StringExpression", "group": "Global variables", "name": "GlobalVariableString", + "private": true, "sentence": "", "events": [ { @@ -1034,6 +1027,7 @@ "functionType": "StringExpression", "group": "Scene variables", "name": "VariableString", + "private": true, "sentence": "", "events": [ { @@ -1069,6 +1063,7 @@ "functionType": "Expression", "group": "Global variables", "name": "GlobalVariable", + "private": true, "sentence": "", "events": [ { @@ -1104,6 +1099,7 @@ "functionType": "Expression", "group": "Scene variables", "name": "Variable", + "private": true, "sentence": "", "events": [ { @@ -1137,8 +1133,9 @@ "description": "Copy the global variable to scene. This copy everything from the types to the values.", "fullName": "Copy a global variable to scene", "functionType": "Action", - "group": "Convert", + "group": "Copy variables", "name": "CopyGlobalVariableToScene", + "private": true, "sentence": "Copy the global variable:_PARAM1_ to a scene variable:_PARAM2_ (clear destination first: _PARAM3_)", "events": [ { @@ -1183,6 +1180,7 @@ "functionType": "Action", "group": "Copy variables", "name": "CopySceneVariableToGlobal", + "private": true, "sentence": "Copy the scene variable:_PARAM1_ to a global variable:_PARAM2_ (clear destination first: _PARAM3_)", "events": [ { @@ -1219,6 +1217,53 @@ } ], "objectGroups": [] + }, + { + "description": "Copy all the chidren of a variable into another variable.", + "fullName": "Copy a variable", + "functionType": "Action", + "name": "CopyVariable", + "sentence": "Copy _PARAM1_ to _PARAM2_ (clear destination first: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.Variable} */", + "const sourceVariable = eventsFunctionContext.getArgument(\"SourceVariable\");", + "/** @type {gdjs.Variable} */", + "const destinationVariable = eventsFunctionContext.getArgument(\"DestinationVariable\");", + "const isExactCopy = eventsFunctionContext.getArgument(\"isExactCopy\");", + "", + "if (sourceVariable.isPrimitive() === destinationVariable.isPrimitive()) {", + " gdjs.Variable.copy(sourceVariable, destinationVariable, isExactCopy);", + "}", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Variable to copy", + "name": "SourceVariable", + "type": "variable" + }, + { + "description": "Destination variable", + "name": "DestinationVariable", + "type": "variable" + }, + { + "defaultValue": "yes", + "description": "Clear the destination variable before copying", + "name": "isExactCopy", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] } ], "eventsBasedBehaviors": [],