更新
This commit is contained in:
parent
fc0d24d783
commit
4da22c93d1
|
|
@ -233,15 +233,15 @@ export default class GameManager extends cc.Component {
|
|||
if (data.data.username) {
|
||||
cc.fx.GameConfig.GM_INFO.username = data.data.username;
|
||||
}
|
||||
// if (data.data.useravatar) {
|
||||
// cc.fx.GameConfig.GM_INFO.useravatarIcon = data.data.useravatar;
|
||||
// if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length < 10)
|
||||
// cc.fx.GameConfig.GM_INFO.useravatarIcon = "icon_" + cc.fx.GameConfig.GM_INFO.useravatarIcon
|
||||
// }
|
||||
// if (data.data.useravatarIcon) {
|
||||
// cc.fx.GameConfig.GM_INFO.useravaterkuang = data.data.useravatarIcon;
|
||||
// cc.fx.GameConfig.GM_INFO.useravaterkuang = "kuang_" + (parseInt(cc.fx.GameConfig.GM_INFO.useravaterkuang) + 1);
|
||||
// }
|
||||
if (data.data.useravatar) {
|
||||
cc.fx.GameConfig.GM_INFO.useravatarIcon = data.data.useravatar;
|
||||
if (cc.fx.GameConfig.GM_INFO.useravatarIcon.length < 10)
|
||||
cc.fx.GameConfig.GM_INFO.useravatarIcon = "icon_" + cc.fx.GameConfig.GM_INFO.useravatarIcon
|
||||
}
|
||||
if (data.data.useravatarIcon) {
|
||||
cc.fx.GameConfig.GM_INFO.useravaterkuang = data.data.useravatarIcon;
|
||||
cc.fx.GameConfig.GM_INFO.useravaterkuang = "kuang_" + (parseInt(cc.fx.GameConfig.GM_INFO.useravaterkuang) + 1);
|
||||
}
|
||||
|
||||
// this.setUserPower(data);
|
||||
// this.setmonth(data);
|
||||
|
|
@ -324,9 +324,9 @@ export default class GameManager extends cc.Component {
|
|||
if (levelInfo.level > data.levelAmount) {
|
||||
cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
|
||||
//// cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin;
|
||||
cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
|
||||
cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount;
|
||||
cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount;
|
||||
const timestamp = Date.now();
|
||||
//// if (coinInfo.coin != data.coinAmount) {
|
||||
// if (coinInfo == undefined || coinInfo.coin == null) {
|
||||
|
|
@ -350,10 +350,10 @@ export default class GameManager extends cc.Component {
|
|||
}
|
||||
|
||||
}
|
||||
if (propInfo.freezeAmount != data.freezeAmount || propInfo.hammerAmount != data.hammerAmount || propInfo.magicAmount != data.magicAmount) {
|
||||
cc.fx.GameTool.setUserProp(0, 0, (data) => {
|
||||
})
|
||||
}
|
||||
// if (propInfo.freezeAmount != data.freezeAmount || propInfo.hammerAmount != data.hammerAmount || propInfo.magicAmount != data.magicAmount) {
|
||||
// cc.fx.GameTool.setUserProp(0, 0, (data) => {
|
||||
// })
|
||||
// }
|
||||
this.load3 = true;
|
||||
this.load4 = true;
|
||||
} else {
|
||||
|
|
@ -372,18 +372,18 @@ export default class GameManager extends cc.Component {
|
|||
cc.fx.StorageMessage.setStorage("level", levelInfo);
|
||||
let coinInfo = { "coin": data.coinAmount, "timestamp": timestamp };
|
||||
cc.fx.StorageMessage.setStorage("coin", coinInfo);
|
||||
let propInfo = {
|
||||
"freezeAmount": data.freezeAmount,
|
||||
"hammerAmount": data.hammerAmount,
|
||||
"magicAmount": data.magicAmount,
|
||||
"timestamp": timestamp,
|
||||
}
|
||||
cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
|
||||
cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
|
||||
cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;
|
||||
// let propInfo = {
|
||||
// "freezeAmount": data.freezeAmount,
|
||||
// "hammerAmount": data.hammerAmount,
|
||||
// "magicAmount": data.magicAmount,
|
||||
// "timestamp": timestamp,
|
||||
// }
|
||||
// cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;
|
||||
cc.fx.GameConfig.GM_INFO.level = data.levelAmount;
|
||||
//// cc.fx.GameConfig.GM_INFO.coin = data.coinAmount;
|
||||
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
// cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
this.load3 = true;
|
||||
this.load4 = true;
|
||||
}
|
||||
|
|
@ -419,18 +419,18 @@ export default class GameManager extends cc.Component {
|
|||
cc.fx.StorageMessage.setStorage("level", levelInfo);
|
||||
//// let coinInfo = { "coin": data.coinAmount, "timestamp": timestamp };
|
||||
//// cc.fx.StorageMessage.setStorage("coin", coinInfo);
|
||||
let propInfo = {
|
||||
"freezeAmount": data.freezeAmount,
|
||||
"hammerAmount": data.hammerAmount,
|
||||
"magicAmount": data.magicAmount,
|
||||
"timestamp": timestamp,
|
||||
}
|
||||
cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
|
||||
cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
|
||||
cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;
|
||||
// let propInfo = {
|
||||
// "freezeAmount": data.freezeAmount,
|
||||
// "hammerAmount": data.hammerAmount,
|
||||
// "magicAmount": data.magicAmount,
|
||||
// "timestamp": timestamp,
|
||||
// }
|
||||
// cc.fx.GameConfig.GM_INFO.freezeAmount = data.freezeAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.hammerAmount = data.hammerAmount;
|
||||
// cc.fx.GameConfig.GM_INFO.magicAmount = data.magicAmount;
|
||||
cc.fx.GameConfig.GM_INFO.level = data.levelAmount;
|
||||
//// cc.fx.GameConfig.GM_INFO.coin = data.coinAmount;
|
||||
cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
// cc.fx.StorageMessage.setStorage("prop", propInfo);
|
||||
}
|
||||
}
|
||||
/** 倒计时,保证进度在1秒内不进入游戏 */
|
||||
|
|
|
|||
|
|
@ -255,9 +255,9 @@ export class GameConfig {
|
|||
scale: 1, //玩家总计成功点火数
|
||||
allOutTradeNo: [], //订单号数组
|
||||
min_Time: 0, //体力恢复的剩余时间
|
||||
freezeAmount: 3, //冻结道具次数
|
||||
hammerAmount: 3, //锤子道具次数
|
||||
magicAmount: 3, //魔法棒道具次数
|
||||
freezeAmount: 0, //冻结道具次数
|
||||
hammerAmount: 0, //锤子道具次数
|
||||
magicAmount: 0, //魔法棒道具次数
|
||||
musicOpen: true, //音乐
|
||||
effectOpen: true, //音效
|
||||
vibrateOpen: true, //震动
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export default class ItemRender extends cc.Component {
|
|||
|
||||
/**数据改变时调用 */
|
||||
public dataChanged() {
|
||||
console.log("用户数据:", this.data);
|
||||
let useravatarIcon = this.data.useravatarIcon;
|
||||
useravatarIcon = "kuang_" + (parseInt(useravatarIcon) + 1);
|
||||
this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame =
|
||||
|
|
@ -59,8 +60,9 @@ export default class ItemRender extends cc.Component {
|
|||
else if (this.data.useravatar == "0" || this.data.useravatar == "1" || this.data.useravatar == "2"
|
||||
|| this.data.useravatar == "3") {
|
||||
let useravatar = this.data.useravatar;
|
||||
useravatar = "icon_" + useravatar;
|
||||
this.node.getChildByName("pic").getComponent(cc.Sprite).spriteFrame = this.ui.getSpriteFrame(useravatar);
|
||||
let useravatarTemp = "icon_" + useravatar;
|
||||
console.log("用户头像:", useravatarTemp);
|
||||
this.node.getChildByName("pic").getComponent(cc.Sprite).spriteFrame = this.ui.getSpriteFrame(useravatarTemp);
|
||||
}
|
||||
|
||||
else this.setPic();
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export default class ranking extends cc.Component {
|
|||
this.selfInfo = null;
|
||||
for (let i = 0; i < this.wordRank.length; i++) {
|
||||
if (this.wordRank[i]._id == cc.fx.GameConfig.GM_INFO.uid) {
|
||||
this.selfInfo = this.wordRank[i];
|
||||
this.selfInfo = JSON.parse(JSON.stringify(this.wordRank[i]));
|
||||
if (this.selfInfo.useravatar == "0" || this.selfInfo.useravatar == "1" || this.selfInfo.useravatar == "2"
|
||||
|| this.selfInfo.useravatar == "3") {
|
||||
this.selfInfo.useravatar = "icon_" + this.selfInfo.useravatar;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user