WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 339929e

Browse files
authored
Sort 3D effects to show light and fog effects first (#6437)
1 parent cea1cf2 commit 339929e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Extensions/3D/JsExtension.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ module.exports = {
20142014
{
20152015
const effect = extension
20162016
.addEffect('BrightnessAndContrast')
2017-
.setFullName(_('Brightness and contrast.'))
2017+
.setFullName(_('Brightness and contrast'))
20182018
.setDescription(
20192019
_(
20202020
'Adjust brightness and contrast.'

newIDE/app/src/EffectsList/index.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,28 @@ export default function EffectsList(props: Props) {
426426
);
427427

428428
const all3DEffectMetadata = React.useMemo(
429-
() => allEffectMetadata.filter(effect => effect.isMarkedAsOnlyWorkingFor3D),
429+
() => {
430+
const lightEffectMetadata = [];
431+
const fogEffectMetadata = [];
432+
const otherEffectMetadata = [];
433+
for (const effect of allEffectMetadata) {
434+
if (!effect.isMarkedAsOnlyWorkingFor3D) {
435+
continue;
436+
}
437+
if (effect.type.endsWith('Light')) {
438+
lightEffectMetadata.push(effect);
439+
} else if (effect.type.endsWith('Fog')) {
440+
fogEffectMetadata.push(effect);
441+
} else {
442+
otherEffectMetadata.push(effect);
443+
}
444+
}
445+
return [
446+
...lightEffectMetadata,
447+
...fogEffectMetadata,
448+
...otherEffectMetadata,
449+
];
450+
},
430451
[allEffectMetadata]
431452
);
432453

0 commit comments

Comments
 (0)