future 1 жил өмнө
parent
commit
4b679c35fc

+ 1 - 1
assets/edit_game.scene

@@ -344,7 +344,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 980.5263157894738,
+    "_orthoHeight": 985.388429752066,
     "_near": 0,
     "_far": 1000,
     "_color": {

+ 371 - 16
assets/resources/prefab/event_item.prefab

@@ -25,20 +25,20 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 36
+        "__id__": 50
       },
       {
-        "__id__": 38
+        "__id__": 52
       },
       {
-        "__id__": 40
+        "__id__": 54
       },
       {
-        "__id__": 42
+        "__id__": 56
       }
     ],
     "_prefab": {
-      "__id__": 44
+      "__id__": 58
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -86,22 +86,25 @@
       },
       {
         "__id__": 15
+      },
+      {
+        "__id__": 29
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 29
+        "__id__": 43
       },
       {
-        "__id__": 31
+        "__id__": 45
       },
       {
-        "__id__": 33
+        "__id__": 47
       }
     ],
     "_prefab": {
-      "__id__": 35
+      "__id__": 49
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -753,18 +756,367 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btn_edit_name",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [
+      {
+        "__id__": 30
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 36
+      },
+      {
+        "__id__": 38
+      },
+      {
+        "__id__": 40
+      }
+    ],
+    "_prefab": {
+      "__id__": 42
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 169.188,
+      "y": -64,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 512,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 29
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 31
+      },
+      {
+        "__id__": 33
+      }
+    ],
+    "_prefab": {
+      "__id__": 35
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 2
+      "__id__": 30
     },
     "_enabled": true,
     "__prefab": {
+      "__id__": 32
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 50,
+      "height": 30
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "7dRiI+lctC6KW9r73ZvncP"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
       "__id__": 30
     },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 34
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_string": "修改",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 20,
+    "_fontSize": 20,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "2bzsg2uE1E2qd+WAa2CTnd"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "b571JiTRZL7Jt+OQSRLVWI",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 29
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 37
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 50,
+      "height": 35
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "158mYhkqBI+40ttTYr5X88"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 29
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 39
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "42R083BGhLIbnJTo9SD5L0"
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 29
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 41
+    },
+    "clickEvents": [],
+    "_interactable": true,
+    "_transition": 2,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 214,
+      "g": 214,
+      "b": 214,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_hoverSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_pressedSprite": {
+      "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_disabledSprite": {
+      "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": {
+      "__id__": 29
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e9cirJP9lNYbN+OwUQWGnm"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "e12I8utwROerK6mCC5r8DX",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 44
+    },
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 360,
@@ -791,7 +1143,7 @@
     },
     "_enabled": false,
     "__prefab": {
-      "__id__": 32
+      "__id__": 46
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -836,7 +1188,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 34
+      "__id__": 48
     },
     "_alignFlags": 40,
     "_target": null,
@@ -885,7 +1237,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 37
+      "__id__": 51
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -913,7 +1265,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 39
+      "__id__": 53
     },
     "_resizeMode": 1,
     "_layoutType": 2,
@@ -951,7 +1303,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 41
+      "__id__": 55
     },
     "lab_event_id": {
       "__id__": 9
@@ -962,6 +1314,9 @@
     "btn_edit_event": {
       "__id__": 15
     },
+    "btn_edit_name": {
+      "__id__": 29
+    },
     "_id": ""
   },
   {
@@ -978,7 +1333,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 43
+      "__id__": 57
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,

+ 1 - 1
assets/resources/prefab/run/game_run.prefab

@@ -6892,7 +6892,7 @@
         "__id__": 412
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 476

+ 14 - 1
assets/script/edit/event/event_item_view.ts

@@ -9,9 +9,18 @@ export class event_item_view extends Component {
     @property(Node) lab_event_id:Node = null;
     @property(Node) lab_event_name:Node = null;
     @property(Node) btn_edit_event:Node = null;
+    @property(Node) btn_edit_name:Node = null;
     private m_type:number = 0;
     private m_data:event_item = null;
     private m_delete_call = null;
+    protected start(): void {
+        this.btn_edit_name.on(Node.EventType.TOUCH_END, ()=>{
+            tools.show_dialog_input(this.m_data.event_name, (str)=>{
+                this.m_data.event_name = str
+                this.updateEventName()
+            })
+        })
+    }
     public initView(type:number,data:event_item,delete_call){
         this.m_data = data;
         this.m_type = type;
@@ -20,7 +29,7 @@ export class event_item_view extends Component {
         // this.lab_event_id.getComponent(Label).string = `当前-${ config.event_type_map.get(this.m_type)}-事件id:${this.m_data.event_id}`
         // this.lab_event_name.getComponent(Label).string = `当前事件名字:${this.m_data.event_name}`
         this.lab_event_id.getComponent(Label).string = `${ config.event_type_map.get(this.m_type)}-id:${this.m_data.event_id}`
-        this.lab_event_name.getComponent(Label).string = `事件名字:${this.m_data.event_name}`
+        this.updateEventName()
         this.btn_edit_event.on(Node.EventType.TOUCH_END,()=>{
             tools.show_edit_event( this.m_type ,this.m_data,(data)=>{
                 if(this.m_delete_call!=null){
@@ -32,6 +41,10 @@ export class event_item_view extends Component {
       
     }
 
+    private updateEventName(){
+        this.lab_event_name.getComponent(Label).string = `事件名字:${this.m_data.event_name}`
+    }
+
     unselectBgColor(){
         this.node.getComponent(Sprite).color = new Color().fromHEX("#9EB2F1")
     }