From 2bae3c0846080a3e2a271caf653c8b667c3d60db Mon Sep 17 00:00:00 2001 From: zhuguoqing Date: Wed, 25 May 2022 18:04:22 +0800 Subject: [PATCH] update friend --- .../resources/prefabs/tips/pb_Invite.prefab | 1354 +++++++++++++++++ .../prefabs/tips/pb_Invite.prefab.meta | 7 + .../resources/prefabs/tips/pb_logout.prefab | 2 +- .../scripts/UI/UIFriend/SingleFriendList.js | 35 +- assets/scripts/UI/UIMain.js | 7 +- assets/scripts/UI/battlematch/UITeamMatch.js | 3 +- assets/scripts/tips/InviteTip.ts | 41 + assets/scripts/tips/InviteTip.ts.meta | 9 + 8 files changed, 1446 insertions(+), 12 deletions(-) create mode 100644 assets/resources/prefabs/tips/pb_Invite.prefab create mode 100644 assets/resources/prefabs/tips/pb_Invite.prefab.meta create mode 100644 assets/scripts/tips/InviteTip.ts create mode 100644 assets/scripts/tips/InviteTip.ts.meta diff --git a/assets/resources/prefabs/tips/pb_Invite.prefab b/assets/resources/prefabs/tips/pb_Invite.prefab new file mode 100644 index 00000000..4e444f1b --- /dev/null +++ b/assets/resources/prefabs/tips/pb_Invite.prefab @@ -0,0 +1,1354 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "", + "_objFlags": 0, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "asyncLoadAssets": false + }, + { + "__type__": "cc.Node", + "_name": "pb_Invite", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 7 + } + ], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 37 + }, + { + "__id__": 38 + } + ], + "_prefab": { + "__id__": 39 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1024, + "height": 512 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 512, + "y": 256, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "New Sprite(Splash)", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 4 + }, + { + "__id__": 5 + } + ], + "_prefab": { + "__id__": 6 + }, + "_opacity": 180, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 1024, + "height": 512 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_state": 0, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_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": 100, + "_originalHeight": 100, + "_id": "" + }, + { + "__type__": "cc.BlockInputEvents", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "0bmPoCOyFDjKDtw1BaWy9N", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "uibg", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 8 + }, + { + "__id__": 21 + }, + { + "__id__": 24 + }, + { + "__id__": 27 + } + ], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 35 + } + ], + "_prefab": { + "__id__": 36 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 669.5, + "height": 278.3 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "top", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 9 + }, + { + "__id__": 12 + } + ], + "_active": true, + "_level": 4, + "_components": [], + "_prefab": { + "__id__": 20 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 95.9405941, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "title", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 10 + } + ], + "_prefab": { + "__id__": 11 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 247, + "g": 194, + "b": 59, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 300.12, + "height": 80 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 0.6, + "y": 0.6, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 9 + }, + "_enabled": true, + "_useOriginalSize": false, + "_string": "Party Invite", + "_N$string": "Party Invite", + "_fontSize": 60, + "_lineHeight": 80, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 0, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "e2frVL381BGZ8JuiZBMIce", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "btn_close", + "_objFlags": 0, + "_parent": { + "__id__": 8 + }, + "_children": [ + { + "__id__": 13 + } + ], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 17 + } + ], + "_prefab": { + "__id__": 19 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 35, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 250.3, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 12 + }, + "_children": [], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 14 + }, + { + "__id__": 15 + } + ], + "_prefab": { + "__id__": 16 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 35, + "height": 35 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c74f487b-f4cf-4ca8-b3b8-39a24aa87336" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_state": 0, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "alignMode": 0, + "_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": 100, + "_originalHeight": 40, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "80SixWdFFFlpQuLphSpLzA", + "sync": false + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [ + { + "__id__": 18 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "c74f487b-f4cf-4ca8-b3b8-39a24aa87336" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 13 + }, + "_id": "" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "30701fYF8RDcYYOfkIkdYpy", + "handler": "onClose", + "customEventData": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "65YPvoRxFA9Z/OWh7iOG9H", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "faPZ4q47NIkpE2vTAyb1ex", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "txt", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_level": 4, + "_components": [ + { + "__id__": 22 + } + ], + "_prefab": { + "__id__": 23 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 258.47, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": -34, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_useOriginalSize": true, + "_string": "Invite you join team", + "_N$string": "Invite you join team", + "_fontSize": 30, + "_lineHeight": 60, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "69ZPCgVK5H6Iy6ecHdFMdT", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "txt copy", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_level": 4, + "_components": [ + { + "__id__": 25 + } + ], + "_prefab": { + "__id__": 26 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 163, + "g": 255, + "b": 155, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 143.99, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 29, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 24 + }, + "_enabled": true, + "_useOriginalSize": true, + "_string": "Your friend", + "_N$string": "Your friend", + "_fontSize": 30, + "_lineHeight": 60, + "_enableWrapText": true, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "87cMmo/fNAoLX45a+pQFr8", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "btnConfirm", + "_objFlags": 0, + "_parent": { + "__id__": 7 + }, + "_children": [ + { + "__id__": 28 + } + ], + "_active": true, + "_level": 4, + "_components": [ + { + "__id__": 31 + }, + { + "__id__": 33 + } + ], + "_prefab": { + "__id__": 34 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 109, + "height": 45 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": -95.049505, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "New Label", + "_objFlags": 0, + "_parent": { + "__id__": 27 + }, + "_children": [], + "_active": true, + "_level": 5, + "_components": [ + { + "__id__": 29 + } + ], + "_prefab": { + "__id__": 30 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 171, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": -0.950495, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 0.4, + "y": 0.5, + "z": 1 + }, + "_rotationX": 0, + "_rotationY": 0, + "_quat": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_skewX": 0, + "_skewY": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_useOriginalSize": false, + "_string": "Confirm", + "_N$string": "Confirm", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": true, + "_N$file": { + "__uuid__": "ef2a48cc-8f1a-4965-b9ba-3deca921b41a" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 0, + "_N$cacheMode": 0, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "28yhHa/TFEpJiBS4NQHtIO", + "sync": false + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 0.9, + "clickEvents": [ + { + "__id__": 32 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 3, + "transition": 3, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 214, + "g": 214, + "b": 214, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_N$normalSprite": null, + "_N$pressedSprite": null, + "pressedSprite": null, + "_N$hoverSprite": null, + "hoverSprite": null, + "_N$disabledSprite": null, + "_N$target": { + "__id__": 27 + }, + "_id": "" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 1 + }, + "component": "", + "_componentId": "30701fYF8RDcYYOfkIkdYpy", + "handler": "onClickOK", + "customEventData": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "7327600a-7c4e-4fed-a79a-dcf9775e5d9e" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_state": 0, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "22zqHiYBhIAZ001CnlQf7Z", + "sync": false + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "b6189259-190d-4fc6-b890-f104d58a7685" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_state": 0, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "7e67v+pp5BirKVLN3Y+Iy5", + "sync": false + }, + { + "__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__": "30701fYF8RDcYYOfkIkdYpy", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "namelabel": { + "__id__": 25 + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__uuid__": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa" + }, + "fileId": "b42iyyWmFAnLJ4bwF6Dpg0", + "sync": false + } +] \ No newline at end of file diff --git a/assets/resources/prefabs/tips/pb_Invite.prefab.meta b/assets/resources/prefabs/tips/pb_Invite.prefab.meta new file mode 100644 index 00000000..3c2a4d5d --- /dev/null +++ b/assets/resources/prefabs/tips/pb_Invite.prefab.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.0.1", + "uuid": "7ec5284f-dad5-4c1a-969d-0b75c01c3daa", + "optimizationPolicy": "AUTO", + "asyncLoadAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/resources/prefabs/tips/pb_logout.prefab b/assets/resources/prefabs/tips/pb_logout.prefab index fc6fe809..697c97a8 100644 --- a/assets/resources/prefabs/tips/pb_logout.prefab +++ b/assets/resources/prefabs/tips/pb_logout.prefab @@ -12,7 +12,7 @@ }, { "__type__": "cc.Node", - "_name": "pb_wallet", + "_name": "pb_Iogout", "_objFlags": 0, "_parent": null, "_children": [ diff --git a/assets/scripts/UI/UIFriend/SingleFriendList.js b/assets/scripts/UI/UIFriend/SingleFriendList.js index a6993e2c..cf26fb5d 100644 --- a/assets/scripts/UI/UIFriend/SingleFriendList.js +++ b/assets/scripts/UI/UIFriend/SingleFriendList.js @@ -1,4 +1,5 @@ var Utils = require('Utils'); +var playerData = require('playerData'); cc.Class({ extends: cc.Component, @@ -42,6 +43,9 @@ cc.Class({ }, init(data) { + // + this.canInvite = true; + // this.playerAccount = data.account_id; if (data.name) { @@ -140,14 +144,27 @@ cc.Class({ }, onInviteFriend() { - console.log('邀请好友'); - // 发送自定义消息 - cc.chatMgr.sendmsg('CMSendCustomMsg', { - target_list: this.playerAccount, - msg: 'InvitePlay', - param1: 0, - param2: 0, - param3: 0, - }); + if (this.canInvite) { + this.canInvite = false; + console.log('邀请好友'); + var data = { + msg: 'InvitePlay', + player: playerData.name, + data: JSON.parse(this.tmpData), + }; + // 发送自定义消息 + cc.chatMgr.sendmsg('CMSendCustomMsg', { + target_list: this.playerAccount, + msg: JSON.stringify(data), + param1: 0, + param2: 0, + param3: 0, + }); + } else { + cc.uiHelper.showTips('Already invited, try again later'); + setTimeout(() => { + this.canInvite = true; + }, 15000); + } }, }); diff --git a/assets/scripts/UI/UIMain.js b/assets/scripts/UI/UIMain.js index 5b714ba7..d7238327 100644 --- a/assets/scripts/UI/UIMain.js +++ b/assets/scripts/UI/UIMain.js @@ -10,6 +10,7 @@ const { GuestLoginTip } = require('../tips/GuestLoginTip'); const { LogoutTip } = require('../tips/LogoutTip'); const { operation, OperationType } = require('../Operation/Operation'); const jcgamelog = require('../jcfw/service/jcgamelog'); +const { InviteTip } = require('../tips/InviteTip'); cc.Class({ extends: cc.Component, @@ -231,7 +232,11 @@ cc.Class({ }, getCustomMsg(msg) { - console.log('custom msg:' + msg); + // 只有不在游戏中的时候出现 + console.log('get once '); + if (!cc.find('Canvas').getComponentInChildren('GameUI')) { + uimanger.showUI(InviteTip.prefabPath, msg); + } }, getwalletEvent() { diff --git a/assets/scripts/UI/battlematch/UITeamMatch.js b/assets/scripts/UI/battlematch/UITeamMatch.js index 3746af2a..d3ba6f46 100644 --- a/assets/scripts/UI/battlematch/UITeamMatch.js +++ b/assets/scripts/UI/battlematch/UITeamMatch.js @@ -204,6 +204,7 @@ cc.Class({ cc.uiMain.callChat(); }, updateteaminfo(v) { + this.inviteTeamInfo = v; if (v.errcode == 0) { var info = v.team_info; this.btn_start.active = @@ -269,7 +270,7 @@ cc.Class({ } for (let i = 0; i < this.friend_list.length; i += 1) { - this.initOne(this.friend_list[i].base_data, this.friend_list[i]); + this.initOne(this.friend_list[i].base_data, this.inviteTeamInfo); } }, diff --git a/assets/scripts/tips/InviteTip.ts b/assets/scripts/tips/InviteTip.ts new file mode 100644 index 00000000..57f8a856 --- /dev/null +++ b/assets/scripts/tips/InviteTip.ts @@ -0,0 +1,41 @@ +import { UIBase } from '../UI/UIBase'; +var playerData = require('playerData'); +const { ccclass, property } = cc._decorator; + +@ccclass +export class InviteTip extends UIBase { + public static prefabPath = 'prefabs/tips/pb_Invite'; + @property(cc.Label) namelabel: cc.Label = null; + + private inviteData = ''; + private m_roomID = ''; + + init(data: any) { + this.inviteData = data.msg; + var tmp = JSON.parse(this.inviteData); + this.namelabel.string = tmp.player.toString(); + this.m_roomID = tmp.data.team_info.team_uuid; + } + + start() { + setTimeout(() => { + if (this.node) this.node.destroy(); + }, 15000); + } + + onClickOK() { + if (playerData.teamuuid) { + cc.uiHelper.showTips('Please leave the current team first'); + return; + } + if (this.m_roomID) { + cc.Notifier.emit('joinTeamRoom', '' + this.m_roomID); + } + this.node.destroy(); + // 加入队伍 + } + + onClose() { + this.node.destroy(); + } +} diff --git a/assets/scripts/tips/InviteTip.ts.meta b/assets/scripts/tips/InviteTip.ts.meta new file mode 100644 index 00000000..2bf892e3 --- /dev/null +++ b/assets/scripts/tips/InviteTip.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.0.5", + "uuid": "307017d8-17c4-4371-860e-7e4224758a72", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file