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 }) => { ...@@ -136,10 +136,6 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
useEffect(() => { useEffect(() => {
setHighlight(!!idleInteractivities.length); setHighlight(!!idleInteractivities.length);
}, [idleInteractivities]); }, [idleInteractivities]);
const onDropdownClick: MenuProps["onClick"] = ({ key }) => {
const index = Number(key);
dropdownMenu.value?.[index]?.onClick();
};
const menuItems = useSnapshot(dropdownMenu); const menuItems = useSnapshot(dropdownMenu);
// <<< 效果 <<< // <<< 效果 <<<
...@@ -195,10 +191,9 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -195,10 +191,9 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
const onCardClick = (card: CardType) => { const onCardClick = (card: CardType) => {
// 中央弹窗展示选中卡牌信息 // 中央弹窗展示选中卡牌信息
// TODO: 对方的卡片/未知的卡片,点击应该是没有效果的
// TODO: 同一张卡片,是否重复点击会关闭CardModal? // TODO: 同一张卡片,是否重复点击会关闭CardModal?
displayCardModal(card); displayCardModal(card);
handleDropdownMenu([card], false); if (card.idleInteractivities) handleDropdownMenu([card], false);
// 侧边栏展示超量素材信息 // 侧边栏展示超量素材信息
const overlayMaterials = cardStore.findOverlay( const overlayMaterials = cardStore.findOverlay(
...@@ -241,8 +236,8 @@ const handleEffectActivation = ( ...@@ -241,8 +236,8 @@ const handleEffectActivation = (
effectInteractivies: Interactivy[], effectInteractivies: Interactivy[],
meta?: any // FIXME: meta的类型 meta?: any // FIXME: meta的类型
) => { ) => {
// 不用考虑为0的情况,因为已经判断了不可能为0 if (!effectInteractivies.length) return;
if (effectInteractivies.length === 1) { else if (effectInteractivies.length === 1) {
// 如果只有一个效果,点击直接触发 // 如果只有一个效果,点击直接触发
sendSelectIdleCmdResponse(effectInteractivies[0].response); sendSelectIdleCmdResponse(effectInteractivies[0].response);
} else { } else {
......
...@@ -11,14 +11,14 @@ export const LifeBar: React.FC = () => { ...@@ -11,14 +11,14 @@ export const LifeBar: React.FC = () => {
return ( return (
<div id="life-bar-container"> <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="life-bar">
<div className="name">{snapPlayer.getOpPlayer().name}</div> <div className="name">{snapPlayer.getOpPlayer().name}</div>
<div className="life">{snap.op.life}</div> <div className="life">{snap.op.life}</div>
</div> </div>
<div className="life-bar">
<div className="name">{snapPlayer.getMePlayer().name}</div>
<div className="life">{snap.me.life}</div>
</div>
</div> </div>
); );
}; };
...@@ -9,4 +9,27 @@ ...@@ -9,4 +9,27 @@
background-color: #323232; background-color: #323232;
padding: 8px; padding: 8px;
border-radius: 6px; 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 { ...@@ -13,12 +13,11 @@ import {
Dropdown, Dropdown,
type DropdownProps, type DropdownProps,
type MenuProps, type MenuProps,
Popconfirm,
Space, Space,
theme, theme,
Tooltip, Tooltip,
} from "antd"; } from "antd";
import { cloneElement, useState } from "react"; import { cloneElement } from "react";
import { useSnapshot } from "valtio"; import { useSnapshot } from "valtio";
import { import {
...@@ -37,7 +36,7 @@ export const Menu = () => { ...@@ -37,7 +36,7 @@ export const Menu = () => {
const { currentPlayer } = useSnapshot(matStore); const { currentPlayer } = useSnapshot(matStore);
const currentPhase = snapPhase.currentPhase; const currentPhase = snapPhase.currentPhase;
const response = [ const endResponse = [
PhaseType.BATTLE_START, PhaseType.BATTLE_START,
PhaseType.BATTLE_STEP, PhaseType.BATTLE_STEP,
PhaseType.DAMAGE, PhaseType.DAMAGE,
...@@ -63,7 +62,7 @@ export const Menu = () => { ...@@ -63,7 +62,7 @@ export const Menu = () => {
// [PhaseType.DAMAGE, "伤害步骤", 3], // [PhaseType.DAMAGE, "伤害步骤", 3],
// [PhaseType.DAMAGE_GAL, "伤害步骤(伤害计算)", 3], // [PhaseType.DAMAGE_GAL, "伤害步骤(伤害计算)", 3],
[PhaseType.MAIN2, "主要阶段 2", 2], [PhaseType.MAIN2, "主要阶段 2", 2],
[PhaseType.END, "结束阶段", response], [PhaseType.END, "结束阶段", endResponse],
// [PhaseType.UNKNOWN, "未知阶段", response], // [PhaseType.UNKNOWN, "未知阶段", response],
]; ];
...@@ -126,6 +125,7 @@ export const Menu = () => { ...@@ -126,6 +125,7 @@ export const Menu = () => {
> >
<Button icon={<CloseCircleFilled />} type="text"></Button> <Button icon={<CloseCircleFilled />} type="text"></Button>
</DropdownWithTitle> </DropdownWithTitle>
{/* <div className="floodlight floodlight-run" /> */}
</div> </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