Quellcode durchsuchen

协议面板调整

薛鸿潇 vor 5 Jahren
Ursprung
Commit
61ba3ccb2f

Datei-Diff unterdrückt, da er zu groß ist
+ 48 - 214
assets/resources/module/setting/rule.prefab


+ 64 - 52
assets/resources/module/setting/setting.prefab

@@ -24,6 +24,9 @@
     "_active": true,
     "_components": [
       {
+        "__id__": 82
+      },
+      {
         "__id__": 83
       },
       {
@@ -46,8 +49,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -58,8 +61,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
-        0,
+        375,
+        667,
         0,
         0,
         0,
@@ -150,15 +153,16 @@
       },
       {
         "__id__": 77
-      },
+      }
+    ],
+    "_active": true,
+    "_components": [
       {
         "__id__": 80
       }
     ],
-    "_active": true,
-    "_components": [],
     "_prefab": {
-      "__id__": 82
+      "__id__": 81
     },
     "_opacity": 255,
     "_color": {
@@ -170,8 +174,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 750,
+      "height": 1334
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -3020,54 +3024,37 @@
     "sync": false
   },
   {
-    "__type__": "cc.Node",
+    "__type__": "cc.Widget",
+    "_name": "",
     "_objFlags": 0,
-    "_parent": {
+    "node": {
       "__id__": 2
     },
-    "_prefab": {
-      "__id__": 81
-    },
-    "_name": "rule",
-    "_active": false,
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": {
+      "__id__": 1
     },
+    "_alignFlags": 45,
+    "_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": 0,
     "_id": ""
   },
   {
     "__type__": "cc.PrefabInfo",
     "root": {
-      "__id__": 80
-    },
-    "asset": {
-      "__uuid__": "7e4d3969-92a1-47cb-a7f0-d6b362601c86"
-    },
-    "fileId": "eeOUTd16xITJkri2+FSKra",
-    "sync": true
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
       "__id__": 1
     },
     "asset": {
@@ -3102,9 +3089,7 @@
     "lbl_version": {
       "__id__": 78
     },
-    "node_rule": {
-      "__id__": 80
-    },
+    "node_rule": null,
     "_id": ""
   },
   {
@@ -3143,6 +3128,33 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_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": 0,
+    "_id": ""
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1

+ 2 - 1
assets/script/game/component/BtnOpenPanel.ts

@@ -31,11 +31,12 @@ export default class BtnOpenPanel extends cc.Component {
     private async openPanel() {
         mk.audio.playEffect("button");
         if (!this.panel_name) return;
-        await mk.ui.openPanel(this.panel_name, this.open_type);        
+        await mk.ui.openPanel(this.panel_name, this.open_type);
         const c_count = this.onComplete.length;
         for (let i = 0; i < c_count; i++) {
             if (this.onComplete[i].handler) this.onComplete[i].emit([])
         }
+        mk.console.log('open->' + this.panel_name)
     }
     // update (dt) {}
 }

+ 3 - 2
assets/script/game/module/setting/Setting.ts

@@ -22,7 +22,7 @@ export default class Setting extends cc.Component {
     img_effect: cc.Sprite = null;
     @property({ type: cc.Label, displayName: "版本号" })
     lbl_version: cc.Label = null;
-    @property({ type: cc.Node, displayName: "协议内容" })
+    // @property({ type: cc.Node, displayName: "协议内容" })
     node_rule: cc.Node = null;
 
     onLoad() {
@@ -66,7 +66,8 @@ export default class Setting extends cc.Component {
 
     }
 
-    clickRule(e,data) {
+    async clickRule(e, data) {
+        if (!this.node_rule) this.node_rule = await mk.ui.openPanel('module/setting/rule');
         let sc = this.node_rule.getComponent(Rule) as Rule;
         sc.setContent(data);
         this.node_rule.active = true;

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.