瀏覽代碼

1.扩展通用提示框的弹出朝向
2.丛林 加入退出按钮,卷轴滚动停止不再回弹

lhj 4 月之前
父節點
當前提交
953f676fd9

+ 13 - 8
luckypot_sp/assets/Lobby/scripts/HNScenceManager.js

@@ -8,6 +8,8 @@ let GameUpdate = require("GameUpdate");
 let BundleLoaderManager = require("BundleLoaderManager");
 let _ScenceManagerInstance = null;
 import GameManagerBase from 'GameManagerBase'
+const LanguageKey = require("LanguageKey");
+var topTipMsg = require("topTipMsg")
 
 //退出游戏,需要保留的内存资源
 let filter_assets = [
@@ -24,6 +26,7 @@ let filter_home_assets = [
 class HNScenceManager {
     PORTRAIT = 0
     LANDSCAPE = 1
+    pgDirect = 0//0是竖着,1是横着
     constructor() {
         this._rootComponent = null;
         this._currGameNode = null;
@@ -33,7 +36,10 @@ class HNScenceManager {
         this.recvMemoryRes = [];
         this.pgContentP = null;
     }
-
+    //设置pg旋转方向
+    setPGDirect(value=0){
+        this.pgDirect = value
+    }
     CreateGame() {
         let gameComponent = null;
         if (!this._currGameNode) {
@@ -220,6 +226,7 @@ class HNScenceManager {
             }
             let runScene = cc.director.getScene().getChildByName("GameScence");
             if (pgurl) {
+                this.setPGDirect(this.LANDSCAPE)//这里根据启动pg游戏的时候传入  转向参数
                 let pgContentP
                 if (this.pgContentP) {
                     pgContentP = this.pgContentP
@@ -228,7 +235,7 @@ class HNScenceManager {
                     runScene.addChild(pgContentP);
                 }
 
-                let direct = 0
+                let direct = this.pgDirect
                 if (direct == this.PORTRAIT) {//PG游戏竖着放
                     pgContentP.setContentSize(750,1334);
                     let scale = runScene.getContentSize().height/1334;
@@ -240,12 +247,6 @@ class HNScenceManager {
                 gameNode.parent = pgContentP
                 pgContentP.setAnchorPoint(0.5, 0.5);
                 pgContentP.setPosition(cc.v2(0,0))
-                // let widget = pgContentP.addComponent(cc.Widget);
-                // widget.isAlignLeft = true;
-                // widget.isAlignRight = true;
-                // widget.isAlignTop = true;
-                // widget.isAlignBottom = true;
-                // widget.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE;
             }else{
                 runScene.addChild(gameNode);
                 gameNode.setPosition(cc.v2(cc.winSize / 2, cc.winSize.height / 2));
@@ -346,6 +347,10 @@ class HNScenceManager {
         cc.director.getScene().getChildByName('Canvas').getChildByName('TopNodeEx').active = bActive;
         cc.director.getScene().getChildByName('Canvas').getChildByName('SecondaryGameList').active = bActive;
     }
+    //pg游戏中退出提示
+    cannotExitGame(){
+        topTipMsg.showTopTipMsg(LanguageKey.t("pubWords.not_exit_game"),this.pgDirect==this.LANDSCAPE);
+    }
 };
 
 HNScenceManager.Instance = function () {

+ 6 - 2
luckypot_sp/assets/Lobby/scripts/homesence/topTipMsg.js

@@ -138,7 +138,7 @@ cc.Class({
             }
         },
 
-        showTopTipMsg: function (strTip) {
+        showTopTipMsg: function (strTip,needRotation=false) {
             if (typeof strTip != 'string' || strTip == '') {
                 return;
             }
@@ -158,7 +158,11 @@ cc.Class({
                 const DISPLAY_TIME = 3500;
                 this.delayDeleteTime = 3.5;
                 let tipNode = getTipNode(str);
-
+                if (needRotation) {
+                    tipScene.angle = 90
+                } else {
+                    tipScene.angle = 0
+                }
                 for (let tipItem of tipScene.children) {
                     playMoveUpAni(tipItem);
                 }

+ 4 - 0
luckypot_sp/assets/SubGame/slotForestbundle/script/ForestGameFrame.ts

@@ -1061,6 +1061,10 @@ export default class ForestGameFrame extends GameBase {
         //     topTipMsg.showTopTipMsg(LanguageKey.t("pubWords.not_exit_game"));
         //     return;
         // }
+        if (this.view.isGaming) {
+            ScenceManager.Instance().cannotExitGame()
+            return
+        }
         if(cc.vv.config.ReviewApk) {
             cc.game.end();
             return;

+ 3 - 3
luckypot_sp/assets/SubGame/slotForestbundle/script/ForestIconView.ts

@@ -301,8 +301,8 @@ export default class ForestIconView extends cc.Component {
         cc.Tween.stopAllByTag(2001);
         cc.Tween.stopAllByTag(3003);
         this.resetAllIconItemPos();
-        let backOutCnt = 0.2;//回弹的距离是X个图标的高度
-        let backOutTime = Math.abs(this._oneIconItemHeight * backOutCnt) / this.playActionSpeed * 28;
+        let backOutCnt = 1;//回弹的距离是X个图标的高度
+        let backOutTime = Math.abs(this._oneIconItemHeight * backOutCnt) / this.playActionSpeed;// * 28;
         let backOutTimeMutiple = 1;
         let easeKind: any;
         let runRollNum = this.runRound
@@ -386,7 +386,7 @@ export default class ForestIconView extends cc.Component {
                     easeKind = cc.easeSineIn();//最上面那个不要用回弹效果
                     // console.log("当前===easeKind==", j);
                 } else {
-                    easeKind = cc.easeBezierAction(0.5, 1.4, 1.8, 1.0)//cc.easeBackOut();
+                    easeKind = cc.easeBezierAction(0.5, 0.5, 1.0, 1.0)//cc.easeBezierAction(0.5, 1.4, 1.8, 1.0)//cc.easeBackOut();
                 }
                 let animTween = cc.tween(iconItem)
                     .tag(lineAnimTag)

+ 201 - 4
luckypot_sp/assets/SubGame/slotForestbundle/slotForestprefab/slotForest.prefab

@@ -52,25 +52,28 @@
       },
       {
         "__id__": 2445
+      },
+      {
+        "__id__": 2451
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 2451
+        "__id__": 2456
       },
       {
         "__id__": 1901
       },
       {
-        "__id__": 2452
+        "__id__": 2457
       },
       {
-        "__id__": 2453
+        "__id__": 2458
       }
     ],
     "_prefab": {
-      "__id__": 2454
+      "__id__": 2459
     },
     "_opacity": 255,
     "_color": {
@@ -91967,6 +91970,200 @@
     "fileId": "0bAiWXp+lGQIfBGuK2yXrp",
     "sync": false
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btnEscape",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 2452
+      },
+      {
+        "__id__": 2453
+      }
+    ],
+    "_prefab": {
+      "__id__": 2455
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 111,
+      "height": 111
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -314.982,
+        752.195,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2451
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "4628f8ef-7e4a-4f86-894a-7c8175a80fc2"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2451
+    },
+    "_enabled": true,
+    "_normalMaterial": null,
+    "_grayMaterial": null,
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 2454
+      }
+    ],
+    "_N$interactable": true,
+    "_N$enableAutoGrayEffect": false,
+    "_N$transition": 0,
+    "transition": 0,
+    "_N$normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_N$hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_N$normalSprite": null,
+    "_N$pressedSprite": null,
+    "pressedSprite": null,
+    "_N$hoverSprite": null,
+    "hoverSprite": null,
+    "_N$disabledSprite": null,
+    "_N$target": {
+      "__id__": 2451
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "1f5ad8b7--a05-5-43-55-8-3f6-7ac1f30b6b1701eb",
+    "handler": "onClickExit",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "0430e104--fbc-d-48-e7-a-df2-6be0927c0c00de95"
+    },
+    "fileId": "f5vEZ9d8pCIqVXWZRjgmoq",
+    "sync": false
+  },
   {
     "__type__": "1f5ad8b7--a05-5-43-55-8-3f6-7ac1f30b6b1701eb",
     "_name": "",

二進制
luckypot_sp/assets/SubGame/slotForestbundle/texture/btnEscape.png


+ 36 - 0
luckypot_sp/assets/SubGame/slotForestbundle/texture/btnEscape.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "64b88935-1d1d-4982-9b34-e769592abe4a",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 112,
+  "height": 112,
+  "platformSettings": {},
+  "subMetas": {
+    "btnEscape": {
+      "ver": "1.0.4",
+      "uuid": "4628f8ef-7e4a-4f86-894a-7c8175a80fc2",
+      "rawTextureUuid": "64b88935-1d1d-4982-9b34-e769592abe4a",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": -0.5,
+      "offsetY": 0.5,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 111,
+      "height": 111,
+      "rawWidth": 112,
+      "rawHeight": 112,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 4 - 0
luckypot_sp/assets/SubGame/slotMousebundle/script/MouseGameFrame.ts

@@ -773,6 +773,10 @@ export default class MouseGameFrame extends cc.Component {//AbstractGameFrame<Mo
         //     topTipMsg.showTopTipMsg(LanguageKey.t("pubWords.not_exit_game"));
         //     return;
         // }
+        if (this.view.isGaming) {
+            ScenceManager.Instance().cannotExitGame()
+            return
+        }
         if(cc.vv.config.ReviewApk) {
             cc.game.end();
             return;

+ 4 - 0
luckypot_sp/assets/SubGame/slotNCowbundle/script/NCowGameFrame.ts

@@ -1090,6 +1090,10 @@ export default class NCowGameFrame extends GameBase {
         //     topTipMsg.showTopTipMsg(LanguageKey.t("pubWords.not_exit_game"));
         //     return;
         // }
+        if (this.view.isGaming) {
+            ScenceManager.Instance().cannotExitGame()
+            return
+        }
         if(cc.vv.config.ReviewApk) {
             cc.game.end();
             return;

+ 1 - 2
luckypot_sp/assets/SubGame/slotNTigerbundle/script/FortuneTigerGameFrame.ts

@@ -19,7 +19,6 @@ import FortuneTigerTestLine from "./FortuneTigerTestLine";
 var ProtocolLoginServer = require("ProtocolLoginServer");
 var GameBase = require("GameBase");
 var ScenceManager = require("HNScenceManager");
-var topTipMsg = require("topTipMsg")
 const { ccclass, property, menu } = cc._decorator;
 export enum G51_SUB_C {
     NTIGER_STATE_REQ = 12301,
@@ -930,7 +929,7 @@ export default class FortuneTigerGameFrame  extends GameBase{//extends AbstractG
         //     return;
         // }
         if (this.view.isGaming) {
-            topTipMsg.showTopTipMsg("gaming!!");
+            ScenceManager.Instance().cannotExitGame()
             return
         }
       

+ 1 - 2
luckypot_sp/assets/SubGame/slotRabbitbundle/script/RabbitGameFrame.ts

@@ -13,7 +13,6 @@ import RabbitSpineIconData from "./RabbitSpineIconData";
 var ProtocolLoginServer = require("ProtocolLoginServer");
 var GameBase = require("GameBase");
 var ScenceManager = require("HNScenceManager");
-var topTipMsg = require("topTipMsg")
 const { ccclass, property, menu } = cc._decorator;
 export enum G51_SUB_C {
     NRABIT_STATE_REQ = 12401,
@@ -841,7 +840,7 @@ export default class RabbitGameFrame extends GameBase {
         //     return;
         // }
         if (this.view.isGaming) {
-            topTipMsg.showTopTipMsg("gaming!!");
+            ScenceManager.Instance().cannotExitGame()
             return
         }
         RabbitSpineIconData.ins.destroy();