75 lines
2.0 KiB
JavaScript
75 lines
2.0 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '89acd5YKINOt7E7Po/TnpnO', 'cmp.worldmap.plot.item');
|
||
|
|
// Scripts/mod/pve/worldmap/cmp.worldmap.plot.item.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/******************************************************************
|
||
|
|
*
|
||
|
|
* 世界地图剧情单项
|
||
|
|
*
|
||
|
|
******************************************************************/
|
||
|
|
|
||
|
|
var TipsController = require("tips_controller");
|
||
|
|
cc.Class({
|
||
|
|
"extends": cc.Component,
|
||
|
|
properties: {},
|
||
|
|
// 设置
|
||
|
|
setData: function setData(_order, _data) {
|
||
|
|
this.order = _order;
|
||
|
|
this.data = _data;
|
||
|
|
if (nx.dt.objEmpty(_data)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 未解锁
|
||
|
|
if (_data.locked) {
|
||
|
|
nx.gui.setActive(this, "normal", false);
|
||
|
|
nx.gui.setActive(this, "h", false);
|
||
|
|
nx.gui.setActive(this, "locked", true);
|
||
|
|
nx.gui.setString(this, "locked/tip/ifos/txt", nx.text.getKey(_data.unlock_desc));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 已解锁
|
||
|
|
nx.gui.setActive(this, "locked", false);
|
||
|
|
|
||
|
|
// 普通模式
|
||
|
|
if (!nx.frame.vget("hMode")) {
|
||
|
|
nx.gui.setActive(this, "h", false);
|
||
|
|
var _node = nx.gui.setActive(this, "normal", true);
|
||
|
|
nx.gui.setString(_node, "name", nx.text.getKey(_data.title));
|
||
|
|
nx.gui.setString(_node, "order", nx.text.format("第%s幕", _order));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
// H模式
|
||
|
|
nx.gui.setActive(this, "normal", false);
|
||
|
|
var node = nx.gui.setActive(this, "h", true);
|
||
|
|
nx.gui.setString(node, "name", nx.text.getKey(_data.title));
|
||
|
|
nx.gui.setString(node, "order", nx.text.format("第%s幕", _order));
|
||
|
|
var bg = cc.path.join("prefab/pve/worldmap/h", "hy_def");
|
||
|
|
if (nx.dt.strNEmpty(_data.bg)) {
|
||
|
|
bg = cc.path.join("prefab/pve/worldmap/h", _data.bg);
|
||
|
|
}
|
||
|
|
nx.gui.setSpriteFrame(node, "", bg);
|
||
|
|
},
|
||
|
|
// 播放剧情
|
||
|
|
onTouchPlay: function onTouchPlay() {
|
||
|
|
if (!this.data) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
nx.bridge.plot.fireForce(this.data.story_id);
|
||
|
|
},
|
||
|
|
// 查看详情
|
||
|
|
onTouchStory: function onTouchStory() {
|
||
|
|
if (!this.data) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
// const TC = TipsController.getInstance();
|
||
|
|
// TC.showTextPanel( "tip", this.data.desc );
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|