Skip to content

[Community] [Slider] Fix value changes when moving several thumbs. #739

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

Merged
merged 2 commits into from
Jan 23, 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
327 changes: 155 additions & 172 deletions extensions/community/PanelSpriteSlider.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"name": "PanelSpriteSlider",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg",
"shortDescription": "A draggable slider that users can move to select a numerical value.",
"version": "1.2.0",
"version": "1.2.1",
"description": "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.",
"origin": {
"identifier": "ResourceBar",
"identifier": "PanelSpriteSlider",
"name": "gdevelop-extension-store"
},
"tags": [
Expand All @@ -25,29 +25,7 @@
"gqDaZjCfevOOxBYkK6zlhtZnXCg1"
],
"dependencies": [],
"eventsFunctions": [
{
"fullName": "Any touch pressed",
"functionType": "Condition",
"name": "AnyTouchPressed",
"private": true,
"sentence": "Any touch is pressed",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager()._touches.firstKey() !== null;",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
}
],
"eventsFunctions": [],
"eventsBasedBehaviors": [
{
"description": "Represent a value on a slider.",
Expand Down Expand Up @@ -890,73 +868,64 @@
},
{
"type": {
"inverted": true,
"value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside"
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior"
"Behavior",
"=",
"\"Hovered\""
]
}
],
"actions": [],
"events": [
"actions": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
]
Expand All @@ -966,99 +935,74 @@
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
"inverted": true,
"value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [
"Object",
"Behavior"
]
}
"parameters": [
"Object",
"Behavior"
]
},
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
],
"actions": [],
"events": [
"actions": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "MouseButtonPressed"
},
"parameters": [
"",
"Left"
]
},
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
"type": {
"value": "PanelSpriteSlider::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteSlider::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
]
Expand Down Expand Up @@ -1516,6 +1460,46 @@
}
],
"objectGroups": []
},
{
"description": "the touch id that is using the button or 0 if none.",
"fullName": "Touch id",
"functionType": "ExpressionAndCondition",
"name": "TouchId",
"sentence": "the touch id",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"Object.Behavior::PropertyTouchId()"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteSlider::ButtonFSM",
"type": "behavior"
}
],
"objectGroups": []
}
],
"propertyDescriptors": [
Expand Down Expand Up @@ -1987,7 +1971,7 @@
"parameters": [
"Object",
"=",
"FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()",
"FillBar.Slider::MinValue() + FillBar.Slider::Size() * (TouchX(Background.ButtonFSM::TouchId(), Object.Layer()) - Object.FullBarLeft()) / Object.FullBarWidth()",
"FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()"
]
}
Expand Down Expand Up @@ -2111,13 +2095,12 @@
"conditions": [
{
"type": {
"value": "SourisSurObjet"
"value": "CollisionPoint"
},
"parameters": [
"Thumb",
"",
"no",
""
"MouseOnlyCursorX(Object.Layer(), 0)",
"MouseOnlyCursorY(Thumb.Layer(), 0)"
]
}
],
Expand Down