Commit 9dc08cb0 authored by timel's avatar timel

fix: fmt

parent 79f8700c
Pipeline #22856 passed with stages
in 12 minutes and 32 seconds
import { fetchCard, ygopro } from "@/api";
import { eventbus, Task } from "@/infra";
import { cardStore, fetchEsHintMeta, matStore } from "@/stores";
import { callCardFocus } from "@/ui/Duel/PlayMat/Card";
export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
fetchEsHintMeta({
......@@ -27,7 +27,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
target.meta = meta;
// 发动效果动画
await eventbus.call(Task.Focus, target.uuid);
await callCardFocus(target.uuid);
console.color("blue")(`${target.meta.text.name} chaining`);
} else {
console.warn(`<Chaining>target from ${location} is null`);
......
import { fetchCard, ygopro } from "@/api";
import { eventbus, Task } from "@/infra";
import { cardStore } from "@/stores";
import { callCardFocus } from "@/ui/Duel/PlayMat/Card";
export default async (confirmCards: ygopro.StocGameMessage.MsgConfirmCards) => {
const cards = confirmCards.cards;
......@@ -14,7 +14,7 @@ export default async (confirmCards: ygopro.StocGameMessage.MsgConfirmCards) => {
const meta = await fetchCard(card.code);
target.meta = meta;
// 动画
await eventbus.call(Task.Focus, target.uuid);
await callCardFocus(target.uuid);
} else {
console.warn(`card of ${card} is null`);
}
......
......@@ -31,7 +31,6 @@ import {
type MoveOptions,
} from "./springs";
import type { SpringApiProps } from "./springs/types";
import { IconFont } from "@/ui/Shared";
const { HAND, GRAVE, REMOVED, EXTRA, MZONE, SZONE, TZONE } = ygopro.CardZone;
......@@ -361,13 +360,10 @@ const handleEffectActivation = (
// <<< 下拉菜单 <<<
type CallReturn<Options> = Options extends {}
? (uuid: string, options?: Options) => Promise<void>
: (uuid: string) => Promise<void>;
const call = <Options,>(task: Task): CallReturn<Options> =>
((uuid: string, options?: Options) =>
eventbus.call(task, uuid, options)) as any;
const call =
<Options,>(task: Task) =>
(uuid: string, options?: Options extends undefined ? never : Options) =>
eventbus.call(task, uuid, options);
export const callCardMove = call<MoveOptions>(Task.Move);
export const callCardFocus = call(Task.Focus);
......
export * from "./css";
export * from "./YgoCard";
export * from "./IconFont";
export * from "./YgoCard";
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