Przeglądaj źródła

添加新的设置页面

mojunshou 8 miesięcy temu
rodzic
commit
8036309b31

Plik diff jest za duży
+ 4937 - 998
assets/bundle/common/prefab/setting.prefab


+ 4 - 4
assets/bundle/gui/eliminate/texture/bg.png.meta

@@ -50,10 +50,10 @@
         "height": 1280,
         "rawWidth": 720,
         "rawHeight": 1280,
-        "borderTop": 0,
-        "borderBottom": 0,
-        "borderLeft": 0,
-        "borderRight": 0,
+        "borderTop": 10,
+        "borderBottom": 10,
+        "borderLeft": 10,
+        "borderRight": 10,
         "packable": true,
         "pixelsToUnit": 100,
         "pivotX": 0.5,

+ 4 - 4
assets/bundle/gui/eliminate/texture/icon_3.png.meta

@@ -50,10 +50,10 @@
         "height": 90,
         "rawWidth": 140,
         "rawHeight": 90,
-        "borderTop": 0,
-        "borderBottom": 0,
-        "borderLeft": 0,
-        "borderRight": 0,
+        "borderTop": 15,
+        "borderBottom": 25,
+        "borderLeft": 15,
+        "borderRight": 15,
         "packable": true,
         "pixelsToUnit": 100,
         "pivotX": 0.5,

+ 9 - 1
assets/bundle/language/json/en.json

@@ -19,5 +19,13 @@
     "music": "music",
     "effect": "effect",
     "close": "Close",
-    "setting": "Setting"
+    "setting": "Setting",
+    "protocol": "User Agreement",
+    "privacy": "Privacy Policy",
+    "about": "About Us",
+    "update": "Check Update",
+    "logout": "Logout Account",
+    "exit": "Exit Login",
+    "shock": "Shock",
+    "Personalization": "Personalization"
 }

+ 9 - 1
assets/bundle/language/json/zh.json

@@ -20,5 +20,13 @@
     "music": "音乐",
     "effect": "音效",
     "close": "关闭",
-    "setting": "设置"
+    "setting": "设置",
+    "protocol": "用户协议",
+    "privacy": "隐私协议",
+    "about": "关于我们",
+    "update": "检查更新",
+    "logout": "注销账号",
+    "exit": "退出登录",
+    "shock": "震动",
+    "personalization": "个性化"
 }

+ 0 - 81
assets/script/game/common/setting/SetViewComp.ts

@@ -1,81 +0,0 @@
-/*
- * @Author: mojunshou 1637302775@qq.com
- * @Date: 2025-03-12 11:17:12
- * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-12 14:39:32
- * @Description: 
- */
-import { EventTouch } from "cc";
-import { _decorator } from "cc";
-import { oops } from "db://oops-framework/core/Oops";
-import { ecs } from "db://oops-framework/libs/ecs/ECS";
-import { CCVMParentComp } from "db://oops-framework/module/common/CCVMParentComp";
-import { UIID } from "../config/GameUIConfig";
-import { Slider } from "cc";
-
-const { ccclass, property } = _decorator;
-
-/** 视图层对象 - 支持 MVVM 框架的数据绑定 */
-@ccclass('SetViewComp')
-@ecs.register('SetView', false)
-export class SetViewComp extends CCVMParentComp {
-    /** 脚本控制的界面 MVVM 框架绑定数据 */
-    /** VM 组件绑定数据 */
-    data: any = {
-        /** 音乐音量进度 */
-        finished: 0,
-        /** 音乐音量 */
-        total: 0,
-        /** 加载资源进度比例值 */
-        progress: "0",
-    };
-
-    private progress: number = 0;
-    /** 视图层逻辑代码分离演示 */
-    protected start() {
-        this.data.progress = 0;
-        this.setButton();
-        //监听
-    }
-
-    private btn_close(event: EventTouch) {
-        console.log("关闭页面");
-        oops.gui.remove(UIID.Setting)
-    }
-
-    //VMEvent的改变回调
-    private onTest(newNum: any, oldNum: any) {
-        console.log(newNum, "==========", oldNum);
-
-
-    }
-
-    //滑动的回调
-    private onSliderCallback(event: Slider) {
-        console.log("slider回调===========", event);
-        let progress = event.progress;
-        //保留两位小数
-
-        let num = Math.round(progress * 100) / 100;
-        this.data.progress = num;
-    }
-
-
-    /** 加载进度事件 */
-    // private onProgressCallback(finished: number, total: number, item: any) {
-    //     oops.log.logView(finished, ">>>>>>>>>>>>>>>")
-    //     this.data.finished = finished;
-    //     this.data.total = total;
-
-    //     var progress = finished / total;
-    //     if (progress > this.progress) {
-    //         this.progress = progress;
-    //         this.data.progress = (progress * 100).toFixed(2);
-    //     }
-    // }
-
-    /** 视图对象通过 ecs.Entity.remove(SetViewComp) 删除组件是触发组件处理自定义释放逻辑 */
-    reset() {
-        this.node.destroy();
-    }
-}

+ 187 - 0
assets/script/game/common/setting/SettingView.ts

@@ -0,0 +1,187 @@
+/*
+ * @Author: mojunshou 1637302775@qq.com
+ * @Date: 2025-03-18 15:35:37
+ * @LastEditors: mojunshou 1637302775@qq.com
+ * @LastEditTime: 2025-03-18 17:14:13
+ * @Description: 游戏设置界面
+ */
+import { _decorator, Label, Sprite } from 'cc';
+import { oops } from 'db://oops-framework/core/Oops';
+import { GameComponent } from "db://oops-framework/module/common/GameComponent";
+import { UIID } from '../config/GameUIConfig';
+import { PlatformUtil } from 'db://oops-framework/core/utils/PlatformUtil';
+
+const { ccclass, property } = _decorator;
+
+/** 显示对象控制 */
+@ccclass('SettingView')
+export class SettingView extends GameComponent {
+
+    lab_name: Label | null = null;    //名字
+    lab_ivnvite: Label | null = null!; //邀请
+    sp_head: Sprite | null = null!;    //头像
+    lab_groupnum: Label | null = null!; //群号
+
+
+    lab_proto: Label | null = null!; //协议
+    lab_privacy: Label | null = null!; //隐私
+    lab_about: Label | null = null!; //关于
+    lab_update: Label | null = null!; //更新
+    lab_logout: Label | null = null!; //注销
+    lab_exit: Label | null = null!; //退出
+
+    protected start() {
+        this.setButton();
+        this.initComponents();
+    }
+
+
+    private initComponents() {
+
+        const lab_name = this.node.getChildByPath('btn_head/lab_name');
+        if (lab_name) {
+            this.lab_name = lab_name.getComponent(Label);
+        }
+
+        const lab_ivnvite = this.node.getChildByPath('btn_head/lab_ivnvite');
+        if (lab_ivnvite) {
+            this.lab_ivnvite = lab_ivnvite.getComponent(Label);
+        }
+
+        const sp_head = this.node.getChildByPath('btn_head/sp_head');
+        if (sp_head) {
+            this.sp_head = sp_head.getComponent(Sprite);
+        }
+
+        const lab_groupnum = this.node.getChildByPath('btn_group/lab_groupnum');
+        if (lab_groupnum) {
+            this.lab_groupnum = lab_groupnum.getComponent(Label);
+        }
+
+        const lab_proto = this.node.getChildByName('btn_proto');
+        if (lab_proto) {
+            this.lab_proto = lab_proto.getComponent(Label);
+        }
+
+        const lab_privacy = this.node.getChildByName('btn_privacy');
+        if (lab_privacy) {
+            this.lab_privacy = lab_privacy.getComponent(Label);
+        }
+
+        const lab_about = this.node.getChildByName('btn_about');
+        if (lab_about) {
+            this.lab_about = lab_about.getComponent(Label);
+        }
+
+        const lab_update = this.node.getChildByName('btn_update');
+        if (lab_update) {
+            this.lab_update = lab_update.getComponent(Label);
+        }
+
+        const lab_logout = this.node.getChildByName('btn_logout');
+        if (lab_logout) {
+            this.lab_logout = lab_logout.getComponent(Label);
+        }
+
+        const lab_exit = this.node.getChildByName('btn_exit');
+        if (lab_exit) {
+            this.lab_exit = lab_exit.getComponent(Label);
+        }
+    }
+
+    /**
+     * @description: 点击头像逻辑
+     * @return {*}
+     */
+    private btn_head() {
+        //复制邀请码
+        // oops.gui.copyText(this.lab_ivnvite!.string);
+        // PlatformUtil.copyText(this.lab_ivnvite!.string);
+    }
+
+    /**
+     * @description: 客服
+     * @return {*}
+     */
+    private btn_service() {
+
+
+
+    }
+
+    /**
+     * @description: 清理缓存
+     * @return {*}
+     */
+    private btn_cache() {
+
+
+
+    }
+
+    /**
+     * @description: 关闭
+     * @return {*}
+     */
+    private btn_close() {
+        oops.gui.remove(UIID.Setting)
+    }
+
+
+
+    /**
+     * @description: 协议
+     * @return {*}
+     */
+    private btn_proto() {
+
+
+
+    }
+
+    /**
+     * @description: 隐私
+     * @return {*}
+     */
+    private btn_privacy() {
+
+    }
+
+    /**
+     * @description: 关于
+     * @return {*}
+     */
+    private btn_about() {
+
+    }
+
+
+    private btn_update() {
+
+    }
+
+    /**
+     * @description: 注销
+     * @return {*}
+     */
+    private btn_logout() {
+
+    }
+
+
+    /**
+     * @description: 退出
+     * @return {*}
+     */
+    private btn_exit() {
+        //清除缓存
+
+
+        //重启游戏
+
+
+    }
+
+
+
+}

