mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-17 20:54:30 +08:00
fix: 怪物手册
This commit is contained in:
1 parent
32f57cafec
commit
8cea9ba7f4
9 files changed
+34
-41
No files matched your search
+1
-6
@@ -71,6 +71,7 @@ const scroll = ref(0);
|
||||
const drag = ref(false);
|
||||
const detail = ref(false);
|
||||
const selected = ref(0);
|
||||
let detailClosing = false;
|
||||
|
||||
const settingScale = mainSetting.getValue('ui.bookScale', 100) / 100;
|
||||
const scale = isMobile
|
||||
@@ -100,8 +101,6 @@ function select(enemy: ToShowEnemy, index: number) {
|
||||
*/
|
||||
async function hide() {
|
||||
const div = document.getElementById('book') as HTMLDivElement;
|
||||
div.style.opacity = '0';
|
||||
await sleep(600);
|
||||
div.style.display = 'none';
|
||||
}
|
||||
|
||||
@@ -110,7 +109,6 @@ async function hide() {
|
||||
*/
|
||||
async function closeDetail() {
|
||||
show();
|
||||
await sleep(600);
|
||||
detail.value = false;
|
||||
}
|
||||
|
||||
@@ -120,8 +118,6 @@ async function closeDetail() {
|
||||
async function show() {
|
||||
const div = document.getElementById('book') as HTMLDivElement;
|
||||
div.style.display = 'flex';
|
||||
await sleep(50);
|
||||
div.style.opacity = '1';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,7 +199,6 @@ onUnmounted(() => {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
transition: opacity 0.6s linear;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
@@ -132,8 +132,6 @@ onMounted(async () => {
|
||||
let moved = false;
|
||||
let pos = [0, 0];
|
||||
|
||||
await sleep(600);
|
||||
|
||||
useDrag(
|
||||
detail,
|
||||
(x, y) => {
|
||||
@@ -178,7 +176,6 @@ onUnmounted(() => {
|
||||
align-items: center;
|
||||
width: 72%;
|
||||
height: 100%;
|
||||
transition: all 0.6s ease;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -32,7 +32,7 @@
|
||||
import { onMounted, onUpdated, ref, watch } from 'vue';
|
||||
import Box from '../components/box.vue';
|
||||
import { GameUi } from '@/core/main/custom/ui';
|
||||
import type { DamageEnemy } from '@/game/enemy/damage';
|
||||
import type { DamageEnemy, EnemyInfo } from '@/game/enemy/damage';
|
||||
import { nextFrame } from '@/plugin/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -68,23 +68,23 @@ const detail = ((): [number, string, string][] => {
|
||||
[enemy.enemy.money, '金币', 'lightyellow'],
|
||||
[enemy.enemy.exp, '经验', 'lawgreen'],
|
||||
[data?.atkDelta ?? 0, '临界', 'lightsalmon'],
|
||||
[-data?.delta ?? 0, '临界减伤', 'lightpink'],
|
||||
[-enemy.calDefDamage(ratio).delta, `${ratio}防`, 'cyan']
|
||||
[data?.delta ?? 0, '临界减伤', 'lightpink'],
|
||||
[enemy.calDefDamage(ratio).delta, `${ratio}防`, 'cyan']
|
||||
];
|
||||
})();
|
||||
const special = (() => {
|
||||
const s = enemy.info.special;
|
||||
|
||||
const fromFunc = (
|
||||
func: string | ((enemy: Enemy) => string),
|
||||
enemy: Enemy
|
||||
func: string | ((enemy: EnemyInfo) => string),
|
||||
enemy: EnemyInfo
|
||||
) => {
|
||||
return typeof func === 'string' ? func : func(enemy);
|
||||
};
|
||||
|
||||
const show = s.slice(0, 2).map(v => {
|
||||
const s = Mota.require('var', 'enemySpecials')[v];
|
||||
return [fromFunc(s.name, enemy.enemy), s.color];
|
||||
return [fromFunc(s.name, enemy.info), s.color];
|
||||
});
|
||||
if (s.length > 2) show.push(['...', 'white']);
|
||||
return show;
|
||||
|
||||
Reference in new issue
Block a user