Commit cc48ea8b authored by timel's avatar timel

fix: small

parent d7e1f353
Pipeline #22411 failed with stages
in 15 minutes and 43 seconds
......@@ -136,10 +136,6 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
useEffect(() => {
setHighlight(!!idleInteractivities.length);
}, [idleInteractivities]);
const onDropdownClick: MenuProps["onClick"] = ({ key }) => {
const index = Number(key);
dropdownMenu.value?.[index]?.onClick();
};
const menuItems = useSnapshot(dropdownMenu);
// <<< 效果 <<<
......@@ -195,10 +191,9 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
const onCardClick = (card: CardType) => {
// 中央弹窗展示选中卡牌信息
// TODO: 对方的卡片/未知的卡片,点击应该是没有效果的
// TODO: 同一张卡片,是否重复点击会关闭CardModal?
displayCardModal(card);
handleDropdownMenu([card], false);
if (card.idleInteractivities) handleDropdownMenu([card], false);
// 侧边栏展示超量素材信息
const overlayMaterials = cardStore.findOverlay(
......@@ -241,8 +236,8 @@ const handleEffectActivation = (
effectInteractivies: Interactivy[],
meta?: any // FIXME: meta的类型
) => {
// 不用考虑为0的情况,因为已经判断了不可能为0
if (effectInteractivies.length === 1) {
if (!effectInteractivies.length) return;
else if (effectInteractivies.length === 1) {
// 如果只有一个效果,点击直接触发
sendSelectIdleCmdResponse(effectInteractivies[0].response);
} else {
......
......@@ -11,14 +11,14 @@ export const LifeBar: React.FC = () => {
return (
<div id="life-bar-container">
<div className="life-bar">
<div className="name">{snapPlayer.getMePlayer().name}</div>
<div className="life">{snap.me.life}</div>
</div>
<div className="life-bar">
<div className="name">{snapPlayer.getOpPlayer().name}</div>
<div className="life">{snap.op.life}</div>
</div>
<div className="life-bar">
<div className="name">{snapPlayer.getMePlayer().name}</div>
<div className="life">{snap.me.life}</div>
</div>
</div>
);
};
......@@ -9,4 +9,27 @@
background-color: #323232;
padding: 8px;
border-radius: 6px;
overflow: hidden;
.floodlight {
position: absolute;
height: 100%;
width: 40px;
background-color: white;
top: 0;
right: 0;
filter: blur(30px);
transform: skewX(-20deg);
}
.floodlight-run {
animation: floodlight 1s linear infinite;
}
}
@keyframes floodlight {
0% {
right: -80px;
}
100% {
right: calc(100% + 80px);
}
}
......@@ -13,12 +13,11 @@ import {
Dropdown,
type DropdownProps,
type MenuProps,
Popconfirm,
Space,
theme,
Tooltip,
} from "antd";
import { cloneElement, useState } from "react";
import { cloneElement } from "react";
import { useSnapshot } from "valtio";
import {
......@@ -37,7 +36,7 @@ export const Menu = () => {
const { currentPlayer } = useSnapshot(matStore);
const currentPhase = snapPhase.currentPhase;
const response = [
const endResponse = [
PhaseType.BATTLE_START,
PhaseType.BATTLE_STEP,
PhaseType.DAMAGE,
......@@ -63,7 +62,7 @@ export const Menu = () => {
// [PhaseType.DAMAGE, "伤害步骤", 3],
// [PhaseType.DAMAGE_GAL, "伤害步骤(伤害计算)", 3],
[PhaseType.MAIN2, "主要阶段 2", 2],
[PhaseType.END, "结束阶段", response],
[PhaseType.END, "结束阶段", endResponse],
// [PhaseType.UNKNOWN, "未知阶段", response],
];
......@@ -126,6 +125,7 @@ export const Menu = () => {
>
<Button icon={<CloseCircleFilled />} type="text"></Button>
</DropdownWithTitle>
{/* <div className="floodlight floodlight-run" /> */}
</div>
</>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment