Procházet zdrojové kódy

增加控制按钮开关
增加广告开关
屏蔽红包元素

kaka před 5 roky
rodič
revize
695a2a5521

+ 5 - 2
assets/resources/game/prefab/game.prefab

@@ -1822,7 +1822,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "邀请码",
+    "_name": "福利礼包",
     "_objFlags": 0,
     "_parent": {
       "__id__": 50
@@ -5626,9 +5626,12 @@
     "btn8": {
       "__id__": 7
     },
-    "btn_redeem": {
+    "btn9": {
       "__id__": 51
     },
+    "btn_pigbank": {
+      "__id__": 191
+    },
     "_id": ""
   },
   {

+ 80 - 71
assets/resources/game/prefab/gameplay.prefab

@@ -45,26 +45,26 @@
         "__id__": 157
       },
       {
-        "__id__": 202
+        "__id__": 201
       },
       {
-        "__id__": 204
+        "__id__": 203
       },
       {
-        "__id__": 219
+        "__id__": 218
       },
       {
-        "__id__": 221
+        "__id__": 220
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 223
+        "__id__": 222
       }
     ],
     "_prefab": {
-      "__id__": 224
+      "__id__": 223
     },
     "_opacity": 255,
     "_color": {
@@ -5718,11 +5718,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 200
+        "__id__": 198
+      },
+      {
+        "__id__": 199
       }
     ],
     "_prefab": {
-      "__id__": 201
+      "__id__": 200
     },
     "_opacity": 255,
     "_color": {
@@ -6814,13 +6817,10 @@
       },
       {
         "__id__": 195
-      },
-      {
-        "__id__": 197
       }
     ],
     "_prefab": {
-      "__id__": 199
+      "__id__": 197
     },
     "_opacity": 255,
     "_color": {
@@ -7019,31 +7019,6 @@
     "_id": ""
   },
   {
-    "__type__": "b8d2cnq+GZLFK30xbLDqr/m",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 190
-    },
-    "_enabled": false,
-    "panel_name": "module/invite/invite",
-    "bool_Auth": false,
-    "open_type": 0,
-    "transition_type": 0,
-    "onComplete": {
-      "__id__": 196
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.ClickEvent",
-    "target": null,
-    "component": "",
-    "_componentId": "",
-    "handler": "",
-    "customEventData": ""
-  },
-  {
     "__type__": "cc.Button",
     "_name": "",
     "_objFlags": 0,
@@ -7057,7 +7032,7 @@
     "zoomScale": 1.2,
     "clickEvents": [
       {
-        "__id__": 198
+        "__id__": 196
       }
     ],
     "_N$interactable": true,
@@ -7169,6 +7144,40 @@
     "_id": ""
   },
   {
+    "__type__": "3bf10Wxox5IQLcQoa17hGCb",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 157
+    },
+    "_enabled": true,
+    "btn1": null,
+    "btn2": {
+      "__id__": 174
+    },
+    "btn3": {
+      "__id__": 190
+    },
+    "btn4": {
+      "__id__": 166
+    },
+    "btn5": {
+      "__id__": 158
+    },
+    "btn6": {
+      "__id__": 182
+    },
+    "btn7": {
+      "__id__": 78
+    },
+    "btn8": {
+      "__id__": 20
+    },
+    "btn9": null,
+    "btn_pigbank": null,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -7190,7 +7199,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 203
+      "__id__": 202
     },
     "_opacity": 255,
     "_color": {
@@ -7259,23 +7268,23 @@
     },
     "_children": [
       {
-        "__id__": 205
+        "__id__": 204
       },
       {
-        "__id__": 208
+        "__id__": 207
       },
       {
-        "__id__": 211
+        "__id__": 210
       }
     ],
     "_active": false,
     "_components": [
       {
-        "__id__": 217
+        "__id__": 216
       }
     ],
     "_prefab": {
-      "__id__": 218
+      "__id__": 217
     },
     "_opacity": 255,
     "_color": {
@@ -7329,17 +7338,17 @@
     "_name": "classic_select_item",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 204
+      "__id__": 203
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 206
+        "__id__": 205
       }
     ],
     "_prefab": {
-      "__id__": 207
+      "__id__": 206
     },
     "_opacity": 255,
     "_color": {
@@ -7393,7 +7402,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 205
+      "__id__": 204
     },
     "_enabled": true,
     "_materials": [
@@ -7436,17 +7445,17 @@
     "_name": "layout_selectItem",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 204
+      "__id__": 203
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 209
+        "__id__": 208
       }
     ],
     "_prefab": {
-      "__id__": 210
+      "__id__": 209
     },
     "_opacity": 255,
     "_color": {
@@ -7500,7 +7509,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 208
+      "__id__": 207
     },
     "_enabled": true,
     "_layoutSize": {
@@ -7543,21 +7552,21 @@
     "_name": "node_closeBtn",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 204
+      "__id__": 203
     },
     "_children": [
       {
-        "__id__": 212
+        "__id__": 211
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 215
+        "__id__": 214
       }
     ],
     "_prefab": {
-      "__id__": 216
+      "__id__": 215
     },
     "_opacity": 255,
     "_color": {
@@ -7611,17 +7620,17 @@
     "_name": "A_close",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 211
+      "__id__": 210
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 213
+        "__id__": 212
       }
     ],
     "_prefab": {
-      "__id__": 214
+      "__id__": 213
     },
     "_opacity": 255,
     "_color": {
@@ -7675,7 +7684,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 212
+      "__id__": 211
     },
     "_enabled": true,
     "_materials": [
@@ -7718,7 +7727,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 211
+      "__id__": 210
     },
     "_enabled": true,
     "_normalMaterial": null,
