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