|
8 | 8 | "name": "SpriteToggleSwitch", |
9 | 9 | "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", |
10 | 10 | "shortDescription": "Toggle switch that users can click or touch.", |
11 | | - "version": "1.1.0", |
| 11 | + "version": "1.1.1", |
12 | 12 | "description": "Toggle switch that users can click or touch. The switch can be customized with sprites.", |
13 | 13 | "tags": [ |
14 | 14 | "ui", |
|
21 | 21 | "gqDaZjCfevOOxBYkK6zlhtZnXCg1" |
22 | 22 | ], |
23 | 23 | "dependencies": [], |
24 | | - "eventsFunctions": [ |
25 | | - { |
26 | | - "fullName": "Any touch pressed", |
27 | | - "functionType": "Condition", |
28 | | - "name": "AnyTouchPressed", |
29 | | - "private": true, |
30 | | - "sentence": "Any touch is pressed", |
31 | | - "events": [ |
32 | | - { |
33 | | - "type": "BuiltinCommonInstructions::JsCode", |
34 | | - "inlineCode": [ |
35 | | - "eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager()._touches.firstKey() !== null;", |
36 | | - "" |
37 | | - ], |
38 | | - "parameterObjects": "", |
39 | | - "useStrict": true, |
40 | | - "eventsSheetExpanded": false |
41 | | - } |
42 | | - ], |
43 | | - "parameters": [], |
44 | | - "objectGroups": [] |
45 | | - } |
46 | | - ], |
| 24 | + "eventsFunctions": [], |
47 | 25 | "eventsBasedBehaviors": [ |
48 | 26 | { |
49 | 27 | "description": "The finite state machine used internally by the switch object.", |
|
735 | 713 | }, |
736 | 714 | { |
737 | 715 | "type": { |
738 | | - "inverted": true, |
739 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside" |
| 716 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
740 | 717 | }, |
741 | 718 | "parameters": [ |
742 | 719 | "Object", |
743 | | - "Behavior" |
| 720 | + "Behavior", |
| 721 | + "=", |
| 722 | + "\"Hovered\"" |
744 | 723 | ] |
745 | 724 | } |
746 | 725 | ], |
747 | | - "actions": [], |
748 | | - "events": [ |
| 726 | + "actions": [ |
749 | 727 | { |
750 | | - "type": "BuiltinCommonInstructions::Standard", |
751 | | - "conditions": [ |
752 | | - { |
753 | | - "type": { |
754 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
755 | | - }, |
756 | | - "parameters": [ |
757 | | - "Object", |
758 | | - "Behavior", |
759 | | - "=", |
760 | | - "\"Hovered\"" |
761 | | - ] |
762 | | - } |
763 | | - ], |
764 | | - "actions": [ |
765 | | - { |
766 | | - "type": { |
767 | | - "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
768 | | - }, |
769 | | - "parameters": [ |
770 | | - "Object", |
771 | | - "Behavior", |
772 | | - "=", |
773 | | - "\"Idle\"" |
774 | | - ] |
775 | | - } |
| 728 | + "type": { |
| 729 | + "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
| 730 | + }, |
| 731 | + "parameters": [ |
| 732 | + "Object", |
| 733 | + "Behavior", |
| 734 | + "=", |
| 735 | + "\"Idle\"" |
| 736 | + ] |
| 737 | + } |
| 738 | + ] |
| 739 | + }, |
| 740 | + { |
| 741 | + "type": "BuiltinCommonInstructions::Standard", |
| 742 | + "conditions": [ |
| 743 | + { |
| 744 | + "type": { |
| 745 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside" |
| 746 | + }, |
| 747 | + "parameters": [ |
| 748 | + "Object", |
| 749 | + "Behavior" |
776 | 750 | ] |
777 | 751 | }, |
778 | 752 | { |
779 | | - "type": "BuiltinCommonInstructions::Standard", |
780 | | - "conditions": [ |
781 | | - { |
782 | | - "type": { |
783 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
784 | | - }, |
785 | | - "parameters": [ |
786 | | - "Object", |
787 | | - "Behavior", |
788 | | - "=", |
789 | | - "\"PressedInside\"" |
790 | | - ] |
791 | | - } |
792 | | - ], |
793 | | - "actions": [ |
794 | | - { |
795 | | - "type": { |
796 | | - "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
797 | | - }, |
798 | | - "parameters": [ |
799 | | - "Object", |
800 | | - "Behavior", |
801 | | - "=", |
802 | | - "\"PressedOutside\"" |
803 | | - ] |
804 | | - } |
| 753 | + "type": { |
| 754 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
| 755 | + }, |
| 756 | + "parameters": [ |
| 757 | + "Object", |
| 758 | + "Behavior", |
| 759 | + "=", |
| 760 | + "\"Idle\"" |
| 761 | + ] |
| 762 | + } |
| 763 | + ], |
| 764 | + "actions": [ |
| 765 | + { |
| 766 | + "type": { |
| 767 | + "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
| 768 | + }, |
| 769 | + "parameters": [ |
| 770 | + "Object", |
| 771 | + "Behavior", |
| 772 | + "=", |
| 773 | + "\"Hovered\"" |
805 | 774 | ] |
806 | 775 | } |
807 | 776 | ] |
|
811 | 780 | "conditions": [ |
812 | 781 | { |
813 | 782 | "type": { |
814 | | - "value": "BuiltinCommonInstructions::Or" |
| 783 | + "inverted": true, |
| 784 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside" |
815 | 785 | }, |
816 | | - "parameters": [], |
817 | | - "subInstructions": [ |
818 | | - { |
819 | | - "type": { |
820 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside" |
821 | | - }, |
822 | | - "parameters": [ |
823 | | - "Object", |
824 | | - "Behavior" |
825 | | - ] |
826 | | - }, |
827 | | - { |
828 | | - "type": { |
829 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside" |
830 | | - }, |
831 | | - "parameters": [ |
832 | | - "Object", |
833 | | - "Behavior" |
834 | | - ] |
835 | | - } |
| 786 | + "parameters": [ |
| 787 | + "Object", |
| 788 | + "Behavior" |
| 789 | + ] |
| 790 | + }, |
| 791 | + { |
| 792 | + "type": { |
| 793 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
| 794 | + }, |
| 795 | + "parameters": [ |
| 796 | + "Object", |
| 797 | + "Behavior", |
| 798 | + "=", |
| 799 | + "\"PressedInside\"" |
836 | 800 | ] |
837 | 801 | } |
838 | 802 | ], |
839 | | - "actions": [], |
840 | | - "events": [ |
| 803 | + "actions": [ |
841 | 804 | { |
842 | | - "type": "BuiltinCommonInstructions::Standard", |
843 | | - "conditions": [ |
844 | | - { |
845 | | - "type": { |
846 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
847 | | - }, |
848 | | - "parameters": [ |
849 | | - "Object", |
850 | | - "Behavior", |
851 | | - "=", |
852 | | - "\"PressedOutside\"" |
853 | | - ] |
854 | | - } |
855 | | - ], |
856 | | - "actions": [ |
857 | | - { |
858 | | - "type": { |
859 | | - "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
860 | | - }, |
861 | | - "parameters": [ |
862 | | - "Object", |
863 | | - "Behavior", |
864 | | - "=", |
865 | | - "\"PressedInside\"" |
866 | | - ] |
867 | | - } |
| 805 | + "type": { |
| 806 | + "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
| 807 | + }, |
| 808 | + "parameters": [ |
| 809 | + "Object", |
| 810 | + "Behavior", |
| 811 | + "=", |
| 812 | + "\"PressedOutside\"" |
| 813 | + ] |
| 814 | + } |
| 815 | + ] |
| 816 | + }, |
| 817 | + { |
| 818 | + "type": "BuiltinCommonInstructions::Standard", |
| 819 | + "conditions": [ |
| 820 | + { |
| 821 | + "type": { |
| 822 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside" |
| 823 | + }, |
| 824 | + "parameters": [ |
| 825 | + "Object", |
| 826 | + "Behavior" |
868 | 827 | ] |
869 | 828 | }, |
870 | 829 | { |
871 | | - "type": "BuiltinCommonInstructions::Standard", |
872 | | - "conditions": [ |
873 | | - { |
874 | | - "type": { |
875 | | - "inverted": true, |
876 | | - "value": "MouseButtonPressed" |
877 | | - }, |
878 | | - "parameters": [ |
879 | | - "", |
880 | | - "Left" |
881 | | - ] |
882 | | - }, |
883 | | - { |
884 | | - "type": { |
885 | | - "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
886 | | - }, |
887 | | - "parameters": [ |
888 | | - "Object", |
889 | | - "Behavior", |
890 | | - "=", |
891 | | - "\"Idle\"" |
892 | | - ] |
893 | | - } |
894 | | - ], |
895 | | - "actions": [ |
896 | | - { |
897 | | - "type": { |
898 | | - "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
899 | | - }, |
900 | | - "parameters": [ |
901 | | - "Object", |
902 | | - "Behavior", |
903 | | - "=", |
904 | | - "\"Hovered\"" |
905 | | - ] |
906 | | - } |
| 830 | + "type": { |
| 831 | + "value": "SpriteToggleSwitch::ButtonFSM::PropertyState" |
| 832 | + }, |
| 833 | + "parameters": [ |
| 834 | + "Object", |
| 835 | + "Behavior", |
| 836 | + "=", |
| 837 | + "\"PressedOutside\"" |
| 838 | + ] |
| 839 | + } |
| 840 | + ], |
| 841 | + "actions": [ |
| 842 | + { |
| 843 | + "type": { |
| 844 | + "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState" |
| 845 | + }, |
| 846 | + "parameters": [ |
| 847 | + "Object", |
| 848 | + "Behavior", |
| 849 | + "=", |
| 850 | + "\"PressedInside\"" |
907 | 851 | ] |
908 | 852 | } |
909 | 853 | ] |
|
1361 | 1305 | } |
1362 | 1306 | ], |
1363 | 1307 | "objectGroups": [] |
| 1308 | + }, |
| 1309 | + { |
| 1310 | + "description": "the touch id that is using the button or 0 if none.", |
| 1311 | + "fullName": "Touch id", |
| 1312 | + "functionType": "ExpressionAndCondition", |
| 1313 | + "name": "TouchId", |
| 1314 | + "sentence": "the touch id", |
| 1315 | + "events": [ |
| 1316 | + { |
| 1317 | + "type": "BuiltinCommonInstructions::Standard", |
| 1318 | + "conditions": [], |
| 1319 | + "actions": [ |
| 1320 | + { |
| 1321 | + "type": { |
| 1322 | + "value": "SetReturnNumber" |
| 1323 | + }, |
| 1324 | + "parameters": [ |
| 1325 | + "Object.Behavior::PropertyTouchId()" |
| 1326 | + ] |
| 1327 | + } |
| 1328 | + ] |
| 1329 | + } |
| 1330 | + ], |
| 1331 | + "expressionType": { |
| 1332 | + "type": "expression" |
| 1333 | + }, |
| 1334 | + "parameters": [ |
| 1335 | + { |
| 1336 | + "description": "Object", |
| 1337 | + "name": "Object", |
| 1338 | + "type": "object" |
| 1339 | + }, |
| 1340 | + { |
| 1341 | + "description": "Behavior", |
| 1342 | + "name": "Behavior", |
| 1343 | + "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM", |
| 1344 | + "type": "behavior" |
| 1345 | + } |
| 1346 | + ], |
| 1347 | + "objectGroups": [] |
1364 | 1348 | } |
1365 | 1349 | ], |
1366 | 1350 | "propertyDescriptors": [ |
|
0 commit comments