@@ -7779,7 +7788,7 @@
     "hoverSprite": null,
     "_N$disabledSprite": null,
     "_N$target": {
-      "__id__": 211
+      "__id__": 210
     },
     "_id": ""
   },
@@ -7799,14 +7808,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 204
+      "__id__": 203
     },
     "_enabled": true,
     "layout_selectCellItemBtn": {
-      "__id__": 209
+      "__id__": 208
     },
     "node_closeBtn": {
-      "__id__": 211
+      "__id__": 210
     },
     "prefab_selectCellItemBtn": {
       "__uuid__": "ceb1c542-7e44-4682-9cec-8c2a76a739b7"
@@ -7835,7 +7844,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 220
+      "__id__": 219
     },
     "_opacity": 255,
     "_color": {
@@ -7906,7 +7915,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 222
+      "__id__": 221
     },
     "_opacity": 255,
     "_color": {
@@ -8032,16 +8041,16 @@
       "__id__": 145
     },
     "node_changeCellItemUI": {
-      "__id__": 204
+      "__id__": 203
     },
     "node_effectUI": {
-      "__id__": 219
+      "__id__": 218
     },
     "node_levelRedPacketUI": {
-      "__id__": 202
+      "__id__": 201
     },
     "node_touchListenMask": {
-      "__id__": 221
+      "__id__": 220
     },
     "_id": ""
   },

+ 13 - 6
assets/script/before/GamePlay.ts

