|
1 | 1 | { |
2 | 2 | "author": "@Bouh, D8H", |
3 | 3 | "category": "General", |
| 4 | + "dimension": "", |
4 | 5 | "extensionNamespace": "", |
| 6 | + "fullName": "Variables copier", |
5 | 7 | "gdevelopVersion": ">=5.5.222", |
6 | | - "fullName": "Extended variables support", |
7 | 8 | "helpPath": "", |
8 | 9 | "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZhcmlhYmxlLWJveCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOSAzSDVDMy45IDMgMyAzLjkgMyA1VjE5QzMgMjAuMSAzLjkgMjEgNSAyMUgxOUMyMC4xIDIxIDIxIDIwLjEgMjEgMTlWNUMyMSAzLjkgMjAuMSAzIDE5IDNNNy40IDE4QzUuOSAxNi41IDUgMTQuMyA1IDEyUzUuOSA3LjUgNy40IDZMOSA2LjdDNy43IDcuOSA3IDkuOSA3IDEyUzcuNyAxNi4xIDkgMTcuM0w3LjQgMThNMTIuNyAxNUwxMS45IDEzTDEwLjUgMTVIOUwxMS4zIDExLjlMMTAgOUgxMS4zTDEyLjEgMTFMMTMuNSA5SDE1TDEyLjggMTJMMTQuMSAxNUgxMi43TTE2LjYgMThMMTUgMTcuM0MxNi4zIDE2IDE3IDE0LjEgMTcgMTJTMTYuMyA3LjkgMTUgNi43TDE2LjYgNkMxOC4xIDcuNSAxOSA5LjcgMTkgMTJTMTguMSAxNi41IDE2LjYgMThaIiAvPjwvc3ZnPg==", |
9 | 10 | "name": "ExtendedVariables", |
10 | 11 | "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/variable-box.svg", |
11 | | - "shortDescription": "Check variable existence, copy, delete, and create dynamic variables at runtime.", |
12 | | - "version": "1.0.4", |
13 | | - "description": [ |
14 | | - "This extension provides: ", |
15 | | - "- Conditions to check if a global/scene/object variable exists.", |
16 | | - "- Actions to copy object variables, global and scene variables.", |
17 | | - "- Actions to delete an existing global/scene variable from memory.", |
18 | | - "- Actions to create a global/scene variable using a text expression, rather than a variable name input.", |
19 | | - "- Expressions to get the value or text from a global/scene variable using a text expression, rather than a variable name.", |
20 | | - "", |
21 | | - "Text expressions allows to enter the name of the variable with an expression like `\"MyVar\"+ ToString(Variable(Health))`" |
22 | | - ], |
| 12 | + "shortDescription": "Copy structure and array variables.", |
| 13 | + "version": "1.1.0", |
| 14 | + "description": "Copy all the children of a structure or an array into another variable.", |
23 | 15 | "origin": { |
24 | 16 | "identifier": "ExtendedVariables", |
25 | 17 | "name": "gdevelop-extension-store" |
26 | 18 | }, |
27 | | - "tags": [ |
28 | | - "variable", |
29 | | - "scene", |
30 | | - "global", |
31 | | - "object", |
32 | | - "remove", |
33 | | - "expression", |
34 | | - "copy", |
35 | | - "structure", |
36 | | - "array", |
37 | | - "boolean", |
38 | | - "duplication" |
39 | | - ], |
| 19 | + "tags": [], |
40 | 20 | "authorIds": [ |
41 | 21 | "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", |
42 | 22 | "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" |
43 | 23 | ], |
44 | 24 | "dependencies": [], |
| 25 | + "globalVariables": [], |
| 26 | + "sceneVariables": [], |
45 | 27 | "eventsFunctions": [ |
46 | 28 | { |
47 | 29 | "description": "Check if a global variable exists.", |
|
107 | 89 | "functionType": "Condition", |
108 | 90 | "group": "Global variables", |
109 | 91 | "name": "GlobalVariableExist", |
| 92 | + "private": true, |
110 | 93 | "sentence": "If the global variable _PARAM1_ exist", |
111 | 94 | "events": [ |
112 | 95 | { |
|
193 | 176 | "functionType": "Condition", |
194 | 177 | "group": "Scene variables", |
195 | 178 | "name": "SceneVariableExist", |
| 179 | + "private": true, |
196 | 180 | "sentence": "If the scene variable _PARAM1_ exist", |
197 | 181 | "events": [ |
198 | 182 | { |
|
285 | 269 | "functionType": "Condition", |
286 | 270 | "group": "Variables", |
287 | 271 | "name": "ObjectVariableExist", |
| 272 | + "private": true, |
288 | 273 | "sentence": "Object _PARAM1_ has object variable _PARAM2_", |
289 | 274 | "events": [ |
290 | 275 | { |
|
366 | 351 | "functionType": "Action", |
367 | 352 | "group": "Global variables", |
368 | 353 | "name": "DeleteGlobalVariable", |
| 354 | + "private": true, |
369 | 355 | "sentence": "Delete the global variable _PARAM1_ from memory", |
370 | 356 | "events": [ |
371 | 357 | { |
|
432 | 418 | "functionType": "Action", |
433 | 419 | "group": "Scene variables", |
434 | 420 | "name": "ModifySceneVariableString", |
| 421 | + "private": true, |
435 | 422 | "sentence": "Change the text of scene variable _PARAM1_ to _PARAM2_", |
436 | 423 | "events": [ |
437 | 424 | { |
|
465 | 452 | "functionType": "Action", |
466 | 453 | "group": "Global variables", |
467 | 454 | "name": "ModifyGlobalVariableString", |
| 455 | + "private": true, |
468 | 456 | "sentence": "Change the text of global variable _PARAM1_ to _PARAM2_", |
469 | 457 | "events": [ |
470 | 458 | { |
|
580 | 568 | "functionType": "Action", |
581 | 569 | "group": "Global variables", |
582 | 570 | "name": "ModifyGlobalVariable", |
| 571 | + "private": true, |
583 | 572 | "sentence": "Change the global variable _PARAM1_ with value: _PARAM2_", |
584 | 573 | "events": [ |
585 | 574 | { |
|
654 | 643 | "functionType": "Action", |
655 | 644 | "group": "Scene variables", |
656 | 645 | "name": "ModifySceneVariable", |
| 646 | + "private": true, |
657 | 647 | "sentence": "Change the scene variable _PARAM1_ with value: _PARAM2_", |
658 | 648 | "events": [ |
659 | 649 | { |
|
722 | 712 | "functionType": "Action", |
723 | 713 | "group": "Scene variables", |
724 | 714 | "name": "DeleteSceneVariable", |
| 715 | + "private": true, |
725 | 716 | "sentence": "Delete the scene variable _PARAM1_ from memory", |
726 | 717 | "events": [ |
727 | 718 | { |
|
964 | 955 | "functionType": "Action", |
965 | 956 | "group": "Variables", |
966 | 957 | "name": "DeleteObjectVariable", |
| 958 | + "private": true, |
967 | 959 | "sentence": "Delete for the object _PARAM1_ the object variable _PARAM2_ from the memory", |
968 | 960 | "events": [ |
969 | 961 | { |
|
999 | 991 | "functionType": "StringExpression", |
1000 | 992 | "group": "Global variables", |
1001 | 993 | "name": "GlobalVariableString", |
| 994 | + "private": true, |
1002 | 995 | "sentence": "", |
1003 | 996 | "events": [ |
1004 | 997 | { |
|
1034 | 1027 | "functionType": "StringExpression", |
1035 | 1028 | "group": "Scene variables", |
1036 | 1029 | "name": "VariableString", |
| 1030 | + "private": true, |
1037 | 1031 | "sentence": "", |
1038 | 1032 | "events": [ |
1039 | 1033 | { |
|
1069 | 1063 | "functionType": "Expression", |
1070 | 1064 | "group": "Global variables", |
1071 | 1065 | "name": "GlobalVariable", |
| 1066 | + "private": true, |
1072 | 1067 | "sentence": "", |
1073 | 1068 | "events": [ |
1074 | 1069 | { |
|
1104 | 1099 | "functionType": "Expression", |
1105 | 1100 | "group": "Scene variables", |
1106 | 1101 | "name": "Variable", |
| 1102 | + "private": true, |
1107 | 1103 | "sentence": "", |
1108 | 1104 | "events": [ |
1109 | 1105 | { |
|
1137 | 1133 | "description": "Copy the global variable to scene. This copy everything from the types to the values.", |
1138 | 1134 | "fullName": "Copy a global variable to scene", |
1139 | 1135 | "functionType": "Action", |
1140 | | - "group": "Convert", |
| 1136 | + "group": "Copy variables", |
1141 | 1137 | "name": "CopyGlobalVariableToScene", |
| 1138 | + "private": true, |
1142 | 1139 | "sentence": "Copy the global variable:_PARAM1_ to a scene variable:_PARAM2_ (clear destination first: _PARAM3_)", |
1143 | 1140 | "events": [ |
1144 | 1141 | { |
|
1183 | 1180 | "functionType": "Action", |
1184 | 1181 | "group": "Copy variables", |
1185 | 1182 | "name": "CopySceneVariableToGlobal", |
| 1183 | + "private": true, |
1186 | 1184 | "sentence": "Copy the scene variable:_PARAM1_ to a global variable:_PARAM2_ (clear destination first: _PARAM3_)", |
1187 | 1185 | "events": [ |
1188 | 1186 | { |
|
1219 | 1217 | } |
1220 | 1218 | ], |
1221 | 1219 | "objectGroups": [] |
| 1220 | + }, |
| 1221 | + { |
| 1222 | + "description": "Copy all the chidren of a variable into another variable.", |
| 1223 | + "fullName": "Copy a variable", |
| 1224 | + "functionType": "Action", |
| 1225 | + "name": "CopyVariable", |
| 1226 | + "sentence": "Copy _PARAM1_ to _PARAM2_ (clear destination first: _PARAM3_)", |
| 1227 | + "events": [ |
| 1228 | + { |
| 1229 | + "type": "BuiltinCommonInstructions::JsCode", |
| 1230 | + "inlineCode": [ |
| 1231 | + "/** @type {gdjs.Variable} */", |
| 1232 | + "const sourceVariable = eventsFunctionContext.getArgument(\"SourceVariable\");", |
| 1233 | + "/** @type {gdjs.Variable} */", |
| 1234 | + "const destinationVariable = eventsFunctionContext.getArgument(\"DestinationVariable\");", |
| 1235 | + "const isExactCopy = eventsFunctionContext.getArgument(\"isExactCopy\");", |
| 1236 | + "", |
| 1237 | + "if (sourceVariable.isPrimitive() === destinationVariable.isPrimitive()) {", |
| 1238 | + " gdjs.Variable.copy(sourceVariable, destinationVariable, isExactCopy);", |
| 1239 | + "}", |
| 1240 | + "" |
| 1241 | + ], |
| 1242 | + "parameterObjects": "", |
| 1243 | + "useStrict": true, |
| 1244 | + "eventsSheetExpanded": true |
| 1245 | + } |
| 1246 | + ], |
| 1247 | + "parameters": [ |
| 1248 | + { |
| 1249 | + "description": "Variable to copy", |
| 1250 | + "name": "SourceVariable", |
| 1251 | + "type": "variable" |
| 1252 | + }, |
| 1253 | + { |
| 1254 | + "description": "Destination variable", |
| 1255 | + "name": "DestinationVariable", |
| 1256 | + "type": "variable" |
| 1257 | + }, |
| 1258 | + { |
| 1259 | + "defaultValue": "yes", |
| 1260 | + "description": "Clear the destination variable before copying", |
| 1261 | + "name": "isExactCopy", |
| 1262 | + "optional": true, |
| 1263 | + "type": "yesorno" |
| 1264 | + } |
| 1265 | + ], |
| 1266 | + "objectGroups": [] |
1222 | 1267 | } |
1223 | 1268 | ], |
1224 | 1269 | "eventsBasedBehaviors": [], |
|
0 commit comments