Skip to content

Commit

Permalink
Deprecate current bbtext font family action and add a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreSi committed Feb 26, 2024
1 parent 5005ec4 commit 1f4116a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Extensions/BBText/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,31 @@ module.exports = {

addSettersAndGettersToObject(object, setterAndGetterProperties, 'BBText');

object
.addAction(
`SetFontFamily2`,
_('Font family'),
_('Set font family'),
_('Set the font of _PARAM0_ to _PARAM1_'),
'',
'res/actions/font24.png',
'res/actions/font24.png'
)
.addParameter('object', 'BBText', 'BBText', false)
.addParameter('fontResource', _('Font family'), '', false)
.getCodeExtraInformation()
.setFunctionName(`setFontFamily`);

const actions = object.getAllActions();
const conditions = object.getAllConditions();
const expressions = object.getAllExpressions();

actions.get('BBText::SetOpacity').setHidden();
conditions.get('BBText::IsOpacity').setHidden();
expressions.get('GetOpacity').setHidden();
// Action deprecated because it's using the `string` type instead of the more
// user-friendly `fontResource` type.
actions.get('BBText::SetFontFamily').setHidden();

return extension;
},
Expand Down
2 changes: 1 addition & 1 deletion Extensions/TextInput/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ module.exports = {
'res/actions/font24.png',
'res/actions/font.png'
)
.addParameter('object', _('Bitmap text'), 'TextInputObject', false)
.addParameter('object', _('Text input'), 'TextInputObject', false)
.addParameter('fontResource', _('Font resource name'), '', false)
.getCodeExtraInformation()
.setFunctionName('setFontResourceName');
Expand Down

0 comments on commit 1f4116a

Please sign in to comment.