|
9 | 9 | "name": "RollingCounter", |
10 | 10 | "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/e509cccd7fb426978c4a79b639670f624f773a886848d288a12be5c28dd7d380_sort-numeric-variant.svg", |
11 | 11 | "shortDescription": "Smoothly change a counter value in a text object.", |
12 | | - "version": "1.1.1", |
| 12 | + "version": "1.2.0", |
13 | 13 | "description": "Smoothly change a counter value in a text object.", |
14 | 14 | "origin": { |
15 | 15 | "identifier": "RollingCounter", |
|
26 | 26 | "dependencies": [], |
27 | 27 | "globalVariables": [], |
28 | 28 | "sceneVariables": [], |
29 | | - "eventsFunctions": [], |
| 29 | + "eventsFunctions": [ |
| 30 | + { |
| 31 | + "description": "Check if the events are running for the editor.", |
| 32 | + "fullName": "Editor is running", |
| 33 | + "functionType": "Condition", |
| 34 | + "name": "IsInGameEdition", |
| 35 | + "private": true, |
| 36 | + "sentence": "Events are running for the editor", |
| 37 | + "events": [ |
| 38 | + { |
| 39 | + "type": "BuiltinCommonInstructions::JsCode", |
| 40 | + "inlineCode": [ |
| 41 | + "const game = runtimeScene.getGame();\r", |
| 42 | + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" |
| 43 | + ], |
| 44 | + "parameterObjects": "", |
| 45 | + "useStrict": true, |
| 46 | + "eventsSheetExpanded": false |
| 47 | + } |
| 48 | + ], |
| 49 | + "parameters": [], |
| 50 | + "objectGroups": [] |
| 51 | + } |
| 52 | + ], |
30 | 53 | "eventsBasedBehaviors": [ |
31 | 54 | { |
32 | 55 | "description": "Smoothly changes a counter value in a text object.", |
|
173 | 196 | "value": "SetNumberVariable" |
174 | 197 | }, |
175 | 198 | "parameters": [ |
176 | | - "DisplayedValue", |
| 199 | + "CounterValue", |
177 | 200 | "=", |
178 | | - "CounterValue" |
| 201 | + "Value" |
179 | 202 | ] |
180 | 203 | }, |
181 | 204 | { |
182 | 205 | "type": { |
183 | 206 | "value": "SetNumberVariable" |
184 | 207 | }, |
185 | 208 | "parameters": [ |
186 | | - "CounterValue", |
| 209 | + "Speed", |
187 | 210 | "=", |
188 | | - "Value" |
| 211 | + "(CounterValue - DisplayedValue) / Duration" |
189 | 212 | ] |
190 | | - }, |
| 213 | + } |
| 214 | + ] |
| 215 | + }, |
| 216 | + { |
| 217 | + "type": "BuiltinCommonInstructions::Standard", |
| 218 | + "conditions": [ |
191 | 219 | { |
192 | 220 | "type": { |
193 | | - "value": "SetNumberVariable" |
| 221 | + "value": "RollingCounter::IsInGameEdition" |
194 | 222 | }, |
195 | 223 | "parameters": [ |
196 | | - "Speed", |
| 224 | + "", |
| 225 | + "" |
| 226 | + ] |
| 227 | + } |
| 228 | + ], |
| 229 | + "actions": [ |
| 230 | + { |
| 231 | + "type": { |
| 232 | + "value": "TextContainerCapability::TextContainerBehavior::SetValue" |
| 233 | + }, |
| 234 | + "parameters": [ |
| 235 | + "Object", |
| 236 | + "Text", |
197 | 237 | "=", |
198 | | - "(CounterValue - DisplayedValue) / Duration" |
| 238 | + "Prefix + ToString(Value) + Suffix" |
199 | 239 | ] |
200 | 240 | } |
201 | 241 | ] |
|
261 | 301 | "value": "", |
262 | 302 | "type": "Behavior", |
263 | 303 | "label": "Text capability", |
264 | | - "description": "", |
265 | | - "group": "", |
266 | 304 | "extraInformation": [ |
267 | 305 | "TextContainerCapability::TextContainerBehavior" |
268 | 306 | ], |
| 307 | + "choices": [], |
269 | 308 | "name": "Text" |
270 | 309 | }, |
271 | 310 | { |
272 | 311 | "value": "Score: ", |
273 | 312 | "type": "String", |
274 | 313 | "label": "Prefix", |
275 | | - "description": "", |
276 | | - "group": "", |
277 | | - "extraInformation": [], |
278 | 314 | "name": "Prefix" |
279 | 315 | }, |
280 | 316 | { |
281 | 317 | "value": "", |
282 | 318 | "type": "String", |
283 | 319 | "label": "Suffix", |
284 | | - "description": "", |
285 | | - "group": "", |
286 | | - "extraInformation": [], |
287 | 320 | "name": "Suffix" |
288 | 321 | }, |
289 | 322 | { |
290 | 323 | "value": "1", |
291 | 324 | "type": "Number", |
292 | 325 | "unit": "Second", |
293 | 326 | "label": "Animation duration", |
294 | | - "description": "", |
295 | | - "group": "", |
296 | | - "extraInformation": [], |
297 | 327 | "name": "Duration" |
298 | 328 | }, |
299 | 329 | { |
300 | 330 | "value": "1", |
301 | 331 | "type": "Number", |
302 | 332 | "unit": "Dimensionless", |
303 | 333 | "label": "Increment", |
304 | | - "description": "", |
305 | | - "group": "", |
306 | | - "extraInformation": [], |
307 | 334 | "name": "Increment" |
308 | 335 | }, |
309 | 336 | { |
310 | 337 | "value": "0", |
311 | 338 | "type": "Number", |
312 | 339 | "label": "", |
313 | | - "description": "", |
314 | | - "group": "", |
315 | | - "extraInformation": [], |
316 | 340 | "hidden": true, |
317 | 341 | "name": "CounterValue" |
318 | 342 | }, |
319 | 343 | { |
320 | 344 | "value": "0", |
321 | 345 | "type": "Number", |
322 | 346 | "label": "", |
323 | | - "description": "", |
324 | | - "group": "", |
325 | | - "extraInformation": [], |
326 | 347 | "hidden": true, |
327 | 348 | "name": "DisplayedValue" |
328 | 349 | }, |
329 | 350 | { |
330 | 351 | "value": "0", |
331 | 352 | "type": "Number", |
332 | 353 | "label": "", |
333 | | - "description": "", |
334 | | - "group": "", |
335 | | - "extraInformation": [], |
336 | 354 | "hidden": true, |
337 | 355 | "name": "Speed" |
338 | 356 | } |
|
0 commit comments