From 4ec36b948566a4f4e43a625ac8a7228c15d4043b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 1 Oct 2026 11:24:29 +0200 Subject: [PATCH 1/2] [Reviewed] [Tiled bar] Fix a crash when there is no instance of the child object Bar --- extensions/reviewed/TiledUnitsBar.json | 190 +++++++++++++++++++++++-- 1 file changed, 176 insertions(+), 14 deletions(-) diff --git a/extensions/reviewed/TiledUnitsBar.json b/extensions/reviewed/TiledUnitsBar.json index 7427c6e78..4c81cdde4 100644 --- a/extensions/reviewed/TiledUnitsBar.json +++ b/extensions/reviewed/TiledUnitsBar.json @@ -1,6 +1,7 @@ { "author": "", "category": "User interface", + "dimension": "2D", "extensionNamespace": "", "fullName": "Resource bar (separated units)", "gdevelopVersion": ">=5.5.230", @@ -9,8 +10,7 @@ "name": "TiledUnitsBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/063e9152cf65bc0f3be2a828afd950c3ecf1b1fc72feefdc2467252fe987dc0f_dots-horizontal.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "dimension": "2D", - "version": "2.0.1", + "version": "2.0.2", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -61,11 +61,15 @@ "}", "const { anchors } = gdjs._TiledUnitsBarExtension;", "", - "const object = objects[0];", - "/** @type {gdjs.AnchorRuntimeBehavior} */", - "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", - "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", - "" + "if (objects.length === 0) {", + " eventsFunctionContext.returnValue = \"None\";", + "}", + "else {", + " const object = objects[0];", + " /** @type {gdjs.AnchorRuntimeBehavior} */", + " const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + " eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "}" ], "parameterObjects": "Object", "useStrict": true, @@ -107,11 +111,15 @@ "}", "const { anchors } = gdjs._TiledUnitsBarExtension;", "", - "const object = objects[0];", - "/** @type {gdjs.AnchorRuntimeBehavior} */", - "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", - "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", - "" + "if (objects.length === 0) {", + " eventsFunctionContext.returnValue = \"None\";", + "}", + "else {", + " const object = objects[0];", + " /** @type {gdjs.AnchorRuntimeBehavior} */", + " const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + " eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "}" ], "parameterObjects": "Object", "useStrict": true, @@ -138,12 +146,26 @@ "objectGroups": [] } ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "LeftEdgeAnchor" + }, + { + "functionName": "RightEdgeAnchor" + } + ] + }, "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar", + "helpPath": "", + "iconUrl": "", "name": "ResourceBar", "objectType": "", + "previewIconUrl": "", "private": true, "eventsFunctions": [ { @@ -386,6 +408,7 @@ "fullName": "", "functionType": "ActionWithOperator", "getterName": "MaxValue", + "group": "Resource bar configuration", "name": "SetMaxValue", "sentence": "", "events": [ @@ -641,6 +664,7 @@ "fullName": "", "functionType": "ActionWithOperator", "getterName": "PreviousHighValueDuration", + "group": "Resource bar configuration", "name": "SetPreviousHighValueDuration", "sentence": "", "events": [ @@ -738,6 +762,52 @@ "objectGroups": [] } ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "Value" + }, + { + "functionName": "SetValue" + }, + { + "folderName": "Resource bar configuration", + "children": [ + { + "functionName": "MaxValue" + }, + { + "functionName": "SetMaxValue" + }, + { + "functionName": "PreviousHighValueDuration" + }, + { + "functionName": "SetPreviousHighValueDuration" + } + ] + }, + { + "functionName": "IsEmpty" + }, + { + "functionName": "IsFull" + }, + { + "functionName": "PreviousHighValue" + }, + { + "functionName": "UpdatePreviousHighValue" + }, + { + "functionName": "IsChanging" + } + ] + }, "propertyDescriptors": [ { "value": "1", @@ -765,7 +835,23 @@ "name": "PreviousHighValueDuration" } ], - "sharedPropertyDescriptors": [] + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "CurrentValue" + }, + { + "propertyName": "MaxValue" + }, + { + "propertyName": "PreviousHighValue" + }, + { + "propertyName": "PreviousHighValueDuration" + } + ] + } } ], "eventsBasedObjects": [ @@ -780,9 +866,12 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", + "helpPath": "", + "iconUrl": "", "isInnerAreaFollowingParentSize": true, "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", + "previewIconUrl": "", "objects": [ { "assetStoreId": "", @@ -883,6 +972,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -958,6 +1048,7 @@ "initialVariables": [] } ], + "editionSettings": {}, "eventsFunctions": [ { "fullName": "", @@ -1191,6 +1282,7 @@ "fullName": "", "functionType": "ActionWithOperator", "getterName": "Value", + "group": "Resource bar", "name": "SetValue", "sentence": "", "events": [ @@ -1290,6 +1382,7 @@ "fullName": "", "functionType": "ActionWithOperator", "getterName": "MaxValue", + "group": "Resource bar configuration", "name": "SetMaxValue", "sentence": "", "events": [ @@ -1468,6 +1561,7 @@ "fullName": "", "functionType": "ActionWithOperator", "getterName": "UnitWidth", + "group": "Resource bar configuration", "name": "SetUnitWidth", "private": true, "sentence": "", @@ -1720,6 +1814,57 @@ "objectGroups": [] } ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "onCreated" + }, + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "onHotReloading" + }, + { + "folderName": "Resource bar", + "children": [ + { + "functionName": "Value" + }, + { + "functionName": "SetValue" + }, + { + "functionName": "IsEmpty" + }, + { + "functionName": "IsFull" + } + ] + }, + { + "folderName": "Resource bar configuration", + "children": [ + { + "functionName": "MaxValue" + }, + { + "functionName": "SetMaxValue" + }, + { + "functionName": "UnitWidth" + }, + { + "functionName": "SetUnitWidth" + } + ] + }, + { + "functionName": "UpdateBarWidth" + } + ] + }, "propertyDescriptors": [ { "value": "3", @@ -1751,7 +1896,24 @@ "description": "How much pixels to show for a value of 1.", "name": "UnitWidth" } - ] + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "MaxValue" + }, + { + "propertyName": "InitialValue" + }, + { + "propertyName": "PreviousInitialValue" + }, + { + "propertyName": "UnitWidth" + } + ] + } } ] } From 6862b8b53eae04f2ebc098f43be653a6c2caf833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 1 Oct 2026 11:38:46 +0200 Subject: [PATCH 2/2] Update JS usage --- scripts/lib/ExtensionsValidatorExceptions.js | 123 ++++++++++--------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/scripts/lib/ExtensionsValidatorExceptions.js b/scripts/lib/ExtensionsValidatorExceptions.js index 46769b943..ad4136716 100644 --- a/scripts/lib/ExtensionsValidatorExceptions.js +++ b/scripts/lib/ExtensionsValidatorExceptions.js @@ -295,6 +295,12 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + Flash: { + gdjsAllowedProperties: ['SpriteRuntimeObject'], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, HedgehogPlatformer: { gdjsAllowedProperties: [ '__hedgehogPlatformerExtension', @@ -338,6 +344,28 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + Light3D: { + gdjsAllowedProperties: [ + '__light3DExtension', + 'CustomRuntimeObject', + 'CustomRuntimeObjectInstanceContainer', + 'CustomRuntimeObject3DRenderer', + 'CustomRuntimeObject3D', + 'registerRuntimeScenePreEventsCallback', + 'registerInGameEditorPostStepCallback', + 'scene3d', + 'RuntimeScene', + ], + gdjsEvtToolsAllowedProperties: ['camera'], + runtimeSceneAllowedProperties: [ + '__spotLight3DExtension', + '__pointLight3DExtension', + 'getScene', + '__lightManager', + 'getRenderer3DInverseWorldScale', + ], + javaScriptObjectAllowedProperties: ['getPrototypeOf'], + }, LinkTools: { gdjsAllowedProperties: ['LinksManager'], gdjsEvtToolsAllowedProperties: ['object'], @@ -393,6 +421,12 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + ObjectPickingTools: { + gdjsAllowedProperties: [], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: ['getObjects'], + javaScriptObjectAllowedProperties: [], + }, ObjectSlicer: { gdjsAllowedProperties: ['_objectSlicer'], gdjsEvtToolsAllowedProperties: [], @@ -457,6 +491,22 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + PlayerAvatar: { + gdjsAllowedProperties: ['_extensionAvatar', 'multiplayerMessageManager'], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, + PlaygamaBridge: { + gdjsAllowedProperties: [ + '_playgamaBridgeExtension', + 'registerRuntimeScenePostEventsCallback', + 'projectData', + ], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, PokiGamesSDKHtml: { gdjsAllowedProperties: ['_pokiGamesSDKHtmlExtension'], gdjsEvtToolsAllowedProperties: [], @@ -524,6 +574,18 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, + Share: { + gdjsAllowedProperties: ['_shareExtension'], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, + Sky3D: { + gdjsAllowedProperties: ['__Sky3DExtension'], + gdjsEvtToolsAllowedProperties: [], + runtimeSceneAllowedProperties: [], + javaScriptObjectAllowedProperties: [], + }, Sprite3D: { gdjsAllowedProperties: [ '__sprite3DExtension', @@ -534,28 +596,6 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, - Light3D: { - gdjsAllowedProperties: [ - '__light3DExtension', - 'CustomRuntimeObject', - 'CustomRuntimeObjectInstanceContainer', - 'CustomRuntimeObject3DRenderer', - 'CustomRuntimeObject3D', - 'registerRuntimeScenePreEventsCallback', - 'registerInGameEditorPostStepCallback', - 'scene3d', - 'RuntimeScene', - ], - gdjsEvtToolsAllowedProperties: ['camera'], - runtimeSceneAllowedProperties: [ - '__spotLight3DExtension', - '__pointLight3DExtension', - 'getScene', - '__lightManager', - 'getRenderer3DInverseWorldScale', - ], - javaScriptObjectAllowedProperties: ['getPrototypeOf'], - }, SpriteMultitouchJoystick: { gdjsAllowedProperties: [], gdjsEvtToolsAllowedProperties: ['input'], @@ -667,45 +707,6 @@ const extensionsAllowedProperties = { runtimeSceneAllowedProperties: [], javaScriptObjectAllowedProperties: [], }, - Share: { - gdjsAllowedProperties: ['_shareExtension'], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: [], - javaScriptObjectAllowedProperties: [], - }, - Flash: { - gdjsAllowedProperties: ['SpriteRuntimeObject'], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: [], - javaScriptObjectAllowedProperties: [], - }, - ObjectPickingTools: { - gdjsAllowedProperties: [], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: ['getObjects'], - javaScriptObjectAllowedProperties: [], - }, - PlaygamaBridge: { - gdjsAllowedProperties: [ - '_playgamaBridgeExtension', - 'registerRuntimeScenePostEventsCallback', - ], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: [], - javaScriptObjectAllowedProperties: [], - }, - Sky3D: { - gdjsAllowedProperties: ['__Sky3DExtension'], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: [], - javaScriptObjectAllowedProperties: [], - }, - PlayerAvatar: { - gdjsAllowedProperties: ['_extensionAvatar', 'multiplayerMessageManager'], - gdjsEvtToolsAllowedProperties: [], - runtimeSceneAllowedProperties: [], - javaScriptObjectAllowedProperties: [], - }, }, };