@@ -341,7 +341,7 @@ export default class GamePlay extends cc.Component {
             gData.reward.subType = 2;
             mk.ad.videoAdType = VideoAdType.LevelScoreRedBag;
             let node_rewardLuck = mk.ui.getCurOnPanel("rewardLuck");
-            if (!node_rewardLuck) {
+            if (!node_rewardLuck && gData.gameData.funOpenData['6'] == '1') {
                 mk.ui.openPanel("module/reward/rewardLuck");
             }
         }
@@ -1028,16 +1028,23 @@ export default class GamePlay extends cc.Component {
         GamePlay.Inst.ifGetPass = false;
 
         let levelNum = gData.gameData.getProp(GameProp.levelNum);
-        if(levelNum == 0){
-            mk.data.sendXYEvent("firstlevel","完成第一关");
+        if (levelNum == 0) {
+            mk.data.sendXYEvent("firstlevel", "完成第一关");
         }
         mk.console.log("[Game]pass passLevelNum", levelNum);
         GamePlay.Inst.ifGetPass = true;
         gData.gameData.setProp(GameProp.levelNum, ++levelNum);
 
-        let node_rewardLuck = mk.ui.getCurOnPanel("rewardLuck");
-        if (node_rewardLuck || this.finalGetScore >= this.targetScore) {
-            return;
+        if (gData.gameData.funOpenData['6'] == '1') {
+            let node_rewardLuck = mk.ui.getCurOnPanel("rewardLuck");
+            if (node_rewardLuck || this.finalGetScore >= this.targetScore) {
+                return;
+            }
+            else {
+                //游戏结算
+                this.gameCount();
+                console.log("gData.gameData.getProp(GameProp.levelNum)", gData.gameData.getProp(GameProp.levelNum));
+            }
         }
         else {
             //游戏结算

+ 7 - 1
assets/script/game/component/tween/TweenCast.ts

@@ -36,7 +36,13 @@ export default class TweenCast extends cc.Component {
     }
 
     onLoad() {
-        this.play();
+        if (gData.gameData.funOpenData['8'] == '1') {
+            this.node.active = true
+            this.play();
+        }
+        else {
+            this.node.active = false
+        }
     }
 
     private play() {

+ 7 - 4
assets/script/game/data/GameData.ts

@@ -6,7 +6,7 @@ import Game from "../game/Game";
  * @author 邹勇
  */
 export class GameData {
-    
+
     public dataFinish: boolean = false;
 
     public savePropFinish: boolean = false;
@@ -18,14 +18,14 @@ export class GameData {
 
     public configs: any = {};
     public adShowConfig: ADShowCfg;
-    /** 功能开启 */
+    /** 功能开启 依次是 0 互推 1 转盘 2 裂变 3 存钱罐 4 福袋 5 签到 6 常规提现 7 气泡红包组 8 福利礼包*/
     public funOpenData: string[] = [];
 
     public gameData: PlayerProp = null;
     /** 标志位:刷新主界面货币 */
     public init_coin: boolean = false;
 
-    public updatePiggyBankValue:boolean = false;
+    public updatePiggyBankValue: boolean = false;
 
     /** 标志位:刷新主界面头像 */
     public init_head: boolean = false;
@@ -63,6 +63,9 @@ export class GameData {
         mk.console.logSingle("getAllConfigInfo", response.data);
         this.initConfigs(response.data);
 
+        //初始化topon
+        mk.ad.init();
+
         data = {};
         response = await mk.http.sendData('getInfoCrypt', data);
         if (response.errcode != 0) {
@@ -283,7 +286,7 @@ class PlayerProp {
     }
 
     /** 初始化 */
-    initPiggyBank(v){
+    initPiggyBank(v) {
         this._piggyBank = v;
     }
 

+ 1 - 1
assets/script/game/data/HttpData.ts

@@ -5,7 +5,7 @@
 export class HttpData {
 
     /** 服务器类型 0测试服 1正式服 2李扬服 3悍国服 */
-    public serverType: number = 1;
+    public serverType: number = 0;
 
     public getServerUrl(): string {
         switch (this.serverType) {

+ 0 - 5
assets/script/game/data/LoginData.ts

@@ -46,9 +46,6 @@ export class LoginData {
             this.rule_data = result.json.server;
             this.privacy_data = result.json.privacy;
             this.loadResCompelete = true;
-            if (CC_DEBUG) {
-                gData.appData.getDeviceInfoCompelete = true;
-            }
         }
 
     }
@@ -255,8 +252,6 @@ export class LoginData {
 
     private async getAccountInfo() {
         console.log('uin  ', gData.loginData.uin)
-        //初始化topon
-        mk.ad.init();
         //更新设备信息
         mk.console.logSingle("machineInfo", gData.appData.machineInfo);
         await mk.http.sendData('user/machine', gData.appData.machineInfo);

+ 1 - 2
assets/script/game/data/module/GuideWeakData.ts

@@ -1,4 +1,3 @@
-import { Data } from "../../../mk/data/Data";
 import GuideWeak from "../../module/guideWeak/GuideWeak";
 /**
  * 弱引导数据
@@ -83,7 +82,7 @@ export default class GuideWeakData {
     }
     public openPanelByBtn() {
         const panel_id = gData.guideWeakData.cur_guide_id
-        if (gData.gameData.funBtns['btn' + panel_id])
+        if (gData.gameData.funBtns['btn' + panel_id] && gData.gameData.funOpenData[`${panel_id}`] == '1')
             gData.gameData.funBtns['btn' + panel_id].emit('click')
     }
     public panel_name_config = {

+ 0 - 2
assets/script/game/data/module/MoreGameData.ts

@@ -138,7 +138,6 @@ export class MoreGameData extends Data {
 
         let downLoadTask = new DownloadTaskClazz(0, 0, data.nebulaAppId, null)
         let curTask = JsbSystem.downFile2Local(url, data.nebulaAppId + ".apk", (locaPath) => {
-            // LogUtil.logV("sendAppDownloadLog", "success")
             downLoadTask.progress = -2
             this.sendAppDownloadLog(data.nebulaAppId)
             setTimeout(() => {
@@ -154,7 +153,6 @@ export class MoreGameData extends Data {
         })
         downLoadTask.downloadTask = curTask
         MoreGameData.downLoadTaskMap[data.nebulaAppId] = downLoadTask
-        // AdM.onSendEvent('hutuiEventDown_' + data.nebulaAppId, "互推下载" + data.title, 'hutuiEventDown')
         return downLoadTask
     }
 

+ 11 - 7
assets/script/game/game/FunBtns.ts

@@ -1,5 +1,3 @@
-import { Fun } from "../data/GData";
-
 const { ccclass, property } = cc._decorator;
 
 @ccclass
@@ -21,15 +19,16 @@ export default class FunBtns extends cc.Component {
     @property({ type: cc.Node, displayName: "气泡红包组" })
     btn8: cc.Node = null;
     @property({ type: cc.Node, displayName: "福利礼包" })
-    btn_redeem: cc.Node = null;
+    btn9: cc.Node = null;
+    @property({ type: cc.Node, displayName: "金猪币按钮" })
+    btn_pigbank: cc.Node = null;
 
     onLoad() {
         gData.gameData.funBtns = this;
     }
 
     start() {
-
-
+        this.init()
     }
 
     init() {
@@ -40,14 +39,19 @@ export default class FunBtns extends cc.Component {
                 node_btn.active = data[i] == "1";
             }
         }
+
+        if (this.btn_pigbank) {
+            this.btn_pigbank.active = data['3'] == '1';
+        }
         this.updateRedeem();
     }
 
     private updateRedeem() {
-        this.btn_redeem.active = gData.redeem.showBtn;
+        if (this.btn9) {
+            this.btn9.active = (gData.redeem.showBtn && gData.gameData.funOpenData['8'] == '1');
+        }
     }
 
-
     update() {
         if (gData.redeem.init_btnChange) {
             this.updateRedeem();

+ 1 - 1
assets/script/game/game/Game.ts

@@ -129,7 +129,7 @@ export default class Game extends cc.Component {
      */
     private initBtns() {
         let sc = this.node_btn.getComponent(FunBtns) as FunBtns;
-        sc.init();
+        // sc.init();
     }
 
     private initQiPaos() {

+ 3 - 2
assets/script/game/module/login/Login.ts

@@ -34,6 +34,7 @@ export default class Login extends cc.Component {
 
         if (CC_DEBUG) {
             mk.aliRiskManager.getRiskCode = true;
+            gData.appData.getDeviceInfoCompelete = true;
         }
         else {
             mk.aliRiskManager.init();
@@ -161,9 +162,9 @@ export default class Login extends cc.Component {
         if (CC_DEBUG) {
             //测试用配置版本号
             gData.appData.appId = "wxcf31f0e54f7fefda";
-            gData.appData.version = "1.1.1";
+            gData.appData.version = "1.1.2";
             gData.appData.tfChannel = "1";
-            gData.appData.appVersion = "1.0.0";
+            gData.appData.appVersion = "1.2.0";
         }
         let data: any = {
             appId: gData.appData.appId,

+ 4 - 2
assets/script/mk/system/AdSystem.ts

@@ -32,10 +32,12 @@ export default class AdSystem {
 
         //判定下平台
         if (cc.sys.os == cc.sys.OS_ANDROID) {
-            this.ifShowAd = true;
+            this.ifShowAd = gData.gameData.configs.ServerConfig.ifShowAd == '1';
         }
         else {
-            this.ifShowAd = false;
+            // this.ifShowAd = false;
+            //test
+            this.ifShowAd = gData.gameData.configs.ServerConfig.ifShowAd == '1';
         }
 
         //初始化Topon广告SDK

+ 1 - 1
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/modules/app/EasyEliminate.iml

@@ -193,8 +193,8 @@
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />