Browse Source

【BUG】修改声音设置问题

mojunshou 7 tháng trước cách đây
mục cha
commit
0997df7fb6

+ 5 - 5
assets/bundle/gui/eliminate/prefab/popup/wechatTransferring.prefab

@@ -1,7 +1,7 @@
 [
   {
     "__type__": "cc.Prefab",
-    "_name": "WechatTransferring",
+    "_name": "wechatTransferring",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_native": "",
@@ -13,7 +13,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "WechatTransferring",
+    "_name": "wechatTransferring",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": null,
@@ -88,7 +88,7 @@
         "__id__": 3
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
         "__id__": 226
@@ -2952,7 +2952,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -246.682,
-      "y": -389.982,
+      "y": -398.055,
       "z": 0
     },
     "_lrot": {
@@ -3577,7 +3577,7 @@
     "value": {
       "__type__": "cc.Vec3",
       "x": -264.368,
-      "y": -464.377,
+      "y": -485.659,
       "z": 0
     }
   },

+ 2 - 2
assets/bundle/gui/eliminate/prefab/popup/wechatTransferring.prefab.meta

@@ -2,12 +2,12 @@
   "ver": "1.1.50",
   "importer": "prefab",
   "imported": true,
-  "uuid": "588d018b-fd6b-4dac-8001-31ca338941f1",
+  "uuid": "3ff39a87-c6e4-4aea-9593-29a84460a3c0",
   "files": [
     ".json"
   ],
   "subMetas": {},
   "userData": {
-    "syncNodeName": "WechatTransferring"
+    "syncNodeName": "wechatTransferring"
   }
 }

+ 5 - 2
assets/script/game/common/manager/ADHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:14:44
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 14:24:24
+ * @LastEditTime: 2025-04-27 16:54:22
  * @Description: 
  */
 // ADHandler.ts
