2 Commits

Author SHA1 Message Date
panw
70130cb930 fix(卡牌): 处理卡牌使用失败时的状态回弹
当卡牌因条件不足(如金币不够)使用失败时,不再直接消失,而是播放回弹动画并恢复原状。同时修复了卡牌取消放大时位置可能被重置的问题。
2026-04-24 15:22:33 +08:00
panw
7047ba932e fix(map): 注释掉任务卡片中更新奖池等级UI的调用
更新金币和消耗UI时不再调用updatePoolLvUI方法,该方法可能存在问题或不再需要。
2026-04-24 15:22:23 +08:00
3 changed files with 2363 additions and 2212 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -575,17 +575,29 @@ export class CardComp extends CCComp {
this.isDragging = false;
if (deltaY >= this.dragUseThreshold) {
this.useCard();
// 使用卡牌后恢复非放大状态
this.isEnlarged = false;
this.isLongPressed = false;
const used = this.useCard();
if (!used) {
// 使用失败(如金币不足),恢复未放大状态并回弹
this.isEnlarged = false;
this.isLongPressed = false;
const currentPos = this.node.position.clone();
this.applyCardUI();
this.node.setPosition(currentPos);
this.playReboundAnim();
} else {
// 使用成功,恢复非放大状态
this.isEnlarged = false;
this.isLongPressed = false;
}
return;
}
// 无论是点击还是长按松手,都恢复正常大小
if (this.isEnlarged) {
this.isEnlarged = false;
const currentPos = this.node.position.clone();
this.applyCardUI();
this.node.setPosition(currentPos);
}
this.isLongPressed = false;
@@ -600,7 +612,9 @@ export class CardComp extends CCComp {
if (this.isEnlarged) {
this.isEnlarged = false;
const currentPos = this.node.position.clone();
this.applyCardUI();
this.node.setPosition(currentPos);
}
this.isLongPressed = false;

View File

@@ -811,7 +811,7 @@ export class MissionCardComp extends CCComp {
}
private updateCoinAndCostUI() {
this.updatePoolLvUI();
// this.updatePoolLvUI();
this.updateDrawCostUI();
}