|
9 | 9 | "name": "SpriteToggleSwitch", |
10 | 10 | "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/8d0cd8cd0c9318f4f6efde6ee6b4c192bd19306467f80c9970387a259300f895_Interface Elements_interface_ui_toggle_switch_on_off.svg", |
11 | 11 | "shortDescription": "Toggle switch that users can click or touch.", |
12 | | - "version": "2.0.1", |
| 12 | + "version": "2.0.2", |
13 | 13 | "description": [ |
14 | 14 | "Toggle switch that users can click or touch. The switch can be customized with sprites.", |
15 | 15 | "", |
|
409 | 409 | "name": "SetChecked", |
410 | 410 | "sentence": "Check _PARAM0_: _PARAM2_", |
411 | 411 | "events": [ |
412 | | - { |
413 | | - "type": "BuiltinCommonInstructions::Comment", |
414 | | - "color": { |
415 | | - "b": 109, |
416 | | - "g": 230, |
417 | | - "r": 255, |
418 | | - "textB": 0, |
419 | | - "textG": 0, |
420 | | - "textR": 0 |
421 | | - }, |
422 | | - "comment": "Avoid a started touch to interfere with a state change from events." |
423 | | - }, |
424 | | - { |
425 | | - "type": "BuiltinCommonInstructions::Standard", |
426 | | - "conditions": [ |
427 | | - { |
428 | | - "type": { |
429 | | - "value": "BuiltinCommonInstructions::Or" |
430 | | - }, |
431 | | - "parameters": [], |
432 | | - "subInstructions": [ |
433 | | - { |
434 | | - "type": { |
435 | | - "value": "BuiltinCommonInstructions::And" |
436 | | - }, |
437 | | - "parameters": [], |
438 | | - "subInstructions": [ |
439 | | - { |
440 | | - "type": { |
441 | | - "inverted": true, |
442 | | - "value": "GetArgumentAsBoolean" |
443 | | - }, |
444 | | - "parameters": [ |
445 | | - "\"Value\"" |
446 | | - ] |
447 | | - }, |
448 | | - { |
449 | | - "type": { |
450 | | - "value": "SpriteToggleSwitch::SwitchFSM::IsChecked" |
451 | | - }, |
452 | | - "parameters": [ |
453 | | - "Object", |
454 | | - "Behavior", |
455 | | - "" |
456 | | - ] |
457 | | - } |
458 | | - ] |
459 | | - }, |
460 | | - { |
461 | | - "type": { |
462 | | - "value": "BuiltinCommonInstructions::And" |
463 | | - }, |
464 | | - "parameters": [], |
465 | | - "subInstructions": [ |
466 | | - { |
467 | | - "type": { |
468 | | - "value": "GetArgumentAsBoolean" |
469 | | - }, |
470 | | - "parameters": [ |
471 | | - "\"Value\"" |
472 | | - ] |
473 | | - }, |
474 | | - { |
475 | | - "type": { |
476 | | - "inverted": true, |
477 | | - "value": "SpriteToggleSwitch::SwitchFSM::IsChecked" |
478 | | - }, |
479 | | - "parameters": [ |
480 | | - "Object", |
481 | | - "Behavior", |
482 | | - "" |
483 | | - ] |
484 | | - } |
485 | | - ] |
486 | | - } |
487 | | - ] |
488 | | - } |
489 | | - ], |
490 | | - "actions": [ |
491 | | - { |
492 | | - "type": { |
493 | | - "value": "SpriteToggleSwitch::ButtonFSM::ResetState" |
494 | | - }, |
495 | | - "parameters": [ |
496 | | - "Object", |
497 | | - "ButtonFSM", |
498 | | - "" |
499 | | - ] |
500 | | - } |
501 | | - ] |
502 | | - }, |
503 | 412 | { |
504 | 413 | "type": "BuiltinCommonInstructions::Standard", |
505 | 414 | "conditions": [ |
506 | 415 | { |
507 | 416 | "type": { |
508 | | - "inverted": true, |
509 | 417 | "value": "BooleanVariable" |
510 | 418 | }, |
511 | 419 | "parameters": [ |
512 | 420 | "Value", |
513 | | - "True", |
| 421 | + "False", |
514 | 422 | "" |
515 | 423 | ] |
516 | 424 | } |
|
526 | 434 | "" |
527 | 435 | ] |
528 | 436 | } |
| 437 | + ], |
| 438 | + "events": [ |
| 439 | + { |
| 440 | + "type": "BuiltinCommonInstructions::Comment", |
| 441 | + "color": { |
| 442 | + "b": 109, |
| 443 | + "g": 230, |
| 444 | + "r": 255, |
| 445 | + "textB": 0, |
| 446 | + "textG": 0, |
| 447 | + "textR": 0 |
| 448 | + }, |
| 449 | + "comment": "Avoid a started touch to interfere with a state change from events." |
| 450 | + }, |
| 451 | + { |
| 452 | + "type": "BuiltinCommonInstructions::Standard", |
| 453 | + "conditions": [ |
| 454 | + { |
| 455 | + "type": { |
| 456 | + "value": "SpriteToggleSwitch::SwitchFSM::IsChecked" |
| 457 | + }, |
| 458 | + "parameters": [ |
| 459 | + "Object", |
| 460 | + "Behavior", |
| 461 | + "" |
| 462 | + ] |
| 463 | + } |
| 464 | + ], |
| 465 | + "actions": [ |
| 466 | + { |
| 467 | + "type": { |
| 468 | + "value": "SpriteToggleSwitch::ButtonFSM::ResetState" |
| 469 | + }, |
| 470 | + "parameters": [ |
| 471 | + "Object", |
| 472 | + "ButtonFSM", |
| 473 | + "" |
| 474 | + ] |
| 475 | + } |
| 476 | + ] |
| 477 | + } |
529 | 478 | ] |
530 | 479 | }, |
531 | 480 | { |
|
553 | 502 | "" |
554 | 503 | ] |
555 | 504 | } |
| 505 | + ], |
| 506 | + "events": [ |
| 507 | + { |
| 508 | + "type": "BuiltinCommonInstructions::Standard", |
| 509 | + "conditions": [ |
| 510 | + { |
| 511 | + "type": { |
| 512 | + "inverted": true, |
| 513 | + "value": "SpriteToggleSwitch::SwitchFSM::IsChecked" |
| 514 | + }, |
| 515 | + "parameters": [ |
| 516 | + "Object", |
| 517 | + "Behavior", |
| 518 | + "" |
| 519 | + ] |
| 520 | + } |
| 521 | + ], |
| 522 | + "actions": [ |
| 523 | + { |
| 524 | + "type": { |
| 525 | + "value": "SpriteToggleSwitch::ButtonFSM::ResetState" |
| 526 | + }, |
| 527 | + "parameters": [ |
| 528 | + "Object", |
| 529 | + "ButtonFSM", |
| 530 | + "" |
| 531 | + ] |
| 532 | + } |
| 533 | + ] |
| 534 | + } |
556 | 535 | ] |
557 | 536 | } |
558 | 537 | ], |
|
710 | 689 | "extraInformation": [ |
711 | 690 | "SpriteToggleSwitch::ButtonFSM" |
712 | 691 | ], |
| 692 | + "choices": [], |
713 | 693 | "name": "ButtonFSM" |
714 | 694 | }, |
715 | 695 | { |
|
1846 | 1826 | "value": "Idle", |
1847 | 1827 | "type": "Choice", |
1848 | 1828 | "label": "State", |
1849 | | - "extraInformation": [ |
1850 | | - "Idle", |
1851 | | - "Hovered", |
1852 | | - "PressedInside", |
1853 | | - "PressedOutside", |
1854 | | - "Validated" |
| 1829 | + "choices": [ |
| 1830 | + { |
| 1831 | + "label": "Idle", |
| 1832 | + "value": "Idle" |
| 1833 | + }, |
| 1834 | + { |
| 1835 | + "label": "Hovered", |
| 1836 | + "value": "Hovered" |
| 1837 | + }, |
| 1838 | + { |
| 1839 | + "label": "PressedInside", |
| 1840 | + "value": "PressedInside" |
| 1841 | + }, |
| 1842 | + { |
| 1843 | + "label": "PressedOutside", |
| 1844 | + "value": "PressedOutside" |
| 1845 | + }, |
| 1846 | + { |
| 1847 | + "label": "Validated", |
| 1848 | + "value": "Validated" |
| 1849 | + } |
1855 | 1850 | ], |
1856 | 1851 | "hidden": true, |
1857 | 1852 | "name": "State" |
|
2074 | 2069 | "conditions": [ |
2075 | 2070 | { |
2076 | 2071 | "type": { |
2077 | | - "inverted": true, |
2078 | 2072 | "value": "BooleanVariable" |
2079 | 2073 | }, |
2080 | 2074 | "parameters": [ |
2081 | 2075 | "IsChecked", |
2082 | | - "True", |
| 2076 | + "False", |
2083 | 2077 | "" |
2084 | 2078 | ] |
2085 | 2079 | } |
|
2180 | 2174 | }, |
2181 | 2175 | { |
2182 | 2176 | "type": { |
2183 | | - "inverted": true, |
2184 | 2177 | "value": "BooleanVariable" |
2185 | 2178 | }, |
2186 | 2179 | "parameters": [ |
2187 | 2180 | "PreviousIsChecked", |
2188 | | - "True", |
| 2181 | + "False", |
2189 | 2182 | "" |
2190 | 2183 | ] |
2191 | 2184 | } |
|
2218 | 2211 | "conditions": [ |
2219 | 2212 | { |
2220 | 2213 | "type": { |
2221 | | - "inverted": true, |
2222 | 2214 | "value": "BooleanVariable" |
2223 | 2215 | }, |
2224 | 2216 | "parameters": [ |
2225 | 2217 | "IsChecked", |
2226 | | - "True", |
| 2218 | + "False", |
2227 | 2219 | "" |
2228 | 2220 | ] |
2229 | 2221 | }, |
|
2772 | 2764 | "fullName": "Is pressed", |
2773 | 2765 | "functionType": "Condition", |
2774 | 2766 | "name": "IsPressed", |
2775 | | - "private": true, |
2776 | 2767 | "sentence": "_PARAM0_ is pressed", |
2777 | 2768 | "events": [ |
2778 | 2769 | { |
|
2811 | 2802 | ], |
2812 | 2803 | "objectGroups": [] |
2813 | 2804 | }, |
| 2805 | + { |
| 2806 | + "description": "Check if the button is currently being pressed outside with mouse or touch.", |
| 2807 | + "fullName": "Is held outside", |
| 2808 | + "functionType": "Condition", |
| 2809 | + "name": "IsPressedOutside", |
| 2810 | + "sentence": "_PARAM0_ is held outside", |
| 2811 | + "events": [ |
| 2812 | + { |
| 2813 | + "type": "BuiltinCommonInstructions::Standard", |
| 2814 | + "conditions": [ |
| 2815 | + { |
| 2816 | + "type": { |
| 2817 | + "value": "SpriteToggleSwitch::ButtonFSM::IsPressedOutside" |
| 2818 | + }, |
| 2819 | + "parameters": [ |
| 2820 | + "State", |
| 2821 | + "ButtonFSM", |
| 2822 | + "" |
| 2823 | + ] |
| 2824 | + } |
| 2825 | + ], |
| 2826 | + "actions": [ |
| 2827 | + { |
| 2828 | + "type": { |
| 2829 | + "value": "SetReturnBoolean" |
| 2830 | + }, |
| 2831 | + "parameters": [ |
| 2832 | + "True" |
| 2833 | + ] |
| 2834 | + } |
| 2835 | + ] |
| 2836 | + } |
| 2837 | + ], |
| 2838 | + "parameters": [ |
| 2839 | + { |
| 2840 | + "description": "Object", |
| 2841 | + "name": "Object", |
| 2842 | + "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch", |
| 2843 | + "type": "object" |
| 2844 | + } |
| 2845 | + ], |
| 2846 | + "objectGroups": [] |
| 2847 | + }, |
2814 | 2848 | { |
2815 | 2849 | "description": "Update the state animation.", |
2816 | 2850 | "fullName": "Update state animation", |
|
0 commit comments