-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathreferences.json
More file actions
152 lines (152 loc) · 6.16 KB
/
references.json
File metadata and controls
152 lines (152 loc) · 6.16 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
{
"author": "Arthur Pacaud (arthuro555)",
"category": "",
"extensionNamespace": "",
"fullName": "Variables/References",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZhcmlhYmxlLWJveCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOSAzSDVDMy45IDMgMyAzLjkgMyA1VjE5QzMgMjAuMSAzLjkgMjEgNSAyMUgxOUMyMC4xIDIxIDIxIDIwLjEgMjEgMTlWNUMyMSAzLjkgMjAuMSAzIDE5IDNNNy40IDE4QzUuOSAxNi41IDUgMTQuMyA1IDEyUzUuOSA3LjUgNy40IDZMOSA2LjdDNy43IDcuOSA3IDkuOSA3IDEyUzcuNyAxNi4xIDkgMTcuM0w3LjQgMThNMTIuNyAxNUwxMS45IDEzTDEwLjUgMTVIOUwxMS4zIDExLjlMMTAgOUgxMS4zTDEyLjEgMTFMMTMuNSA5SDE1TDEyLjggMTJMMTQuMSAxNUgxMi43TTE2LjYgMThMMTUgMTcuM0MxNi4zIDE2IDE3IDE0LjEgMTcgMTJTMTYuMyA3LjkgMTUgNi43TDE2LjYgNkMxOC4xIDcuNSAxOSA5LjcgMTkgMTJTMTguMSAxNi41IDE2LjYgMThaIiAvPjwvc3ZnPg==",
"name": "References",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/variable-box.svg",
"shortDescription": "Adds references and pointers for variables.",
"version": "1.0.0",
"description": "Adds actions to use references (variable that redirect any read/write to another variable) and pointers (unique numbers identifying a variable that can be resolved to a reference). Some usages are for callback variables in events based functions (getting a variable with a fixed name referring to a variable with a name passed as parameter), pointers to make advanced data structures like linked lists, and getting a top level variable dynamically.",
"origin": {
"identifier": "References",
"name": "gdevelop-extension-store"
},
"tags": [
"advanced",
"variables",
"reference",
"pointer",
"ref",
"memory",
"callback"
],
"authorIds": [
"ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
],
"dependencies": [],
"eventsFunctions": [
{
"description": "Transforms a scene variable into a reference to another scene variable.",
"fullName": "Create reference to scene variable",
"functionType": "Action",
"name": "CreateReference",
"sentence": "Make variable _PARAM1_ a reference to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const reference = eventsFunctionContext.getArgument(\"reference\");",
"const source = eventsFunctionContext.getArgument(\"source\");",
"",
"// Override each method ",
"for (let func of Object.getOwnPropertyNames(gdjs.Variable.prototype))",
" reference[func] = gdjs.Variable.prototype[func].bind(source);",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The scene variable to turn into a reference",
"name": "reference",
"type": "scenevar"
},
{
"description": "The scene variable the reference will refer to",
"name": "source",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "Transforms a scene variable into a reference to a global variable.",
"fullName": "Create reference to global variable",
"functionType": "Action",
"name": "CreateGlobalReference",
"sentence": "Make variable _PARAM1_ a reference to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const reference = eventsFunctionContext.getArgument(\"reference\");",
"const source = eventsFunctionContext.getArgument(\"source\");",
"",
"// Override each method ",
"for (let func of Object.getOwnPropertyNames(gdjs.Variable.prototype))",
" reference[func] = gdjs.Variable.prototype[func].bind(source);",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The scene variable to turn into a reference",
"name": "reference",
"type": "scenevar"
},
{
"description": "The global variable the reference will refer to",
"name": "source",
"type": "globalvar"
}
],
"objectGroups": []
},
{
"description": "Transforms a scene variable into a reference to an object's variable.",
"fullName": "Create reference to object variable",
"functionType": "Action",
"name": "CreateObjectReference",
"sentence": "Make variable _PARAM2_ a reference to variable _PARAM3_ of _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const reference = eventsFunctionContext.getArgument(\"reference\");",
"const source = eventsFunctionContext.getArgument(\"source\");",
"",
"console.log(reference, source)",
"",
"// Override each method ",
"for (let func of Object.getOwnPropertyNames(gdjs.Variable.prototype))",
" reference[func] = gdjs.Variable.prototype[func].bind(source);",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The object that possesses the variable to refer to",
"name": "Object",
"type": "objectList"
},
{
"description": "The scene variable to turn into a reference",
"name": "reference",
"type": "scenevar"
},
{
"description": "The object variable the reference will refer to",
"name": "source",
"type": "objectvar"
}
],
"objectGroups": []
}
],
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}