添加灯光模式

This commit is contained in:
zhw2590582 committed 2020-02-29 09:37:06 +08:00
1 parent 4867d8e25a
commit 3379e6091c
18 files changed
+170 -54

No files matched your search

@@ -1,9 +0,0 @@
export default function close(option) {
return art => ({
...option,
html: art.i18n.get('Close'),
click: contextmenu => {
contextmenu.show = false;
},
});
}
+4 -4
View File
@@ -4,7 +4,7 @@ import playbackRate from './playbackRate';
import aspectRatio from './aspectRatio';
import info from './info';
import version from './version';
import close from './close';
import light from './light';
export default class Contextmenu extends Component {
constructor(art) {
@@ -54,9 +54,9 @@ export default class Contextmenu extends Component {
);
this.add(
close({
disable: false,
name: 'close',
light({
disable: !option.light,
name: 'light',
index: 50,
}),
);
@@ -0,0 +1,18 @@
export default function light(option) {
return art => {
const { i18n, player } = art;
return {
...option,
html: i18n.get('Light Off'),
click: contextmenu => {
player.light = !player.light;
contextmenu.show = false;
},
mounted: $menu => {
art.on('light', value => {
$menu.innerText = i18n.get(value ? 'Light On' : 'Light Off');
});
},
};
};
}