81 lines
2.3 KiB
JavaScript
81 lines
2.3 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '412ef6Rgr1AWrpzg2o4NYMB', 'cmp.act.heronewchal.item');
|
|
// Scripts/mod/acts/heroNewChallenge/cmp.act.heronewchal.item.js
|
|
|
|
"use strict";
|
|
|
|
var ItemLay = require("cmp.common.itemlayout");
|
|
var HeroNewChalMod = require("act.heronewchal.mod");
|
|
var HCT = require("hero_controller");
|
|
var PartnerConst = require("partner_const");
|
|
cc.Class({
|
|
"extends": cc.Component,
|
|
properties: {
|
|
rewards: {
|
|
"default": null,
|
|
type: ItemLay
|
|
},
|
|
orderLev: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
orderName: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
batNd: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
getNd: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
maskNd: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
day_id: 0
|
|
},
|
|
setData: function setData(data) {
|
|
if (nx.dt.objEmpty(data)) return;
|
|
this.data = data;
|
|
this.maskNd.active = false;
|
|
if (data.status1 == 1) {
|
|
if (data.status2 == 2) {
|
|
this.maskNd.active = true;
|
|
}
|
|
nx.gui.setActive(this.batNd, "", data.status2 == 0);
|
|
nx.gui.setActive(this.getNd, "", data.status2 == 1);
|
|
} else {
|
|
this.maskNd.active = true;
|
|
var cur_day = HeroNewChalMod.getInstance().getCurDay();
|
|
var next_day = HeroNewChalMod.getInstance().getNextDay();
|
|
if (cur_day == data.id) {
|
|
nx.gui.setString(this.maskNd, "lock/txt", cc.js.formatStr(nx.text.getKey("DayNeedLock"), next_day));
|
|
} else {
|
|
nx.gui.setString(this.maskNd, "lock/txt", nx.text.getKey("Locked"));
|
|
}
|
|
}
|
|
nx.gui.setActive(this.maskNd, "got", data.status2 == 2);
|
|
nx.gui.setActive(this.maskNd, "lock", data.status1 == 0);
|
|
var info = game.configs.fake_battle_data.data_new_info[HeroNewChalMod.getInstance().getCampId()][data.id];
|
|
if (info) {
|
|
nx.gui.setString(this.orderLev, "", info.id);
|
|
nx.gui.setString(this.orderName, "", info.name);
|
|
this.rewards.rebuild(info.reward);
|
|
}
|
|
},
|
|
clickBat: function clickBat() {
|
|
if (!this.data) return;
|
|
HCT.getInstance().openFormGoFightPanel(true, PartnerConst.Fun_Form.Encounter, {
|
|
id: this.data.id
|
|
}, 1, false);
|
|
},
|
|
clickReward: function clickReward() {
|
|
if (!this.data) return;
|
|
HeroNewChalMod.getInstance().send31002(this.data.id);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |