Skip to content

Commit 6e554f5

Browse files
authored
[Slider] Fix slider disappearance when the minimum value is set to 1 (#785)
1 parent 7869a6b commit 6e554f5

File tree

1 file changed

+126
-62
lines changed

1 file changed

+126
-62
lines changed

extensions/reviewed/PanelSpriteSlider.json

Lines changed: 126 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "PanelSpriteSlider",
99
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg",
1010
"shortDescription": "A draggable slider that users can move to select a numerical value.",
11-
"version": "1.4.0",
11+
"version": "1.4.1",
1212
"description": [
1313
"A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.",
1414
"",
@@ -221,6 +221,18 @@
221221
"=",
222222
"GetArgumentAsNumber(\"Value\")"
223223
]
224+
},
225+
{
226+
"type": {
227+
"value": "PanelSpriteSlider::Slider::SetValue"
228+
},
229+
"parameters": [
230+
"Object",
231+
"Behavior",
232+
"=",
233+
"Object.Behavior::Value()",
234+
""
235+
]
224236
}
225237
]
226238
}
@@ -302,6 +314,18 @@
302314
"=",
303315
"GetArgumentAsNumber(\"Value\")"
304316
]
317+
},
318+
{
319+
"type": {
320+
"value": "PanelSpriteSlider::Slider::SetValue"
321+
},
322+
"parameters": [
323+
"Object",
324+
"Behavior",
325+
"=",
326+
"Object.Behavior::Value()",
327+
""
328+
]
305329
}
306330
]
307331
}
@@ -322,11 +346,11 @@
322346
"objectGroups": []
323347
},
324348
{
325-
"description": "Return the bar value bounds size.",
349+
"description": "the bar value bounds size.",
326350
"fullName": "Size",
327-
"functionType": "Expression",
351+
"functionType": "ExpressionAndCondition",
328352
"name": "Size",
329-
"sentence": "",
353+
"sentence": "the bar value bounds size",
330354
"events": [
331355
{
332356
"type": "BuiltinCommonInstructions::Standard",
@@ -423,6 +447,18 @@
423447
"=",
424448
"GetArgumentAsNumber(\"Value\")"
425449
]
450+
},
451+
{
452+
"type": {
453+
"value": "PanelSpriteSlider::Slider::SetValue"
454+
},
455+
"parameters": [
456+
"Object",
457+
"Behavior",
458+
"=",
459+
"Object.Behavior::Value()",
460+
""
461+
]
426462
}
427463
]
428464
}
@@ -2162,6 +2198,14 @@
21622198
{
21632199
"type": "BuiltinCommonInstructions::Standard",
21642200
"conditions": [
2201+
{
2202+
"type": {
2203+
"value": "PanelSpriteSlider::PanelSpriteSlider::PropertyShowLabelAtChanges"
2204+
},
2205+
"parameters": [
2206+
"Object"
2207+
]
2208+
},
21652209
{
21662210
"type": {
21672211
"value": "CollisionPoint"
@@ -3074,78 +3118,98 @@
30743118
"events": [
30753119
{
30763120
"type": "BuiltinCommonInstructions::Standard",
3077-
"conditions": [],
3078-
"actions": [
3121+
"conditions": [
30793122
{
30803123
"type": {
3081-
"value": "PanelSpriteObject::Width"
3124+
"value": "PanelSpriteSlider::Slider::Size"
30823125
},
30833126
"parameters": [
30843127
"FillBar",
3085-
"=",
3086-
"Object.FullBarWidth() * (FillBar.Slider::Value() - FillBar.Slider::MinValue()) / FillBar.Slider::Size()"
3087-
]
3088-
}
3089-
]
3090-
},
3091-
{
3092-
"type": "BuiltinCommonInstructions::Standard",
3093-
"conditions": [],
3094-
"actions": [
3095-
{
3096-
"type": {
3097-
"value": "SetCenterX"
3098-
},
3099-
"parameters": [
3100-
"Thumb",
3101-
"=",
3102-
"Object.FullBarLeft() + FillBar.Width()"
3103-
]
3104-
},
3105-
{
3106-
"type": {
3107-
"value": "SetCenterY"
3108-
},
3109-
"parameters": [
3110-
"Thumb",
3111-
"=",
3112-
"FillBar.CenterY()"
3128+
"Slider",
3129+
">",
3130+
"0",
3131+
""
31133132
]
31143133
}
3115-
]
3116-
},
3117-
{
3118-
"type": "BuiltinCommonInstructions::Standard",
3119-
"conditions": [],
3120-
"actions": [
3134+
],
3135+
"actions": [],
3136+
"events": [
31213137
{
3122-
"type": {
3123-
"value": "TextObject::String"
3124-
},
3125-
"parameters": [
3126-
"Label",
3127-
"=",
3128-
"ToString(Object.Value())"
3138+
"type": "BuiltinCommonInstructions::Standard",
3139+
"conditions": [],
3140+
"actions": [
3141+
{
3142+
"type": {
3143+
"value": "PanelSpriteObject::Width"
3144+
},
3145+
"parameters": [
3146+
"FillBar",
3147+
"=",
3148+
"Object.FullBarWidth() * (FillBar.Slider::Value() - FillBar.Slider::MinValue()) / FillBar.Slider::Size()"
3149+
]
3150+
}
31293151
]
31303152
},
31313153
{
3132-
"type": {
3133-
"value": "SetCenterX"
3134-
},
3135-
"parameters": [
3136-
"Label",
3137-
"=",
3138-
"Thumb.CenterX()"
3154+
"type": "BuiltinCommonInstructions::Standard",
3155+
"conditions": [],
3156+
"actions": [
3157+
{
3158+
"type": {
3159+
"value": "SetCenterX"
3160+
},
3161+
"parameters": [
3162+
"Thumb",
3163+
"=",
3164+
"Object.FullBarLeft() + FillBar.Width()"
3165+
]
3166+
},
3167+
{
3168+
"type": {
3169+
"value": "SetCenterY"
3170+
},
3171+
"parameters": [
3172+
"Thumb",
3173+
"=",
3174+
"FillBar.CenterY()"
3175+
]
3176+
}
31393177
]
31403178
},
31413179
{
3142-
"type": {
3143-
"value": "MettreY"
3144-
},
3145-
"parameters": [
3146-
"Label",
3147-
"=",
3148-
"Thumb.Y() - Label.Height() - Object.PropertyLabelMargin()"
3180+
"type": "BuiltinCommonInstructions::Standard",
3181+
"conditions": [],
3182+
"actions": [
3183+
{
3184+
"type": {
3185+
"value": "TextObject::String"
3186+
},
3187+
"parameters": [
3188+
"Label",
3189+
"=",
3190+
"ToString(Object.Value())"
3191+
]
3192+
},
3193+
{
3194+
"type": {
3195+
"value": "SetCenterX"
3196+
},
3197+
"parameters": [
3198+
"Label",
3199+
"=",
3200+
"Thumb.CenterX()"
3201+
]
3202+
},
3203+
{
3204+
"type": {
3205+
"value": "MettreY"
3206+
},
3207+
"parameters": [
3208+
"Label",
3209+
"=",
3210+
"Thumb.Y() - Label.Height() - Object.PropertyLabelMargin()"
3211+
]
3212+
}
31493213
]
31503214
}
31513215
]

0 commit comments

Comments
 (0)