@@ -65,7 +65,6 @@ export class ADHandler {
             default: //激励视频
                 oops.gui.waitOpen();
                 // oops.message.dispatchEvent(GameEvent.updateGameState, "paused");
-                oops.message.dispatchEvent(GameEvent.pauseGame);
                 method = 'ad.reward';
                 param.callback.onShow = 'ADHandler.inst.adRewardShow';
                 param.callback.onClose = 'ADHandler.inst.adRewardClose';
@@ -87,6 +86,7 @@ export class ADHandler {
         oops.gui.waitClose();
         console.log('[广告] 启屏广告加载失败');
         ServerHandler.inst.getAccountInfo();
+        //加载实名认证
     };
 
     adInterstitialLoadFailed = () => {
@@ -102,6 +102,7 @@ export class ADHandler {
     adRewardShow = (str: string) => {
         const data = JSON.parse(str);
         ServerHandler.inst.getSign(data.price);
+        oops.message.dispatchEvent(GameEvent.pauseGame);
     };
 
     adRewardLoadFailed = (str: string) => {
@@ -157,9 +158,11 @@ export class ADHandler {
                     break;
                 case "speed_reward":   //加速奖励
                     oops.message.dispatchEvent(GameEvent.DoubleSpeedOpenSuccess);
+                    ServerHandler.inst.getVideorReward();
                     resetViewType();
                     break;
                 case "revive_reward":  //复活奖励
+                    ServerHandler.inst.getVideorReward();
                     resetViewType();
                     oops.message.dispatchEvent(GameEvent.RestartGame);
                     break;

+ 5 - 7
assets/script/game/common/manager/ProtocolEvent.ts

@@ -2,20 +2,20 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 11:51:36
+ * @LastEditTime: 2025-04-27 16:57:57
  * @Description: 消息定义
  */
 
-const server_url = "http://192.168.10.103:8880";
+// const server_url = "http://192.168.10.103:8880";
 // https://central-test.atmob.com
-// const server_url = "https://central-test.atmob.com";
+const server_url = "https://central-test.atmob.com";
+
+
 export enum ProtocolEvent {
     /**微信登录*/
     WechatLogin = server_url + "/project/playlet/v1/user/login",
     /**账号信息*/
     AccountInfo = server_url + "/project/playlet/v1/user/detail",
-    /**修改设置*/
-    ModifySetting = server_url + "/project/playlet/v1/user/updateSetting",
     /**领取每日奖励*/
     GetDailyReward = server_url + "/project/playlet/v1/daily/eliminationTsk/gain",
     /**用户道具信息*/
@@ -38,10 +38,8 @@ export enum ProtocolEvent {
     AdVideoStart = server_url + "/project/playlet/v1/video/start",
     /**视频奖励*/
     GetVideorReward = server_url + "/project/playlet/v1/reward/videoReward",
-
     //获取微信提现页信息
     GetWechatTxInfo = server_url + "/project/playlet/v3/withdraw/view/wechat/fake",
-
     /**红包币提现*/
     GetRedPacketCash = server_url + "/project/playlet/v1/withdraw/convert",
     /**提现记录*/

+ 2 - 2
assets/script/game/common/manager/ServerHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:16:41
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-25 18:18:20
+ * @LastEditTime: 2025-04-27 16:18:46
  * @Description: 
  */
 // ServerHandler.ts
@@ -329,7 +329,7 @@ export class ServerHandler {
 
     //少量领取翻倍奖励返回
     onGetDoubleRewards(str: string) {
-        console.log('[服务器] 直接领取通关奖励成功返回', str);
+        console.log('[服务器] 少量领取双倍奖励成功返回', str);
         let result = JSON.parse(str);
         smc.game.GameModel.changeHbCoin = result.changes['1004'] || 0;
         smc.game.GameModel.changeWxCoin = result.changes['1005'] || 0;

+ 18 - 17
assets/script/game/common/setting/SettingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:40:20
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-25 16:33:49
+ * @LastEditTime: 2025-04-27 17:45:39
  * @Description:设置界面 
  */
 import { _decorator } from "cc";
@@ -79,26 +79,27 @@ export class SettingViewComp extends CCVMParentComp {
 
     //更新按钮状态
     private updateBtnState() {
-        const music_state = oops.storage.getBoolean("music_state");
-        const effect_state = oops.storage.getBoolean("effect_state");
-        oops.log.logView(music_state, "music_state");
-        console.log("effect_state", effect_state);
-
-        if (music_state == null) {
+        const music_state = oops.storage.get("music_state");
+        const effect_state = oops.storage.get("effect_state");
+        if (!music_state) {
+            // 将字符串转换为布尔值
+            let music_state_bool = true;
+            this._musicState = music_state_bool;
             oops.storage.set("music_state", true);
-            this._musicState = true;
         } else {
-            // 将字符串转换为布尔值
-            let music_state_bool = music_state == true ? true : false;
+            let music_state_bool = music_state == "true" ? true : false
             this._musicState = music_state_bool;
+            oops.storage.set("music_state", music_state_bool);
         }
-        if (effect_state == null) {
+        if (!effect_state) {
             oops.storage.set("effect_state", true);
-            this._effectState = true;
+            let effect_state_bool = true;
+            this._effectState = effect_state_bool;
         } else {
-            // 将字符串转换为布尔值
-            let effect_state_bool = effect_state == true ? true : false;
+            //存在
+            let effect_state_bool = effect_state == "true" ? true : false;
             this._effectState = effect_state_bool;
+            oops.storage.set("effect_state", effect_state_bool);
         }
         oops.audio.switchMusic = this._musicState;
         oops.audio.switchEffect = this._effectState;
@@ -144,15 +145,15 @@ export class SettingViewComp extends CCVMParentComp {
     //打开音乐
     private btn_music() {
         this._musicState = !this._musicState;
+        oops.storage.set("music_state", this._musicState);
+        oops.audio.switchMusic = this._musicState;
         if (this._musicState) {
             DCHandler.inst.reportData(3001002);
+            oops.audio.playMusicLoop("common/audios/bgm");
         } else {
             DCHandler.inst.reportData(3001003);
-            oops.audio.music.play();
         }
         console.log(">>>>>>>>>>>>oops.audio.musicVolume", oops.audio.volumeMusic)
-        oops.storage.set("music_state", this._musicState);
-        oops.audio.switchMusic = this._musicState;
         const btn_on = this.musicBtn.node.getChildByPath("btn_on")!;
         const btn_off = this.musicBtn.node.getChildByPath("btn_off")!;
         btn_on.active = this._musicState;

+ 1 - 1
assets/script/game/common/tips/KindTipsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 09:58:58
+ * @LastEditTime: 2025-04-27 16:51:29
  * @Description: 温馨提示弹窗
  */
 import { _decorator } from 'cc';

+ 3 - 1
assets/script/game/view/DoubleRewardsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:57:43
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 14:33:38
+ * @LastEditTime: 2025-04-27 16:41:14
  * @Description: 惊喜翻倍弹窗
  */
 import { _decorator, instantiate, Label, Node, Prefab, UITransform } from 'cc';
@@ -85,6 +85,7 @@ export class DoubleRewardsView extends VMParent {
         ADHandler.inst.showAd(AD_TYPE.Double_Close);
         DCHandler.inst.reportData(2000401);
         DCHandler.inst.reportData(2000403);
+        oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
     }
 
 
@@ -110,6 +111,7 @@ export class DoubleRewardsView extends VMParent {
                     ADHandler.inst.showAd(AD_TYPE.Double_Close);
                     DCHandler.inst.reportData(2000402);
                     DCHandler.inst.reportData(2000403);
+                    oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
                 }
                 if (this.callback) {
                     this.unschedule(this.callback);

+ 13 - 16
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-27 15:21:12
+ * @LastEditTime: 2025-04-27 16:20:21
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -234,6 +234,8 @@ export class EliminateViewComp extends CCComp {
     //新手引导
     private isGuideMode = false;
     private guideStep = 0;
+    //自动间隔时间
+    private autoInterval: number = 1.5;
 
     //福利弹窗
     private popupType: string = "";
@@ -1573,9 +1575,6 @@ export class EliminateViewComp extends CCComp {
                                 //这个数可以被总消除次数整除那就可以弹广告
                                 if (this.eliminateTotal % randomNum === 0) {
                                     //如果有自动就暂停自动
-                                    if (this.autoState) {
-                                        this.gameState = GameState.PAUSED;
-                                    }
                                     if (smc.game.GameModel.skipAdConfig != -1) {
                                         if (smc.game.GameModel.skipAdCount > 0 && smc.game.GameModel.skipAdCount % smc.game.GameModel.skipAdConfig == 0) {
                                             console.log("skipAdCount>>>>>>>>>>>>>>>", smc.game.GameModel.skipAdCount);
@@ -1583,9 +1582,15 @@ export class EliminateViewComp extends CCComp {
                                             smc.game.GameModel.viewType = "double_reward";
                                             ADHandler.inst.showAd(AD_TYPE.Double_Receive);
                                         } else {
+                                            if (this.autoState) {
+                                                this.gameState = GameState.PAUSED;
+                                            }
                                             ServerHandler.inst.getDoubleSurprise();
                                         }
                                     } else {
+                                        if (this.autoState) {
+                                            this.gameState = GameState.PAUSED;
+                                        }
                                         ServerHandler.inst.getDoubleSurprise();
                                     }
                                 }
@@ -1593,6 +1598,7 @@ export class EliminateViewComp extends CCComp {
                         }
                     }
                 }
+
                 this.updateGameScore();
                 resolve(true)
             }, 0.1)
@@ -2050,7 +2056,7 @@ export class EliminateViewComp extends CCComp {
             DCHandler.inst.reportData(3000008);
             this.executeAutoPlace();
             this.autoFunction = this.executeAutoPlace;
-            this.schedule(this.autoFunction, 1.5);
+            this.schedule(this.autoFunction, this.autoInterval);
             this.autoNode.active = true;
         } else {
             //关闭
@@ -2279,6 +2285,7 @@ export class EliminateViewComp extends CCComp {
             if (this.gameState === GameState.PLAYING && this.autoState) {
                 this.doubleSpeedTime--
                 this.autoMoveTime = 0.25;
+                this.autoInterval = 1.1;
                 //修改剩余时间,秒格式化成时分10:59
                 const minutes = Math.floor(this.doubleSpeedTime / 60);
                 const seconds = this.doubleSpeedTime % 60;
@@ -2287,6 +2294,7 @@ export class EliminateViewComp extends CCComp {
                 //时间到了
                 if (this.doubleSpeedTime <= 0) {
                     this.autoMoveTime = 0.4;
+                    this.autoInterval = 1.5;
                     this.lab_doubleTime.string = "二倍速";
                     this.isDoubleSpeed = false;
                     this.doubleNum = 1;
@@ -2473,15 +2481,4 @@ export class EliminateViewComp extends CCComp {
         }
     }
 
-
-
-    //用导演直接冻结游戏或者恢复游戏
-    updateGameStatus() {
-
-
-
-    }
-
-
-
 }

+ 5 - 3
assets/script/game/view/GamePassView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 14:43:24
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-23 18:59:11
+ * @LastEditTime: 2025-04-27 16:24:43
  * @Description: 游戏通关弹窗
  */
 import { Label, Node } from 'cc';
@@ -111,11 +111,13 @@ export class GamePassView extends GameComponent {
             time--;
             if (time <= 0 && this.isAuto) {
                 this.btn_more();
-                this.unschedule(this.callback);
+                if (this.callback) {
+                    this.unschedule(this.callback);
+                }
                 DCHandler.inst.reportData(3000502);
             }
         }
-        this.schedule(this.callback, 1, this.time);
+        this.schedule(this.callback, 1);
 
     }
 

+ 5 - 6
assets/script/game/view/popup/WechatTransfer.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-19 11:34:46
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:08:05
+ * @LastEditTime: 2025-04-27 16:43:25
  * @Description: 微信转账中界面
  */
 import { _decorator, Component, Node, Animation } from 'cc';
@@ -123,13 +123,12 @@ export class WechatTransfer extends VMParent {
         if (animation) {
             animation.play();
         }
-        ServerHandler.inst.updatePopupState({
-            level: smc.account.AccountModel.curLevel,
-            type: smc.game.GameModel.popupType
-        })
         //3秒后关闭
         this.scheduleOnce(() => {
-            //更新
+            ServerHandler.inst.updatePopupState({
+                level: smc.account.AccountModel.curLevel,
+                type: smc.game.GameModel.popupType
+            })
             oops.gui.remove(UIID.WechaatTransfer)
         }, 4)
     }