diff --git a/src/core/main/setting.ts b/src/core/main/setting.ts index ab5b5ed..0fff2ec 100644 --- a/src/core/main/setting.ts +++ b/src/core/main/setting.ts @@ -487,6 +487,8 @@ mainSetting .setDisplayFunc('mapScale', value => `${value}%`) .register('toolbarScale', '工具栏缩放', 100, COM.Number, [10, 500, 10]) .setDisplayFunc('toolbarScale', value => `${value}%`) + .register('bookScale', '怪物手册缩放', 100, COM.Number, [10, 500, 10]) + .setDisplayFunc('bookScale', value => `${value}%`) ) .register( 'debug', @@ -524,6 +526,7 @@ loading.once('coreInit', () => { 'ui.toolbarScale', isMobile ? 50 : Math.floor(window.innerWidth / 1700 * 10) * 10 ), + 'ui.bookScale': storage.getValue('ui.bookScale', isMobile ? 100 : 80), 'debug.frame': !!storage.getValue('debug.frame', false), }); }); @@ -550,6 +553,8 @@ mainSetting .setDescription('audio.soundEnabled', `是否开启音效`) .setDescription('audio.soundVolume', `音效的音量`) .setDescription('ui.mapScale', `楼传小地图的缩放,百分比格式`) + .setDescription('ui.toolbarScale', `自定义工具栏的缩放比例`) + .setDescription('ui.bookScale', `怪物手册界面中每个怪物框体的高度缩放,最小值限定为 20% 屏幕高度`) .setDescription('screen.fontSizeStatus', `修改状态栏的字体大小`) .setDescription('screen.blur', '打开任意ui界面时是否有背景虚化效果,移动端打开后可能会有掉帧或者发热现象。关闭ui后生效'); diff --git a/src/ui/book.vue b/src/ui/book.vue index cbaa0d3..e14fdc4 100644 --- a/src/ui/book.vue +++ b/src/ui/book.vue @@ -50,6 +50,8 @@ import { getDetailedEnemy } from '../plugin/ui/fixed'; import { GameUi } from '@/core/main/custom/ui'; import { gameKey } from '@/core/main/init/hotkey'; import { mainUi } from '@/core/main/init/ui'; +import { mainSetting } from '@/core/main/setting'; +import { isMobile } from '@/plugin/use'; const props = defineProps<{ num: number; @@ -70,6 +72,14 @@ const drag = ref(false); const detail = ref(false); const selected = ref(0); +const settingScale = mainSetting.getValue('ui.bookScale', 100) / 100; +const scale = isMobile + ? Math.max(settingScale * 15, 20) + : Math.max( + (window.innerWidth / window.innerHeight) * 15 * settingScale, + 20 + ); + /** * 选择怪物,展示详细信息 * @param enemy 选择的怪物 @@ -216,7 +226,7 @@ onUnmounted(() => { .enemy { display: flex; flex-direction: column; - height: 20vh; + height: v-bind('scale + "vh"'); width: 100%; padding: 0 1% 0 1%; } @@ -232,7 +242,7 @@ onUnmounted(() => { } .enemy { - height: 15vh; + height: v-bind('scale * 2 / 3 + "vh"'); } }