|
本帖最后由 agcuijx 于 2022-10-7 12:35 编辑
修改了一些bug,没有太多时间测试,大家尽量去测试。论坛可以留言有什么bug。
17.修改坐骑使用升级丹时会造成坐骑名称丢失的bug 服务端文件game\utils\db.ts
static saveHorseList(roleId: number, dict: { [key: number]: Horse }, callback: (error: any, rows: any[]) => void) {
let sql = ``;
for (let position in dict) {
let horse = dict[position];
if (horse) {
let name = horse.showName; //这里修改成showName
let level = horse.level;
let exp = horse.exp;
sql += `INSERT INTO dhxy_horse(role_id,position,name,level,exp) VALUES('${roleId}','${position}','${name}','${level}','${exp}') ON DUPLICATE KEY UPDATE name='${name}',level='${level}',exp='${exp}';`
}
}
if (sql.length < 1) {
return;
}
DB.query(sql, callback);
}
18.修改不能连续使用坐骑丹的bug(测试)
客户端文件script\ts\horse\horsePanel.ts
添加变量
currentSelect:number = 0; //记录上次选择点击的itemid
修改useItemBtnClick(e)方法
useItemBtnClick(e) {
//if (e.type == cc.Node.EventType.TOUCH_START) {
// this.maxtiemcnt = LongPressSpeedProp.MAXTIMECNT;
//this.timecnt = 0;
//this.currentBtn = e.target;
//this.useItemData = e.target.data;
//this.schedule(this.useItemUpdate, 1 / 30)
//}
//else if (e.type == cc.Node.EventType.TOUCH_END) {
// this.timecnt = this.maxtiemcnt;
//this.useItemUpdate();
//this.currentBtn = null;
//this.unscheduleAllCallbacks();
//}
this.timecnt = LongPressSpeedProp.MAXTIMECNT;
this.UpgradeSkill = true;
this.useItemData = e.target.data;
this.timecnt = 0;
this.currentBtn = e.target;
this.useItemUpdate();
//console.log('携带data='+JSON.stringify(this.useItemData));
}
修改onClickItem方法
onClickItem(item: fgui.GObject) {
let index = this.list.getChildIndex(item);
this.list.selectedIndex = index; //添加这行
this.currentSelect = index;
this.refreshPanel();
}
修改useHorseUpgradeItem
useHorseUpgradeItem(data: any) {
let count = ItemUtil.getBagItemCount(data.id);
if (count < 1) {
MsgAlert.addMsg(`您没有足够的[${data.name}]!`)
return;
}
let params = {
itemId: data.id,
horseIndex: this.currentSelect + 1 //修改这里
};
GameModel.send("c2s_horse_upgrade", params);
this.list.scrollToView(this.currentSelect);
}
|
|