update
This commit is contained in:
parent
e09a3e0a4a
commit
319b4c2319
@ -47,8 +47,8 @@
|
|||||||
},
|
},
|
||||||
"_scale": {
|
"_scale": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 0.416015625,
|
"x": 0.5703125,
|
||||||
"y": 0.416015625,
|
"y": 0.5703125,
|
||||||
"z": 1
|
"z": 1
|
||||||
},
|
},
|
||||||
"_quat": {
|
"_quat": {
|
||||||
@ -12654,7 +12654,7 @@
|
|||||||
"__id__": 377
|
"__id__": 377
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": false,
|
"_active": true,
|
||||||
"_level": 2,
|
"_level": 2,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
|
@ -13759,7 +13759,7 @@
|
|||||||
"__id__": 368
|
"__id__": 368
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [],
|
"_components": [],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
@ -14355,7 +14355,7 @@
|
|||||||
"__id__": 478
|
"__id__": 478
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_level": 3,
|
"_level": 3,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
|
@ -1,517 +1,517 @@
|
|||||||
var NetManage = require('NetManage');
|
var NetManage = require("NetManage");
|
||||||
var gameConfig = require('gameConfig');
|
var gameConfig = require("gameConfig");
|
||||||
var Utils = require('Utils');
|
var Utils = require("Utils");
|
||||||
const { uimanger, UIManger } = require('./UIManger');
|
const { uimanger, UIManger } = require("./UIManger");
|
||||||
const { KeyanMain } = require('./Academy/UIKeyanMain');
|
const { KeyanMain } = require("./Academy/UIKeyanMain");
|
||||||
|
|
||||||
const Config = require('../Config');
|
const Config = require("../Config");
|
||||||
const { default: Loading } = require('../gif/Loading');
|
const { default: Loading } = require("../gif/Loading");
|
||||||
const { GuestLoginTip } = require('../tips/GuestLoginTip');
|
const { GuestLoginTip } = require("../tips/GuestLoginTip");
|
||||||
const { LogoutTip } = require('../tips/LogoutTip');
|
const { LogoutTip } = require("../tips/LogoutTip");
|
||||||
const { operation, OperationType } = require('../Operation/Operation');
|
const { operation, OperationType } = require("../Operation/Operation");
|
||||||
const jcgamelog = require('../jcfw/service/jcgamelog');
|
const jcgamelog = require("../jcfw/service/jcgamelog");
|
||||||
cc.Class({
|
cc.Class({
|
||||||
extends: cc.Component,
|
extends: cc.Component,
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
pb_chat: {
|
pb_chat: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_chose: {
|
pb_chose: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_chosehero: {
|
pb_chosehero: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_teammatch: {
|
pb_teammatch: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_hero: {
|
pb_hero: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_heroInfo: {
|
pb_heroInfo: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_herobuy: {
|
pb_herobuy: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_xp: {
|
pb_xp: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_bag: {
|
pb_bag: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_top: {
|
pb_top: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_season: {
|
pb_season: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_editname: {
|
pb_editname: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_rank: {
|
pb_rank: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_userinfo: {
|
pb_userinfo: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
pb_task: {
|
pb_task: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
pb_gun: {
|
pb_gun: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
pb_seasoncard: {
|
pb_seasoncard: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
lb_name: {
|
lb_name: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Label,
|
type: cc.Label,
|
||||||
},
|
},
|
||||||
lb_lv: {
|
lb_lv: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Label,
|
type: cc.Label,
|
||||||
},
|
},
|
||||||
sp_head: {
|
sp_head: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Sprite,
|
type: cc.Sprite,
|
||||||
},
|
},
|
||||||
sp_head_back: {
|
sp_head_back: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Sprite,
|
type: cc.Sprite,
|
||||||
},
|
},
|
||||||
lb_gold: {
|
lb_gold: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Label,
|
type: cc.Label,
|
||||||
},
|
},
|
||||||
lb_diamond: {
|
lb_diamond: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Label,
|
type: cc.Label,
|
||||||
},
|
},
|
||||||
spine_hero: {
|
spine_hero: {
|
||||||
default: null,
|
default: null,
|
||||||
type: sp.Skeleton,
|
type: sp.Skeleton,
|
||||||
},
|
},
|
||||||
pr_progress: {
|
pr_progress: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.ProgressBar,
|
type: cc.ProgressBar,
|
||||||
},
|
},
|
||||||
|
|
||||||
pb_reward1: {
|
pb_reward1: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
pb_shop: {
|
pb_shop: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
pb_keyan: {
|
pb_keyan: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_accountNode: {
|
nd_accountNode: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_iosChooseWalletNode: {
|
nd_iosChooseWalletNode: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_connectwalletBtn: {
|
nd_connectwalletBtn: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
nd_editName: {
|
nd_editName: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_linkNode: {
|
nd_linkNode: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_splitLine: {
|
nd_splitLine: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
|
|
||||||
nd_eventNode: {
|
nd_eventNode: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Node,
|
type: cc.Node,
|
||||||
},
|
},
|
||||||
pb_friend: {
|
pb_friend: {
|
||||||
default: null,
|
default: null,
|
||||||
type: cc.Prefab,
|
type: cc.Prefab,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
cc.audioEngine.stopAll();
|
cc.audioEngine.stopAll();
|
||||||
},
|
},
|
||||||
start() {
|
start() {
|
||||||
//test
|
//test
|
||||||
this.nd_linkNode.active = !Config.isTest;
|
this.nd_linkNode.active = !Config.isTest;
|
||||||
this.nd_splitLine.active = !Config.isTest;
|
this.nd_splitLine.active = !Config.isTest;
|
||||||
//
|
//
|
||||||
|
|
||||||
cc.uiMain = this;
|
cc.uiMain = this;
|
||||||
cc.Notifier.on('openSelfPlayerInfoUI', this, this.callInfo.bind(this));
|
cc.Notifier.on("openSelfPlayerInfoUI", this, this.callInfo.bind(this));
|
||||||
cc.Notifier.on('joinTeamRoom', this, this.joinTeamRoom.bind(this));
|
cc.Notifier.on("joinTeamRoom", this, this.joinTeamRoom.bind(this));
|
||||||
// cc.Notifier.on("openheroinfo", this, this.openheroinfo.bind(this));
|
// cc.Notifier.on("openheroinfo", this, this.openheroinfo.bind(this));
|
||||||
cc.Notifier.on('buyitem', this, this.buyitem.bind(this));
|
cc.Notifier.on("buyitem", this, this.buyitem.bind(this));
|
||||||
cc.Notifier.on(
|
cc.Notifier.on(
|
||||||
'refreshBaseInfo',
|
"refreshBaseInfo",
|
||||||
this,
|
this,
|
||||||
this.refreshBaseInfo.bind(this)
|
this.refreshBaseInfo.bind(this)
|
||||||
);
|
);
|
||||||
cc.Notifier.on('getreward', this, this.callreward.bind(this));
|
cc.Notifier.on("getreward", this, this.callreward.bind(this));
|
||||||
cc.Notifier.on(
|
cc.Notifier.on(
|
||||||
'hasConnectWallet',
|
"hasConnectWallet",
|
||||||
this,
|
this,
|
||||||
this.getwalletEvent.bind(this)
|
this.getwalletEvent.bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.refreshBaseInfo();
|
this.refreshBaseInfo();
|
||||||
NetManage.getItemList();
|
NetManage.getItemList();
|
||||||
NetManage.getHeroList();
|
NetManage.getHeroList();
|
||||||
NetManage.getSkinList();
|
NetManage.getSkinList();
|
||||||
|
|
||||||
//
|
//
|
||||||
this.nd_connectwalletBtn.active = !Config.isTest;
|
this.nd_connectwalletBtn.active = !Config.isTest;
|
||||||
if (window.hasWallet) {
|
if (window.hasWallet) {
|
||||||
this.nd_connectwalletBtn.active = false;
|
this.nd_connectwalletBtn.active = false;
|
||||||
this.nd_accountNode.active = true;
|
this.nd_accountNode.active = true;
|
||||||
this.nd_accountNode.getComponent(cc.Label).string = this.replacepos(
|
this.nd_accountNode.getComponent(cc.Label).string = this.replacepos(
|
||||||
window.account,
|
window.account,
|
||||||
7,
|
7,
|
||||||
37
|
37
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//第一次显示改名界面
|
//第一次显示改名界面
|
||||||
// this.calleditname(90001);
|
// this.calleditname(90001);
|
||||||
// 后端说可以改名并且已经链接钱包的情况 才可以改名
|
// 后端说可以改名并且已经链接钱包的情况 才可以改名
|
||||||
if (window.canrename && window.hasWallet == true) {
|
if (window.canrename && window.hasWallet == true) {
|
||||||
window.canrename = false;
|
window.canrename = false;
|
||||||
this.nd_editName.active = true;
|
this.nd_editName.active = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getwalletEvent() {
|
getwalletEvent() {
|
||||||
this.nd_connectwalletBtn.active = false;
|
this.nd_connectwalletBtn.active = false;
|
||||||
this.nd_accountNode.active = true;
|
this.nd_accountNode.active = true;
|
||||||
this.nd_accountNode.getComponent(cc.Label).string = this.replacepos(
|
this.nd_accountNode.getComponent(cc.Label).string = this.replacepos(
|
||||||
window.account,
|
window.account,
|
||||||
7,
|
7,
|
||||||
37
|
37
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 将钱包地址中间字段换成 *****
|
// 将钱包地址中间字段换成 *****
|
||||||
replacepos(text, start, stop) {
|
replacepos(text, start, stop) {
|
||||||
var mid = '*****';
|
var mid = "*****";
|
||||||
let mystr =
|
let mystr =
|
||||||
text.toString().substr(0, start - 1) +
|
text.toString().substr(0, start - 1) +
|
||||||
mid +
|
mid +
|
||||||
text.toString().substr(stop + 1);
|
text.toString().substr(stop + 1);
|
||||||
return mystr;
|
return mystr;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
cc.Notifier.off('openSelfPlayerInfoUI', this);
|
cc.Notifier.off("openSelfPlayerInfoUI", this);
|
||||||
cc.Notifier.off('joinTeamRoom', this);
|
cc.Notifier.off("joinTeamRoom", this);
|
||||||
// cc.Notifier.off("openheroinfo", this);
|
// cc.Notifier.off("openheroinfo", this);
|
||||||
cc.Notifier.off('buyitem', this);
|
cc.Notifier.off("buyitem", this);
|
||||||
cc.Notifier.off('refreshBaseInfo', this);
|
cc.Notifier.off("refreshBaseInfo", this);
|
||||||
cc.Notifier.off('getreward', this);
|
cc.Notifier.off("getreward", this);
|
||||||
cc.Notifier.on('hasConnectWallet', this);
|
cc.Notifier.on("hasConnectWallet", this);
|
||||||
},
|
},
|
||||||
refreshBaseInfo() {
|
refreshBaseInfo() {
|
||||||
var pdata = cc.playerData;
|
var pdata = cc.playerData;
|
||||||
this.lb_name.string = pdata.name;
|
this.lb_name.string = pdata.name;
|
||||||
this.lb_lv.string = 'LV.' + pdata.level;
|
this.lb_lv.string = "LV." + pdata.level;
|
||||||
this.lb_gold.string = pdata.gold;
|
this.lb_gold.string = pdata.gold;
|
||||||
this.lb_diamond.string = pdata.diamond;
|
this.lb_diamond.string = pdata.diamond;
|
||||||
this.pr_progress.progress = pdata.exp / pdata.max_exp;
|
this.pr_progress.progress = pdata.exp / pdata.max_exp;
|
||||||
|
|
||||||
if (this.nowheadid != pdata.head_id) {
|
if (this.nowheadid != pdata.head_id) {
|
||||||
this.nowheadid = pdata.head_id;
|
this.nowheadid = pdata.head_id;
|
||||||
Utils.setitem(this, this.nowheadid, this.sp_head);
|
Utils.setitem(this, this.nowheadid, this.sp_head);
|
||||||
}
|
}
|
||||||
if (this.nowheroid != pdata.hero_id) {
|
if (this.nowheroid != pdata.hero_id) {
|
||||||
this.nowheroid = pdata.hero_id;
|
this.nowheroid = pdata.hero_id;
|
||||||
var skinres = cc.playerData.getheroSkinbyId(this.nowheroid, 0);
|
var skinres = cc.playerData.getheroSkinbyId(this.nowheroid, 0);
|
||||||
cc.loader.loadRes(
|
cc.loader.loadRes(
|
||||||
'spine/heropic/pic_hero' + skinres,
|
"spine/heropic/pic_hero" + skinres,
|
||||||
sp.SkeletonData,
|
sp.SkeletonData,
|
||||||
function (err, sp) {
|
function (err, sp) {
|
||||||
this.spine_hero.skeletonData = sp;
|
this.spine_hero.skeletonData = sp;
|
||||||
this.spine_hero._updateSkeletonData();
|
this.spine_hero._updateSkeletonData();
|
||||||
this.spine_hero.setAnimation(0, 'animation', true);
|
this.spine_hero.setAnimation(0, "animation", true);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.nowkuang != pdata.head_frame) {
|
if (this.nowkuang != pdata.head_frame) {
|
||||||
this.nowkuang = pdata.head_frame;
|
this.nowkuang = pdata.head_frame;
|
||||||
Utils.setitem(this, this.nowkuang, this.sp_head_back);
|
Utils.setitem(this, this.nowkuang, this.sp_head_back);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
joinTeamRoom(v) {
|
joinTeamRoom(v) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var cb = function (v) {
|
var cb = function (v) {
|
||||||
if (v.errcode == 0) {
|
if (v.errcode == 0) {
|
||||||
self.callteammatch(v);
|
self.callteammatch(v);
|
||||||
} else {
|
} else {
|
||||||
cc.uiHelper.showTips(v.errmsg);
|
cc.uiHelper.showTips(v.errmsg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
NetManage.joinTeam(v, cb);
|
NetManage.joinTeam(v, cb);
|
||||||
|
|
||||||
// this.callteammatch(v)
|
// this.callteammatch(v)
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickOfficial() {
|
onClickOfficial() {
|
||||||
this.openUrlinNative('https://www.cebg.games/');
|
this.openUrlinNative("https://www.cebg.games/");
|
||||||
},
|
},
|
||||||
onClickTwitter() {
|
onClickTwitter() {
|
||||||
this.openUrlinNative('https://twitter.com/CEBG_GAME');
|
this.openUrlinNative("https://twitter.com/CEBG_GAME");
|
||||||
},
|
},
|
||||||
onClickTelegram() {
|
onClickTelegram() {
|
||||||
this.openUrlinNative('https://t.me/CEBG_official');
|
this.openUrlinNative("https://t.me/CEBG_official");
|
||||||
},
|
},
|
||||||
onClickDiscord() {
|
onClickDiscord() {
|
||||||
this.openUrlinNative('https://discord.gg/8dWX6jpcME');
|
this.openUrlinNative("https://discord.gg/8dWX6jpcME");
|
||||||
},
|
},
|
||||||
|
|
||||||
openUrlinNative(url) {
|
openUrlinNative(url) {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'openurl', url);
|
jcgamelog.addOperation(OperationType.BUTTON, "openurl", url);
|
||||||
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
if (cc.sys.os == cc.sys.OS_ANDROID) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'org/cocos2dx/javascript/AppActivity',
|
"org/cocos2dx/javascript/AppActivity",
|
||||||
'openSocialUrl',
|
"openSocialUrl",
|
||||||
'(Ljava/lang/String;)V',
|
"(Ljava/lang/String;)V",
|
||||||
url
|
url
|
||||||
);
|
);
|
||||||
} else if (cc.sys.os == cc.sys.OS_IOS) {
|
} else if (cc.sys.os == cc.sys.OS_IOS) {
|
||||||
jsb.reflection.callStaticMethod(
|
jsb.reflection.callStaticMethod(
|
||||||
'AppController',
|
"AppController",
|
||||||
'openSocialUrl:',
|
"openSocialUrl:",
|
||||||
url
|
url
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
callreward(v) {
|
callreward(v) {
|
||||||
var nd = cc.instantiate(this.pb_reward1);
|
var nd = cc.instantiate(this.pb_reward1);
|
||||||
nd.getComponent('UIReward').initdata(v);
|
nd.getComponent("UIReward").initdata(v);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callBattle() {
|
callBattle() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'intobattle');
|
jcgamelog.addOperation(OperationType.BUTTON, "intobattle");
|
||||||
if (cc.sys.isNative) {
|
if (cc.sys.isNative) {
|
||||||
if (Config.isTest) {
|
if (Config.isTest) {
|
||||||
// 审核
|
// 审核
|
||||||
var nd = cc.instantiate(this.pb_chose);
|
var nd = cc.instantiate(this.pb_chose);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
} else {
|
} else {
|
||||||
// debug
|
// debug
|
||||||
if (!window.hasWallet) {
|
if (!window.hasWallet) {
|
||||||
uimanger.showUI(GuestLoginTip.prefabPath);
|
uimanger.showUI(GuestLoginTip.prefabPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var nd = cc.instantiate(this.pb_chose);
|
var nd = cc.instantiate(this.pb_chose);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// browser
|
// browser
|
||||||
var nd = cc.instantiate(this.pb_chose);
|
var nd = cc.instantiate(this.pb_chose);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
callChat() {
|
callChat() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'intochat');
|
jcgamelog.addOperation(OperationType.BUTTON, "intochat");
|
||||||
var nd = cc.instantiate(this.pb_chat);
|
var nd = cc.instantiate(this.pb_chat);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callbattlechosehero(opt) {
|
callbattlechosehero(opt) {
|
||||||
var nd = cc.instantiate(this.pb_chosehero);
|
var nd = cc.instantiate(this.pb_chosehero);
|
||||||
nd.getComponent('UIChoseHero').initdata(opt);
|
nd.getComponent("UIChoseHero").initdata(opt);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callteammatch(teamid) {
|
callteammatch(teamid) {
|
||||||
var nd = cc.instantiate(this.pb_teammatch);
|
var nd = cc.instantiate(this.pb_teammatch);
|
||||||
nd.getComponent('UITeamMatch').initdata(teamid);
|
nd.getComponent("UITeamMatch").initdata(teamid);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
onclickinfo() {
|
onclickinfo() {
|
||||||
this.callInfo(NetManage.account_id);
|
this.callInfo(NetManage.account_id);
|
||||||
},
|
},
|
||||||
callInfo(v) {
|
callInfo(v) {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'into userinfo');
|
jcgamelog.addOperation(OperationType.BUTTON, "into userinfo");
|
||||||
NetManage.getUeserInfo(v, (data) => {
|
NetManage.getUeserInfo(v, (data) => {
|
||||||
if (data.errcode == 0) {
|
if (data.errcode == 0) {
|
||||||
var nd = cc.instantiate(this.pb_userinfo);
|
var nd = cc.instantiate(this.pb_userinfo);
|
||||||
nd.getComponent('UIRoleInfo').initdata(data.info);
|
nd.getComponent("UIRoleInfo").initdata(data.info);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
callbag() {
|
callbag() {
|
||||||
var nd = cc.instantiate(this.pb_bag);
|
var nd = cc.instantiate(this.pb_bag);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
callgunskin() {},
|
callgunskin() {},
|
||||||
callxinpian() {
|
callxinpian() {
|
||||||
NetManage.gettalentList(() => {
|
NetManage.gettalentList(() => {
|
||||||
var nd = cc.instantiate(this.pb_xp);
|
var nd = cc.instantiate(this.pb_xp);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
callrole() {
|
callrole() {
|
||||||
NetManage.getHeroList((data) => {
|
NetManage.getHeroList((data) => {
|
||||||
var nd = cc.instantiate(this.pb_hero);
|
var nd = cc.instantiate(this.pb_hero);
|
||||||
nd.getComponent('UIHero').initdata(data);
|
nd.getComponent("UIHero").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// openheroinfo(v) {
|
// openheroinfo(v) {
|
||||||
// var nd = cc.instantiate(this.pb_heroInfo);
|
// var nd = cc.instantiate(this.pb_heroInfo);
|
||||||
// nd.getComponent('UIHeroInfo').initdata(v.hero_id);
|
// nd.getComponent('UIHeroInfo').initdata(v.hero_id);
|
||||||
// this.node.addChild(nd);
|
// this.node.addChild(nd);
|
||||||
// },
|
// },
|
||||||
buyitem(v) {
|
buyitem(v) {
|
||||||
//待扩展其他类型的
|
//待扩展其他类型的
|
||||||
var nd = cc.instantiate(this.pb_herobuy);
|
var nd = cc.instantiate(this.pb_herobuy);
|
||||||
nd.getComponent('UIHeroBuy').initdata(v);
|
nd.getComponent("UIHeroBuy").initdata(v);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
calltop(fnode) {
|
calltop(fnode) {
|
||||||
var nd = cc.instantiate(this.pb_top);
|
var nd = cc.instantiate(this.pb_top);
|
||||||
fnode.addChild(nd);
|
fnode.addChild(nd);
|
||||||
},
|
},
|
||||||
|
|
||||||
callseason() {
|
callseason() {
|
||||||
NetManage.getSeasonInfo(() => {
|
NetManage.getSeasonInfo(() => {
|
||||||
var nd = cc.instantiate(this.pb_season);
|
var nd = cc.instantiate(this.pb_season);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
calleditname(itemid) {
|
calleditname(itemid) {
|
||||||
var nd = cc.instantiate(this.pb_editname);
|
var nd = cc.instantiate(this.pb_editname);
|
||||||
nd.getComponent('UINameCard').initdata(itemid);
|
nd.getComponent("UINameCard").initdata(itemid);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
|
|
||||||
callrank() {
|
callrank() {
|
||||||
NetManage.getactivityRankingList(1, (data) => {
|
NetManage.getactivityRankingList(1, (data) => {
|
||||||
var nd = cc.instantiate(this.pb_rank);
|
var nd = cc.instantiate(this.pb_rank);
|
||||||
nd.getComponent('UIRank').init(JSON.stringify(data));
|
nd.getComponent("UIRank").init(JSON.stringify(data));
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
|
|
||||||
// type 10 时常rank
|
// type 10 时常rank
|
||||||
// NetManage.getRankList(10, () => {
|
// NetManage.getRankList(10, () => {
|
||||||
// var nd = cc.instantiate(this.pb_rank);
|
// var nd = cc.instantiate(this.pb_rank);
|
||||||
// this.node.addChild(nd);
|
// this.node.addChild(nd);
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
calltask() {
|
calltask() {
|
||||||
NetManage.missionList(1, (data) => {
|
NetManage.missionList(1, (data) => {
|
||||||
var nd = cc.instantiate(this.pb_task);
|
var nd = cc.instantiate(this.pb_task);
|
||||||
nd.getComponent('UITask').initdata(data);
|
nd.getComponent("UITask").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
callGuns() {
|
callGuns() {
|
||||||
// NetManage.UpdateVersion((data) => {
|
// NetManage.UpdateVersion((data) => {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// });
|
// });
|
||||||
NetManage.gunList((data) => {
|
NetManage.gunList((data) => {
|
||||||
var nd = cc.instantiate(this.pb_gun);
|
var nd = cc.instantiate(this.pb_gun);
|
||||||
nd.getComponent('UIGuns').initdata(data);
|
nd.getComponent("UIGuns").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
callShop() {
|
callShop() {
|
||||||
NetManage.getShopGoodsInfo((data) => {
|
NetManage.getShopGoodsInfo((data) => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
var nd = cc.instantiate(this.pb_shop);
|
var nd = cc.instantiate(this.pb_shop);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
callKeyan() {
|
callKeyan() {
|
||||||
// NetManage.getShopGoodsInfo((data) => {
|
// NetManage.getShopGoodsInfo((data) => {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
// });
|
// });
|
||||||
var nd = cc.instantiate(this.pb_keyan);
|
var nd = cc.instantiate(this.pb_keyan);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
|
|
||||||
callseasoncard() {
|
callseasoncard() {
|
||||||
NetManage.seasonCard((data) => {
|
NetManage.seasonCard((data) => {
|
||||||
var nd = cc.instantiate(this.pb_seasoncard);
|
var nd = cc.instantiate(this.pb_seasoncard);
|
||||||
nd.getComponent('UISeasonCard').initdata(data);
|
nd.getComponent("UISeasonCard").initdata(data);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
callFriend() {
|
callFriend() {
|
||||||
var nd = cc.instantiate(this.pb_friend);
|
var nd = cc.instantiate(this.pb_friend);
|
||||||
this.node.addChild(nd);
|
this.node.addChild(nd);
|
||||||
},
|
},
|
||||||
|
|
||||||
callEvent() {
|
callEvent() {
|
||||||
this.nd_eventNode.active = true;
|
this.nd_eventNode.active = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
closeEvent() {
|
closeEvent() {
|
||||||
this.nd_eventNode.active = false;
|
this.nd_eventNode.active = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
jcgamelog.addOperation(OperationType.BUTTON, 'logout');
|
jcgamelog.addOperation(OperationType.BUTTON, "logout");
|
||||||
uimanger.showUI(LogoutTip.prefabPath);
|
uimanger.showUI(LogoutTip.prefabPath);
|
||||||
},
|
},
|
||||||
|
|
||||||
connectwalletinmain() {
|
connectwalletinmain() {
|
||||||
jcgamelog.addOperation(
|
jcgamelog.addOperation(
|
||||||
OperationType.BUTTON,
|
OperationType.BUTTON,
|
||||||
'clickwalletconnectinmain'
|
"clickwalletconnectinmain"
|
||||||
);
|
);
|
||||||
localStorage.removeItem('walletaccount');
|
localStorage.removeItem("walletaccount");
|
||||||
window.hasWallet = false;
|
window.hasWallet = false;
|
||||||
cc.game.restart();
|
cc.game.restart();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user