Skip to content

Commit f16df79

Browse files
authored
[Reviewed] [Button] Add an action to activate or deactivate interactions with the button (#743)
1 parent 8425211 commit f16df79

File tree

1 file changed

+168
-2
lines changed

1 file changed

+168
-2
lines changed

extensions/reviewed/PanelSpriteButton.json

+168-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "PanelSpriteButton",
99
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg",
1010
"shortDescription": "A button that can be customized.",
11-
"version": "1.3.1",
11+
"version": "1.4.0",
1212
"description": [
1313
"The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.",
1414
"",
@@ -686,6 +686,56 @@
686686
],
687687
"objectGroups": []
688688
},
689+
{
690+
"fullName": "",
691+
"functionType": "Action",
692+
"name": "onDeActivate",
693+
"sentence": "",
694+
"events": [
695+
{
696+
"type": "BuiltinCommonInstructions::Standard",
697+
"conditions": [],
698+
"actions": [
699+
{
700+
"type": {
701+
"value": "PanelSpriteButton::ButtonFSM::SetPropertyState"
702+
},
703+
"parameters": [
704+
"Object",
705+
"Behavior",
706+
"=",
707+
"\"Idle\""
708+
]
709+
},
710+
{
711+
"type": {
712+
"value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId"
713+
},
714+
"parameters": [
715+
"Object",
716+
"Behavior",
717+
"=",
718+
"0"
719+
]
720+
}
721+
]
722+
}
723+
],
724+
"parameters": [
725+
{
726+
"description": "Object",
727+
"name": "Object",
728+
"type": "object"
729+
},
730+
{
731+
"description": "Behavior",
732+
"name": "Behavior",
733+
"supplementaryInformation": "PanelSpriteButton::ButtonFSM",
734+
"type": "behavior"
735+
}
736+
],
737+
"objectGroups": []
738+
},
689739
{
690740
"description": "Check if the button is not used.",
691741
"fullName": "Is idle",
@@ -1122,7 +1172,7 @@
11221172
{
11231173
"defaultName": "Button",
11241174
"description": "A button that can be customized.",
1125-
"fullName": "Panel sprite button",
1175+
"fullName": "Button (panel sprite)",
11261176
"name": "PanelSpriteButton",
11271177
"eventsFunctions": [
11281178
{
@@ -2297,6 +2347,122 @@
22972347
]
22982348
}
22992349
]
2350+
},
2351+
{
2352+
"description": "De/activate interactions with the button.",
2353+
"fullName": "De/activate interactions",
2354+
"functionType": "Action",
2355+
"name": "Activate",
2356+
"sentence": "De/activate interactions with _PARAM0_",
2357+
"events": [
2358+
{
2359+
"type": "BuiltinCommonInstructions::Standard",
2360+
"conditions": [
2361+
{
2362+
"type": {
2363+
"value": "GetArgumentAsBoolean"
2364+
},
2365+
"parameters": [
2366+
"\"ShouldActivate\""
2367+
]
2368+
}
2369+
],
2370+
"actions": [
2371+
{
2372+
"type": {
2373+
"value": "ActivateBehavior"
2374+
},
2375+
"parameters": [
2376+
"Idle",
2377+
"ButtonFSM",
2378+
"yes"
2379+
]
2380+
}
2381+
]
2382+
},
2383+
{
2384+
"type": "BuiltinCommonInstructions::Standard",
2385+
"conditions": [
2386+
{
2387+
"type": {
2388+
"inverted": true,
2389+
"value": "GetArgumentAsBoolean"
2390+
},
2391+
"parameters": [
2392+
"\"ShouldActivate\""
2393+
]
2394+
}
2395+
],
2396+
"actions": [
2397+
{
2398+
"type": {
2399+
"value": "ActivateBehavior"
2400+
},
2401+
"parameters": [
2402+
"Idle",
2403+
"ButtonFSM",
2404+
"no"
2405+
]
2406+
}
2407+
]
2408+
}
2409+
],
2410+
"parameters": [
2411+
{
2412+
"description": "Object",
2413+
"name": "Object",
2414+
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
2415+
"type": "object"
2416+
},
2417+
{
2418+
"description": "Activate",
2419+
"name": "ShouldActivate",
2420+
"type": "yesorno"
2421+
}
2422+
],
2423+
"objectGroups": []
2424+
},
2425+
{
2426+
"description": "Check if interactions are activated on the button.",
2427+
"fullName": "Interactions activated",
2428+
"functionType": "Condition",
2429+
"name": "IsActivated",
2430+
"sentence": "Interactions on _PARAM0_ are activated",
2431+
"events": [
2432+
{
2433+
"type": "BuiltinCommonInstructions::Standard",
2434+
"conditions": [
2435+
{
2436+
"type": {
2437+
"value": "BehaviorActivated"
2438+
},
2439+
"parameters": [
2440+
"Idle",
2441+
"ButtonFSM"
2442+
]
2443+
}
2444+
],
2445+
"actions": [
2446+
{
2447+
"type": {
2448+
"value": "SetReturnBoolean"
2449+
},
2450+
"parameters": [
2451+
"True"
2452+
]
2453+
}
2454+
]
2455+
}
2456+
],
2457+
"parameters": [
2458+
{
2459+
"description": "Object",
2460+
"name": "Object",
2461+
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
2462+
"type": "object"
2463+
}
2464+
],
2465+
"objectGroups": []
23002466
}
23012467
],
23022468
"propertyDescriptors": [

0 commit comments

Comments
 (0)