Compare commits
2 Commits
cc06adeda1
...
70130cb930
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70130cb930 | ||
|
|
7047ba932e |
File diff suppressed because it is too large
Load Diff
@@ -575,17 +575,29 @@ export class CardComp extends CCComp {
|
||||
this.isDragging = false;
|
||||
|
||||
if (deltaY >= this.dragUseThreshold) {
|
||||
this.useCard();
|
||||
// 使用卡牌后恢复非放大状态
|
||||
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;
|
||||
|
||||
@@ -811,7 +811,7 @@ export class MissionCardComp extends CCComp {
|
||||
}
|
||||
|
||||
private updateCoinAndCostUI() {
|
||||
this.updatePoolLvUI();
|
||||
// this.updatePoolLvUI();
|
||||
this.updateDrawCostUI();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user