From 18c0921c32fd8e915c97750cae01333ddf247b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 17 Feb 2025 15:50:29 +0100 Subject: [PATCH 01/11] [Reviewed] [Button] Use anchor behaviors --- extensions/reviewed/PanelSpriteButton.json | 663 ++++++++++----------- 1 file changed, 313 insertions(+), 350 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 8d5ad5ae8..5c90c1d7f 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -2,14 +2,14 @@ "author": "", "category": "User interface", "extensionNamespace": "", - "fullName": "Panel sprite button", "gdevelopVersion": ">=5.5.222", + "fullName": "Panel sprite button", "helpPath": "/objects/button", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", "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.5.0", + "version": "1.6.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.", "", @@ -1118,6 +1118,8 @@ "type": "Boolean", "label": "", "description": "Should check hovering", + "group": "", + "extraInformation": [], "hidden": true, "name": "ShouldCheckHovering" }, @@ -1125,6 +1127,8 @@ "value": "Idle", "type": "Choice", "label": "State", + "description": "", + "group": "", "extraInformation": [ "Idle", "Hovered", @@ -1139,6 +1143,9 @@ "value": "0", "type": "Number", "label": "Touch id", + "description": "", + "group": "", + "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -1146,6 +1153,9 @@ "value": "", "type": "Boolean", "label": "Touch is inside", + "description": "", + "group": "", + "extraInformation": [], "hidden": true, "name": "TouchIsInside" }, @@ -1153,6 +1163,9 @@ "value": "", "type": "Boolean", "label": "Mouse is inside", + "description": "", + "group": "", + "extraInformation": [], "hidden": true, "name": "MouseIsInside" }, @@ -1160,6 +1173,9 @@ "value": "", "type": "Number", "label": "", + "description": "", + "group": "", + "extraInformation": [], "hidden": true, "name": "Index" } @@ -1169,7 +1185,7 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, + "areaMaxX": 256, "areaMaxY": 64, "areaMaxZ": 64, "areaMinX": 0, @@ -1178,167 +1194,9 @@ "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", + "isInnerAreaFollowingParentSize": true, "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [], "eventsFunctions": [ { "fullName": "", @@ -1368,7 +1226,7 @@ }, "parameters": [ "", - "Idle", + "Hovered", "0", "0", "" @@ -1380,7 +1238,7 @@ }, "parameters": [ "", - "Hovered", + "Pressed", "0", "0", "" @@ -1388,14 +1246,24 @@ }, { "type": { - "value": "Create" + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Hovered", + "Resizable", + "Idle.Width()", + "Idle.Height()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" }, "parameters": [ - "", "Pressed", - "0", - "0", - "" + "Resizable", + "Idle.Width()", + "Idle.Height()" ] }, { @@ -1423,6 +1291,16 @@ "=", "1" ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Pressed", + "=", + "1" + ] } ] }, @@ -1444,26 +1322,13 @@ "actions": [ { "type": { - "value": "Create" + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" }, "parameters": [ - "", - "Label", - "0", - "0", + "Object", "" ] }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Label", - "=", - "2" - ] - }, { "type": { "value": "TextObject::SetWrapping" @@ -1472,15 +1337,6 @@ "Label", "yes" ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" - ] } ] } @@ -1912,143 +1768,6 @@ } ], "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the button size change:\n- backgrounds for each state are resized to take the full dimensions of the button\n- the label is put back at the center of the button\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Width" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Height" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "variables": [ - { - "name": "Width", - "type": "number", - "value": 0 - }, - { - "name": "Height", - "type": "number", - "value": 0 - } - ] - } - ] - } - ], - "parameters": [] } ], "parameters": [ @@ -2059,22 +1778,7 @@ "type": "object" } ], - "objectGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ] + "objectGroups": [] }, { "description": "Check if the button is not used.", @@ -2340,11 +2044,11 @@ "objectGroups": [] }, { - "description": "the label text.", + "description": "Return the label text.", "fullName": "Label text", - "functionType": "ExpressionAndCondition", + "functionType": "StringExpression", "name": "LabelText", - "sentence": "the label text", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -2652,12 +2356,16 @@ "value": "0", "type": "Number", "label": "Label offset on Y axis when pressed", + "description": "", + "group": "", + "extraInformation": [], "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", "label": "Left padding", + "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -2668,6 +2376,7 @@ "value": "0", "type": "Number", "label": "Right padding", + "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -2678,6 +2387,7 @@ "value": "0", "type": "Number", "label": "Top padding", + "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -2688,6 +2398,7 @@ "value": "0", "type": "Number", "label": "Bottom padding", + "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -2698,9 +2409,261 @@ "value": "0.25", "type": "Number", "label": "Hovered fade out duration (in seconds)", + "description": "", + "group": "", + "extraInformation": [], "name": "HoveredFadeOutDuration" } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 4, + "name": "Anchor", + "topEdgeAnchor": 4, + "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Text", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 256, + "x": 0, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } ] } ] -} +} \ No newline at end of file From 43c4d567e3818bc79d9829d68025e463b9ae3c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 20 Feb 2025 18:14:20 +0100 Subject: [PATCH 02/11] Replace deprecated instructions. --- extensions/reviewed/PanelSpriteButton.json | 547 ++++++++++----------- 1 file changed, 272 insertions(+), 275 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 5c90c1d7f..849714738 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -1191,12 +1191,262 @@ "areaMinX": 0, "areaMinY": 0, "areaMinZ": 0, + "assetStoreId": "", "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", "isInnerAreaFollowingParentSize": true, - "isUsingLegacyInstancesRenderer": true, + "isUsingLegacyInstancesRenderer": false, "name": "PanelSpriteButton", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Text", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "Idle", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 256, + "x": 0, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -1328,15 +1578,6 @@ "Object", "" ] - }, - { - "type": { - "value": "TextObject::SetWrapping" - }, - "parameters": [ - "Label", - "yes" - ] } ] } @@ -1499,7 +1740,7 @@ "actions": [ { "type": { - "value": "Tween::AddObjectOpacityTween" + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" }, "parameters": [ "Hovered", @@ -1507,7 +1748,7 @@ "\"Fadeout\"", "0", "\"linear\"", - "Object.PropertyHoveredFadeOutDuration() * 1000", + "HoveredFadeOutDuration", "" ] } @@ -1545,10 +1786,11 @@ "conditions": [ { "type": { - "value": "PanelSpriteObject::Opacity" + "value": "OpacityCapability::OpacityBehavior::Value" }, "parameters": [ "Hovered", + "Opacity", "=", "0" ] @@ -1565,10 +1807,11 @@ }, { "type": { - "value": "PanelSpriteObject::SetOpacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Hovered", + "Opacity", "=", "255" ] @@ -1642,10 +1885,11 @@ }, { "type": { - "value": "PanelSpriteObject::SetOpacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Hovered", + "Opacity", "=", "255" ] @@ -1679,7 +1923,7 @@ "parameters": [ "Label", "=", - "Object.CenterWithPaddingY() + Object.PropertyPressedLabelOffsetY()" + "Object.CenterWithPaddingY() + PressedLabelOffsetY" ] }, { @@ -2008,12 +2252,13 @@ "actions": [ { "type": { - "value": "TextObject::String" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ "Label", + "Text", "=", - "LabelText" + "Value" ] }, { @@ -2037,7 +2282,7 @@ }, { "description": "Text", - "name": "LabelText", + "name": "Value", "type": "string" } ], @@ -2059,7 +2304,7 @@ "value": "SetReturnString" }, "parameters": [ - "Label.String()" + "Label.Text::Value()" ] } ] @@ -2095,7 +2340,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Idle.CenterY() + (Object.PropertyTopPadding() - Object.PropertyBottomPadding()) / 2" + "Idle.CenterY() + (TopPadding - BottomPadding) / 2" ] } ] @@ -2133,9 +2378,9 @@ "parameters": [ "Label", "=", - "Object.PropertyLeftPadding()", + "LeftPadding", "=", - "Object.PropertyTopPadding()" + "TopPadding" ] }, { @@ -2145,7 +2390,7 @@ "parameters": [ "Label", "=", - "Idle.Width() - Object.PropertyLeftPadding() - Object.PropertyRightPadding()" + "Idle.Width() - LeftPadding - RightPadding" ] }, { @@ -2171,7 +2416,7 @@ "parameters": [ "Label", "=", - "Background.CenterX() + (Object.PropertyLeftPadding() - Object.PropertyRightPadding()) / 2" + "Background.CenterX() + (LeftPadding - RightPadding) / 2" ] } ] @@ -2199,7 +2444,7 @@ "parameters": [ "Label", "+", - "Object.PropertyPressedLabelOffsetY()" + "PressedLabelOffsetY" ] } ] @@ -2415,255 +2660,7 @@ "name": "HoveredFadeOutDuration" } ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "bottomEdgeAnchor": 4, - "name": "Anchor", - "topEdgeAnchor": 4, - "type": "AnchorBehavior::AnchorBehavior", - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Text", - "font": "", - "textAlignment": "center", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "center", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "name": "Anchor", - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "type": "AnchorBehavior::AnchorBehavior", - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 64, - "layer": "", - "name": "Idle", - "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", - "width": 256, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 64, - "layer": "", - "name": "Label", - "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", - "width": 256, - "x": 0, - "y": 32, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ] + "variants": [] } ] } \ No newline at end of file From 478baa102d27a23daddda1066e33f58de9221a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 25 Feb 2025 14:02:27 +0100 Subject: [PATCH 03/11] [Button] Use property mapping. --- extensions/reviewed/PanelSpriteButton.json | 398 +++++++++------------ 1 file changed, 162 insertions(+), 236 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 849714738..9723a03f4 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -1191,7 +1191,6 @@ "areaMinX": 0, "areaMinY": 0, "areaMinZ": 0, - "assetStoreId": "", "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", @@ -1551,32 +1550,16 @@ "=", "1" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Place the label over the backgrounds." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ - "Object", - "" + "Label", + "Text", + "=", + "LabelText" ] } ] @@ -1615,18 +1598,47 @@ "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], "actions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ "Object", + "=", + "PressedLabelOffsetY", "" ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Label", + "Text", + "=", + "LabelText" + ] + } + ] } ], "parameters": [ @@ -1688,12 +1700,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -1840,12 +1853,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -1918,12 +1932,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY() + PressedLabelOffsetY" + "PressedLabelOffsetY", + "" ] }, { @@ -1975,12 +1990,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -2260,15 +2276,6 @@ "=", "Value" ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" - ] } ] } @@ -2323,158 +2330,6 @@ ], "objectGroups": [] }, - { - "description": "Return the label center Y according to the button configuration. This expression is used in doStepPostEvents when the button is pressed or released.", - "fullName": "", - "functionType": "Expression", - "name": "CenterWithPaddingY", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Idle.CenterY() + (TopPadding - BottomPadding) / 2" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the label according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterLabel", - "private": true, - "sentence": "Center the label of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Label", - "=", - "LeftPadding", - "=", - "TopPadding" - ] - }, - { - "type": { - "value": "TextObject::WrappingWidth" - }, - "parameters": [ - "Label", - "=", - "Idle.Width() - LeftPadding - RightPadding" - ] - }, - { - "type": { - "value": "SetCenterY" - }, - "parameters": [ - "Label", - "=", - "Object.CenterWithPaddingY()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenterX" - }, - "parameters": [ - "Label", - "=", - "Background.CenterX() + (LeftPadding - RightPadding) / 2" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Label", - "+", - "PressedLabelOffsetY" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ] - }, { "description": "De/activate interactions with the button.", "fullName": "De/activate interactions", @@ -2594,70 +2449,141 @@ } ], "objectGroups": [] + }, + { + "description": "the labelOffset of the object.", + "fullName": "LabelOffset", + "functionType": "ExpressionAndCondition", + "name": "LabelOffset", + "private": true, + "sentence": "the labelOffset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "LabelOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LabelOffset", + "name": "SetLabelOffset", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "+", + "Value - LabelOffset" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LabelOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] } ], "propertyDescriptors": [ { - "value": "0", - "type": "Number", - "label": "Label offset on Y axis when pressed", + "value": "", + "type": "String", + "label": "Label", "description": "", "group": "", "extraInformation": [], - "name": "PressedLabelOffsetY" + "name": "LabelText" }, { - "value": "0", + "value": "0.25", "type": "Number", - "label": "Left padding", + "unit": "Second", + "label": "Hovered fade out duration", "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "LeftPadding" + "group": "States", + "extraInformation": [], + "name": "HoveredFadeOutDuration" }, { "value": "0", "type": "Number", - "label": "Right padding", + "unit": "Pixel", + "label": "Label offset on Y axis when pressed", "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "RightPadding" + "group": "States", + "extraInformation": [], + "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", - "label": "Top padding", + "unit": "Pixel", + "label": "", "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "TopPadding" + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LabelOffset" }, { - "value": "0", - "type": "Number", - "label": "Bottom padding", + "value": "", + "type": "Choice", + "label": "", "description": "", - "group": "Padding", + "group": "", "extraInformation": [ - "Label" + "Label.Text=LabelText" ], - "name": "BottomPadding" - }, - { - "value": "0.25", - "type": "Number", - "label": "Hovered fade out duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], - "name": "HoveredFadeOutDuration" + "hidden": true, + "name": "_PropertyMapping" } ], "variants": [] From b08ea1588cd629bc4b75fdb7f309f0dfe9c5a8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 25 Feb 2025 14:26:25 +0100 Subject: [PATCH 04/11] [Dialog box] Use property mapping. --- .../reviewed/TwoChoicesDialogBoxes.json | 1665 ++++++++--------- 1 file changed, 773 insertions(+), 892 deletions(-) diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index 888d99a15..55b436132 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -9,7 +9,7 @@ "name": "TwoChoicesDialogBoxes", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0842ffc478006e9b6687fca9a5761494c4efd1df873220637af5b4ac7253f850_Interface Elements_interface_ui_window_application_app_button_cta.svg", "shortDescription": "A dialog box with buttons to let users make a choice.", - "version": "0.2.0", + "version": "0.2.1", "description": [ "A dialog box showing multiple options (usually \"yes\" and \"no\") and a customizable text message.", "It handles keyboard, gamepad and touch controls." @@ -49,6 +49,294 @@ "isTextContainer": true, "isUsingLegacyInstancesRenderer": false, "name": "TwoChoicesDialogBox", + "objects": [ + { + "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", + "name": "NoButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Semi-transparent black and white", + "variables": [ + { + "name": "ID", + "type": "number", + "value": 0 + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "OutlineEffect", + "doubleParameters": { + "padding": 0, + "thickness": 2 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 8, + "RightPadding": 8, + "PressedLabelOffsetY": 0, + "IdleLabelOffsetY": -8, + "BottomPadding": 8, + "TopPadding": 8, + "MinimalWidth": 300 + } + }, + { + "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", + "name": "YesButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Semi-transparent black and white", + "variables": [ + { + "name": "ID", + "type": "number", + "value": 0 + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "OutlineEffect", + "doubleParameters": { + "padding": 0, + "thickness": 2 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 8, + "RightPadding": 8, + "PressedLabelOffsetY": 0, + "IdleLabelOffsetY": -8, + "BottomPadding": 8, + "TopPadding": 8, + "MinimalWidth": 300 + } + }, + { + "assetStoreId": "", + "bottomMargin": 16, + "height": 48, + "leftMargin": 16, + "name": "TextBorder", + "rightMargin": 16, + "texture": "Border.png", + "tiled": true, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 48, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "name": "Dialogue", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "text": "Default message. Continue?", + "opacity": 255, + "scale": 2, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "8BitOperatorPlus8Regular_Edited.fnt", + "textureAtlasResourceName": "8BitOperatorPlus8Regular_Edited.png", + "align": "left", + "wordWrap": true + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Dialogue" + }, + { + "objectName": "TextBorder" + }, + { + "objectName": "YesButton" + }, + { + "objectName": "NoButton" + } + ] + }, + "objectsGroups": [ + { + "name": "Buttons", + "objects": [ + { + "name": "NoButton" + }, + { + "name": "YesButton" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 124, + "layer": "", + "name": "Dialogue", + "persistentUuid": "c7183394-9ca6-4c16-9d13-f0b7cfe803d8", + "width": 554, + "x": 19, + "y": 18, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 213, + "layer": "", + "name": "TextBorder", + "persistentUuid": "639d5661-817d-4faa-b33b-c0ff129c309a", + "width": 600, + "x": 0, + "y": 0, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 36, + "layer": "", + "name": "YesButton", + "persistentUuid": "a0ca78d3-0a23-4bbe-89de-fb2d0a53996c", + "width": 105, + "x": 350, + "y": 160, + "zOrder": 510, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 36, + "layer": "", + "name": "NoButton", + "persistentUuid": "6781aafa-3ae9-4820-bb97-682a524a0cf6", + "width": 103, + "x": 471, + "y": 160, + "zOrder": 510, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "ID", + "persistentUuid": "bb563dbe-93eb-4412-b843-f60016b9a893", + "type": "number", + "value": 1 + } + ] + } + ], "eventsFunctions": [ { "fullName": "", @@ -382,240 +670,104 @@ "r": 255, "textB": 0, "textG": 0, - "textR": 0 - }, - "comment": "To escape the dialog we can focus the button with the identifier 1 which is usually the button to cancel/deny by pressing one of the key or buttons" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableEscape", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Escape" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"B\"", - "" - ] - } - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::SetActiveButtonById" - }, - "parameters": [ - "Object", - "=", - "1", - "" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Object", - "Text", - "=", - "TextMessage" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the \"Yes\" button of the dialog was selected.", - "fullName": "\"Yes\" button is clicked", - "functionType": "Condition", - "name": "IsYesClicked", - "sentence": "\"Yes\" button of _PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The button is clicked\nOr\nThe button is active and a key is pressed to validate the button" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "YesButton", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::ActiveButtonById" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "NumpadReturn" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Return" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Space" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"A\"", - "" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Space" - ] - } + "textR": 0 + }, + "comment": "To escape the dialog we can focus the button with the identifier 1 which is usually the button to cancel/deny by pressing one of the key or buttons" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableEscape", + "True", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Escape" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"B\"", + "" ] } ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::SetActiveButtonById" + }, + "parameters": [ + "Object", + "=", + "1", + "" + ] } ] } - ], + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ - "True" + "Object", + "Text", + "=", + "TextMessage" ] } ] @@ -632,11 +784,11 @@ "objectGroups": [] }, { - "description": "Check if the \"No\" button of the dialog was selected.", - "fullName": "\"No\" button is clicked", + "description": "Check if the \"Yes\" button of the dialog was selected.", + "fullName": "\"Yes\" button is clicked", "functionType": "Condition", - "name": "IsNoClicked", - "sentence": "\"No\" button of _PARAM0_ is clicked", + "name": "IsYesClicked", + "sentence": "\"Yes\" button of _PARAM0_ is clicked", "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -664,19 +816,10 @@ "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" }, "parameters": [ - "NoButton", + "YesButton", "" ] }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Escape" - ] - }, { "type": { "value": "BuiltinCommonInstructions::And" @@ -690,7 +833,7 @@ "parameters": [ "Object", "=", - "1", + "0", "" ] }, @@ -720,168 +863,47 @@ }, { "type": { - "value": "Gamepads::C_Button_pressed" + "value": "KeyPressed" }, "parameters": [ "", - "1", - "\"A\"", - "" + "Space" ] }, { "type": { - "value": "KeyPressed" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ "", - "Space" - ] - } - ] - } - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the highlighted button.", - "fullName": "Highlighted button", - "functionType": "ExpressionAndCondition", - "group": "Dialog Box configuration", - "name": "ActiveButtonById", - "private": true, - "sentence": "the highlighted button", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ActiveButtonById" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ActiveButtonById", - "name": "SetActiveButtonById", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ActiveButtonById", - "=", - "mod(Value, SceneInstancesCount(Buttons))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Buttons", - "ID", - "=", - "ActiveButtonById" - ] - } - ], - "actions": [ - { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" - }, - "parameters": [ - "Buttons", - "Effect", - "\"OutlineEffect\"", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Buttons", - "ID", - "!=", - "ActiveButtonById" + "1", + "\"A\"", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Space" + ] + } + ] + } + ] + } ] } ], "actions": [ { "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "value": "SetReturnBoolean" }, "parameters": [ - "Buttons", - "Effect", - "\"OutlineEffect\"", - "no" + "True" ] } ] @@ -898,560 +920,419 @@ "objectGroups": [] }, { - "description": "the text shown by the dialog.", - "fullName": "Text message", - "functionType": "ExpressionAndCondition", - "group": "Dialog Box configuration", - "name": "TextMessage", - "private": true, - "sentence": "the text", + "description": "Check if the \"No\" button of the dialog was selected.", + "fullName": "\"No\" button is clicked", + "functionType": "Condition", + "name": "IsNoClicked", + "sentence": "\"No\" button of _PARAM0_ is clicked", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "TextMessage" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "TextMessage", - "name": "SetTextMessage", - "private": true, - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The button is clicked\nOr\nThe button is active and a key is pressed to validate the button" + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "TextMessage", - "=", - "Value" - ] - }, + "conditions": [ { "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Dialogue", - "Text", - "=", - "TextMessage" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "Default message. Continue?", - "type": "String", - "label": "Message", - "description": "", - "group": "", - "extraInformation": [], - "name": "TextMessage" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "Default highlighted button identifier", - "description": "Default highlighted button identifier.", - "group": "", - "extraInformation": [], - "deprecated": true, - "name": "ActiveButtonById" - }, - { - "value": "true", - "type": "Boolean", - "label": "Cancel with Escape key", - "description": "Enable or disable the escape key to close the dialog.", - "group": "", - "extraInformation": [], - "name": "EnableEscape" - }, - { - "value": "Yes", - "type": "String", - "label": "Label for the \"Yes\" button", - "description": "This is the button with identifier 0.", - "group": "", - "extraInformation": [], - "name": "LabelButtonID0" - }, - { - "value": "No", - "type": "String", - "label": "Label for the \"No\" button", - "description": "This is the button with identifier 1.", - "group": "", - "extraInformation": [], - "name": "LabelButtonID1" - } - ], - "objects": [ - { - "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", - "name": "NoButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variables": [ - { - "name": "ID", - "type": "number", - "value": 0 - } - ], - "effects": [ - { - "effectType": "Outline", - "name": "OutlineEffect", - "doubleParameters": { - "padding": 0, - "thickness": 2 - }, - "stringParameters": { - "color": "255;255;255" - }, - "booleanParameters": {} + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "NoButton", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Escape" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::ActiveButtonById" + }, + "parameters": [ + "Object", + "=", + "1", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "NumpadReturn" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Return" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"A\"", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Space" + ] + } + ] + } + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], - "behaviors": [ + "parameters": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "content": { - "LeftPadding": 8, - "RightPadding": 8, - "PressedLabelOffsetY": 0, - "IdleLabelOffsetY": -8, - "BottomPadding": 8, - "TopPadding": 8, - "MinimalWidth": 300 - }, - "childrenContent": { - "Hovered": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Idle": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Label": { - "bold": false, - "italic": false, - "smoothed": true, - "underlined": false, - "string": "No", - "font": "", - "textAlignment": "center", - "characterSize": 26, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "No", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 26, - "color": "255;255;255" - } - }, - "Pressed": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - } - } + "objectGroups": [] }, { - "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", - "name": "YesButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variables": [ + "description": "the highlighted button.", + "fullName": "Highlighted button", + "functionType": "ExpressionAndCondition", + "group": "Dialog Box configuration", + "name": "ActiveButtonById", + "private": true, + "sentence": "the highlighted button", + "events": [ { - "name": "ID", - "type": "number", - "value": 0 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ActiveButtonById" + ] + } + ] } ], - "effects": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "effectType": "Outline", - "name": "OutlineEffect", - "doubleParameters": { - "padding": 0, - "thickness": 2 - }, - "stringParameters": { - "color": "255;255;255" - }, - "booleanParameters": {} + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "behaviors": [ + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ActiveButtonById", + "name": "SetActiveButtonById", + "private": true, + "sentence": "", + "events": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 8, - "RightPadding": 8, - "PressedLabelOffsetY": 0, - "IdleLabelOffsetY": -8, - "BottomPadding": 8, - "TopPadding": 8, - "MinimalWidth": 300 - }, - "childrenContent": { - "Hovered": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Idle": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border.png", - "tiled": true, - "topMargin": 8, - "width": 256 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActiveButtonById", + "=", + "mod(Value, SceneInstancesCount(Buttons))" + ] + } + ] }, - "Label": { - "bold": false, - "italic": false, - "smoothed": true, - "underlined": false, - "string": "Yes", - "font": "", - "textAlignment": "center", - "characterSize": 26, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Yes", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 26, - "color": "255;255;255" - } + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Buttons", + "ID", + "=", + "ActiveButtonById" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Buttons", + "Effect", + "\"OutlineEffect\"", + "yes" + ] + } + ] }, - "Pressed": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - } - } - }, - { - "assetStoreId": "", - "bottomMargin": 16, - "height": 48, - "leftMargin": 16, - "name": "TextBorder", - "rightMargin": 16, - "texture": "Border.png", - "tiled": true, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 48, - "variables": [], - "effects": [], - "behaviors": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Buttons", + "ID", + "!=", + "ActiveButtonById" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Buttons", + "Effect", + "\"OutlineEffect\"", + "no" + ] + } + ] } - ] - }, - { - "assetStoreId": "", - "name": "Dialogue", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "content": { - "text": "Default message. Continue?", - "opacity": 255, - "scale": 2, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "8BitOperatorPlus8Regular_Edited.fnt", - "textureAtlasResourceName": "8BitOperatorPlus8Regular_Edited.png", - "align": "left", - "wordWrap": true - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Dialogue" - }, - { - "objectName": "TextBorder" - }, - { - "objectName": "YesButton" - }, - { - "objectName": "NoButton" - } - ] - }, - "objectsGroups": [ + "objectGroups": [] + }, { - "name": "Buttons", - "objects": [ + "description": "the text shown by the dialog.", + "fullName": "Text message", + "functionType": "ExpressionAndCondition", + "group": "Dialog Box configuration", + "name": "TextMessage", + "private": true, + "sentence": "the text", + "events": [ { - "name": "NoButton" - }, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "TextMessage" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ { - "name": "YesButton" + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } - ] - } - ], - "layers": [ + ], + "objectGroups": [] + }, { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TextMessage", + "name": "SetTextMessage", + "private": true, + "sentence": "", + "events": [ { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "TextMessage", + "=", + "Value" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Dialogue", + "Text", + "=", + "TextMessage" + ] + } + ] } ], - "effects": [] + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" + } + ], + "objectGroups": [] } ], - "instances": [ + "propertyDescriptors": [ { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 124, - "layer": "", - "name": "Dialogue", - "persistentUuid": "c7183394-9ca6-4c16-9d13-f0b7cfe803d8", - "width": 554, - "x": 19, - "y": 18, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "Default message. Continue?", + "type": "String", + "label": "Message", + "description": "", + "group": "", + "extraInformation": [], + "name": "TextMessage" }, { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 213, - "layer": "", - "name": "TextBorder", - "persistentUuid": "639d5661-817d-4faa-b33b-c0ff129c309a", - "width": 600, - "x": 0, - "y": 0, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Default highlighted button identifier", + "description": "Default highlighted button identifier.", + "group": "", + "extraInformation": [], + "deprecated": true, + "name": "ActiveButtonById" }, { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 36, - "layer": "", - "name": "YesButton", - "persistentUuid": "a0ca78d3-0a23-4bbe-89de-fb2d0a53996c", - "width": 105, - "x": 350, - "y": 160, - "zOrder": 510, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "true", + "type": "Boolean", + "label": "Cancel with Escape key", + "description": "Enable or disable the escape key to close the dialog.", + "group": "", + "extraInformation": [], + "name": "EnableEscape" }, { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 36, - "layer": "", - "name": "NoButton", - "persistentUuid": "6781aafa-3ae9-4820-bb97-682a524a0cf6", - "width": 103, - "x": 471, - "y": 160, - "zOrder": 510, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [ - { - "name": "ID", - "persistentUuid": "bb563dbe-93eb-4412-b843-f60016b9a893", - "type": "number", - "value": 1 - } - ] + "value": "Yes", + "type": "String", + "label": "Label for the \"Yes\" button", + "description": "This is the button with identifier 0.", + "group": "", + "extraInformation": [], + "name": "LabelButtonID0" + }, + { + "value": "No", + "type": "String", + "label": "Label for the \"No\" button", + "description": "This is the button with identifier 1.", + "group": "", + "extraInformation": [], + "name": "LabelButtonID1" + }, + { + "value": "", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "YesButton.LabelText=LabelButtonID0", + "NoButton.LabelText=LabelButtonID1", + "Dialogue.Text=TextMessage" + ], + "hidden": true, + "name": "_PropertyMapping" } - ] + ], + "variants": [] } ] } \ No newline at end of file From c97e4daeb3fad93fb63962285e887ce00a1affde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 28 May 2025 14:14:28 +0200 Subject: [PATCH 05/11] [Button] Remove resource name --- extensions/reviewed/PanelSpriteButton.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 9723a03f4..7317facec 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -2,8 +2,8 @@ "author": "", "category": "User interface", "extensionNamespace": "", - "gdevelopVersion": ">=5.5.222", "fullName": "Panel sprite button", + "gdevelopVersion": ">=5.5.230", "helpPath": "/objects/button", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", "name": "PanelSpriteButton", @@ -1258,7 +1258,7 @@ "leftMargin": 0, "name": "Idle", "rightMargin": 0, - "texture": "Idle", + "texture": "", "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", @@ -2585,8 +2585,7 @@ "hidden": true, "name": "_PropertyMapping" } - ], - "variants": [] + ] } ] } \ No newline at end of file From c24dd9f143b100645e68b8e59f88321dddd3330c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 28 May 2025 14:22:13 +0200 Subject: [PATCH 06/11] [Dialog] Set minimal GDevelop version --- extensions/reviewed/TwoChoicesDialogBoxes.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index 55b436132..54b0c50e1 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -2,8 +2,8 @@ "author": "", "category": "Input", "extensionNamespace": "", - "gdevelopVersion": ">=5.5.222", "fullName": "Two choices dialog boxes", + "gdevelopVersion": ">=5.5.230", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjMiIHkxPSIxMSIgeDI9IjI5IiB5Mj0iMTEiLz4NCjxnPg0KCTxwYXRoIGQ9Ik03LDlDNi43LDksNi41LDguOSw2LjMsOC43QzYuMSw4LjUsNiw4LjMsNiw4YzAtMC4zLDAuMS0wLjUsMC4zLTAuN2MwLDAsMC4xLTAuMSwwLjEtMC4xYzAuMSwwLDAuMS0wLjEsMC4yLTAuMQ0KCQlDNi43LDcsNi43LDcsNi44LDdjMC4xLDAsMC4zLDAsMC40LDBjMC4xLDAsMC4xLDAsMC4yLDAuMWMwLjEsMCwwLjEsMC4xLDAuMiwwLjFjMCwwLDAuMSwwLjEsMC4xLDAuMWMwLjEsMC4xLDAuMiwwLjIsMC4yLDAuMw0KCQlDOCw3LjcsOCw3LjksOCw4YzAsMC4xLDAsMC4zLTAuMSwwLjRDNy45LDguNSw3LjgsOC42LDcuNyw4LjdDNy41LDguOSw3LjMsOSw3LDl6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMTAsOUM5LjcsOSw5LjUsOC45LDkuMyw4LjdDOS4xLDguNSw5LDguMyw5LDhjMC0wLjEsMC0wLjMsMC4xLTAuNGMwLjEtMC4xLDAuMS0wLjIsMC4yLTAuM2MwLjEtMC4xLDAuMi0wLjIsMC4zLTAuMg0KCQlDMTAsNi45LDEwLjQsNywxMC43LDcuM2MwLjEsMC4xLDAuMiwwLjIsMC4yLDAuM0MxMSw3LjcsMTEsNy45LDExLDhjMCwwLjMtMC4xLDAuNS0wLjMsMC43QzEwLjUsOC45LDEwLjMsOSwxMCw5eiIvPg0KPC9nPg0KPGc+DQoJPHBhdGggZD0iTTEzLDljLTAuMSwwLTAuMywwLTAuNC0wLjFjLTAuMS0wLjEtMC4yLTAuMS0wLjMtMC4yYy0wLjEtMC4xLTAuMi0wLjItMC4yLTAuM0MxMiw4LjMsMTIsOC4xLDEyLDhjMC0wLjEsMC0wLjMsMC4xLTAuNA0KCQljMC4xLTAuMSwwLjEtMC4yLDAuMi0wLjNjMC40LTAuNCwxLTAuNCwxLjQsMGMwLjEsMC4xLDAuMiwwLjIsMC4yLDAuM0MxNCw3LjcsMTQsNy45LDE0LDhjMCwwLjEsMCwwLjMtMC4xLDAuNA0KCQljLTAuMSwwLjEtMC4xLDAuMi0wLjIsMC4zQzEzLjUsOC45LDEzLjMsOSwxMyw5eiIvPg0KPC9nPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI3LDVINUMzLjksNSwzLDUuOSwzLDd2MThjMCwxLjEsMC45LDIsMiwyaDIyYzEuMSwwLDItMC45LDItMlY3QzI5LDUuOSwyOC4xLDUsMjcsNXoiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMywyM0g5Yy0xLjEsMC0yLTAuOS0yLTJ2LTRjMC0xLjEsMC45LTIsMi0yaDE0YzEuMSwwLDIsMC45LDIsMnY0QzI1LDIyLjEsMjQuMSwyMywyMywyM3oiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE1LDE5IDE2LDIwIDE4LDE4ICIvPg0KPC9zdmc+DQo=", "name": "TwoChoicesDialogBoxes", @@ -200,7 +200,8 @@ "bitmapFontResourceName": "8BitOperatorPlus8Regular_Edited.fnt", "textureAtlasResourceName": "8BitOperatorPlus8Regular_Edited.png", "align": "left", - "wordWrap": true + "wordWrap": true, + "verticalTextAlignment": "top" } } ], @@ -1331,8 +1332,7 @@ "hidden": true, "name": "_PropertyMapping" } - ], - "variants": [] + ] } ] } \ No newline at end of file From 9de13823671f21616c42450e8d5b113af412e188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 1 Jul 2025 17:20:41 +0200 Subject: [PATCH 07/11] [Button] Add condition for checking label text --- extensions/reviewed/PanelSpriteButton.json | 70 ++++++++++++---------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 7317facec..56fd68bf1 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -1118,8 +1118,6 @@ "type": "Boolean", "label": "", "description": "Should check hovering", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShouldCheckHovering" }, @@ -1127,8 +1125,6 @@ "value": "Idle", "type": "Choice", "label": "State", - "description": "", - "group": "", "extraInformation": [ "Idle", "Hovered", @@ -1143,9 +1139,6 @@ "value": "0", "type": "Number", "label": "Touch id", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -1153,9 +1146,6 @@ "value": "", "type": "Boolean", "label": "Touch is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIsInside" }, @@ -1163,9 +1153,6 @@ "value": "", "type": "Boolean", "label": "Mouse is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MouseIsInside" }, @@ -1173,9 +1160,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "Index" } @@ -2260,6 +2244,7 @@ "fullName": "Label text", "functionType": "Action", "name": "SetLabelText", + "private": true, "sentence": "Change the text of _PARAM0_ to _PARAM1_", "events": [ { @@ -2296,11 +2281,46 @@ "objectGroups": [] }, { - "description": "Return the label text.", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LabelText", + "name": "SetLabelTextOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Label", + "Text", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the label text.", "fullName": "Label text", - "functionType": "StringExpression", + "functionType": "ExpressionAndCondition", "name": "LabelText", - "sentence": "", + "sentence": "the label text", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -2537,9 +2557,6 @@ "value": "", "type": "String", "label": "Label", - "description": "", - "group": "", - "extraInformation": [], "name": "LabelText" }, { @@ -2547,9 +2564,7 @@ "type": "Number", "unit": "Second", "label": "Hovered fade out duration", - "description": "", "group": "States", - "extraInformation": [], "name": "HoveredFadeOutDuration" }, { @@ -2557,9 +2572,7 @@ "type": "Number", "unit": "Pixel", "label": "Label offset on Y axis when pressed", - "description": "", "group": "States", - "extraInformation": [], "name": "PressedLabelOffsetY" }, { @@ -2567,9 +2580,6 @@ "type": "Number", "unit": "Pixel", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "LabelOffset" }, @@ -2577,8 +2587,6 @@ "value": "", "type": "Choice", "label": "", - "description": "", - "group": "", "extraInformation": [ "Label.Text=LabelText" ], From 61b55a2851580efba283a75d61fcf8bce487d0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Sun, 20 Jul 2025 12:01:04 +0200 Subject: [PATCH 08/11] Declare breaking changes. --- extensions/reviewed/PanelSpriteButton.json | 8 +++++++- extensions/reviewed/TwoChoicesDialogBoxes.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 56fd68bf1..af8a9bfbd 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -9,7 +9,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.6.0", + "version": "2.0.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.", "", @@ -26,6 +26,12 @@ "authorIds": [ "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." + } + ], "dependencies": [], "globalVariables": [], "sceneVariables": [], diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index 54b0c50e1..c5d340ba6 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -9,7 +9,7 @@ "name": "TwoChoicesDialogBoxes", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0842ffc478006e9b6687fca9a5761494c4efd1df873220637af5b4ac7253f850_Interface Elements_interface_ui_window_application_app_button_cta.svg", "shortDescription": "A dialog box with buttons to let users make a choice.", - "version": "0.2.1", + "version": "0.3.0", "description": [ "A dialog box showing multiple options (usually \"yes\" and \"no\") and a customizable text message.", "It handles keyboard, gamepad and touch controls." From c361c757c0a5831a783cdcf48c59ba165fa4fecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Sun, 20 Jul 2025 19:11:58 +0200 Subject: [PATCH 09/11] Set the label property as multi-line. --- extensions/reviewed/PanelSpriteButton.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index af8a9bfbd..e2b8be1a4 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -2561,7 +2561,7 @@ "propertyDescriptors": [ { "value": "", - "type": "String", + "type": "MultilineString", "label": "Label", "name": "LabelText" }, From 31ee95e25d06bc59c81377a92a98fabe122dcc93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 21 Jul 2025 16:50:38 +0200 Subject: [PATCH 10/11] Hide deprecated property. --- .../reviewed/TwoChoicesDialogBoxes.json | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index c5d340ba6..8064424a6 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -1074,7 +1074,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "ActiveButtonById" + "HighlightedButtonIndex" ] } ] @@ -1110,7 +1110,7 @@ "value": "SetNumberVariable" }, "parameters": [ - "ActiveButtonById", + "HighlightedButtonIndex", "=", "mod(Value, SceneInstancesCount(Buttons))" ] @@ -1128,7 +1128,7 @@ "Buttons", "ID", "=", - "ActiveButtonById" + "HighlightedButtonIndex" ] } ], @@ -1157,7 +1157,7 @@ "Buttons", "ID", "!=", - "ActiveButtonById" + "HighlightedButtonIndex" ] } ], @@ -1275,29 +1275,21 @@ "value": "Default message. Continue?", "type": "String", "label": "Message", - "description": "", - "group": "", - "extraInformation": [], "name": "TextMessage" }, { "value": "0", "type": "Number", "unit": "Dimensionless", - "label": "Default highlighted button identifier", - "description": "Default highlighted button identifier.", - "group": "", - "extraInformation": [], - "deprecated": true, - "name": "ActiveButtonById" + "label": "", + "hidden": true, + "name": "HighlightedButtonIndex" }, { "value": "true", "type": "Boolean", "label": "Cancel with Escape key", "description": "Enable or disable the escape key to close the dialog.", - "group": "", - "extraInformation": [], "name": "EnableEscape" }, { @@ -1305,8 +1297,6 @@ "type": "String", "label": "Label for the \"Yes\" button", "description": "This is the button with identifier 0.", - "group": "", - "extraInformation": [], "name": "LabelButtonID0" }, { @@ -1314,16 +1304,12 @@ "type": "String", "label": "Label for the \"No\" button", "description": "This is the button with identifier 1.", - "group": "", - "extraInformation": [], "name": "LabelButtonID1" }, { "value": "", "type": "Choice", "label": "", - "description": "", - "group": "", "extraInformation": [ "YesButton.LabelText=LabelButtonID0", "NoButton.LabelText=LabelButtonID1", From d52af83cf238ca460d10741db9eb65b51fbb56c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 21 Jul 2025 17:03:42 +0200 Subject: [PATCH 11/11] Allow multi-line text. --- extensions/reviewed/TwoChoicesDialogBoxes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index 8064424a6..309c0ce95 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -1273,7 +1273,7 @@ "propertyDescriptors": [ { "value": "Default message. Continue?", - "type": "String", + "type": "MultilineString", "label": "Message", "name": "TextMessage" },