mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-09 00:38:00 +08:00
fix: 工具栏缩放修改后图标大小不变
This commit is contained in:
parent
d613ab5ae0
commit
cbc09e6b86
@ -54,7 +54,7 @@ interface MiscInfo {
|
|||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
emit: MiscEmitFn;
|
emit: MiscEmitFn;
|
||||||
display: Component;
|
display: () => Component;
|
||||||
activable?: boolean;
|
activable?: boolean;
|
||||||
actived?: ActivedFn;
|
actived?: ActivedFn;
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ interface Misc {
|
|||||||
id: string,
|
id: string,
|
||||||
name: string,
|
name: string,
|
||||||
emit: MiscEmitFn,
|
emit: MiscEmitFn,
|
||||||
display: Component
|
display: () => Component
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,7 +292,7 @@ function MiscTool(props: CustomToolbarProps<'misc'>) {
|
|||||||
style={style}
|
style={style}
|
||||||
onClick={() => info.emit(v, toolbar, item)}
|
onClick={() => info.emit(v, toolbar, item)}
|
||||||
>
|
>
|
||||||
{info.display}
|
{info.display()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@ -759,10 +759,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
MotaSettingItem<number>
|
MotaSettingItem<number>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register('danmaku', '发弹幕', openDanmakuPoster, () =>
|
||||||
'danmaku',
|
|
||||||
'发弹幕',
|
|
||||||
openDanmakuPoster,
|
|
||||||
h(MessageOutlined)
|
h(MessageOutlined)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
@ -771,13 +768,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.useItem('book', true);
|
core.useItem('book', true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.book.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.book.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'fly',
|
'fly',
|
||||||
@ -785,13 +784,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.useItem('fly', true);
|
core.useItem('fly', true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.fly.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.fly.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'toolbox',
|
'toolbox',
|
||||||
@ -799,13 +800,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
mainUi.open('toolbox');
|
mainUi.open('toolbox');
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.toolbox.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.toolbox.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'equipbox',
|
'equipbox',
|
||||||
@ -813,13 +816,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
mainUi.open('equipbox');
|
mainUi.open('equipbox');
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.equipbox.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.equipbox.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'virtualKey',
|
'virtualKey',
|
||||||
@ -834,13 +839,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.keyboard.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.keyboard.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'shop',
|
'shop',
|
||||||
@ -848,13 +855,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.openQuickShop(true);
|
core.openQuickShop(true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.shop.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.shop.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'save',
|
'save',
|
||||||
@ -862,13 +871,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.save(true);
|
core.save(true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.save.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.save.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'load',
|
'load',
|
||||||
@ -876,13 +887,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.load(true);
|
core.load(true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.load.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.load.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'undo',
|
'undo',
|
||||||
@ -890,7 +903,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.doSL('autoSave', 'load');
|
core.doSL('autoSave', 'load');
|
||||||
},
|
},
|
||||||
h(RollbackOutlined)
|
() => h(RollbackOutlined)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'redo',
|
'redo',
|
||||||
@ -898,7 +911,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.doSL('autoSave', 'reload');
|
core.doSL('autoSave', 'reload');
|
||||||
},
|
},
|
||||||
h(RetweetOutlined)
|
() => h(RetweetOutlined)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'setting',
|
'setting',
|
||||||
@ -906,13 +919,15 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
() => {
|
() => {
|
||||||
core.openSettings(true);
|
core.openSettings(true);
|
||||||
},
|
},
|
||||||
<img
|
() => (
|
||||||
src={core.statusBar.icons.settings.src}
|
<img
|
||||||
style={{
|
src={core.statusBar.icons.settings.src}
|
||||||
'object-fit': 'contain',
|
style={{
|
||||||
width: `${(scale.value / 100) * 32}px`
|
'object-fit': 'contain',
|
||||||
}}
|
width: `${(scale.value / 100) * 32}px`
|
||||||
></img>
|
}}
|
||||||
|
></img>
|
||||||
|
)
|
||||||
);
|
);
|
||||||
CustomToolbar.misc.register(
|
CustomToolbar.misc.register(
|
||||||
'minimap',
|
'minimap',
|
||||||
@ -956,7 +971,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
|||||||
}
|
}
|
||||||
tool.refresh();
|
tool.refresh();
|
||||||
},
|
},
|
||||||
h(LayoutOutlined)
|
() => h(LayoutOutlined)
|
||||||
);
|
);
|
||||||
|
|
||||||
CustomToolbar.misc.bindActivable('minimap', true, () => minimapTool);
|
CustomToolbar.misc.bindActivable('minimap', true, () => minimapTool);
|
||||||
|
Loading…
Reference in New Issue
Block a user