Commit 892fb37f authored by Chunchi Che's avatar Chunchi Che

fix focus

parent 4d7d9493
Pipeline #21574 passed with stages
in 23 minutes and 32 seconds
...@@ -109,12 +109,12 @@ export default (move: MsgMove) => { ...@@ -109,12 +109,12 @@ export default (move: MsgMove) => {
true true
); );
setTimeout( setTimeout(() => {
() => // 因为手牌可能会洗牌,sequence就对不上了,所以这里把所有手牌的focus字段都设置成false
(matStore.in(to.location).of(to.controler)[to.sequence].focus = for (const hand of matStore.in(to.location).of(to.controler)) {
false), hand.focus = false;
200 }
); }, 200);
} }
break; break;
} }
......
...@@ -50,6 +50,7 @@ function reloadDuelField( ...@@ -50,6 +50,7 @@ function reloadDuelField(
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {}, counters: {},
focus: false,
reload: true, reload: true,
}; };
}); });
......
...@@ -39,6 +39,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => { ...@@ -39,6 +39,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
controler: 1 - opponent, controler: 1 - opponent,
zone: ygopro.CardZone.DECK, zone: ygopro.CardZone.DECK,
}, },
focus: false,
counters: {}, counters: {},
idleInteractivities: [], idleInteractivities: [],
}); });
...@@ -55,6 +56,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => { ...@@ -55,6 +56,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
controler: opponent, controler: opponent,
zone: ygopro.CardZone.DECK, zone: ygopro.CardZone.DECK,
}, },
focus: false,
counters: {}, counters: {},
idleInteractivities: [], idleInteractivities: [],
}); });
...@@ -72,6 +74,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => { ...@@ -72,6 +74,7 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
controler: opponent, controler: opponent,
zone: ygopro.CardZone.EXTRA, zone: ygopro.CardZone.EXTRA,
}, },
focus: false,
counters: {}, counters: {},
idleInteractivities: [], idleInteractivities: [],
}); });
......
...@@ -40,7 +40,7 @@ class CardArray extends Array<CardState> implements ArrayCardState { ...@@ -40,7 +40,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
position: position:
position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position, position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position,
}, },
focus, focus: focus ?? false,
counters: {}, counters: {},
idleInteractivities: [], idleInteractivities: [],
}); });
...@@ -84,7 +84,7 @@ class CardArray extends Array<CardState> implements ArrayCardState { ...@@ -84,7 +84,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
) { ) {
const meta = await fetchCard(id); const meta = await fetchCard(id);
const target = this[sequence]; const target = this[sequence];
target.focus = focus; target.focus = focus ?? false;
target.occupant = meta; target.occupant = meta;
if (position) { if (position) {
target.location.position = position; target.location.position = position;
...@@ -160,6 +160,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) => ...@@ -160,6 +160,7 @@ const genBlock = (zone: ygopro.CardZone, n: number) =>
location: { location: {
zone, zone,
}, },
focus: false,
idleInteractivities: [], idleInteractivities: [],
counters: {}, counters: {},
})); }));
......
...@@ -120,7 +120,7 @@ export interface CardState { ...@@ -120,7 +120,7 @@ export interface CardState {
zone: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区 zone: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
position?: ygopro.CardPosition; // 卡片的姿势:攻击还是守备 position?: ygopro.CardPosition; // 卡片的姿势:攻击还是守备
}; // 位置信息,叫location的原因是为了和ygo对齐 }; // 位置信息,叫location的原因是为了和ygo对齐
focus?: boolean; // 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示 focus: boolean; // 用于实现动画效果,当这个字段为true时,该张卡片会被放大并在屏幕中央展示
idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息 idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息
placeInteractivity?: Interactivity<{ placeInteractivity?: Interactivity<{
controler: number; controler: number;
......
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