From c3853aa3feeb31b8ffb853b2ae8747ab8cbd2573 Mon Sep 17 00:00:00 2001 From: TJH Date: Mon, 29 Dec 2025 17:29:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BE=99=E8=99=8E=E6=A6=9C=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SlotRanking/prefab/SlotRanking.prefab | 16 +++++++------- .../SlotRanking/scripts/RankHistoryList.ts | 9 ++++---- assets/Game/SlotRanking/scripts/RankList.ts | 22 +++++++++++++++---- .../SlotRanking/scripts/RewardHistoryList.ts | 2 +- assets/Game/SlotRanking/scripts/RewardList.ts | 4 +--- .../Game/SlotRanking/scripts/SlotRanking.ts | 14 +++++++++--- .../scripts/SlotRankingDataManager.ts | 2 +- assets/Game/scripts/SlotScene.ts | 6 +++++ 8 files changed, 50 insertions(+), 25 deletions(-) diff --git a/assets/Game/SlotRanking/prefab/SlotRanking.prefab b/assets/Game/SlotRanking/prefab/SlotRanking.prefab index f470847..9ffb8fd 100644 --- a/assets/Game/SlotRanking/prefab/SlotRanking.prefab +++ b/assets/Game/SlotRanking/prefab/SlotRanking.prefab @@ -22172,7 +22172,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -369, + "x": -320, "y": 0, "z": 0 }, @@ -22353,7 +22353,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -190, + "x": -140, "y": 0, "z": 0 }, @@ -22534,7 +22534,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 15, + "x": 50, "y": 0, "z": 0 }, @@ -22715,7 +22715,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 205, + "x": 220, "y": 0, "z": 0 }, @@ -24034,7 +24034,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -369, + "x": -320, "y": 0, "z": 0 }, @@ -24215,7 +24215,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": -190, + "x": -140, "y": 0, "z": 0 }, @@ -24396,7 +24396,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 15, + "x": 50, "y": 0, "z": 0 }, @@ -24577,7 +24577,7 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 205, + "x": 220, "y": 0, "z": 0 }, diff --git a/assets/Game/SlotRanking/scripts/RankHistoryList.ts b/assets/Game/SlotRanking/scripts/RankHistoryList.ts index d73519e..ad6c0f6 100644 --- a/assets/Game/SlotRanking/scripts/RankHistoryList.ts +++ b/assets/Game/SlotRanking/scripts/RankHistoryList.ts @@ -80,7 +80,7 @@ export class RankHistoryList extends Component { this.historyIndex = 1; this.updateHistoryArrows(); - + this.refreshSelfRankingInfo(null); await this.loadHistoryData(this.currentHistoryType, this.historyIndex); } @@ -114,11 +114,10 @@ export class RankHistoryList extends Component { // ==================== 历史记录逻辑 ==================== async loadHistoryData(type: string, index: number) { this.setRankHistoryRadioBtn(type); - + this.refreshSelfRankingInfo(null); if (!this.isTypeAvailable(type)) { console.log(`${type} 历史榜单活动未开启`); - this.rankHistoryLoadingNode.active = false; - this.refreshSelfRankingInfo(null); + this.rankHistoryLoadingNode.active = false; this.showActivityNotOpenTip(); return; } @@ -163,7 +162,7 @@ export class RankHistoryList extends Component { this.selfInfo.getChildByName('Rank').getChildByName('sp_1').active = false; this.selfInfo.getChildByName('Rank').getChildByName('sp_2').active = false; this.selfInfo.getChildByName('Rank').getChildByName('sp_3').active = false; - this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = false; + this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = true; this.selfInfo.getChildByName('Rank').getChildByName('rankLab').getComponent(Label).string = '-'; this.selfInfo.getChildByName('Uid').getComponent(Label).string = '-'; this.selfInfo.getChildByName('Shop').getComponent(Label).string = '-'; diff --git a/assets/Game/SlotRanking/scripts/RankList.ts b/assets/Game/SlotRanking/scripts/RankList.ts index a2948cc..0019f39 100644 --- a/assets/Game/SlotRanking/scripts/RankList.ts +++ b/assets/Game/SlotRanking/scripts/RankList.ts @@ -77,7 +77,7 @@ export class RankList extends Component { this.rankList.active = true; this.currentRankType = ''; this.updateRankButtonsAvailability(); - + this.refreshSelfRankingInfo(null); await this.switchRankTab(defaultType); } @@ -123,7 +123,7 @@ export class RankList extends Component { this.currentRankType = type; this.setRankRadioBtn(type); - + this.refreshSelfRankingInfo(null); if (!this.isTypeAvailable(type)) { console.log(`${type} 榜单活动未开启`); this.rankLoadingNode.active = false; @@ -132,7 +132,6 @@ export class RankList extends Component { } this.marqueeTexts = []; this.currentMarqueeIndex = 0; - this.refreshSelfRankingInfo(null); this.showActivityNotOpenTip(); if (this.countdownTimer) { clearInterval(this.countdownTimer); @@ -183,7 +182,19 @@ export class RankList extends Component { console.error('获取排行榜数据失败:', error); this.showActivityNotOpenTip(); Tween.stopAllByTarget(this.rankLoadingNode); + if (this.countdownTimer) { + clearInterval(this.countdownTimer); + this.countdownTimer = null; + } + this.rankingEndTime.getComponent(Label).string = "--:--:--"; this.rankLoadingNode.active = false; + // 停止跑马灯 + if (this.msg_1 && this.msg_1.isValid) { + Tween.stopAllByTarget(this.msg_1); + this.msg_1.active = false; + } + this.marqueeTexts = []; + this.currentMarqueeIndex = 0; } } @@ -264,6 +275,9 @@ export class RankList extends Component { this.rankingListVScroll.setTotalCount(rankInfos.List.length); this.rankingListVScroll.renderItemFn = (node: Node, idx: number) => { let itemData = rankInfos.List[idx]; + if (!itemData) { + return; + } node.getChildByName('bg').active = idx % 2 === 0; node.getChildByName('bg2').active = idx % 2 !== 0; node.getChildByName('Rank').getChildByName('sp_1').active = idx === 0; @@ -285,7 +299,7 @@ export class RankList extends Component { this.selfInfo.getChildByName('Rank').getChildByName('sp_1').active = false; this.selfInfo.getChildByName('Rank').getChildByName('sp_2').active = false; this.selfInfo.getChildByName('Rank').getChildByName('sp_3').active = false; - this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = false; + this.selfInfo.getChildByName('Rank').getChildByName('rankLab').active = true; this.selfInfo.getChildByName('Rank').getChildByName('rankLab').getComponent(Label).string = '-'; this.selfInfo.getChildByName('Uid').getComponent(Label).string = '-'; this.selfInfo.getChildByName('Shop').getComponent(Label).string = '-'; diff --git a/assets/Game/SlotRanking/scripts/RewardHistoryList.ts b/assets/Game/SlotRanking/scripts/RewardHistoryList.ts index 2ecf4dc..ed60993 100644 --- a/assets/Game/SlotRanking/scripts/RewardHistoryList.ts +++ b/assets/Game/SlotRanking/scripts/RewardHistoryList.ts @@ -1,7 +1,7 @@ import { _decorator, Component, Label, Node, Tween, tween } from 'cc'; import { VirtualScrollView } from './VScrollView'; -import { I18nManager } from 'db://assets/Loading/scripts/manager/I18nManager'; import { callGameApiForRank } from 'db://assets/Loading/scripts/comm'; +import { I18nManager } from 'db://assets/Loading/scripts/manager/I18nManager'; import { AudioManager } from 'db://assets/Loading/scripts/manager/AudioManager'; const { ccclass, property } = _decorator; diff --git a/assets/Game/SlotRanking/scripts/RewardList.ts b/assets/Game/SlotRanking/scripts/RewardList.ts index 02bc550..6b08fff 100644 --- a/assets/Game/SlotRanking/scripts/RewardList.ts +++ b/assets/Game/SlotRanking/scripts/RewardList.ts @@ -302,9 +302,7 @@ export class RewardList extends Component { if (result.Balance !== undefined && this.slotScene && this.slotScene.slotBar) { this.slotScene.slotBar.setBalance(result.Balance); } - - // 播放音效 - AudioManager.instance.playSFX("Coin_Drop"); + console.log(`成功领取 ${result.Ids.length} 个奖励,新余额: ${result.Balance}`); } else { diff --git a/assets/Game/SlotRanking/scripts/SlotRanking.ts b/assets/Game/SlotRanking/scripts/SlotRanking.ts index 26095c2..d3d5173 100644 --- a/assets/Game/SlotRanking/scripts/SlotRanking.ts +++ b/assets/Game/SlotRanking/scripts/SlotRanking.ts @@ -67,10 +67,10 @@ export class SlotRanking extends Component { this.initComponents(); this.rankingBtn.setPosition(this.startPos); - this.rankingBtn.active = SlotRankingDataManager.instance.getRankListStatus() === 0 || SlotRankingDataManager.instance.getRankListStatus() === 1 || SlotRankingDataManager.instance.getCurTimeIsBiggerThanRankMaxCloseTime(); - this.rankingBtn.getComponent(Button).interactable = SlotRankingDataManager.instance.getRankListStatus() === 0 || SlotRankingDataManager.instance.getCurTimeIsBiggerThanRankMaxCloseTime(); - this.rankingBtn.getChildByName('icon').getComponent(sp.Skeleton).color = SlotRankingDataManager.instance.getRankListStatus() === 0 ? Color.WHITE : Color.GRAY; + this.rankingBtn.active = SlotRankingDataManager.instance.getRankListStatus() === 0 || SlotRankingDataManager.instance.getRankListStatus() === 1 || SlotRankingDataManager.instance.getRankMaxCloseTimeIsBiggerThanCurTime(); + this.rankingBtn.getComponent(Button).interactable = SlotRankingDataManager.instance.getRankListStatus() === 0; + this.rankingBtn.getChildByName('icon').getComponent(sp.Skeleton).color = SlotRankingDataManager.instance.getRankListStatus() === 0 ? Color.WHITE : Color.GRAY; this.rankingBtn.on(Node.EventType.TOUCH_START, this.onTouchStart, this); this.rankingBtn.on(Node.EventType.TOUCH_MOVE, this.onTouchMove, this); @@ -144,10 +144,18 @@ export class SlotRanking extends Component { return false; } + if (this.slotScene.gameState.isFeatureBuySpin) { + return false; + } + if (this.slotScene.gameState.isEliminating) { return false; } + if (!this.rankingBtn.getComponent(Button).interactable) { + return false; + } + return true; } diff --git a/assets/Game/SlotRanking/scripts/SlotRankingDataManager.ts b/assets/Game/SlotRanking/scripts/SlotRankingDataManager.ts index 4e78e2f..750a649 100644 --- a/assets/Game/SlotRanking/scripts/SlotRankingDataManager.ts +++ b/assets/Game/SlotRanking/scripts/SlotRankingDataManager.ts @@ -13,7 +13,7 @@ export class SlotRankingDataManager { set rankList(list: any) { this._rankList = list; } get rankList(): any { return this._rankList; } - getCurTimeIsBiggerThanRankMaxCloseTime(): boolean { + getRankMaxCloseTimeIsBiggerThanCurTime(): boolean { if (!this._rankList || !this._rankList.List || this._rankList.List.length === 0) { // 代表当前没有活动开启,则说明关闭入口按钮 return false; diff --git a/assets/Game/scripts/SlotScene.ts b/assets/Game/scripts/SlotScene.ts index 54eb040..696f5f5 100644 --- a/assets/Game/scripts/SlotScene.ts +++ b/assets/Game/scripts/SlotScene.ts @@ -24,6 +24,7 @@ interface GameState { isAutoSpin: boolean; isEliminating: boolean; isFastSpin: boolean; + isFeatureBuySpin: boolean; isFirstFreeSpin: boolean; isInFreeSpin: boolean; isOneRoundEnd: boolean; @@ -87,6 +88,7 @@ export class SlotScene extends Component { isEliminating: false, isFastSpin: false, isFirstFreeSpin: false, + isFeatureBuySpin: false, isInFreeSpin: false, isOneRoundEnd: false, isDebug: false @@ -213,9 +215,12 @@ export class SlotScene extends Component { let panel = NodePoolManager.instance.getNodeFromPoolStatic('FeatureBuy', this.FeatureBuyPre); let featureBuy = panel.getComponent(FeatureBuy) this.node.addChild(panel); + featureBuy.show(this.slotBar.getBet(), this.gameInfo.BuyMul, () => { this.slotGame.setFeatureBuyInteractable(false) this.spinBtnClick(false, true); + this.gameState.isFeatureBuySpin = true; + this.slotBar.featureBuySpin(); }); } @@ -727,6 +732,7 @@ export class SlotScene extends Component { private async handleFreeSpinEnd(winType: WIN_TYPE, isReconnect: boolean = false) { this.gameState.isFirstFreeSpin = false; + this.gameState.isFeatureBuySpin = false; this.gameState.isInFreeSpin = false; this.slotBar.exitFreeSpin();