+ 1 - 1
assets/script/game/common/setting/SetViewComp.ts.meta

@@ -2,7 +2,7 @@
   "ver": "4.0.24",
   "importer": "typescript",
   "imported": true,
-  "uuid": "aa1d3e49-b396-4e7e-863e-38eee315af2c",
+  "uuid": "c559c16f-30d0-4546-806d-7056a2a91a68",
   "files": [],
   "subMetas": {},
   "userData": {}

+ 9 - 10
assets/script/game/eliminate/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-11 18:05:45
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-18 10:13:28
+ * @LastEditTime: 2025-03-18 14:39:01
  * @Description: 
  */
 import { _decorator, Color, EventTouch, instantiate, JsonAsset, Node, Prefab, Sprite, UITransform, Vec3, Widget, tween } from "cc";
@@ -77,9 +77,6 @@ export class EliminateViewComp extends CCComp {
     @property({ type: Prefab, displayName: "红包预制体" })
     private redPacketPrefab: Prefab = null!;
 
-    @property({ type: Prefab, displayName: "锤子预制体" })
-    private hammerPrefab: Prefab = null!;
-
     //游戏状态
     game_status: number = GameStatus.None;
     max_row: number = 0;
@@ -575,7 +572,6 @@ export class EliminateViewComp extends CCComp {
             console.log("打印进这里来了")
             return
         }
-        //这个事件不生效
         brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
             // if (this.adShowingFlag) return
             // 未操作完时不能操作下一个方块
@@ -647,7 +643,9 @@ export class EliminateViewComp extends CCComp {
                         }
                     }
                 }
-                if (gridData === null) return
+                if (gridData === null) {
+                    return;
+                }
                 tempGridList.push(gridData)
             })
             // 检查整体情况
@@ -663,8 +661,9 @@ export class EliminateViewComp extends CCComp {
             }
             // 格子给用户提示
             tempGridList.forEach((gridData) => {
-                if (gridData.status !== GridStatus.NotUse) return
-
+                if (gridData.status !== GridStatus.NotUse) {
+                    return;
+                }
                 if (gridData.gridNode) {
                     const children = gridData.gridNode.children[0];
                     if (children) {
@@ -675,7 +674,8 @@ export class EliminateViewComp extends CCComp {
                 this.gridColorList.push(gridData)
             })
         })
-        // 触摸松开后,这里有问题,到位置,提示格子是绿色,能放置,但是不动了,正常应该能过去并且放置到格子的
+
+        // 触摸结束
         brickNode.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
             console.log("移动结束数据查看", this.editingData.gridList.length);
             console.log("brickData数据查看", this.editingData.brickData);
@@ -1437,7 +1437,6 @@ export class EliminateViewComp extends CCComp {
                             bestRotation = { gridConfig: currentGridConfig, deg: currentDeg }
                         }
                     }
-
                     // 如果方块可以旋转,计算下一个旋转状态
                     if (brickData.rotateFlag && rotation < 3) {
                         const next = this.nextGridRotate(currentGridConfig, currentDeg)

+ 2 - 3
assets/script/game/initialize/view/LoadingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: dgflash
  * @Date: 2021-07-03 16:13:17
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-13 14:43:57
+ * @LastEditTime: 2025-03-19 10:18:14
  */
 import { _decorator } from "cc";
 import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
@@ -58,7 +58,7 @@ export class LoadingViewComp extends CCVMParentComp {
         }
     }
 
-    /** 加载资源 */
+    /** 加载资源,如果登录成功,再进行加载,没登录就进行登录 */
     private async loadRes() {
         this.data.progress = 0;
         await this.loadCustom();
@@ -82,7 +82,6 @@ export class LoadingViewComp extends CCVMParentComp {
     private onProgressCallback(finished: number, total: number, item: any) {
         this.data.finished = finished;
         this.data.total = total;
-
         var progress = finished / total;
         if (progress > this.progress) {
             this.progress = progress;