This commit is contained in:
guoqing.zhu 2022-05-30 19:46:41 +08:00
parent bf3ea6ca1f
commit 7d1b9146dd
17 changed files with 1698 additions and 840 deletions

View File

@ -47,8 +47,8 @@
},
"_scale": {
"__type__": "cc.Vec3",
"x": 0.739453136920929,
"y": 0.739453136920929,
"x": 0.28436189984387933,
"y": 0.28436189984387933,
"z": 1
},
"_quat": {

View File

@ -1,7 +0,0 @@
{
"ver": "1.0.1",
"uuid": "b7fa5c6e-e86a-4acb-a6b9-dddc3852f6b9",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -1059,7 +1059,7 @@
"__id__": 53
}
],
"_active": true,
"_active": false,
"_level": 2,
"_components": [
{

View File

@ -9509,14 +9509,14 @@
},
"_position": {
"__type__": "cc.Vec3",
"x": 424,
"y": 193,
"x": 221.9,
"y": 162.4,
"z": 0
},
"_scale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"x": 0.68,
"y": 0.68,
"z": 1
},
"_rotationX": 0,
@ -10491,7 +10491,7 @@
"btn_start": {
"__id__": 196
},
"nd_friendList": {
"friendList": {
"__id__": 264
},
"content_friend": {

View File

@ -4920,7 +4920,7 @@
"node": {
"__id__": 1
},
"_enabled": true,
"_enabled": false,
"_id": ""
},
{

View File

@ -1657,7 +1657,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 44.02,
"width": 45,
"height": 20
},
"_anchorPoint": {

View File

@ -48,14 +48,14 @@
"_level": 1,
"_components": [
{
"__id__": 124
"__id__": 121
},
{
"__id__": 125
"__id__": 122
}
],
"_prefab": {
"__id__": 126
"__id__": 123
},
"_opacity": 255,
"_color": {
@ -4060,20 +4060,17 @@
"_children": [
{
"__id__": 115
},
{
"__id__": 118
}
],
"_active": false,
"_level": 2,
"_components": [
{
"__id__": 121
"__id__": 118
}
],
"_prefab": {
"__id__": 123
"__id__": 120
},
"_opacity": 255,
"_color": {
@ -4121,7 +4118,7 @@
},
{
"__type__": "cc.Node",
"_name": "bg",
"_name": "btn_add",
"_objFlags": 0,
"_parent": {
"__id__": 114
@ -4141,14 +4138,14 @@
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"height": 30
"width": 38,
"height": 31
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -4192,10 +4189,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
"__uuid__": "eb8341e5-9f00-4bac-9c13-d8f9a87b802e"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
@ -4217,105 +4214,7 @@
"asset": {
"__uuid__": "cef03361-18fb-4a3d-a4fd-6babd3277617"
},
"fileId": "2adArhRGFC4LRUh1JKlVUM",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 114
},
"_children": [],
"_active": true,
"_level": 3,
"_components": [
{
"__id__": 119
}
],
"_prefab": {
"__id__": 120
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 35.02,
"height": 40
},
"_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.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 118
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "invite",
"_N$string": "invite",
"_fontSize": 15,
"_lineHeight": 40,
"_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__": "cef03361-18fb-4a3d-a4fd-6babd3277617"
},
"fileId": "a9Itw5JpRG3Y5k0qgHHSgO",
"fileId": "55ECtxcRpDmqbbNrqZBHIh",
"sync": false
},
{
@ -4330,7 +4229,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 122
"__id__": 119
}
],
"_N$interactable": true,

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "008b722a-185f-4d3c-bb13-aa7df302a817",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"subMetas": {}
}

View File

