Fix function name collision between event-based objects from the same extension (#4598)

This commit is contained in:
D8H
2022-11-30 14:10:52 +01:00
committed by GitHub
parent 7452358656
commit 32279f02e9

View File

@@ -110,7 +110,7 @@ export const declareObjectMetadata = (
const objectType = eventsBasedObject.getName(); const objectType = eventsBasedObject.getName();
objectMetadata objectMetadata
.addAction( .addScopedAction(
'Width', 'Width',
i18n._('Width'), i18n._('Width'),
i18n._('Change the width of an object.'), i18n._('Change the width of an object.'),
@@ -126,8 +126,27 @@ export const declareObjectMetadata = (
.setFunctionName('setWidth') .setFunctionName('setWidth')
.setGetter('getWidth'); .setGetter('getWidth');
// Deprecated
objectMetadata objectMetadata
.addAction( .addAction(
'Width',
i18n._('Width'),
i18n._('Change the width of an object.'),
i18n._('the width'),
i18n._('Size'),
'res/actions/scaleWidth24_black.png',
'res/actions/scale_black.png'
)
.setHidden()
.addParameter('object', i18n._('Object'), objectType)
.useStandardOperatorParameters('number')
.markAsAdvanced()
.getCodeExtraInformation()
.setFunctionName('setWidth')
.setGetter('getWidth');
objectMetadata
.addScopedAction(
'Height', 'Height',
i18n._('Height'), i18n._('Height'),
i18n._('Change the height of an object.'), i18n._('Change the height of an object.'),
@@ -143,6 +162,43 @@ export const declareObjectMetadata = (
.setFunctionName('setHeight') .setFunctionName('setHeight')
.setGetter('getHeight'); .setGetter('getHeight');
// Deprecated
objectMetadata
.addAction(
'Height',
i18n._('Height'),
i18n._('Change the height of an object.'),
i18n._('the height'),
i18n._('Size'),
'res/actions/scaleHeight24_black.png',
'res/actions/scale_black.png'
)
.setHidden()
.addParameter('object', i18n._('Object'), objectType)
.useStandardOperatorParameters('number')
.markAsAdvanced()
.getCodeExtraInformation()
.setFunctionName('setHeight')
.setGetter('getHeight');
objectMetadata
.addScopedAction(
'Scale',
i18n._('Scale'),
i18n._('Modify the scale of the specified object.'),
i18n._('the scale'),
i18n._('Size'),
'res/actions/scale24_black.png',
'res/actions/scale_black.png'
)
.addParameter('object', i18n._('Object'), objectType)
.useStandardOperatorParameters('number')
.markAsAdvanced()
.getCodeExtraInformation()
.setFunctionName('setScale')
.setGetter('getScale');
// Deprecated
objectMetadata objectMetadata
.addAction( .addAction(
'Scale', 'Scale',
@@ -153,6 +209,7 @@ export const declareObjectMetadata = (
'res/actions/scale24_black.png', 'res/actions/scale24_black.png',
'res/actions/scale_black.png' 'res/actions/scale_black.png'
) )
.setHidden()
.addParameter('object', i18n._('Object'), objectType) .addParameter('object', i18n._('Object'), objectType)
.useStandardOperatorParameters('number') .useStandardOperatorParameters('number')
.markAsAdvanced() .markAsAdvanced()
@@ -193,7 +250,7 @@ export const declareObjectMetadata = (
.setGetter('getScaleY'); .setGetter('getScaleY');
objectMetadata objectMetadata
.addAction( .addScopedAction(
'FlipX', 'FlipX',
i18n._('Flip the object horizontally'), i18n._('Flip the object horizontally'),
i18n._('Flip the object horizontally'), i18n._('Flip the object horizontally'),
@@ -208,8 +265,26 @@ export const declareObjectMetadata = (
.getCodeExtraInformation() .getCodeExtraInformation()
.setFunctionName('flipX'); .setFunctionName('flipX');
// Deprecated
objectMetadata objectMetadata
.addAction( .addAction(
'FlipX',
i18n._('Flip the object horizontally'),
i18n._('Flip the object horizontally'),
i18n._('Flip horizontally _PARAM0_: _PARAM1_'),
i18n._('Effects'),
'res/actions/flipX24.png',
'res/actions/flipX.png'
)
.setHidden()
.addParameter('object', i18n._('Object'), objectType)
.addParameter('yesorno', i18n._('Activate flipping'))
.markAsSimple()
.getCodeExtraInformation()
.setFunctionName('flipX');
objectMetadata
.addScopedAction(
'FlipY', 'FlipY',
i18n._('Flip the object vertically'), i18n._('Flip the object vertically'),
i18n._('Flip the object vertically'), i18n._('Flip the object vertically'),
@@ -225,7 +300,24 @@ export const declareObjectMetadata = (
.setFunctionName('flipY'); .setFunctionName('flipY');
objectMetadata objectMetadata
.addCondition( .addAction(
'FlipY',
i18n._('Flip the object vertically'),
i18n._('Flip the object vertically'),
i18n._('Flip vertically _PARAM0_: _PARAM1_'),
i18n._('Effects'),
'res/actions/flipY24.png',
'res/actions/flipY.png'
)
.setHidden()
.addParameter('object', i18n._('Object'), objectType)
.addParameter('yesorno', i18n._('Activate flipping'))
.markAsSimple()
.getCodeExtraInformation()
.setFunctionName('flipY');
objectMetadata
.addScopedCondition(
'FlippedX', 'FlippedX',
i18n._('Horizontally flipped'), i18n._('Horizontally flipped'),
i18n._('Check if the object is horizontally flipped'), i18n._('Check if the object is horizontally flipped'),
@@ -238,6 +330,37 @@ export const declareObjectMetadata = (
.getCodeExtraInformation() .getCodeExtraInformation()
.setFunctionName('isFlippedX'); .setFunctionName('isFlippedX');
// Deprecated
objectMetadata
.addCondition(
'FlippedX',
i18n._('Horizontally flipped'),
i18n._('Check if the object is horizontally flipped'),
i18n._('_PARAM0_ is horizontally flipped'),
i18n._('Effects'),
'res/actions/flipX24.png',
'res/actions/flipX.png'
)
.setHidden()
.addParameter('object', i18n._('Object'), objectType)
.getCodeExtraInformation()
.setFunctionName('isFlippedX');
objectMetadata
.addScopedCondition(
'FlippedY',
i18n._('Vertically flipped'),
i18n._('Check if the object is vertically flipped'),
i18n._('_PARAM0_ is vertically flipped'),
i18n._('Effects'),
'res/actions/flipY24.png',
'res/actions/flipY.png'
)
.addParameter('object', i18n._('Object'), objectType)
.getCodeExtraInformation()
.setFunctionName('isFlippedY');
// Deprecated
objectMetadata objectMetadata
.addCondition( .addCondition(
'FlippedY', 'FlippedY',
@@ -248,6 +371,7 @@ export const declareObjectMetadata = (
'res/actions/flipY24.png', 'res/actions/flipY24.png',
'res/actions/flipY.png' 'res/actions/flipY.png'
) )
.setHidden()
.addParameter('object', i18n._('Object'), objectType) .addParameter('object', i18n._('Object'), objectType)
.getCodeExtraInformation() .getCodeExtraInformation()
.setFunctionName('isFlippedY'); .setFunctionName('isFlippedY');