future 1 жил өмнө
parent
commit
25acfd3104

+ 28 - 28
assets/resources/ui/rank.prefab

@@ -3542,7 +3542,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 3,
+      "x": 0,
       "y": 9,
       "z": 0
     },
@@ -3584,7 +3584,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 25,
-      "height": 100
+      "height": 120
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -3622,11 +3622,11 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 25,
+    "_actualFontSize": 23,
+    "_fontSize": 23,
     "_fontFamily": "Arial",
     "_lineHeight": 30,
-    "_overflow": 2,
+    "_overflow": 1,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
@@ -3692,8 +3692,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 71,
-      "height": 138
+      "width": 96,
+      "height": 152
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -5051,7 +5051,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 3,
+      "x": 0,
       "y": 9,
       "z": 0
     },
@@ -5093,7 +5093,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 25,
-      "height": 100
+      "height": 120
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -5131,11 +5131,11 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 25,
+    "_actualFontSize": 23,
+    "_fontSize": 23,
     "_fontFamily": "Arial",
     "_lineHeight": 30,
-    "_overflow": 2,
+    "_overflow": 1,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
@@ -5201,8 +5201,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 71,
-      "height": 138
+      "width": 96,
+      "height": 152
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -6560,7 +6560,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 3,
+      "x": 0,
       "y": 9,
       "z": 0
     },
@@ -6602,7 +6602,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 25,
-      "height": 100
+      "height": 120
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -6640,11 +6640,11 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 25,
+    "_actualFontSize": 23,
+    "_fontSize": 23,
     "_fontFamily": "Arial",
     "_lineHeight": 30,
-    "_overflow": 2,
+    "_overflow": 1,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
@@ -6710,8 +6710,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 71,
-      "height": 138
+      "width": 96,
+      "height": 152
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -9368,7 +9368,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 3,
+      "x": 0,
       "y": 9,
       "z": 0
     },
@@ -9410,7 +9410,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 25,
-      "height": 100
+      "height": 120
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -9448,11 +9448,11 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 25,
+    "_actualFontSize": 23,
+    "_fontSize": 23,
     "_fontFamily": "Arial",
     "_lineHeight": 30,
-    "_overflow": 2,
+    "_overflow": 1,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
@@ -9518,8 +9518,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 71,
-      "height": 138
+      "width": 96,
+      "height": 152
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 8 - 8
assets/resources/ui/rank_list_item.prefab

@@ -457,7 +457,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 3,
+      "x": 0,
       "y": 9,
       "z": 0
     },
@@ -499,7 +499,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 25,
-      "height": 100
+      "height": 120
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -537,11 +537,11 @@
     "_string": "",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 25,
+    "_actualFontSize": 23,
+    "_fontSize": 23,
     "_fontFamily": "Arial",
     "_lineHeight": 30,
-    "_overflow": 2,
+    "_overflow": 1,
     "_enableWrapText": true,
     "_font": null,
     "_isSystemFontUsed": true,
@@ -607,8 +607,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 71,
-      "height": 138
+      "width": 96,
+      "height": 152
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -649,7 +649,7 @@
     },
     "_type": 0,
     "_fillType": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
       "x": 0,

+ 10 - 5
assets/script/tools.ts

@@ -76,13 +76,18 @@ export class tools  {
         }
     }
 
-    public static substring(string:string, length:number):string {
-        if(string.length>length) {
-            string = string.substring(0,length)
+    public static substringRankRegionName(node:Node,string:string) {
+        let lab_component = node.getComponent(Label)
+        if(lab_component==null) { return }
+        if(string.length>4) {
+            string = string.substring(0,4)
         }
-        return string
+        if(string.length==2) {
+            lab_component.lineHeight = 60
+        }
+        lab_component.string = string
     }
-    
+
 }
 
 

+ 1 - 2
assets/script/ui/rank/rank_list_item.ts

@@ -32,8 +32,7 @@ export class rank_list_item extends base_ui {
         tools.loadRemoteImg(data.avatarUrl, (r)=>{
             this.img_avatar.getComponent(Sprite).spriteFrame = r.sf
         })
-
-        this.lab_region.getComponent(Label).string = tools.substring(data.city_name,4)
+        tools.substringRankRegionName(this.lab_region, data.city_name)
         tools.labelCutString(this.lab_nickname,data.nickName,8,false) //this.lab_nickname.getComponent(Label).string = data.nickName
         this.lab_score.getComponent(Label).string = data.score + ' 分'
         this.img_car.getComponent(Sprite).spriteFrame = GameManager.getUserCarInfo(data.user_id,data.car_id).sf

+ 1 - 1
assets/script/ui/rank/rank_list_top.ts

@@ -122,7 +122,7 @@ export class rank_list_top extends base_ui {
         } else {
             bg_node.active = true
         }
-        node.getComponent(Label).string = data.city_name
+        tools.substringRankRegionName(node, data.city_name)
     }
 
     private onClickRankGotoUserInfo(data:rankData) {

+ 1 - 1
assets/script/ui/rank/rank_my_info.ts

@@ -52,7 +52,7 @@ export class rank_my_info extends Component {
         tools.loadRemoteImg(data.avatarUrl, (r)=>{
             this.img_avatar.getComponent(Sprite).spriteFrame = r.sf
         })
-        this.lab_region.getComponent(Label).string = data.city_name
+        tools.substringRankRegionName(this.lab_region, data.city_name)
         this.lab_nickname.getComponent(Label).string = data.nickName
         this.lab_score.getComponent(Label).string = data.score + ' 分'
         this.img_car.getComponent(Sprite).spriteFrame = GameManager.getUserDefaultRankCarSf()

BIN
assets/texture/ui/rank/rank_region_bg.png


+ 21 - 21
assets/texture/ui/rank/rank_region_bg.png.meta

@@ -39,17 +39,17 @@
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {
-        "trimType": "auto",
+        "trimType": "custom",
         "trimThreshold": 1,
         "rotated": false,
         "offsetX": 0,
         "offsetY": 0,
         "trimX": 0,
         "trimY": 0,
-        "width": 71,
-        "height": 138,
-        "rawWidth": 71,
-        "rawHeight": 138,
+        "width": 96,
+        "height": 152,
+        "rawWidth": 96,
+        "rawHeight": 152,
         "borderTop": 0,
         "borderBottom": 0,
         "borderLeft": 0,
@@ -61,17 +61,17 @@
         "meshType": 0,
         "vertices": {
           "rawPosition": [
-            -35.5,
-            -69,
+            -48,
+            -76,
             0,
-            35.5,
-            -69,
+            48,
+            -76,
             0,
-            -35.5,
-            69,
+            -48,
+            76,
             0,
-            35.5,
-            69,
+            48,
+            76,
             0
           ],
           "indexes": [
@@ -84,12 +84,12 @@
           ],
           "uv": [
             0,
-            138,
-            71,
-            138,
+            152,
+            96,
+            152,
             0,
             0,
-            71,
+            96,
             0
           ],
           "nuv": [
@@ -103,13 +103,13 @@
             1
           ],
           "minPos": [
-            -35.5,
-            -69,
+            -48,
+            -76,
             0
           ],
           "maxPos": [
-            35.5,
-            69,
+            48,
+            76,
             0
           ]
         },