@ -34,8 +34,6 @@ if (isDevEnv()) {
singapore: '-test.kingsome.cn',
turkey: '-test-kingsome.cn',
};
}else{
console.log("正式服")
}
const netIdHash = (function () {

View File

@ -145,7 +145,7 @@ cc.Class({
onInviteFriend() {
if (this.canInvite) {
this.canInvite = false;
cc.Notifier.emit("inviteplayer")
var data = {
msg: 'InvitePlay',
player: playerData.name,

View File

@ -1,6 +1,8 @@
let viewCell = require('viewCell');
var gameConfig = require('gameConfig');
var Utils = require('Utils');
const { uimanger } = require('../UIManger');
const { playerInfoUI } = require('../../tips/PlayInfomationTips');
cc.Class({
extends: viewCell,
@ -73,7 +75,6 @@ cc.Class({
initdata(v) {
var u = JSON.stringify(v);
console.log(JSON.stringify(v));
v.user.ranked = v.ranked;
v = v.user;
var headid = v.head_id;
@ -120,6 +121,7 @@ cc.Class({
account_id: this.account_id,
hero_id: this.hero_id,
});
uimanger.showUI(playerInfoUI,this.account_id);
},
onDisable() {

View File

@ -33,6 +33,25 @@ cc.Class({
default: null,
type: cc.Node,
},
friendList:{
default:null,
type:cc.Node,
},
content_friend:{
default:null,
type:cc.Node,
},
friendScrollview:{
default:null,
type:cc.ScrollView,
},
pb_oneFriend:{
default:null,
type:cc.Prefab,
}
},
// LIFE-CYCLE CALLBACKS:
@ -52,11 +71,14 @@ cc.Class({
);
cc.director.on('SOCKETCLOSE', this.socketCloseCallBack, this);
this.btn_start.active = false;
cc.Notifier.on("friendlist", this, this.getFriendList.bind(this));
cc.Notifier.on("inviteplayer", this, this.onCloseFriendList.bind(this));
},
onDestroy() {
cc.playerData.team_list = null;
cc.Notifier.off('SMUpdateMatchInfo', this);
cc.director.off('SOCKETCLOSE', this);
cc.Notifier.off("friendlist", this, this.getFriendList.bind(this));
cc.playerData.teamuuid = null;
},
initdata(teamuuid) {
@ -183,10 +205,61 @@ cc.Class({
onclicktalk() {
cc.uiMain.callChat();
},
onOpenFriendList(){
this.friendList.active = true;
cc.chatMgr.sendmsg("CMFriendList");
},
setToNone() {
this.content_friend.destroyAllChildren();
this.friendScrollview.stopAutoScroll();
this.friendScrollview.scrollToTop();
},
initOne(data, tmpData = {}) {
const node = cc.instantiate(this.pb_oneFriend);
node.getComponent("SingleFriendList").setToInvite();
node.getComponent("SingleFriendList").init(data);
if (tmpData) node.getComponent("SingleFriendList").saveData(tmpData);
this.content_friend.addChild(node);
},
getFriendList(msg) {
this.setToNone();
this.friend_list = [];
for (var m = 0; m < msg.friend_list.length; m++) {
this.friend_list.push(msg.friend_list[m]);
}
for (var i = this.friend_list.length - 1; i >= 0; i--) {
if (
this.friend_list[i].base_data["account_id"] ==
SDKManage.account_id
) {
this.friend_list.splice(i, 1);
break;
}
}
for (let i = 0; i < this.friend_list.length; i += 1) {
var data={
player:cc.playerData.name,
teaminfo:this.team_info
}
this.initOne(this.friend_list[i].base_data, data);
}
},
onCloseFriendList(){
this.friendList.active = false;
},
updateteaminfo(v) {
console.log(v);
if (v.errcode == 0) {
var info = v.team_info;
this.team_info = v.team_info;
this.btn_start.active =
info.member_list[0].account_id == SDKManage.account_id;
this.refreshwait(info.member_list);

View File

@ -4,6 +4,8 @@ var playerData = require('playerData');
var gameConfig = require('gameConfig');
var Utils = require('Utils');
const BaseNet = require('../BaseNet');
const { uimanger } = require('../UI/UIManger');
const { playerInfoUI } = require('../tips/PlayInfomationTips');
function etos() {
return '<img src ="e' + arguments[0].match(/\d+/gi)[0] + '"/>';
@ -240,7 +242,8 @@ cc.Class({
// cc.Notifier.emit("openSelfPlayerInfoUI");
return;
}
cc.Notifier.emit('chat_playerInfo', this.m_data);
// cc.Notifier.emit('chat_playerInfo', this.m_data);
uimanger.showUI(playerInfoUI,this.account_id);
},
setmode(isself) {

View File

@ -12,9 +12,10 @@ export class InviteTip extends UIBase {
init(data: any) {
this.inviteData = data.msg;
console.log(`邀请信息:${JSON.stringify(this.inviteData)}`)
var tmp = JSON.parse(this.inviteData);
this.namelabel.string = tmp.player.toString();
this.m_roomID = tmp.data.team_info.team_uuid;
this.m_roomID = tmp.data.teaminfo.team_uuid;
}
start() {

View File

@ -0,0 +1,110 @@
import NetManage from "../manages/NetManage";
var Utils = require('Utils');
const { UIBase } = require("../UI/UIBase");
cc.Class({
extends: UIBase,
properties: {
headIcon:{
default:null,
type:cc.Sprite
},
playName:{
default:null,
type:cc.Label
},
totalKill:{
default:null,
type:cc.Label
},
totalGame:{
default:null,
type:cc.Label
},
totalWin:{
default:null,
type:cc.Label
},
WinRate:{
default:null,
type:cc.Label
},
MostKill:{
default:null,
type:cc.Label
},
AverageKill:{
default:null,
type:cc.Label
},
MostDMG:{
default:null,
type:cc.Label
},
AverageDMG:{
default:null,
type:cc.Label
},
},
init(data){
// data : user account --> get user info according to user account
NetManage.getUeserInfo(data,(res)=>{
this.account_id = data;
this.playerData = res;
this.playName.string = this.playerData.info.name;
Utils.setitem(this,this.playerData.info.head_id,this.headIcon);
//
this.totalKill.string = this.playerData.info.history_seasons[0].total_kills;
this.totalGame.string = this.playerData.info.history_seasons[0].game_times;
this.totalWin.string = this.playerData.info.history_seasons[0].win_times;
this.WinRate.string = `${this.playerData.info.history_seasons[0].win_rate}%`;
//
this.MostKill.string = this.playerData.info.history_seasons[0].max_kills;
this.AverageKill.string = this.playerData.info.history_seasons[0].avg_kills;
this.MostDMG.string = this.playerData.info.history_seasons[0].max_damage_out;
this.AverageDMG.string = this.playerData.info.history_seasons[0].avg_damage_out;
//
})
},
start () {
},
onClose(){
this.node.destroy()
},
onClickAddFriend(){
cc.uiHelper.showTips("Send friend request!");
cc.chatMgr.sendmsg('CMFriendApply', {
friend_id: this.account_id,
msg: '',
});
},
onClickAddBlackList(){
cc.uiHelper.showTips("Add to blacklist");
cc.chatMgr.sendmsg('CMFriendDeleteBlack', {
account_id: this.account_id,
});
},
});
export var playerInfoUI = "prefabs/tips/playerinfo"

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "b057a86e-9c61-474b-aaf5-0ce0fbd0b5b9",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}