zouyong 5 lat temu
rodzic
commit
082445da2c

+ 32 - 2
assets/resources/module/guide/guide.prefab

@@ -28,10 +28,13 @@
     "_components": [
       {
         "__id__": 15
+      },
+      {
+        "__id__": 16
       }
     ],
     "_prefab": {
-      "__id__": 16
+      "__id__": 17
     },
     "_opacity": 255,
     "_color": {
@@ -56,7 +59,7 @@
       "ctor": "Float64Array",
       "array": [
         0,
-        0,
+        667,
         0,
         0,
         0,
@@ -522,6 +525,33 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 5,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 1334,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 2 - 2
assets/resources/module/reward/texture/button_big.png.meta

@@ -7,8 +7,8 @@
   "premultiplyAlpha": false,
   "genMipmaps": false,
   "packable": true,
-  "width": 258,
-  "height": 109,
+  "width": 328,
+  "height": 137,
   "platformSettings": {},
   "subMetas": {
     "button_big": {

+ 15 - 6
assets/script/game/data/GameData.ts

@@ -24,9 +24,9 @@ export class GameData {
     public gameData: PlayerProp = null;
     /** 标志位:刷新主界面货币 */
     public init_coin: boolean = false;
-    
-     /** 标志位:刷新主界面头像 */
-    public init_head:boolean = false;
+
+    /** 标志位:刷新主界面头像 */
+    public init_head: boolean = false;
 
     public props: Map<number, number> = new Map<number, number>();
 
@@ -179,12 +179,21 @@ export class GameData {
 
         this.setProps(arr);
     }
+
+    /** 是否是新用户 */
+    public isNewPlayer(): boolean {
+        let v = this.getProp(GameProp.newPlayer);
+        return v == 0;
+    }
 }
 
 /**
  * 所有模块的非校验数据
  */
 export enum GameProp {
+    /** -------------------- 通用玩家数据 ------------------------- */
+    newPlayer = 1,
+
     /** ------------------ 游戏核心数据 --------------------------- */
     /** 关卡数 */
     levelNum = 10,
@@ -216,7 +225,7 @@ export enum GameProp {
 class PlayerProp {
     /** 自定义不需要校验的数据 */
     gameUserData = 0;
-    
+
     _isSignInToday = 0;
     /**
      * 今日是否有签到
@@ -433,7 +442,7 @@ export enum EVENT_TYPE {
     UPDATE_CashNum = "UPDATE_CashNum",
 }
 
-export enum StorageKey{
+export enum StorageKey {
+
 
-    
 }

+ 6 - 3
assets/script/game/data/module/GuideData.ts

@@ -5,7 +5,10 @@
 export class GuideData {
 
     /** 新手引导数据 */
-    public data: Map<number, Guide[]>;
+    public data: Map<number, GuideVO[]>;
+
+    /** 当前引导id */
+    public crtID:number = null;
 
     public init(config) {
         this.data = new Map<number, Guide[]>();
@@ -35,12 +38,12 @@ export class GuideData {
         this.data.set(id, arr);
     }
 
-    public getGuidesByID(id): Guide[] {
+    public getGuidesByID(id): GuideVO[] {
         return this.data.get(id);
     }
 
 }
-export class Guide {
+export class GuideVO {
     /** 大步骤 */
     id: number;
     /** 大步骤中的小步 */

+ 10 - 0
assets/script/game/game/Game.ts

@@ -48,7 +48,17 @@ export default class Game extends cc.Component {
         this.initBtns();
         this.initQiPaos();
         this.initInfo();
+
+        if(gData.gameData.isNewPlayer()){
+            // this.initGuide();
+        }
     }
+
+    private initGuide(){
+        gData.guideData.crtID = 1;
+        mk.ui.openPanel("module/guide/guide");
+    }
+
     update() {
         if (gData.gameData.init_coin) {
             this.initInfo();

+ 25 - 0
assets/script/game/module/guide/Guide.ts

@@ -1,3 +1,5 @@
+import { GuideVO } from "../../data/module/GuideData";
+
 /**
  * @description 新手引导
  * @author 邹勇
@@ -14,9 +16,32 @@ export default class Guide extends cc.Component {
     @property(cc.Node)
     node_block: cc.Node = null;
 
+    private guides: GuideVO[];
+    private crtStep: number;
+    private crtGuide: GuideVO;
 
     onLoad() {
+        
+    }
+
+    start(){
+        if(gData.guideData.crtID == null){
+            this.node.destroy();
+            return;
+        }
+        this.guides = gData.guideData.getGuidesByID(gData.guideData.crtID);
+        this.crtStep = -1;
+        this.nextStep();
+    }
+
+    private nextStep() {
+        this.crtStep++;
+        this.crtGuide = this.guides[this.crtStep];
+        this.updateGuide();
+    }
 
+    private updateGuide(){
+        
     }
 
 

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

@@ -47,10 +47,10 @@ export default class Login extends cc.Component {
                 gData.appData.getDeviceInfoCompelete = false;
             }
             else if (gData.gameData.dataFinish) {//登录流程完毕
-                if (!mk.storage.getStorage('notShowAgreementTip')) {
-                    //!mk.storage.getStorage('notShowAgreementTip')
+                if(gData.gameData.isNewPlayer()){
                     mk.ui.openPanel("module/agreementTip/agreementTip");
-                } else {
+                }
+                else{
                     mk.ui.openPanel("game/prefab/game");
                 }
 

+ 6 - 0
assets/script/mk/system/GuideSystem.ts

@@ -11,6 +11,7 @@ export default class GuideSystem {
     private crtGuide: Guide;
 
     public open(id: number) {
+        mk.ui.openPanel("module/guide/guide");
         this.guides = gData.guideData.getGuidesByID(id);
         this.crtStep = -1;
         this.nextStep();
@@ -19,5 +20,10 @@ export default class GuideSystem {
     private nextStep() {
         this.crtStep++;
         this.crtGuide = this.guides[this.crtStep];
+        this.updateGuide();
+    }
+
+    private updateGuide(){
+        
     }
 }