674 lines
20 KiB
JavaScript
674 lines
20 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'f9a4af+kMJO4qSuTtaOd0fz', 'cmp.bedroom.wnd');
|
|
// Scripts/mod/home/bedroom/cmp.bedroom.wnd.js
|
|
|
|
"use strict";
|
|
|
|
/******************************************************************
|
|
*
|
|
* 闺房亲密度场景
|
|
*
|
|
******************************************************************/
|
|
|
|
var BridgeWindow = require("bridge.window");
|
|
var BackPackController = require("backpack_controller");
|
|
var HomeModel = require("home.mod");
|
|
// const HomeHMod = require( "home.h.mod" );
|
|
var FxSpine = require("nx.fx.spine");
|
|
var MAX_USE = 5;
|
|
var ACTIONS = [{
|
|
action: "action1",
|
|
voice: 0
|
|
}, {
|
|
action: "action2",
|
|
voice: 1
|
|
}, {
|
|
action: "action3",
|
|
voice: 2
|
|
}];
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
spGirl: {
|
|
"default": null,
|
|
type: FxSpine
|
|
},
|
|
nodGirls: {
|
|
"default": null,
|
|
type: cc.ScrollView
|
|
},
|
|
nodLoading: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodUI: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodRole: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodParts: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodArchives: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodGifts: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodRelation: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodOps: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodEffect: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
nodAddition: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
// 显示
|
|
onEnable: function onEnable() {
|
|
// 置空
|
|
this.setEmpty();
|
|
|
|
// 初始化道具格子
|
|
this.initItemList();
|
|
|
|
// 背包监听
|
|
this.bindGEvent(EventId.ADD_GOODS, this.onBagItemUpdate.bind(this));
|
|
this.bindGEvent(EventId.DELETE_GOODS, this.onBagItemUpdate.bind(this));
|
|
this.bindGEvent(EventId.MODIFY_GOODS_NUM, this.onBagItemUpdate.bind(this));
|
|
|
|
// 闺蜜列表重建
|
|
this.rebuildMenu();
|
|
|
|
// 视图绑定
|
|
nx.bridge.vbind(this, [["HomeGirlShow", this.onCurrentGirl.bind(this)]]);
|
|
},
|
|
// 关闭
|
|
onDisable: function onDisable() {
|
|
// 视图监听解除
|
|
nx.bridge.vunbind(this);
|
|
|
|
// 背包监听解除
|
|
this.unbindGEvents();
|
|
|
|
// 展示清除
|
|
nx.bridge.vset("HomeGirlShow", 0);
|
|
},
|
|
// 置空
|
|
setEmpty: function setEmpty() {
|
|
this.current = null;
|
|
// this.nodRole.active = false;
|
|
this.nodLoading.active = false;
|
|
this.nodUI.active = false;
|
|
},
|
|
// 闺蜜列表重建
|
|
rebuildMenu: function rebuildMenu() {
|
|
// 伙伴列表
|
|
var arr = [];
|
|
var focusId = 0;
|
|
var girls = nx.bridge.vget("HomeGirls");
|
|
var _loop = function _loop(id) {
|
|
var pt = game.configs.favor_data.data_partner[id];
|
|
var ifo = nx.dt.objClone(pt);
|
|
ifo.have = nx.dt.arrMember(girls, null, function (_t) {
|
|
return _t && _t.partner_id == id;
|
|
});
|
|
arr.push(ifo);
|
|
|
|
// 默认聚焦记录
|
|
if (focusId == 0 && ifo.have) {
|
|
focusId = parseInt(id);
|
|
}
|
|
};
|
|
for (var id in game.configs.favor_data.data_partner) {
|
|
_loop(id);
|
|
}
|
|
|
|
// 排序
|
|
arr.sort(function (_a, _b) {
|
|
if (_a.have != _b.have) {
|
|
return _a.have ? -1 : 1;
|
|
}
|
|
return _a.sort - _b.sort;
|
|
});
|
|
|
|
// 列表重建
|
|
var root = this.nodGirls.content;
|
|
var build = function build(_index, _node, _partner) {
|
|
_node.gindex = _index;
|
|
_node.partner_id = _partner.partner_id;
|
|
// let partner = game.configs.partner_data.data_partner_base[_partner.partner_id];
|
|
// 锁定
|
|
if (!_partner.have) {
|
|
nx.gui.setActive(_node, "normal", false);
|
|
nx.gui.setActive(_node, "lock", true);
|
|
|
|
// nx.gui.setString( _node, "lock/txt", partner.name );
|
|
var _path = cc.path.join("prefab/home/bedroom/roles", _partner.res, "icon2_" + nx.getLocLanguage());
|
|
nx.gui.setSpriteFrame(_node, "lock/img", _path);
|
|
return;
|
|
}
|
|
|
|
// 解锁
|
|
nx.gui.setActive(_node, "lock", false);
|
|
nx.gui.setActive(_node, "normal", true);
|
|
nx.gui.setActive(_node, "normal/focus", false);
|
|
// nx.gui.setString( _node, "normal/txt", partner.name );
|
|
var path = cc.path.join("prefab/home/bedroom/roles", _partner.res, "icon_" + nx.getLocLanguage());
|
|
nx.gui.setSpriteFrame(_node, "normal/img", path);
|
|
};
|
|
nx.gui.gocChildren(root, "", arr.length, root.children[0]);
|
|
for (var i = 0; i < arr.length; ++i) {
|
|
var node = root.children[i];
|
|
if (node) {
|
|
build(i, node, arr[i]);
|
|
}
|
|
}
|
|
|
|
// 延迟选中
|
|
this.scheduleOnce(function () {
|
|
var pid = nx.bridge.vget("HomeGirlShow");
|
|
if (!nx.dt.numPositive(pid, false) && focusId > 0) {
|
|
nx.bridge.vset("HomeGirlShow", focusId);
|
|
}
|
|
}, 0.01);
|
|
},
|
|
// ========================================================================
|
|
// 闺蜜相关
|
|
// ========================================================================
|
|
|
|
// 载入新闺蜜
|
|
loadGirl: function loadGirl(_pid, _cb) {
|
|
var _this = this;
|
|
// 角色模型动画
|
|
var infos = game.configs.favor_data.data_partner[_pid];
|
|
if (nx.dt.objEmpty(infos)) {
|
|
return;
|
|
}
|
|
this.cmpRole = null;
|
|
this.nodLoading.active = true;
|
|
// this.nodRole.active = true;
|
|
// this.nodRole.removeAllChildren();
|
|
|
|
// 载入新预制
|
|
var path = cc.path.join("prefab/home/bedroom/roles", infos.res, "role");
|
|
nx.res.loadPrefab(path, function (_err, _data) {
|
|
_this.nodLoading.active = false;
|
|
if (_err) {
|
|
return;
|
|
}
|
|
var node = cc.instantiate(_data);
|
|
node.parent = _this.nodRole;
|
|
_this.cmpRole = nx.gui.getComponent(node, "", "cmp.bedroom.girl.show");
|
|
_this.cmpRole.bindTouch(_this.onTouchGirl.bind(_this));
|
|
nx.dt.fnInvoke(_cb);
|
|
});
|
|
},
|
|
// 闺蜜选中
|
|
onCurrentGirl: function onCurrentGirl(_pid, _old) {
|
|
// 选择切换
|
|
var chds = this.nodGirls.content.children;
|
|
for (var i = 0; i < chds.length; ++i) {
|
|
var node = chds[i];
|
|
nx.gui.setActive(node, "normal/focus", node.partner_id == _pid);
|
|
}
|
|
|
|
// 新角色
|
|
var partner = HomeModel.getInstance().queryGirl(_pid);
|
|
if (!partner) {
|
|
this.setEmpty();
|
|
return;
|
|
}
|
|
|
|
// 动画判断
|
|
var pid = this.current ? this.current.partner_id : 0;
|
|
if (pid == _pid) {
|
|
this.doEffect(this.current, partner);
|
|
}
|
|
|
|
// 角色切换
|
|
this.current = partner;
|
|
|
|
// 信息刷新
|
|
var self = this;
|
|
var showUI = function showUI(_init) {
|
|
if (_init === void 0) {
|
|
_init = false;
|
|
}
|
|
self.nodUI.active = true;
|
|
self.updateIntimacy(_init);
|
|
self.updateArchives(_init);
|
|
self.updateActions(_init);
|
|
self.onBagItemUpdate();
|
|
};
|
|
|
|
// 新角色载入
|
|
if (pid != this.current.partner_id) {
|
|
this.nodUI.active = false;
|
|
// this.loadGirl( this.current.partner_id, () => {
|
|
this.rebuildItems();
|
|
// this.freshHEntry();
|
|
showUI(true);
|
|
// } );
|
|
} else {
|
|
showUI(false);
|
|
}
|
|
},
|
|
// 闺蜜切换
|
|
onTouchTogRole: function onTouchTogRole(_item) {
|
|
var pid = _item ? _item.parent.partner_id : -1;
|
|
if (!nx.dt.numPositive(pid, false)) {
|
|
return;
|
|
}
|
|
if (!this.current || this.current.partner_id != pid) {
|
|
nx.bridge.vset("HomeGirlShow", pid);
|
|
}
|
|
},
|
|
// 点击闺蜜
|
|
onTouchGirl: function onTouchGirl(_part) {
|
|
console.log("TOUCH:", _part);
|
|
},
|
|
// ========================================================================
|
|
// 亲密度相关
|
|
// ========================================================================
|
|
|
|
// 刷新亲密度
|
|
updateIntimacy: function updateIntimacy(_init) {
|
|
// 无效
|
|
var DATA = game.configs.favor_data.data_intimacy_lev;
|
|
if (nx.dt.objEmpty(this.current) || nx.dt.objEmpty(DATA)) {
|
|
return;
|
|
}
|
|
var exp = this.current.intimacy_num;
|
|
var lev = this.current.intimacy_lev;
|
|
var cur = DATA[lev];
|
|
var next = DATA[lev + 1];
|
|
|
|
// 亲密度
|
|
nx.gui.setString(this.nodRelation, "level/txt", lev);
|
|
var prog = nx.gui.getComponent(this.nodRelation, "prog", cc.ProgressBar);
|
|
if (cur && prog) {
|
|
if (!next) {
|
|
prog.progress = 1;
|
|
nx.gui.setString(prog, "txt", "");
|
|
} else {
|
|
prog.progress = exp / next.exp;
|
|
nx.gui.setString(prog, "txt", exp + "/" + next.exp);
|
|
}
|
|
}
|
|
|
|
// 满级
|
|
if (!next) {
|
|
nx.gui.setString(this.nodAddition, "to/txt", lev);
|
|
nx.gui.setActive(this.nodAddition, "from", false);
|
|
nx.gui.setActive(this.nodAddition, "top", true);
|
|
nx.gui.setString(this.nodAddition, "next", nx.text.getKey("好感加成已满"));
|
|
nx.gui.setString(this.nodAddition, "atk/from", nx.text.getKey("满加成"));
|
|
nx.gui.setString(this.nodAddition, "atk/to", cur.attr[0][1]);
|
|
nx.gui.setString(this.nodAddition, "def/from", nx.text.getKey("满加成"));
|
|
nx.gui.setString(this.nodAddition, "def/to", cur.attr[1][1]);
|
|
nx.gui.setString(this.nodAddition, "hp/from", nx.text.getKey("满加成"));
|
|
nx.gui.setString(this.nodAddition, "hp/to", cur.attr[2][1]);
|
|
} else {
|
|
nx.gui.setString(this.nodAddition, "from/txt", lev);
|
|
nx.gui.setString(this.nodAddition, "to/txt", lev + 1);
|
|
nx.gui.setActive(this.nodAddition, "from", true);
|
|
nx.gui.setActive(this.nodAddition, "top", false);
|
|
var tip = nx.text.format("好感加成解锁", next.exp - exp);
|
|
nx.gui.setString(this.nodAddition, "next", tip);
|
|
nx.gui.setString(this.nodAddition, "atk/from", cur.attr.length > 0 ? cur.attr[0][1] : 0);
|
|
nx.gui.setString(this.nodAddition, "atk/to", next.attr[0][1]);
|
|
nx.gui.setString(this.nodAddition, "def/from", cur.attr.length > 0 ? cur.attr[1][1] : 0);
|
|
nx.gui.setString(this.nodAddition, "def/to", next.attr[1][1]);
|
|
nx.gui.setString(this.nodAddition, "hp/from", cur.attr.length > 0 ? cur.attr[2][1] : 0);
|
|
nx.gui.setString(this.nodAddition, "hp/to", next.attr[2][1]);
|
|
}
|
|
},
|
|
// ========================================================================
|
|
// 档案相关
|
|
// ========================================================================
|
|
|
|
// 刷新档案
|
|
updateArchives: function updateArchives() {
|
|
// 无效
|
|
var DATA = game.configs.favor_data.data_intimacy_lev;
|
|
if (nx.dt.objEmpty(this.current) || nx.dt.objEmpty(DATA)) {
|
|
return;
|
|
}
|
|
var num = 1;
|
|
var lev = this.current.intimacy_lev;
|
|
for (var i = 0; i < lev; ++i) {
|
|
var ifo = DATA[i];
|
|
if (ifo.type == 1) {
|
|
++num;
|
|
}
|
|
}
|
|
var list = nx.gui.find(this.nodArchives, "list");
|
|
if (list) {
|
|
for (var _i = 0; _i < list.children.length; ++_i) {
|
|
var item = list.children[_i];
|
|
var lock = _i >= num;
|
|
nx.gui.setActive(item, "on", !lock);
|
|
nx.gui.setActive(item, "off", lock);
|
|
}
|
|
}
|
|
},
|
|
// 点击档案
|
|
onTouchArchive: function onTouchArchive(_key) {
|
|
var _this2 = this;
|
|
if (!this.current) {
|
|
return;
|
|
}
|
|
var HC = HomeModel.getInstance();
|
|
var pid = this.current.partner_id + "_" + _key;
|
|
HC.reqStoryData(pid, function (_ret, _data) {
|
|
if (!_ret) {
|
|
nx.tbox(_data);
|
|
return;
|
|
}
|
|
nx.bridge.createPanel("WndBedroomStory", {
|
|
partner_id: _this2.current.partner_id,
|
|
profile_id: pid,
|
|
step: _data.step
|
|
});
|
|
});
|
|
},
|
|
// ========================================================================
|
|
// 动作相关
|
|
// ========================================================================
|
|
|
|
// 刷新动作
|
|
updateActions: function updateActions(_init) {
|
|
// 无效
|
|
var DATA = game.configs.favor_data.data_intimacy_lev;
|
|
if (nx.dt.objEmpty(this.current) || nx.dt.objEmpty(DATA)) {
|
|
return;
|
|
}
|
|
var num = 0;
|
|
var lev = this.current.intimacy_lev;
|
|
for (var i = 0; i <= lev; ++i) {
|
|
if (DATA[i].type == 2) {
|
|
++num;
|
|
}
|
|
}
|
|
for (var _i2 = 0; _i2 < this.nodParts.children.length; ++_i2) {
|
|
var item = this.nodParts.children[_i2];
|
|
var lock = _i2 >= num;
|
|
nx.gui.setActive(item, "lock", lock);
|
|
nx.gui.setActive(item, "on", !lock);
|
|
nx.gui.setActive(item, "off", false);
|
|
}
|
|
|
|
// 换人了
|
|
if (!nx.dt.numGood(this.actionIdx) || this.actionIdx >= num) {
|
|
this.actionIdx = 0;
|
|
}
|
|
this.onTogActionTag(this.actionIdx, _init);
|
|
},
|
|
// 切换动作
|
|
onTogActionTag: function onTogActionTag(_index, _force) {
|
|
var index = parseInt(_index) || 0;
|
|
for (var i = 0; i < this.nodParts.children.length; ++i) {
|
|
var item = this.nodParts.children[i];
|
|
nx.gui.setActive(item, "on", i == index);
|
|
nx.gui.setActive(item, "off", i != index);
|
|
}
|
|
if (this.actionIdx == index && !_force) {
|
|
return;
|
|
}
|
|
this.actionIdx = index;
|
|
var open = nx.bridge.vget("HOpened");
|
|
var key = open ? "data_actions_h" : "data_actions";
|
|
var DATA = game.configs.favor_data[key];
|
|
if (nx.dt.objNEmpty(DATA) && nx.dt.objNEmpty(this.current)) {
|
|
var temp = DATA[this.current.partner_id]["" + index];
|
|
if (temp) {
|
|
this.spGirl.play(temp.path, temp.name, null, true);
|
|
}
|
|
return;
|
|
}
|
|
},
|
|
// 点击锁定动作
|
|
onTouchLockTag: function onTouchLockTag(_index) {
|
|
nx.tbox("好感度不足");
|
|
},
|
|
// ========================================================================
|
|
// 道具相关
|
|
// ========================================================================
|
|
|
|
// 初始化道具格子
|
|
initItemList: function initItemList() {
|
|
var adds = game.configs.favor_data.data_const.itemrate_data.val;
|
|
var chds = this.nodGifts.children;
|
|
for (var i = 0; i < chds.length; ++i) {
|
|
var item = chds[i];
|
|
nx.gui.setString(item, "point/num", "+" + adds[i]);
|
|
}
|
|
},
|
|
// 重构道具列表
|
|
rebuildItems: function rebuildItems() {
|
|
var pid = this.current ? this.current.partner_id : 0;
|
|
var DATA = game.configs.favor_data.data_partner[pid];
|
|
if (nx.dt.objEmpty(DATA)) {
|
|
nx.gui.setActive(this.nodOps, "", false);
|
|
return;
|
|
}
|
|
var chds = this.nodGifts.children;
|
|
for (var i = 0; i < chds.length; ++i) {
|
|
var node = chds[i];
|
|
node.cfgs = gitemdata(DATA.item[i]);
|
|
if (nx.dt.objEmpty(node.cfgs)) {
|
|
node.active = false;
|
|
} else {
|
|
node.active = true;
|
|
nx.bridge.setIcon(node, "icon", node.cfgs.icon);
|
|
nx.gui.setString(node, "name", nx.text.getKey(node.cfgs.name));
|
|
}
|
|
}
|
|
this.selectGift(0);
|
|
},
|
|
// 礼物选中
|
|
selectGift: function selectGift(_index) {
|
|
var item = null;
|
|
var chds = this.nodGifts.children;
|
|
for (var i = 0; i < chds.length; ++i) {
|
|
var node = chds[i];
|
|
nx.gui.setActive(node, "focus", _index == i);
|
|
if (_index == i) {
|
|
item = node;
|
|
}
|
|
}
|
|
|
|
// 当前道具
|
|
this.item = item ? item.cfgs : null;
|
|
if (nx.dt.objEmpty(this.item)) {
|
|
nx.gui.setActive(this.nodOps, "", false);
|
|
return;
|
|
}
|
|
nx.gui.setActive(this.nodOps, "", true);
|
|
var model = BackPackController.getInstance().getModel();
|
|
var count = model.getBackPackItemNumByBid(this.item.id);
|
|
nx.gui.setActive(this.nodOps, "one", count > 0);
|
|
nx.gui.setActive(this.nodOps, "all", count > 1);
|
|
},
|
|
// 礼物切换
|
|
onTouchTogGift: function onTouchTogGift(_key) {
|
|
var index = parseInt(_key) || 1;
|
|
this.selectGift(index - 1);
|
|
},
|
|
// 道具使用
|
|
onTouchUse: function onTouchUse(_key) {
|
|
if (!this.item) {
|
|
return;
|
|
}
|
|
var model = BackPackController.getInstance().getModel();
|
|
var count = model.getBackPackItemNumByBid(this.item.id);
|
|
var num = _key == "all" ? Math.min(count, MAX_USE) : 1;
|
|
HomeModel.getInstance().reqUseIntimacyItem(this.item.id, num, function (_ret, _data) {
|
|
if (!_ret) {
|
|
// nx.tbox( _data );
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
// 道具更新
|
|
onBagItemUpdate: function onBagItemUpdate(_bagCode, _itemList) {
|
|
if (!this.current) {
|
|
return;
|
|
}
|
|
var DATA = game.configs.favor_data.data_partner[this.current.partner_id];
|
|
var chds = this.nodGifts.children;
|
|
var items = DATA.item;
|
|
var model = BackPackController.getInstance().getModel();
|
|
for (var i = 0; i < chds.length; ++i) {
|
|
var count = model.getBackPackItemNumByBid(items[i]);
|
|
nx.gui.setString(chds[i], "count/txt", count);
|
|
}
|
|
},
|
|
// 动画效果
|
|
doEffect: function doEffect(_from, _to) {
|
|
if (!_from || !_to) return;
|
|
|
|
// 亲密度增加
|
|
var pt = _to.intimacy_num - _from.intimacy_num;
|
|
if (nx.dt.numPositive(pt, false)) {
|
|
var ach = nx.gui.find(this.nodEffect, "pt");
|
|
var tmp = nx.gui.find(this.nodEffect, "ts/point");
|
|
var node = cc.instantiate(tmp);
|
|
nx.gui.setString(node, "txt", "+" + pt);
|
|
node.parent = ach;
|
|
node.position = cc.Vec2.ZERO;
|
|
node.opacity = 0;
|
|
cc.tween(node).to(0.2, {
|
|
opacity: 255,
|
|
position: cc.v2(0, 50)
|
|
}).to(0.6, {
|
|
position: cc.v2(0, 100),
|
|
opacity: 100
|
|
}).removeSelf().start();
|
|
nx.audio.playSFX(cc.path.join("prefab/home/bedroom/bgm", "c1"), false);
|
|
}
|
|
|
|
// 等级改变
|
|
var lv = _to.intimacy_lev - _from.intimacy_lev;
|
|
var DATA = game.configs.favor_data.data_intimacy_lev[_from.intimacy_lev];
|
|
if (DATA && nx.dt.numPositive(lv, false)) {
|
|
var path = "";
|
|
switch (DATA.type) {
|
|
case 1:
|
|
path = "imgDoc";
|
|
break;
|
|
case 2:
|
|
path = "imgAction";
|
|
break;
|
|
case 3:
|
|
path = "imgEvent";
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
if (path == "") {
|
|
return;
|
|
}
|
|
var _ach = nx.gui.find(this.nodEffect, "new");
|
|
var _tmp = nx.gui.find(this.nodEffect, "ts/new");
|
|
var _node2 = cc.instantiate(_tmp);
|
|
_node2.parent = _ach;
|
|
_node2.position = cc.Vec2.ZERO;
|
|
nx.gui.setSpriteFrame(_node2, "img", cc.path.join("prefab/home/bedroom/ui", path));
|
|
_node2.scale = 0.9;
|
|
_node2.opacity = 0;
|
|
cc.tween(_node2).to(0.2, {
|
|
scale: 1.1,
|
|
opacity: 255
|
|
}).to(0.1, {
|
|
scale: 1
|
|
}).to(0.6, {
|
|
position: cc.v2(0, 255),
|
|
opacity: 100
|
|
}).removeSelf().start();
|
|
nx.audio.playSFX(cc.path.join("prefab/home/bedroom/bgm", "c2"), false);
|
|
}
|
|
},
|
|
// ========================================================================
|
|
// 其他
|
|
// ========================================================================
|
|
|
|
// 点击帮助
|
|
onTouchHelp: function onTouchHelp() {
|
|
nx.bridge.createPanel("WndBedroomHelp");
|
|
},
|
|
// 点击引导
|
|
onTouchGuide: function onTouchGuide() {
|
|
nx.bridge.createPanel("WndPlotPictures", {
|
|
id: "bedroom"
|
|
});
|
|
},
|
|
// 全屏切换
|
|
onTogExpand: function onTogExpand() {
|
|
var vis = nx.gui.isActive(this, "ui");
|
|
nx.gui.setActive(this, "ui", !vis);
|
|
nx.gui.setActive(this, "effect", !vis);
|
|
nx.gui.setActive(this, "girls", !vis);
|
|
nx.gui.setActive(this, "LT", !vis);
|
|
nx.gui.setActive(this, "expand/on", !vis);
|
|
nx.gui.setActive(this, "expand/off", vis);
|
|
},
|
|
// ========================================================================
|
|
// H
|
|
// ========================================================================
|
|
|
|
// 刷新入口
|
|
freshHEntry: function freshHEntry() {
|
|
|
|
// // 未开启
|
|
// let HH = HomeHMod.getInstance();
|
|
// let open = nx.bridge.vget( "HOpened" );
|
|
// if( !HH || !open ) {
|
|
// nx.gui.setActive( this.nodUI, "hentry", false );
|
|
// return;
|
|
// }
|
|
|
|
// // 当前闺蜜
|
|
// let pid = nx.bridge.vget( "HomeGirlShow" );
|
|
// if( !HH.isMember( pid ) ) {
|
|
// nx.gui.setActive( this.nodUI, "hentry", false );
|
|
// return;
|
|
// }
|
|
|
|
// nx.gui.setActive( this.nodUI, "hentry", true );
|
|
},
|
|
// 点击入口
|
|
onTouchHEntry: function onTouchHEntry() {
|
|
|
|
// let open = nx.bridge.vget( "HOpened" );
|
|
// if( !open ) {
|
|
// nx.warn( "$Bedroom:未开启!" );
|
|
// return;
|
|
// }
|
|
|
|
// let pid = nx.bridge.vget( "HomeGirlShow" );
|
|
// if( !nx.dt.numPositive( pid, false ) ) {
|
|
// nx.warn( "$Bedroom:当前无效!" + pid + typeof ( pid ) );
|
|
// return;
|
|
// }
|
|
|
|
// nx.bridge.createPanel( "WndHomeH", { pid: pid } );
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |