mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-29 18:53:25 +08:00
fix: 字体大小
This commit is contained in:
parent
37840ba0b0
commit
3d61d87e6c
@ -1326,7 +1326,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
|||||||
filterMap.push(
|
filterMap.push(
|
||||||
[
|
[
|
||||||
['sample0', 'sample1', 'sample2'], // 楼层列表
|
['sample0', 'sample1', 'sample2'], // 楼层列表
|
||||||
'brightness(120%)' // 滤镜内容
|
'brightness(80%)' // 滤镜内容
|
||||||
],
|
],
|
||||||
[['MT0'], 'contrast(120%)']
|
[['MT0'], 'contrast(120%)']
|
||||||
);
|
);
|
||||||
|
@ -119,7 +119,7 @@ export class MotaSetting extends EventEmitter<SettingEvent> {
|
|||||||
* @param key 要设置的设置的键
|
* @param key 要设置的设置的键
|
||||||
* @param value 要设置的值
|
* @param value 要设置的值
|
||||||
*/
|
*/
|
||||||
setValue(key: string, value: boolean | number) {
|
setValue(key: string, value: boolean | number, noEmit: boolean = false) {
|
||||||
const setting = this.getSettingBy(key.split('.'));
|
const setting = this.getSettingBy(key.split('.'));
|
||||||
if (typeof setting.value !== typeof value) {
|
if (typeof setting.value !== typeof value) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@ -130,7 +130,7 @@ export class MotaSetting extends EventEmitter<SettingEvent> {
|
|||||||
const old = setting.value as boolean | number;
|
const old = setting.value as boolean | number;
|
||||||
setting.value = value;
|
setting.value = value;
|
||||||
|
|
||||||
this.emit('valueChange', key, value, old);
|
if (!noEmit) this.emit('valueChange', key, value, old);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -348,8 +348,22 @@ function handleScreenSetting<T extends number | boolean>(
|
|||||||
o: T
|
o: T
|
||||||
) {
|
) {
|
||||||
if (key === 'fullscreen') {
|
if (key === 'fullscreen') {
|
||||||
|
const fontSize = mainSetting.getValue('screen.fontSize', 16);
|
||||||
|
const beforeIsMobile = isMobile;
|
||||||
// 全屏
|
// 全屏
|
||||||
triggerFullscreen(n as boolean);
|
triggerFullscreen(n as boolean).then(() => {
|
||||||
|
if (beforeIsMobile) {
|
||||||
|
mainSetting.setValue(
|
||||||
|
'screen.fontSize',
|
||||||
|
Math.floor((fontSize * 2) / 3)
|
||||||
|
);
|
||||||
|
} else if (isMobile) {
|
||||||
|
mainSetting.setValue(
|
||||||
|
'screen.fontSize',
|
||||||
|
Math.floor((fontSize * 3) / 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (key === 'heroDetail') {
|
} else if (key === 'heroDetail') {
|
||||||
// 勇士显伤
|
// 勇士显伤
|
||||||
core.drawHero();
|
core.drawHero();
|
||||||
@ -497,3 +511,11 @@ mainSetting
|
|||||||
.setDescription('audio.soundEnabled', `是否开启音效`)
|
.setDescription('audio.soundEnabled', `是否开启音效`)
|
||||||
.setDescription('audio.soundVolume', `音效的音量`)
|
.setDescription('audio.soundVolume', `音效的音量`)
|
||||||
.setDescription('ui.mapScale', `楼传小地图的缩放,百分比格式`);
|
.setDescription('ui.mapScale', `楼传小地图的缩放,百分比格式`);
|
||||||
|
|
||||||
|
Mota.requireAll('var').hook.once('mounted', () => {
|
||||||
|
if (storage.getValue('@@exitFromFullscreen', false)) {
|
||||||
|
const fontSize = mainSetting.getValue('screen.fontSize', 16);
|
||||||
|
mainSetting.setValue('screen.fontSize', Math.round((fontSize * 3) / 2));
|
||||||
|
}
|
||||||
|
storage.setValue('@@exitFromFullscreen', !!document.fullscreenElement);
|
||||||
|
});
|
||||||
|
@ -10,6 +10,7 @@ import { parseColor } from './webgl/utils';
|
|||||||
import { Keyboard, KeyboardEmits } from '@/core/main/custom/keyboard';
|
import { Keyboard, KeyboardEmits } from '@/core/main/custom/keyboard';
|
||||||
import { mainUi } from '@/core/main/init/ui';
|
import { mainUi } from '@/core/main/init/ui';
|
||||||
import { isAssist } from '@/core/main/custom/hotkey';
|
import { isAssist } from '@/core/main/custom/hotkey';
|
||||||
|
import { mainSetting, settingStorage } from '@/core/main/setting';
|
||||||
|
|
||||||
type CanParseCss = keyof {
|
type CanParseCss = keyof {
|
||||||
[P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string
|
[P in keyof CSSStyleDeclaration as CSSStyleDeclaration[P] extends string
|
||||||
@ -284,6 +285,8 @@ export async function triggerFullscreen(full: boolean) {
|
|||||||
maxGameScale();
|
maxGameScale();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
mainSetting.setValue('screen.fullscreen', full, true);
|
||||||
|
settingStorage.setValue('@@exitFromFullscreen', full);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -697,12 +697,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
#equipbox {
|
|
||||||
padding: 5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#equipbox-main {
|
#equipbox-main {
|
||||||
height: 90vh;
|
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
@ -717,7 +712,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#equip-list {
|
#equip-list {
|
||||||
flex-basis: 30%;
|
flex-basis: 45%;
|
||||||
|
|
||||||
#filter #sort-type {
|
#filter #sort-type {
|
||||||
font-size: 150%;
|
font-size: 150%;
|
||||||
|
@ -387,22 +387,11 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@media screen and (max-width: 600px) {
|
||||||
#toolbox {
|
|
||||||
padding: 5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tools {
|
|
||||||
transform: translateY(-50%);
|
|
||||||
span {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#toolbox-main {
|
#toolbox-main {
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
height: 90%;
|
height: 90%;
|
||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
margin-top: 20%;
|
margin-top: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-list {
|
.item-list {
|
||||||
|
Loading…
Reference in New Issue
Block a user