Skip to content

Commit

Permalink
Sort 3D effects to show light and fog effects first (#6437)
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Mar 8, 2024
1 parent cea1cf2 commit 339929e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Extensions/3D/JsExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ module.exports = {
{
const effect = extension
.addEffect('BrightnessAndContrast')
.setFullName(_('Brightness and contrast.'))
.setFullName(_('Brightness and contrast'))
.setDescription(
_(
'Adjust brightness and contrast.'
Expand Down
23 changes: 22 additions & 1 deletion newIDE/app/src/EffectsList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,28 @@ export default function EffectsList(props: Props) {
);

const all3DEffectMetadata = React.useMemo(
() => allEffectMetadata.filter(effect => effect.isMarkedAsOnlyWorkingFor3D),
() => {
const lightEffectMetadata = [];
const fogEffectMetadata = [];
const otherEffectMetadata = [];
for (const effect of allEffectMetadata) {
if (!effect.isMarkedAsOnlyWorkingFor3D) {
continue;
}
if (effect.type.endsWith('Light')) {
lightEffectMetadata.push(effect);
} else if (effect.type.endsWith('Fog')) {
fogEffectMetadata.push(effect);
} else {
otherEffectMetadata.push(effect);
}
}
return [
...lightEffectMetadata,
...fogEffectMetadata,
...otherEffectMetadata,
];
},
[allEffectMetadata]
);

Expand Down

0 comments on commit 339929e

Please sign in to comment.