Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reviewed] [Button] Add an action to activate or deactivate interactions with the button #743

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 168 additions & 2 deletions extensions/reviewed/PanelSpriteButton.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "PanelSpriteButton",
"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",
"shortDescription": "A button that can be customized.",
"version": "1.3.1",
"version": "1.4.0",
"description": [
"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.",
"",
Expand Down Expand Up @@ -686,6 +686,56 @@
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "onDeActivate",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "PanelSpriteButton::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
},
{
"type": {
"value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId"
},
"parameters": [
"Object",
"Behavior",
"=",
"0"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::ButtonFSM",
"type": "behavior"
}
],
"objectGroups": []
},
{
"description": "Check if the button is not used.",
"fullName": "Is idle",
Expand Down Expand Up @@ -1122,7 +1172,7 @@
{
"defaultName": "Button",
"description": "A button that can be customized.",
"fullName": "Panel sprite button",
"fullName": "Button (panel sprite)",
"name": "PanelSpriteButton",
"eventsFunctions": [
{
Expand Down Expand Up @@ -2297,6 +2347,122 @@
]
}
]
},
{
"description": "De/activate interactions with the button.",
"fullName": "De/activate interactions",
"functionType": "Action",
"name": "Activate",
"sentence": "De/activate interactions with _PARAM0_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GetArgumentAsBoolean"
},
"parameters": [
"\"ShouldActivate\""
]
}
],
"actions": [
{
"type": {
"value": "ActivateBehavior"
},
"parameters": [
"Idle",
"ButtonFSM",
"yes"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "GetArgumentAsBoolean"
},
"parameters": [
"\"ShouldActivate\""
]
}
],
"actions": [
{
"type": {
"value": "ActivateBehavior"
},
"parameters": [
"Idle",
"ButtonFSM",
"no"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
},
{
"description": "Activate",
"name": "ShouldActivate",
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Check if interactions are activated on the button.",
"fullName": "Interactions activated",
"functionType": "Condition",
"name": "IsActivated",
"sentence": "Interactions on _PARAM0_ are activated",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BehaviorActivated"
},
"parameters": [
"Idle",
"ButtonFSM"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
}
],
"propertyDescriptors": [
Expand Down