77 lines
2.0 KiB
JavaScript
77 lines
2.0 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '1c8e1CQ5gpBxaB6gVxaTmUo', 'cmp.dungeon.item.tab');
|
|
// Scripts/mod/pve/dungeon/cmp/cmp.dungeon.item.tab.js
|
|
|
|
"use strict";
|
|
|
|
var ItemBase = require("nx.fx.sv.expand.item");
|
|
cc.Class({
|
|
"extends": ItemBase,
|
|
properties: {
|
|
select_tab: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
off_txt: {
|
|
"default": null,
|
|
type: cc.Label
|
|
},
|
|
select_txt: {
|
|
"default": null,
|
|
type: cc.Label
|
|
}
|
|
},
|
|
// LIFE-CYCLE CALLBACKS:
|
|
onLoad: function onLoad() {},
|
|
// 数据重置
|
|
rebind: function rebind(_idx, _data, _key) {
|
|
this._super(_idx, _data, _key);
|
|
|
|
// 刷新
|
|
this.setData(_data);
|
|
},
|
|
setData: function setData(data) {
|
|
if (nx.dt.objEmpty(data)) {
|
|
return false;
|
|
}
|
|
this.data = data;
|
|
this.off_txt.string = game.configs.dungeon_stone_data.data_type_open[this.data.id].name;
|
|
this.select_txt.string = game.configs.dungeon_stone_data.data_type_open[this.data.id].name;
|
|
var id = game.configs.dungeon_stone_data.data_type_open[this.data.id].activate;
|
|
if (id) {
|
|
var cmp = nx.gui.getComponent(this, "lock", "bridge.condition.locker");
|
|
if (cmp) {
|
|
cmp.setCondition(id);
|
|
}
|
|
}
|
|
|
|
//紅點處理
|
|
var dot = nx.gui.getComponent(this, "tip", "nx.vb.visible");
|
|
var cfgs = game.configs.source_data.data_source_data[id];
|
|
if (!cfgs) {
|
|
nx.gui.setActive(dot, "", false);
|
|
return;
|
|
}
|
|
if (cfgs.lev_limit) {
|
|
this.result = nx.bridge.checkConditions(cfgs.lev_limit);
|
|
if (!nx.dt.objNEmpty(this.result)) {
|
|
if (!dot) {
|
|
nx.gui.setActive(dot, "", false);
|
|
} else {
|
|
var key = cc.js.formatStr("pve.dungeon.%s", data.id);
|
|
dot.setTarget(nx.mTip, key);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
nx.gui.setActive(dot, "", false);
|
|
},
|
|
onFocus: function onFocus() {
|
|
this.select_tab.active = true;
|
|
},
|
|
outFocus: function outFocus() {
|
|
this.select_tab.active = false;
|
|
} // update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |