Greasy Fork is available in English.

雀魂mod

雀魂mod,解锁了全人物道具等。。。

  1. // ==UserScript==
  2. // @name 雀魂mod
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.9
  5. // @description 雀魂mod,解锁了全人物道具等。。。
  6. // @author You
  7. // @match https://www.majsoul.com/1/
  8. // @grant none
  9. // ==/UserScript==
  10. //cfg.item_definition.item.map_ 物品一览
  11. //1代表一姬,2代表二阶堂,以此类推
  12. var setcharacter = 16; //人物
  13. var charid = "charid=";
  14. var skin = "skin="
  15. var ca = document.cookie.split(';');
  16. for (var i = 0; i < ca.length; i++) {
  17. var c = ca[i].trim();
  18. if (c.indexOf(charid) == 0) {
  19. setcharacter = c.substring(charid.length, c.length) - 200000;
  20. console.log(setcharacter)
  21. }
  22. }
  23. for (var i = 0; i < ca.length; i++) {
  24. var c = ca[i].trim();
  25. if (c.indexOf(skin) == 0) {
  26. setskin = c.substring(skin.length, c.length);
  27. } else {
  28. setskin = null
  29. }
  30. }
  31. /*
  32. id:305001, name_chs:"咸鱼立直棒"
  33. id: 305002, name_chs: "大葱立直棒",
  34. id: 305003, name_chs: "狗骨头立直棒"
  35. id: 305004, name_chs: "巧克力立直棒"
  36. id: 305005, name_chs: "邪眼立直棒",
  37. id: 305006, name_chs: "翡翠立直棒",
  38. id: 305018, name_chs: "猩红立直棒",
  39. id: 305019, name_chs: "24K金棒",
  40. id: 305027, name_chs: "爆竹立直棒",
  41. id: 305028, name_chs: "饺子立直棒",
  42. */
  43. var setitemlizhibang = 305001; //立直棒
  44. /*
  45. id: 305007, name_chs: "烈焰和牌",
  46. id: 305008, name_chs: "旋风和牌",
  47. id: 305009, name_chs: "樱花和牌",
  48. id: 305023, name_chs: "黑炎和牌",
  49. id: 305029, name_chs: "烟花和牌",
  50. id: 305034, name_chs: "和牌-爆炎龙卷",
  51. id: 305035, name_chs: "和牌-方舟反应堆",
  52. id: 305036, name_chs: "和牌-红玫瑰",
  53. */
  54. var setitemhupai = 305035; //胡牌特效
  55. /*
  56. id: 305010, name_chs: "苍火立直",
  57. id: 305021, name_chs: "碎冰立直",
  58. id: 305022, name_chs: "火焰立直",
  59. id: 305032, name_chs: "立直-幻影",
  60. id: 305033, name_chs: "立直-飞羽",
  61.  
  62. */
  63. var setlizhi = 305033; //立直特效
  64. /*
  65. id: 305011, name_chs: "橘猫爪",
  66. id: 305030, name_chs: "夜月猫爪",
  67. id: 305031, name_chs: "蓝猫爪",
  68. */
  69. var setshou = 305030; //爪子
  70. /*
  71. id: 305025, name_chs: "《真剑胜负》",
  72. id: 305026, name_chs: "《激斗》"
  73. */
  74. var setmusic = 305025; //立直音效
  75. setTimeout(
  76. (function() {
  77. setTimeout(function() {
  78. // Hack 开启报番型,作者 aoarashi1988,Handle修改
  79. if (game) {
  80. game.Tools.get_chara_audio = function(t, e) {
  81. if (e && "" != e) {
  82. var i = t.charid,
  83. n = cfg.item_definition.character.get(i);
  84. if (!n) return null;
  85. for (var r = t.level,
  86. a = cfg.voice.sound.findGroup(n.sound),
  87. s = [],
  88. o = 0; o < a.length; o++) a[o].type == e && a[o].level_limit <= r && s.push(o);
  89. if (0 == s.length) return null;
  90. var l = s[Math.floor(Math.random() * s.length)];
  91. return {
  92. path: a[l].path,
  93. volume: view.AudioMgr.getCVmute(n.id) ? 0 : view.AudioMgr.getCVvolume(n.id) * n.sound_volume,
  94. time_length: a[l].time_length
  95. };
  96. }
  97. };
  98. view.AudioMgr.PlayCharactorSound = function(t, e, i) {
  99. var n = t.charid,
  100. a = cfg.item_definition.character.get(n);
  101. if (!a) return null;
  102. for (var r = t.level,
  103. s = cfg.voice.sound.findGroup(a.sound),
  104. o = [],
  105. l = 0; l < s.length; l++) s[l].type == e && s[l].level_limit <= r && o.push(l);
  106. if (0 == o.length) return null;
  107. var h = o[Math.floor(Math.random() * o.length)],
  108. c = a.sound_volume;
  109. return (
  110. (c *= this.getCVvolume(n)), this.getCVmute(n) && (c = 0), {
  111. words: s[h]["words_" + GameMgr.client_language],
  112. sound: this.PlaySound(s[h].path, c, i)
  113. });
  114. };
  115. requestAnimationFrame(function autoRun() {
  116. try {
  117. const arrBackup = cfg.voice.sound.groups_;
  118. if (!arrBackup || arrBackup.length === 0) {
  119. throw new Error();
  120. }
  121. console.log("Hacked所有语音");
  122. Object.entries(cfg.voice.sound.groups_).forEach(
  123. ([soundID, soundGroup]) => {
  124. soundGroup.forEach((soundObject, index) => {
  125. soundObject.level_limit = 0;
  126. });
  127. });
  128. } catch (error) {
  129. requestAnimationFrame(autoRun);
  130. }
  131. });
  132. }
  133. //以下为解锁全立绘,作者UsernameFull
  134. //设置全部道具
  135. ! function(t) {
  136. var e;
  137. ! function(t) {
  138. t[t.none = 0] = "none", t[t.daoju = 1] = "daoju", t[t.gift = 2] = "gift", t[t.fudai = 3] = "fudai", t[t.character_view = 4] = "character_view", t[t.common_view = 5] = "common_view"
  139. }(e = t.EItemCategory || (t.EItemCategory = {}));
  140. var i = function(i) {
  141. function n() {
  142. var t = i.call(this, new ui.lobby.bagUI) || this;
  143. return t.container_top = null, t.container_content = null, t.locking = !1, t.tabs = [], t.page_item = null, t.page_gift = null, t.page_desktop = null, t.page_skin = null, t.select_index = 0, n.Inst = t, t
  144. }
  145. return __extends(n, i), n.init = function() {
  146. var t = this;
  147. app.NetAgent.AddListener2Lobby("NotifyAccountUpdate", Laya.Handler.create(this, function(e) {
  148. var i = e.update;
  149. i && i.bag && (t.update_data(i.bag.update_items), t.update_daily_gain_data(i.bag))
  150. }, null, !1)), this.fetch()
  151. }, n.fetch = function() {
  152. var e = this;
  153. this._item_map = {}, this._daily_gain_record = {}, app.NetAgent.sendReq2Lobby("Lobby", "fetchBagInfo", {}, function(i, n) {
  154. if (i || n.error) t.UIMgr.Inst.showNetReqError("fetchBagInfo", i, n);
  155. else {
  156. app.Log.log("背包信息:" + JSON.stringify(n));
  157. var a = n.bag;
  158. //设置全部道具(立直棒及特效不起效果)
  159. if (a) {
  160. // if (a.items)
  161. // for (h = 0; h < a.items.length; h++) {
  162. // var r = a.items[h].item_id,
  163. // s = a.items[h].stack,
  164. // o = cfg.item_definition.item.get(r);
  165. // o && (e._item_map[r] = {
  166. // item_id: r,
  167. // count: s,
  168. // category: o.category
  169. // })
  170. // }
  171. if (a.daily_gain_record)
  172. for (var l = a.daily_gain_record, h = 0; h < l.length; h++) {
  173. var c = l[h].limit_source_id;
  174. e._daily_gain_record[c] = {};
  175. var u = l[h].record_time;
  176. e._daily_gain_record[c].record_time = u;
  177. var _ = l[h].records;
  178. if (_)
  179. for (var d = 0; d < _.length; d++) e._daily_gain_record[c][_[d].item_id] = _[d].count
  180. }
  181. }
  182. var items = cfg.item_definition.item.map_;
  183. for (var id in items) {
  184. cfg.item_definition.item.get(id);
  185. e._item_map[id] = {
  186. item_id: id,
  187. count: 1,
  188. category: items[id].category
  189. };
  190. }
  191. }
  192. })
  193. }, n.find_item = function(t) {
  194. var e = this._item_map[t];
  195. return e ? {
  196. item_id: e.item_id,
  197. category: e.category,
  198. count: e.count
  199. } : null
  200. }, n.get_item_count = function(t) {
  201. var e = this.find_item(t);
  202. if (e) return e.count;
  203. if (100001 == t) {
  204. var i = GameMgr.Inst.account_data.diamond;
  205. return GameMgr.inGooglePlay && GameMgr.Inst.account_numerical_resource[101001] && (i += GameMgr.Inst.account_numerical_resource[101001]), GameMgr.inChina && GameMgr.Inst.account_numerical_resource[101002] && (i += GameMgr.Inst.account_numerical_resource[101002]), i
  206. }
  207. return 100002 == t ? GameMgr.Inst.access_token.gold : 0
  208. }, n.find_items_by_category = function(t) {
  209. var e = [];
  210. for (var i in this._item_map) this._item_map[i].category == t && e.push({
  211. item_id: this._item_map[i].item_id,
  212. category: this._item_map[i].category,
  213. count: this._item_map[i].count
  214. });
  215. return e
  216. }, n.update_data = function(t) {
  217. for (r = 0; r < t.length; r++) {
  218. var e = t[r].item_id,
  219. i = t[r].stack;
  220. i > 0 ? this._item_map.hasOwnProperty(e.toString()) ? this._item_map[e].count = i : this._item_map[e] = {
  221. item_id: e,
  222. count: i,
  223. category: cfg.item_definition.item.get(e).category
  224. } : this._item_map.hasOwnProperty(e.toString()) && (this._item_map[e] = 0, delete this._item_map[e])
  225. }
  226. this.Inst && this.Inst.when_data_change();
  227. for (r = 0; r < t.length; r++) {
  228. e = t[r].item_id;
  229. if (this._item_listener.hasOwnProperty(e.toString()))
  230. for (var n = this._item_listener[e], a = 0; a < n.length; a++) n[a].run()
  231. }
  232. for (var r = 0; r < this._all_item_listener.length; r++) this._all_item_listener[r].run()
  233. }, n.update_daily_gain_data = function(t) {
  234. var e = t.update_daily_gain_record;
  235. if (e)
  236. for (var i = 0; i < e.length; i++) {
  237. var n = e[i].limit_source_id;
  238. this._daily_gain_record[n] || (this._daily_gain_record[n] = {});
  239. var a = e[i].record_time;
  240. this._daily_gain_record[n].record_time = a;
  241. var r = e[i].records;
  242. if (r)
  243. for (var s = 0; s < r.length; s++) this._daily_gain_record[n][r[s].item_id] = r[s].count
  244. }
  245. }, n.get_item_daily_record = function(t, e) {
  246. return this._daily_gain_record[t] && this._daily_gain_record[t].record_time && game.Tools.isPassedRefreshTime(this._daily_gain_record[t].record_time) && this._daily_gain_record[t][e] ? this._daily_gain_record[t][e] : 0
  247. }, n.add_item_listener = function(t, e) {
  248. this._item_listener.hasOwnProperty(t.toString()) || (this._item_listener[t] = []), this._item_listener[t].push(e)
  249. }, n.remove_item_listener = function(t, e) {
  250. var i = this._item_listener[t];
  251. if (i)
  252. for (var n = 0; n < i.length; n++)
  253. if (i[n] === e) {
  254. i[n] = i[i.length - 1], i.pop();
  255. break
  256. }
  257. }, n.add_all_item_listener = function(t) {
  258. this._all_item_listener.push(t)
  259. }, n.remove_all_item_listener = function(t) {
  260. for (var e = this._all_item_listener, i = 0; i < e.length; i++)
  261. if (e[i] === t) {
  262. e[i] = e[e.length - 1], e.pop();
  263. break
  264. }
  265. }, n.prototype.have_red_point = function() {
  266. return this.page_desktop.have_red_point()
  267. }, n.prototype.onCreate = function() {
  268. var e = this;
  269. this.container_top = this.me.getChildByName("top"), this.container_top.getChildByName("btn_back").clickHandler = Laya.Handler.create(this, function() {
  270. e.locking || e.hide(Laya.Handler.create(e, function() {
  271. t.UI_Lobby.Inst.enable = !0
  272. }))
  273. }, null, !1), this.container_content = this.me.getChildByName("content");
  274. for (var i = function(t) {
  275. n.tabs.push(n.container_content.getChildByName("tabs").getChildByName("btn" + t)), n.tabs[t].clickHandler = Laya.Handler.create(n, function() {
  276. e.select_index != t && e.on_change_tab(t)
  277. }, null, !1)
  278. }, n = this, a = 0; a < 5; a++) i(a);
  279. this.page_item = new t.UI_Bag_PageItem(this.container_content.getChildByName("page_items")), this.page_gift = new t.UI_Bag_PageGift(this.container_content.getChildByName("page_gift")), this.page_desktop = new t.UI_Bag_PageDesktop(this.container_content.getChildByName("page_desktop")), this.page_skin = new t.UI_Bag_PageSkin(this.container_content.getChildByName("page_skin"))
  280. }, n.prototype.show = function(e) {
  281. var i = this;
  282. void 0 === e && (e = 0), this.enable = !0, this.locking = !0, t.UIBase.anim_alpha_in(this.container_top, {
  283. y: -30
  284. }, 200), t.UIBase.anim_alpha_in(this.container_content, {
  285. y: 30
  286. }, 200), Laya.timer.once(300, this, function() {
  287. i.locking = !1
  288. }), this.on_change_tab(e), game.Scene_Lobby.Inst.change_bg("indoor", !1), 4 != e && this.page_skin.when_update_data(), this.tabs[3].getChildByName("redpoint").visible = this.page_desktop.have_red_point()
  289. }, n.prototype.hide = function(e) {
  290. var i = this;
  291. this.locking = !0, t.UIBase.anim_alpha_out(this.container_top, {
  292. y: -30
  293. }, 200), t.UIBase.anim_alpha_out(this.container_content, {
  294. y: 30
  295. }, 200), Laya.timer.once(300, this, function() {
  296. i.locking = !1, i.enable = !1, e && e.run()
  297. })
  298. }, n.prototype.onDisable = function() {
  299. this.page_desktop.me.visible && this.page_desktop.close(), this.page_skin.close()
  300. }, n.prototype.on_change_tab = function(t) {
  301. this.select_index = t;
  302. for (var i = 0; i < this.tabs.length; i++) this.tabs[i].skin = game.Tools.localUISrc(t == i ? "myres/shop/tab_choose.png" : "myres/shop/tab_unchoose.png"), this.tabs[i].getChildAt(0).color = t == i ? "#d9b263" : "#8cb65f";
  303. switch (this.page_item.close(), this.page_gift.close(), this.page_desktop.close(), this.page_skin.me.visible = !1, t) {
  304. case 0:
  305. this.page_item.show(e.daoju);
  306. break;
  307. case 1:
  308. this.page_gift.show();
  309. break;
  310. case 2:
  311. this.page_item.show(e.character_view);
  312. break;
  313. case 3:
  314. this.page_desktop.show();
  315. break;
  316. case 4:
  317. this.page_skin.show()
  318. }
  319. }, n.prototype.when_data_change = function() {
  320. this.page_item.me.visible && this.page_item.when_update_data(), this.page_gift.me.visible && this.page_gift.when_update_data()
  321. }, n.prototype.on_skin_change = function() {
  322. this.page_skin.when_update_data()
  323. }, n.prototype.clear_desktop_btn_redpoint = function() {
  324. this.tabs[3].getChildByName("redpoint").visible = !1
  325. }, n._item_map = {}, n._item_listener = {}, n._all_item_listener = [], n._daily_gain_record = {}, n.Inst = null, n
  326. }(t.UIBase);
  327. t.UI_Bag = i
  328. }(uiscript || (uiscript = {}));
  329. //桌布和卡背
  330. ! function(t) {
  331. var e = function() {
  332. function e(t) {
  333. var e = this;
  334. console.log(this);
  335. this.desktop_default = 305044, this.mjp_defalut = 305045, this.lobby_bg_default = 307001, this.tab_index = 0, this.select_index = 0, this.items = [], this.img_desktop = null, this.img_mjp = null, this.btn_save = null, this.seen_lobby_bg_map = null, this.me = t, this.scrollview = t.getChildByName("items").scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(new Laya.Handler(this, this.render_item), -1, 3, 10), this.scrollview.reset(), this.btn_tablecloth = t.getChildByName("items").getChildByName("btn_tablecloth"), this.btn_tablecloth.clickHandler = Laya.Handler.create(this, function() {
  336. 1 != e.tab_index && e.change_tab(1)
  337. }, null, !1), this.btn_cardback = t.getChildByName("items").getChildByName("btn_cardback"), this.btn_cardback.clickHandler = Laya.Handler.create(this, function() {
  338. 2 != e.tab_index && e.change_tab(2)
  339. }, null, !1), this.btn_lobby_bg = t.getChildByName("items").getChildByName("btn_lobby_bg"), this.btn_lobby_bg.clickHandler = new Laya.Handler(this, function() {
  340. 3 != e.tab_index && e.change_tab(3)
  341. });
  342. var i = this.me.getChildByName("preview");
  343. this.img_desktop = i.getChildByName("desktop"), this.img_mjp = i.getChildByName("mjp"), this.btn_save = i.getChildByName("btn_use"), this.btn_save.clickHandler = Laya.Handler.create(this, this.save_change, null, !1)
  344. }
  345. return e.prototype.have_red_point = function() {
  346. if (!this.seen_lobby_bg_map) {
  347. this.seen_lobby_bg_map = {};
  348. var e = Laya.LocalStorage.getItem(game.Tools.eeesss("lobby_bg_list_" + GameMgr.Inst.account_id));
  349. if (e)
  350. for (var i = (e = game.Tools.dddsss(e)).split(","), n = 0; n < i.length; n++) this.seen_lobby_bg_map[i[n]] = 1
  351. }
  352. for (var a = t.UI_Bag.find_items_by_category(t.EItemCategory.common_view), n = 0; n < a.length; n++) {
  353. if (3 == cfg.item_definition.item.get(a[n].item_id).type && !this.seen_lobby_bg_map[a[n].item_id]) return !0
  354. }
  355. return !1
  356. }, e.prototype.show = function() {
  357. this.me.visible = !0, this.btn_save.visible = !1, this.change_tab(1), this.btn_lobby_bg.getChildByName("redpoint").visible = this.have_red_point()
  358. }, e.prototype.close = function() {
  359. this.me.visible = !1, this.items = [], this.scrollview.reset(), Laya.loader.clearTextureRes(this.img_desktop.skin), Laya.loader.clearTextureRes(this.img_mjp.skin), this.img_desktop.skin = "", this.img_mjp.skin = "", game.LoadMgr.clearImgSkin(this.img_desktop), game.LoadMgr.clearImgSkin(this.img_mjp)
  360. }, e.prototype.change_tab = function(e) {
  361. var i = this;
  362. if (this.tab_index = e, this.items = [], 1 == e ? this.items.push({
  363. item_id: this.desktop_default,
  364. owned: !0
  365. }) : 2 == e ? this.items.push({
  366. item_id: this.mjp_defalut,
  367. owned: !0
  368. }) : 3 == e && this.items.push({
  369. item_id: this.lobby_bg_default,
  370. owned: !0
  371. }), this.scrollview.reset(), this.select_index = 0, this.btn_tablecloth.getChildByName("inchoose").visible = 1 == e, this.btn_cardback.getChildByName("inchoose").visible = 2 == e, this.btn_lobby_bg.getChildByName("inchoose").visible = 3 == e, 1 == e || 2 == e) {
  372. var n = t.UI_Bag.find_items_by_category(t.EItemCategory.common_view);
  373. n = n.sort(function(t, e) {
  374. return t.item_id - e.item_id
  375. });
  376. for (a = 0; a < n.length; a++)
  377. if (n[a].item_id != this.desktop_default && n[a].item_id != this.mjp_defalut) {
  378. cfg.item_definition.item.get(n[a].item_id).type == e && (this.items.push({
  379. item_id: n[a].item_id,
  380. owned: !0
  381. }), n[a].item_id == game.GameUtility.get_common_view_id(e) && (this.select_index = this.items.length - 1))
  382. }
  383. } else 3 == e && cfg.item_definition.item.forEach(function(n) {
  384. n.id != i.lobby_bg_default && 5 == n.category && 3 == n.type && (i.items.push({
  385. item_id: n.id,
  386. owned: t.UI_Bag.get_item_count(n.id) > 0
  387. }), n.id == game.GameUtility.get_common_view_id(e) && (i.select_index = i.items.length - 1))
  388. });
  389. if (this.select_index < 0 && (this.select_index = 0), this.scrollview.addItem(this.items.length), this._on_select_change(), 3 == e) {
  390. this.btn_lobby_bg.getChildByName("redpoint").visible = !1, t.UI_Bag.Inst.clear_desktop_btn_redpoint();
  391. for (var a = 0; a < this.items.length; a++) this.items[a].owned && (this.seen_lobby_bg_map[this.items[a].item_id.toString()] = 1);
  392. var r = "";
  393. for (var s in this.seen_lobby_bg_map) "" != r && (r += ","), r += s;
  394. Laya.LocalStorage.setItem(game.Tools.eeesss("lobby_bg_list_" + GameMgr.Inst.account_id), game.Tools.eeesss(r))
  395. }
  396. }, e.prototype.render_item = function(e) {
  397. var i = this,
  398. n = e.index,
  399. a = e.container,
  400. r = e.cache_data,
  401. s = this.items[n],
  402. o = cfg.item_definition.item.get(s.item_id),
  403. l = a.getChildByName("btn").getChildByName("inchoose");
  404. this.select_index == n ? l.visible = !0 : l.visible = !1;
  405. var h = a.getChildByName("btn");
  406. h.clickHandler = Laya.Handler.create(this, function() {
  407. if (i.select_index != n) {
  408. var e = i.select_index;
  409. i.select_index = n, l.visible = !0, e >= 0 && e < i.items.length && i.scrollview.wantToRefreshItem(e), i._on_select_change()
  410. } else t.UI_ItemDetail.Inst.show(s.item_id)
  411. }, null, !1);
  412. var c = a.getChildByName("useing"),
  413. u = GameMgr.Inst.commonview_slot[this.tab_index];
  414. u || (1 == this.tab_index ? u = this.desktop_default : 2 == this.tab_index ? u = this.mjp_defalut : 3 == this.tab_index && (u = this.lobby_bg_default)), u == s.item_id ? c.visible = !0 : c.visible = !1, h.getChildByName("lock").visible = !s.owned, r.skin || (r.skin = new t.UI_Item_Skin(h.getChildByName("icon"))), r.skin.setSkin(o.icon);
  415. a.getChildByName("name").text = o["name_" + GameMgr.client_language]
  416. }, e.prototype._on_select_change = function() {
  417. if (this.img_mjp.visible = 1 == this.tab_index || 2 == this.tab_index, this.select_index >= 0 && this.select_index < this.items.length) {
  418. var t = this.items[this.select_index];
  419. if (t.owned) {
  420. var e = GameMgr.Inst.commonview_slot[this.tab_index];
  421. e || (1 == this.tab_index ? e = this.desktop_default : 2 == this.tab_index ? e = this.mjp_defalut : 3 == this.tab_index && (e = this.lobby_bg_default)), e == t.item_id ? this.btn_save.visible = !1 : (this.btn_save.visible = !0, this.btn_save.getChildByName("info").text = game.Tools.strOfLocalization(2035))
  422. } else this.btn_save.visible = !1;
  423. 1 == this.tab_index ? (this._show_desktop_preview(t.item_id), this._show_mjp_preview(game.GameUtility.get_common_view_id(game.ECommonView.mjp))) : 2 == this.tab_index ? (this._show_mjp_preview(t.item_id), this._show_desktop_preview(game.GameUtility.get_common_view_id(game.ECommonView.desktop))) : 3 == this.tab_index && this._show_lobby_bg_preview(t.item_id)
  424. } else this.btn_save.visible = !1, 1 == this.tab_index ? (this._show_desktop_preview(0), this._show_mjp_preview(game.GameUtility.get_common_view_id(game.ECommonView.mjp))) : 2 == this.tab_index ? (this._show_mjp_preview(0), this._show_desktop_preview(game.GameUtility.get_common_view_id(game.ECommonView.desktop))) : 3 == this.tab_index && this._show_lobby_bg_preview(0)
  425. }, e.prototype._show_desktop_preview = function(t) {
  426. var e = cfg.item_definition.view.get(t),
  427. i = "";
  428. e || (e = cfg.item_definition.view.get(this.desktop_default)), i = "myres2/tablecloth/" + e.res_name + "/preview.jpg", game.LoadMgr.clearImgSkin(this.img_desktop), "" != this.img_desktop.skin && (Laya.loader.clearTextureRes(this.img_desktop.skin), this.img_desktop.skin = ""), game.LoadMgr.setImgSkin(this.img_desktop, i)
  429. }, e.prototype._show_mjp_preview = function(t) {
  430. var e = cfg.item_definition.view.get(t),
  431. i = "";
  432. e || (e = cfg.item_definition.view.get(this.mjp_defalut)), i = "myres2/mjp/" + e.res_name + "/preview.png", game.LoadMgr.clearImgSkin(this.img_mjp), "" != this.img_mjp.skin && (Laya.loader.clearTextureRes(this.img_mjp.skin), this.img_mjp.skin = ""), game.LoadMgr.setImgSkin(this.img_mjp, i)
  433. }, e.prototype._show_lobby_bg_preview = function(t) {
  434. var e = cfg.item_definition.view.get(t),
  435. i = "";
  436. e || (e = cfg.item_definition.view.get(this.lobby_bg_default)), i = "myres2/lobby_bg/" + e.res_name + ".jpg", game.LoadMgr.clearImgSkin(this.img_desktop), "" != this.img_desktop.skin && (Laya.loader.clearTextureRes(this.img_desktop.skin), this.img_desktop.skin = ""), game.LoadMgr.setImgSkin(this.img_desktop, i)
  437. }, e.prototype.save_change = function() {
  438. var t = this.items[this.select_index],
  439. e = t.item_id;
  440. if (0 == this.select_index && (e = 0), GameMgr.Inst.commonview_slot[this.tab_index] = e,
  441. //屏蔽改变桌布,牌背,大厅背景的网络请求
  442. // app.NetAgent.sendReq2Lobby("Lobby", "changeCommonView", {
  443. // slot: this.tab_index,
  444. // value: e
  445. // }, function(t, e) {
  446. // t ? app.Log.log(t) : app.Log.log(e)
  447. // }),
  448. 2 == this.tab_index && GameMgr.Inst.load_mjp_view(e), 3 == this.tab_index) {
  449. var i = "";
  450. if (0 != this.select_index) {
  451. i = "scene/Assets/Resource/lobby/" + cfg.item_definition.view.get(t.item_id).res_name + ".jpg"
  452. } else i = "scene/Assets/Resource/lobby/yard.jpg";
  453. game.Scene_Lobby.Inst.set_lobby_bg(i)
  454. }
  455. for (var n = 0; n < this.items.length; n++) this.scrollview.wantToRefreshItem(n);
  456. this._on_select_change()
  457. }, e
  458. }();
  459. t.UI_Bag_PageDesktop = e
  460. }(uiscript || (uiscript = {}));
  461. //修改牌桌上角色
  462. ! function(t) {
  463. var e = function() {
  464. function e() {
  465. var e = this;
  466. this.urls = [], this.link_index = -1, this.connect_state = t.EConnectState.none, this.reconnect_count = 0, this.reconnect_span = [500, 1e3, 3e3, 6e3, 1e4, 15e3], this.playerreconnect = !1, this.lasterrortime = 0, this.load_over = !1, this.loaded_player_count = 0, this.real_player_count = 0, app.NetAgent.AddListener2MJ("NotifyPlayerLoadGameReady", Laya.Handler.create(this, function(t) {
  467. app.Log.log("NotifyPlayerLoadGameReady: " + JSON.stringify(t)), e.loaded_player_count = t.ready_id_list.length, e.load_over && uiscript.UI_Loading.Inst.enable && uiscript.UI_Loading.Inst.showLoadCount(e.loaded_player_count, e.real_player_count)
  468. }))
  469. }
  470. return Object.defineProperty(e, "Inst", {
  471. get: function() {
  472. return null == this._Inst ? this._Inst = new e : this._Inst
  473. },
  474. enumerable: !0,
  475. configurable: !0
  476. }), e.prototype.OpenConnect = function(e, i, n, a, r) {
  477. var s = this;
  478. uiscript.UI_Loading.Inst.show("enter_mj"), this.Close(), view.AudioMgr.StopMusic(), Laya.timer.once(500, this, function() {
  479. s.url = "", s.token = e, s.game_uuid = i, s.server_location = n, GameMgr.Inst.ingame = !0, GameMgr.Inst.mj_server_location = n, GameMgr.Inst.mj_game_token = e, GameMgr.Inst.mj_game_uuid = i, s.playerreconnect = a, s._setState(t.EConnectState.tryconnect), s.load_over = !1, s.loaded_player_count = 0, s.real_player_count = 0, s._fetch_gateway(0)
  480. })
  481. }, e.prototype.Close = function() {
  482. this.load_over = !1, app.Log.log("MJNetMgr close"), this._setState(t.EConnectState.none), app.NetAgent.Close2MJ(), this.url = ""
  483. }, e.prototype._OnConnent = function(e) {
  484. app.Log.log("MJNetMgr _OnConnent event:" + e), e == Laya.Event.CLOSE || e == Laya.Event.ERROR ? Laya.timer.currTimer - this.lasterrortime > 100 && (this.lasterrortime = Laya.timer.currTimer, this.connect_state == t.EConnectState.tryconnect ? this._try_to_linknext() : this.connect_state == t.EConnectState.connecting ? view.DesktopMgr.Inst.active ? (view.DesktopMgr.Inst.duringReconnect = !0, this._setState(t.EConnectState.reconnecting), this.reconnect_count = 0, this._Reconnect()) : (this._setState(t.EConnectState.disconnect), uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2008)), t.Scene_MJ.Inst.ForceOut()) : this.connect_state == t.EConnectState.reconnecting && this._Reconnect()) : e == Laya.Event.OPEN && (this.connect_state == t.EConnectState.tryconnect ? (this._setState(t.EConnectState.connecting), this._ConnectSuccess()) : this.connect_state == t.EConnectState.reconnecting && (this._setState(t.EConnectState.connecting), this._ConnectSuccess()))
  485. }, e.prototype._Reconnect = function() {
  486. var e = this;
  487. t.LobbyNetMgr.Inst.connect_state == t.EConnectState.none || t.LobbyNetMgr.Inst.connect_state == t.EConnectState.disconnect ? this._setState(t.EConnectState.disconnect) : t.LobbyNetMgr.Inst.connect_state == t.EConnectState.connecting && GameMgr.Inst.logined ? this.reconnect_count >= this.reconnect_span.length ? this._setState(t.EConnectState.disconnect) : (Laya.timer.once(this.reconnect_span[this.reconnect_count], this, function() {
  488. e.connect_state == t.EConnectState.reconnecting && (app.Log.log("MJNetMgr reconnect count:" + e.reconnect_count), app.NetAgent.connect2MJ(e.url, Laya.Handler.create(e, e._OnConnent, null, !1)))
  489. }), this.reconnect_count++) : Laya.timer.once(1e3, this, this._Reconnect)
  490. }, e.prototype._try_to_linknext = function() {
  491. this.link_index++, this.url = "", app.Log.log("mj _try_to_linknext(" + this.link_index + ") url.length=" + this.urls.length), this.link_index < 0 || this.link_index >= this.urls.length ? (this._setState(t.EConnectState.none), uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(59)), this._SendDebugInfo(), view.DesktopMgr.Inst && !view.DesktopMgr.Inst.active && t.Scene_MJ.Inst.ForceOut()) : (app.NetAgent.connect2MJ(this.urls[this.link_index].url, Laya.Handler.create(this, this._OnConnent, null, !1)), this.url = this.urls[this.link_index].url)
  492. }, e.prototype._fetch_gateway = function(e) {
  493. var i = this;
  494. this.urls = [], this.link_index = -1, app.Log.log("mj _fetch_gateway retry_count:" + e);
  495. ! function(n) {
  496. var a = new Laya.HttpRequest;
  497. a.once(Laya.Event.COMPLETE, i, function(n) {
  498. ! function(n) {
  499. var a = JSON.parse(n);
  500. if (app.Log.log("mj _fetch_gateway func_success data = " + n), a.maintenance) i._setState(t.EConnectState.none), uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2009)), view.DesktopMgr.Inst.active || t.Scene_MJ.Inst.ForceOut();
  501. else if (a.servers && a.servers.length > 0) {
  502. for (var r = a.servers, s = t.Tools.deal_gateway(r), o = 0; o < s.length; o++) i.urls.push({
  503. name: t.LobbyNetMgr.gateway_name + "_" + o,
  504. url: s[o]
  505. });
  506. i.link_index = -1, i._try_to_linknext()
  507. } else e < 1 ? Laya.timer.once(1e3, i, function() {
  508. i._fetch_gateway(e + 1)
  509. }) : (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(60)), i._SendDebugInfo(), view.DesktopMgr.Inst && !view.DesktopMgr.Inst.active && t.Scene_MJ.Inst.ForceOut(), i._setState(t.EConnectState.none))
  510. }(n)
  511. }), a.once(Laya.Event.ERROR, i, function(n) {
  512. app.Log.log("mj _fetch_gateway func_error"), e < 1 ? Laya.timer.once(500, i, function() {
  513. i._fetch_gateway(e + 1)
  514. }) : (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(58)), i._SendDebugInfo(), view.DesktopMgr.Inst.active || t.Scene_MJ.Inst.ForceOut(), i._setState(t.EConnectState.none))
  515. });
  516. var r = [];
  517. r.push("If-Modified-Since"), r.push("0"), n += "?service=ws-game-gateway", GameMgr.inHttps ? n += "&protocol=ws&ssl=true" : n += "&protocol=ws&ssl=false", n += "&location=" + i.server_location, a.send(n, "", "get", "text", r), app.Log.log("mj _fetch_gateway func_fetch url = " + n)
  518. }(t.LobbyNetMgr.gateway_url)
  519. }, e.prototype._setState = function(e) {
  520. this.connect_state = e, GameMgr.inRelease || null != uiscript.UI_Common.Inst && (e == t.EConnectState.none ? uiscript.UI_Common.Inst.label_net_mj.text = "" : e == t.EConnectState.tryconnect ? (uiscript.UI_Common.Inst.label_net_mj.text = "尝试连接麻将服务器", uiscript.UI_Common.Inst.label_net_mj.color = "#000000") : e == t.EConnectState.connecting ? (uiscript.UI_Common.Inst.label_net_mj.text = "麻将服务器:正常", uiscript.UI_Common.Inst.label_net_mj.color = "#00ff00") : e == t.EConnectState.disconnect ? (uiscript.UI_Common.Inst.label_net_mj.text = "麻将服务器:断开连接", uiscript.UI_Common.Inst.label_net_mj.color = "#ff0000", uiscript.UI_Disconnect.Inst && uiscript.UI_Disconnect.Inst.show()) : e == t.EConnectState.reconnecting && (uiscript.UI_Common.Inst.label_net_mj.text = "麻将服务器:正在重连", uiscript.UI_Common.Inst.label_net_mj.color = "#ff0000", uiscript.UI_Disconnect.Inst && uiscript.UI_Disconnect.Inst.show()))
  521. }, e.prototype._ConnectSuccess = function() {
  522. var e = this;
  523. app.Log.log("MJNetMgr _ConnectSuccess "), this.load_over = !1, app.NetAgent.sendReq2MJ("FastTest", "authGame", {
  524. account_id: GameMgr.Inst.account_id,
  525. token: this.token,
  526. game_uuid: this.game_uuid
  527. }, function(i, n) {
  528. if (i || n.error) uiscript.UIMgr.Inst.showNetReqError("authGame", i, n), t.Scene_MJ.Inst.GameEnd(), view.AudioMgr.PlayMusic("music/lobby.mp3");
  529. else {
  530. app.Log.log("麻将桌验证通过:" + JSON.stringify(n)), uiscript.UI_Loading.Inst.setProgressVal(.1);
  531. var a = [];
  532. view.DesktopMgr.player_link_state = n.state_list;
  533. var r = t.Tools.strOfLocalization(2003),
  534. s = n.game_config.mode;
  535. view.ERuleMode.Liqi4;
  536. s.mode < 10 ? (view.ERuleMode.Liqi4, e.real_player_count = 4) : s.mode < 20 && (view.ERuleMode.Liqi3, e.real_player_count = 3);
  537. for (h = 0; h < e.real_player_count; h++) a.push(null);
  538. s.extendinfo && (r = t.Tools.strOfLocalization(2004)), s.detail_rule && s.detail_rule.ai_level && (1 === s.detail_rule.ai_level && (r = t.Tools.strOfLocalization(2003)), 2 === s.detail_rule.ai_level && (r = t.Tools.strOfLocalization(2004)));
  539. for (h = 0; h < n.seat_list.length; h++) {
  540. var o = n.seat_list[h];
  541. if (0 == o) a[h] = {
  542. nickname: r,
  543. avatar_id: 400101,
  544. level: {
  545. id: 10101
  546. },
  547. level3: {
  548. id: 20101
  549. },
  550. character: {
  551. charid: 200001,
  552. level: 0,
  553. exp: 0,
  554. views: [],
  555. skin: 400101,
  556. is_upgraded: !1
  557. }
  558. };
  559. else {
  560. 0;
  561. for (var l = 0; l < n.players.length; l++)
  562. if (n.players[l].account_id == o) {
  563. a[h] = n.players[l];
  564. console.log("n_id:" + a[h].account_id);
  565. console.log(GameMgr.Inst.account_id);
  566. //修改牌桌上人物头像及皮肤
  567. if (a[h].account_id == GameMgr.Inst.account_id) {
  568. (a[h].character = {
  569. charid: GameMgr.Inst.account_data.my_charid,
  570. level: 5,
  571. exp: 0,
  572. skin: GameMgr.Inst.account_data.my_character.skin,
  573. views: GameMgr.Inst.account_data.my_character.views,
  574. is_upgraded: 1
  575. }), (a[h].avatar_id = GameMgr.Inst.account_data.my_character.skin);
  576. }
  577. //end
  578. break
  579. }
  580. }
  581. }
  582. for (var h = 0; h < e.real_player_count; h++) null == a[h] && (a[h] = {
  583. account: 0,
  584. nickname: t.Tools.strOfLocalization(2010),
  585. avatar_id: 400101,
  586. level: {
  587. id: 10101
  588. },
  589. level3: {
  590. id: 20101
  591. },
  592. character: {
  593. charid: 200001,
  594. level: 0,
  595. exp: 0,
  596. views: [],
  597. skin: 400101,
  598. is_upgraded: !1
  599. }
  600. });
  601. e.loaded_player_count = n.ready_id_list.length, e._AuthSuccess(a, n.is_game_start, n.game_config.toJSON())
  602. }
  603. })
  604. }, e.prototype._AuthSuccess = function(e, i, n) {
  605. var a = this;
  606. view.DesktopMgr.Inst && view.DesktopMgr.Inst.active ? (this.load_over = !0, Laya.timer.once(500, this, function() {
  607. app.Log.log("重连信息1 round_id:" + view.DesktopMgr.Inst.round_id + " step:" + view.DesktopMgr.Inst.current_step), view.DesktopMgr.Inst.Reset(), view.DesktopMgr.Inst.duringReconnect = !0, uiscript.UI_Loading.Inst.setProgressVal(.2), app.NetAgent.sendReq2MJ("FastTest", "syncGame", {
  608. round_id: view.DesktopMgr.Inst.round_id,
  609. step: view.DesktopMgr.Inst.current_step
  610. }, function(e, i) {
  611. e || i.error ? (uiscript.UIMgr.Inst.showNetReqError("syncGame", e, i), t.Scene_MJ.Inst.ForceOut()) : (app.Log.log("[syncGame] " + JSON.stringify(i)), i.isEnd ? (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2011)), t.Scene_MJ.Inst.GameEnd()) : (uiscript.UI_Loading.Inst.setProgressVal(.3), view.DesktopMgr.Inst.fetchLinks(), view.DesktopMgr.Inst.Reset(), view.DesktopMgr.Inst.duringReconnect = !0, view.DesktopMgr.Inst.syncGameByStep(i.game_restore)))
  612. })
  613. })) : t.Scene_MJ.Inst.openMJRoom(e, Laya.Handler.create(this, function() {
  614. view.DesktopMgr.Inst.initRoom(JSON.parse(JSON.stringify(n)), e, GameMgr.Inst.account_id, view.EMJMode.play, Laya.Handler.create(a, function() {
  615. i ? Laya.timer.frameOnce(10, a, function() {
  616. app.Log.log("重连信息2 round_id:-1 step:" + 1e6), view.DesktopMgr.Inst.Reset(), view.DesktopMgr.Inst.duringReconnect = !0, app.NetAgent.sendReq2MJ("FastTest", "syncGame", {
  617. round_id: "-1",
  618. step: 1e6
  619. }, function(e, i) {
  620. app.Log.log("syncGame " + JSON.stringify(i)), e || i.error ? (uiscript.UIMgr.Inst.showNetReqError("syncGame", e, i), t.Scene_MJ.Inst.ForceOut()) : (uiscript.UI_Loading.Inst.setProgressVal(1), view.DesktopMgr.Inst.fetchLinks(), a._PlayerReconnectSuccess(i))
  621. })
  622. }) : Laya.timer.frameOnce(10, a, function() {
  623. app.Log.log("send enterGame"), view.DesktopMgr.Inst.Reset(), view.DesktopMgr.Inst.duringReconnect = !0, app.NetAgent.sendReq2MJ("FastTest", "enterGame", {}, function(e, i) {
  624. e || i.error ? (uiscript.UIMgr.Inst.showNetReqError("enterGame", e, i), t.Scene_MJ.Inst.ForceOut()) : (uiscript.UI_Loading.Inst.setProgressVal(1), app.Log.log("enterGame"), a._EnterGame(i), view.DesktopMgr.Inst.fetchLinks())
  625. })
  626. })
  627. }))
  628. }), Laya.Handler.create(this, function(t) {
  629. return uiscript.UI_Loading.Inst.setProgressVal(.1 + .8 * t)
  630. }, null, !1))
  631. }, e.prototype._EnterGame = function(e) {
  632. app.Log.log("正常进入游戏: " + JSON.stringify(e)), e.is_end ? (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2011)), t.Scene_MJ.Inst.GameEnd()) : e.game_restore ? view.DesktopMgr.Inst.syncGameByStep(e.game_restore) : (console.log("正常进入游戏:" + Laya.Stat.currentMemorySize / 1024 / 1024 + " MB"), this.load_over = !0, this.load_over && uiscript.UI_Loading.Inst.enable && uiscript.UI_Loading.Inst.showLoadCount(this.loaded_player_count, this.real_player_count), view.DesktopMgr.Inst.duringReconnect = !1, view.DesktopMgr.Inst.StartChainAction(0))
  633. }, e.prototype._PlayerReconnectSuccess = function(e) {
  634. app.Log.log("_PlayerReconnectSuccess data:" + JSON.stringify(e)), e.isEnd ? (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2011)), t.Scene_MJ.Inst.GameEnd()) : e.game_restore ? view.DesktopMgr.Inst.syncGameByStep(e.game_restore) : (uiscript.UIMgr.Inst.ShowErrorInfo(t.Tools.strOfLocalization(2012)), t.Scene_MJ.Inst.ForceOut())
  635. }, e.prototype._SendDebugInfo = function() {
  636. var t = {};
  637. t.type = "未连接了!!!!!!", t.logs = app.Log.getCacheLog(), GameMgr.Inst.postInfo2Server(t)
  638. }, e._Inst = null, e
  639. }();
  640. t.MJNetMgr = e
  641. }(game || (game = {}));
  642. //打完之后刷新用户数据,重新赋值为寮舍选择人物
  643. ! function(t) {
  644. var e = function() {
  645. function e(e) {
  646. var i = this;
  647. this.money = null, this.rank = null, this.small_rank = null, this.rank_show_type = 0, this.me = e;
  648. var n = e.getChildByName("container_name");
  649. this.label_name = n.getChildByName("label_name"), this.rank = new t.UI_Level(n.getChildByName("rank")), this.title = new t.UI_PlayerTitle(n.getChildByName("img_title")), this.small_rank = new t.UI_Level(n.getChildByName("btn_small_rank")), this.money = new t.UI_Money(e, Laya.Handler.create(h.Inst, h.Inst.Hide, null, !1), Laya.Handler.create(this, function() {
  650. return h.Inst.locking
  651. }, null, !1)), n.getChildByName("btn_info").clickHandler = Laya.Handler.create(this, function() {
  652. t.UI_PlayerInfo.Inst.show(), GameMgr.Inst.BehavioralStatistics(13)
  653. }, null, !1), e.getChildByName("btn_activity").clickHandler = Laya.Handler.create(this, function() {
  654. h.Inst.locking || (t.UI_Activity.Inst.show(), GameMgr.Inst.BehavioralStatistics(18))
  655. }, null, !1), e.getChildByName("btn_rank").clickHandler = Laya.Handler.create(this, function() {
  656. h.Inst.locking || (t.UI_Rank.Inst.show(), GameMgr.Inst.BehavioralStatistics(18))
  657. }, null, !1), e.getChildByName("btn_info").clickHandler = Laya.Handler.create(this, function() {
  658. h.Inst.locking || t.UI_Info.Inst.show()
  659. }, null, !1), e.getChildByName("btn_set").clickHandler = Laya.Handler.create(this, function() {
  660. h.Inst.locking || t.UI_Config.Inst.show()
  661. }, null, !1), e.getChildByName("btn_help").clickHandler = Laya.Handler.create(this, function() {
  662. h.Inst.locking || t.UI_Rules.Inst.show()
  663. }, null, !1), e.getChildByName("btn_xinshouyindao").clickHandler = Laya.Handler.create(this, function() {
  664. h.Inst.locking || (t.UI_PiPeiYuYue.Inst.enable ? t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null) : h.Inst.Hide(Laya.Handler.create(i, function() {
  665. t.UI_XinShouYinDao.Inst.show(0, Laya.Handler.create(i, function() {
  666. h.Inst.enable = !0
  667. }))
  668. })))
  669. }, null, !1), n.getChildByName("btn_small_rank").clickHandler = new Laya.Handler(this, function() {
  670. h.Inst.locking || (0 == i.rank_show_type ? i.rank_show_type = 1 : i.rank_show_type = 0, i.show_rank(), Laya.LocalStorage.setItem("rank_show_type", i.rank_show_type.toString()))
  671. });
  672. var a = Laya.LocalStorage.getItem("rank_show_type");
  673. this.rank_show_type = "1" == a ? 1 : 0
  674. }
  675. return e.prototype.refresh = function() {
  676. var t = GameMgr.Inst.account_data;
  677. this.label_name.text = t.nickname, this.title.id = t.title, this.show_rank(), this.money.onEnable(), this.refreshRedpoint()
  678. }, e.prototype.refreshRedpoint = function() {
  679. this.me.getChildByName("btn_activity").getChildByName("redpoint").visible = t.UI_Mail.haveRedPoint || t.UI_Activity.haveRedPoint, this.me.getChildByName("btn_info").getChildByName("redpoint").visible = t.UI_Info.haveRedPoint
  680. }, e.prototype.show_rank = function() {
  681. var t = "level",
  682. e = "level3";
  683. 1 == this.rank_show_type && (t = "level3", e = "level"), this.rank.id = GameMgr.Inst.account_data[t].id, this.small_rank.id = GameMgr.Inst.account_data[e].id
  684. }, e
  685. }(),
  686. i = function() {
  687. function e(e) {
  688. this.me = e, this.btn_dajiangsai = e.getChildByName("btn_dajiangsai"), this.btn_yibanchang = e.getChildByName("btn_yibanchang"), this.btn_yourenfang = e.getChildByName("btn_yourenfang"), this.btn_yibanchang.clickHandler = Laya.Handler.create(this, function() {
  689. h.Inst.setPage(1), GameMgr.Inst.BehavioralStatistics(1)
  690. }, null, !1), this.btn_yourenfang.clickHandler = Laya.Handler.create(this, function() {
  691. h.Inst.setPage(2), GameMgr.Inst.BehavioralStatistics(2)
  692. }, null, !1), this.btn_dajiangsai.clickHandler = Laya.Handler.create(this, function() {
  693. GameMgr.Inst.BehavioralStatistics(3), h.Inst.setPage(3), t.UI_Activity.activity_is_running(1011) && Laya.LocalStorage.setItem("art0_1011_" + GameMgr.Inst.account_id, Date.now().toString())
  694. }, null, !1)
  695. }
  696. return e.prototype.onEnable = function(e) {
  697. var i = this;
  698. this.btn_yibanchang.visible = !1, this.btn_dajiangsai.visible = !1, this.btn_yourenfang.visible = !1, this.btn_yibanchang.alpha = 1, this.btn_dajiangsai.alpha = 1, this.btn_yourenfang.alpha = 1, Laya.timer.once(e, this, function() {
  699. view.AudioMgr.PlayAudio(104), i.btn_yibanchang.x = 700, i.btn_yibanchang.y = 405, i.btn_yibanchang.scaleX = .2, i.btn_yibanchang.scaleY = .2, i.btn_yibanchang.visible = !0, i.btn_yibanchang.alpha = 0, Laya.Tween.to(i.btn_yibanchang, {
  700. x: 1183,
  701. y: 368,
  702. scaleX: 1.2,
  703. scaleY: 1.2,
  704. alpha: 1
  705. }, 233, function(t, e, i, n) {
  706. return Laya.Ease.backOut(t, e, i, n, 1)
  707. })
  708. }), Laya.timer.once(e + 100, this, function() {
  709. view.AudioMgr.PlayAudio(104), i.btn_dajiangsai.x = 700, i.btn_dajiangsai.y = 530, i.btn_dajiangsai.scaleX = .2, i.btn_dajiangsai.scaleY = .2, i.btn_dajiangsai.visible = !0, i.btn_dajiangsai.alpha = 0, Laya.Tween.to(i.btn_dajiangsai, {
  710. x: 1110,
  711. y: 547,
  712. scaleX: 1.2,
  713. scaleY: 1.2,
  714. alpha: 1
  715. }, 233, function(t, e, i, n) {
  716. return Laya.Ease.backOut(t, e, i, n, 1)
  717. })
  718. }), Laya.timer.once(e + 200, this, function() {
  719. view.AudioMgr.PlayAudio(104), i.btn_yourenfang.x = 700, i.btn_yourenfang.y = 634, i.btn_yourenfang.scaleX = .2, i.btn_yourenfang.scaleY = .2, i.btn_yourenfang.visible = !0, i.btn_yourenfang.alpha = 0, Laya.Tween.to(i.btn_yourenfang, {
  720. x: 1123,
  721. y: 736,
  722. scaleX: 1.2,
  723. scaleY: 1.2,
  724. alpha: 1
  725. }, 233, function(t, e, i, n) {
  726. return Laya.Ease.backOut(t, e, i, n, 1)
  727. })
  728. });
  729. var n = !1;
  730. if (t.UI_Activity.activity_is_running(1011)) {
  731. var a = Laya.LocalStorage.getItem("art0_1011_" + GameMgr.Inst.account_id),
  732. r = 0;
  733. a && "" != a && (r = parseInt(a)), n = Date.now() > r + 864e6
  734. }
  735. this.btn_dajiangsai.getChildByName("redpoint").visible = n, this.me.visible = !0
  736. }, e.prototype.onDisable = function(e) {
  737. var i = this;
  738. t.UIBase.anim_alpha_out(this.btn_yibanchang, {
  739. x: -500,
  740. y: 450,
  741. scaleX: -1,
  742. scaleY: -1
  743. }, 200, e, null, Laya.Ease.backIn), t.UIBase.anim_alpha_out(this.btn_dajiangsai, {
  744. x: -500,
  745. y: 150,
  746. scaleX: -1,
  747. scaleY: -1
  748. }, 200, e, null, Laya.Ease.backIn), t.UIBase.anim_alpha_out(this.btn_yourenfang, {
  749. x: -500,
  750. y: -150,
  751. scaleX: -1,
  752. scaleY: -1
  753. }, 200, e, null, Laya.Ease.backIn), Laya.timer.once(200 + e, this, function() {
  754. i.me.visible = !1
  755. })
  756. }, e
  757. }(),
  758. n = function() {
  759. function t(t) {
  760. var e = this;
  761. this.me = t, this.me.visible = !1, this.btn_back = t.getChildByName("btn_back"), this.btn_back.clickHandler = new Laya.Handler(this, function() {
  762. e.func_back && e.func_back.run()
  763. }), this.title = t.getChildByName("title")
  764. }
  765. return t.prototype.show = function(t, e) {
  766. this.title.text = t, game.Tools.labelLocalizationPosition(this.title, 345, this.title.width, !0), this.func_back = e, this.me.visible || (this.me.visible = !0, h.Inst.me.page_title_in.play(0, !1)), Laya.timer.clearAll(this)
  767. }, t.prototype.close = function() {
  768. var t = this;
  769. this.me.visible && (h.Inst.me.page_title_out.play(0, !1), Laya.timer.once(200, this, function() {
  770. t.me.visible = !1
  771. }))
  772. }, t
  773. }(),
  774. a = function() {
  775. function e(e) {
  776. var i = this;
  777. this.locking = !1, this.me = e, this.me.visible = !1, this.p0 = e.getChildByName("p0"), this.p0.getChildByName("content").vScrollBar.visible = !1, this.content0 = this.p0.getChildByName("content");
  778. for (var n = GameMgr.Inst.account_data, a = function(e) {
  779. var a = r.p0.getChildByName("content").getChildByName("btn" + e),
  780. s = a.getChildByName("container"),
  781. o = s.getChildByName("btn"),
  782. l = a.getChildByName("stop"),
  783. c = 0;
  784. c = e < 4 ? 1 + 3 * e : 15;
  785. var u = cfg.desktop.matchmode.find(c);
  786. u.is_open ? (o.mouseEnabled = !0, s.filters = [], l.visible = !1, o.clickHandler = Laya.Handler.create(r, function() {
  787. if (!i.locking) {
  788. var a = !0,
  789. r = "";
  790. a && !u.is_open && (a = !1, r = game.Tools.strOfLocalization(1306));
  791. var s = !0,
  792. o = !0,
  793. l = !0,
  794. c = !0,
  795. _ = !0,
  796. d = !0,
  797. f = n.level.id,
  798. p = n.level3.id,
  799. m = n.gold;
  800. cfg.desktop.matchmode.forEach(function(t) {
  801. var i = e + 1;
  802. 5 == i && (i = 6), t.room == i && ((!t.glimit_floor || m >= t.glimit_floor) && (_ = !1), (-1 == t.glimit_ceil || m <= t.glimit_ceil) && (d = !1), t.mode < 10 ? ((!t.level_limit || f >= t.level_limit) && (s = !1), (!t.level_limit_ceil || f <= t.level_limit_ceil) && (o = !1)) : ((!t.level_limit || p >= t.level_limit) && (l = !1), (!t.level_limit_ceil || p <= t.level_limit_ceil) && (c = !1)))
  803. }), (s || o) && (l || c) ? (a = !1, r = game.Tools.strOfLocalization(103)) : _ ? (a = !1, r = game.Tools.strOfLocalization(101)) : d && (a = !1, r = game.Tools.strOfLocalization(102)), a ? (i.close(), Laya.timer.once(100, i, function() {
  804. h.Inst.page_east_north.show(u.room)
  805. })) : t.UIMgr.Inst.ShowErrorInfo(r)
  806. }
  807. }, null, !1)) : (o.mouseEnabled = !1, s.filters = [new Laya.ColorFilter(t.GRAY_FILTER)], l.visible = !0), s.getChildByName("btn_tips").clickHandler = Laya.Handler.create(r, function() {
  808. i.locking || t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(e < 4 ? 4 + e : 64))
  809. }, null, !1)
  810. }, r = this, s = 0; s < 5; s++) a(s)
  811. }
  812. return e.prototype.show = function() {
  813. var t = this;
  814. this.content0.vScrollBar.value = 0, view.AudioMgr.PlayAudio(102), this.me.visible = !0, this.locking = !0, h.Inst.page_title.show(game.Tools.strOfLocalization(2079), Laya.Handler.create(this, function() {
  815. t.locking || h.Inst.setPage(0)
  816. }, null, !1)), this.p0.alpha = 1, this.p0.visible = !1;
  817. for (var e = 0; e < 5; e++) this.p0.getChildByName("content").getChildByName("btn" + e).alpha = 1;
  818. Laya.timer.once(100, this, function() {
  819. t.p0.visible = !0, h.Inst.me.rank_in.play(0, !1)
  820. }), Laya.timer.once(300, this, function() {
  821. t.locking = !1
  822. })
  823. }, e.prototype.close = function() {
  824. var t = this;
  825. this.me.visible && (this.locking = !0, h.Inst.me.rank_out.play(0, !1), Laya.timer.once(200, this, function() {
  826. t.me.visible = !1, t.locking = !1, Laya.timer.clearAll(t)
  827. }))
  828. }, e
  829. }(),
  830. r = function() {
  831. function e(e) {
  832. var i = this;
  833. this.locking = !1, this.me = e, this.me.visible = !1, this.btn_create_room = e.getChildByName("content").getChildByName("btn0").getChildByName("btn"), e.getChildByName("content").getChildByName("btn0").getChildByName("btn_tips").clickHandler = Laya.Handler.create(this, function() {
  834. t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(8)), GameMgr.Inst.BehavioralStatistics(10)
  835. }, null, !1), this.btn_add_room = e.getChildByName("content").getChildByName("btn1").getChildByName("btn"), e.getChildByName("content").getChildByName("btn1").getChildByName("btn_tips").clickHandler = Laya.Handler.create(this, function() {
  836. t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(9))
  837. }, null, !1), this.btn_create_room.clickHandler = Laya.Handler.create(this, function() {
  838. h.Inst.locking || (t.UI_PiPeiYuYue.Inst.enable ? t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null) : h.Inst.Hide(Laya.Handler.create(i, function() {
  839. t.UI_Create_Room.Show()
  840. })))
  841. }, null, !1), this.btn_add_room.clickHandler = Laya.Handler.create(this, function() {
  842. t.UI_PiPeiYuYue.Inst.enable ? t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null) : (t.UI_NumberInput.Inst.show(game.Tools.strOfLocalization(2080), Laya.Handler.create(i, function(e) {
  843. app.NetAgent.sendReq2Lobby("Lobby", "joinRoom", {
  844. room_id: e
  845. }, function(e, i) {
  846. e || i.error ? t.UIMgr.Inst.showNetReqError("joinRoom", e, i) : (h.Inst.enable = !1, t.UI_WaitingRoom.Inst.updateData(i.room), t.UIMgr.Inst.ShowWaitingRoom())
  847. })
  848. }), null), GameMgr.Inst.BehavioralStatistics(11))
  849. }, null, !1), "chs" != GameMgr.client_language && (e.getChildByName("content").getChildByName("btn0").getChildByName("del").visible = !1, e.getChildByName("content").getChildByName("btn1").getChildByName("del").visible = !1)
  850. }
  851. return e.prototype.show = function() {
  852. var t = this;
  853. h.Inst.page_title.show(game.Tools.strOfLocalization(2023), Laya.Handler.create(this, function() {
  854. t.locking || h.Inst.setPage(0)
  855. }, null, !1)), this.btn_add_room.alpha = 1, this.btn_create_room.alpha = 1, this.btn_create_room.visible = !0, this.btn_add_room.visible = !0, this.me.visible = !0, view.AudioMgr.PlayAudio(102), h.Inst.me.friend_in.play(0, !1), Laya.timer.once(150, this, function() {
  856. t.locking = !1
  857. })
  858. }, e.prototype.close = function() {
  859. var t = this;
  860. this.me.visible && (this.locking = !0, h.Inst.me.friend_out.play(0, !1), Laya.timer.once(200, this, function() {
  861. t.locking = !1, t.me.visible = !1
  862. }))
  863. }, e
  864. }(),
  865. s = function() {
  866. function e(e) {
  867. var i = this;
  868. this.btns = [], this.me = e, e.visible = !1, this.content = e.getChildByName("content");
  869. for (var n = function(e) {
  870. var n = a.content.getChildByName("btn" + e);
  871. a.btns.push(n), n.getChildByName("container").getChildByName("btn").clickHandler = Laya.Handler.create(a, function() {
  872. if (!h.Inst.locking && !i.locking)
  873. if (0 == e) {
  874. if (t.UI_PiPeiYuYue.Inst.enable) return void t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null);
  875. h.Inst.Hide(Laya.Handler.create(i, function() {
  876. t.UI_Match_Lobby.Inst.show()
  877. }))
  878. } else 1 == e && (i.close(), h.Inst.page_east_north.show(5), Laya.LocalStorage.setItem("art1_1011_" + GameMgr.Inst.account_id, Date.now().toString()))
  879. }, null, !1), n.getChildByName("container").getChildByName("btn_tips").clickHandler = Laya.Handler.create(a, function() {
  880. h.Inst.locking || i.locking || (0 == e ? t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(56)) : 1 == e && t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(2775)))
  881. }, null, !1)
  882. }, a = this, r = 0; r < 2; r++) n(r)
  883. }
  884. return e.prototype.show = function() {
  885. var e = this;
  886. h.Inst.page_title.show(game.Tools.strOfLocalization(2025), Laya.Handler.create(this, function() {
  887. e.locking || h.Inst.setPage(0)
  888. }, null, !1));
  889. for (var i = 0; i < this.btns.length; i++) this.btns[i].alpha = 1;
  890. var n = !1;
  891. if (t.UI_Activity.activity_is_running(1011)) {
  892. this.btns[1].visible = !0;
  893. var a = Laya.LocalStorage.getItem("art1_1011_" + GameMgr.Inst.account_id),
  894. r = 0;
  895. a && "" != a && (r = parseInt(a)), n = Date.now() > r + 864e6, this.btns[1].getChildByName("redpoint").visible = n
  896. } else this.btns[1].visible = !1;
  897. this.locking = !0, view.AudioMgr.PlayAudio(102), this.me.visible = !0, h.Inst.me.match_in.play(0, !1), Laya.timer.once(150, this, function() {
  898. e.locking = !1
  899. })
  900. }, e.prototype.close = function() {
  901. var t = this;
  902. this.me.visible && (h.Inst.me.match_out.play(0, !1), Laya.timer.once(200, this, function() {
  903. t.me.visible = !1
  904. }))
  905. }, e
  906. }(),
  907. o = function() {
  908. function e(e) {
  909. var i = this;
  910. this.locking = !1, this.room_type = -1, this.list_mode = [], this._last_fetch_time = 0, this._last_fetch_success = !1, this.me = e, this.me.visible = !1;
  911. GameMgr.Inst.account_data;
  912. this.p1 = e.getChildByName("p1"), this.p1.getChildByName("content").vScrollBar.visible = !1, this.content1 = this.p1.getChildByName("content");
  913. for (var n = function(e) {
  914. a.p1.getChildByName("content").getChildByName("btn" + e).getChildByName("btn").clickHandler = Laya.Handler.create(a, function() {
  915. if (!i.locking && i.list_mode[e].met) {
  916. var n = i.p1.getChildByName("content").getChildByName("btn" + e).getChildByName("flag_yuyue");
  917. t.UI_PiPeiYuYue.Inst.matchYuYued(i.list_mode[e].id) ? t.UI_PiPeiYuYue.Inst.cancelPiPei(i.list_mode[e].id) : (t.UI_PiPeiYuYue.Inst.addMatch(i.list_mode[e].id), n.visible = !0), GameMgr.Inst.BehavioralStatistics(8 + e)
  918. }
  919. }, null, !1), a.p1.getChildByName("content").getChildByName("btn" + e).getChildByName("btn_tips").clickHandler = Laya.Handler.create(a, function() {
  920. if (!i.locking) {
  921. var n = 0;
  922. switch (e) {
  923. case 0:
  924. n = 2;
  925. break;
  926. case 1:
  927. n = 3;
  928. break;
  929. case 2:
  930. n = 24;
  931. break;
  932. case 3:
  933. n = 25
  934. }
  935. t.UI_InfoLite.Inst.show(game.Tools.strOfLocalization(n))
  936. }
  937. }, null, !1)
  938. }, a = this, r = 0; r < 4; r++) n(r);
  939. t.UI_PiPeiYuYue.Inst.me.on("cancelPiPei", this, function(t) {
  940. for (var e = 0; e < 4; e++) i.list_mode[e].id == t && (i.p1.getChildByName("content").getChildByName("btn" + e).getChildByName("flag_yuyue").visible = !1)
  941. }), t.UI_PiPeiYuYue.Inst.me.on("pipeiover", this, function() {
  942. for (var t = 0; t < 4; t++) i.p1.getChildByName("content").getChildByName("btn" + t).getChildByName("flag_yuyue").visible = !1
  943. })
  944. }
  945. return e.prototype.show = function(e) {
  946. var i = this;
  947. Laya.timer.clearAll(this);
  948. var n = "";
  949. cfg.desktop.matchmode.forEach(function(t) {
  950. t.room == e && (n = t["room_name_" + GameMgr.client_language])
  951. }), h.Inst.page_title.show(n, Laya.Handler.create(this, function() {
  952. i.locking || (i.close(), 5 == e ? h.Inst.page_match.show() : h.Inst.page_rank.show())
  953. }, null, !1)), this.room_type = e, this.content1.vScrollBar.value = 0, view.AudioMgr.PlayAudio(102), this.me.visible = !0, this.locking = !0;
  954. for (a = 0; a < 4; a++) this.p1.getChildByName("content").getChildByName("btn" + a).getChildByName("count").text = "--", this.p1.getChildByName("content").getChildByName("btn" + a).alpha = 1;
  955. h.Inst.me.east_north_in.play(0, !1), Laya.timer.once(150, this, function() {
  956. i.locking = !1
  957. }), Laya.timer.loop(1e3, this, this._fetchPlayerCount), this.content1.vScrollBar.value = 0, this.list_mode = [], cfg.desktop.matchmode.forEach(function(t, e) {
  958. if (0 != t.mode && i.room_type == t.room) {
  959. var n = !0,
  960. a = GameMgr.Inst.account_data[t.mode < 10 ? "level" : "level3"].id;
  961. t.level_limit && a < t.level_limit && (n = !1), t.level_limit_ceil && a > t.level_limit_ceil && (n = !1), i.list_mode.push({
  962. mode: t.mode,
  963. id: t.id,
  964. met: n
  965. })
  966. }
  967. }), this._last_fetch_time = 0, this._last_fetch_success = !0, this._fetchPlayerCount();
  968. for (var a = 0; a < this.list_mode.length; a++) {
  969. var r = this.p1.getChildByName("content").getChildByName("btn" + a);
  970. r.getChildByName("flag_yuyue").visible = t.UI_PiPeiYuYue.Inst.matchYuYued(this.list_mode[a].id), r.getChildByName("unmet").visible = !this.list_mode[a].met, r.getChildByName("btn").mouseEnabled = this.list_mode[a].met
  971. }
  972. }, e.prototype.close = function() {
  973. var t = this;
  974. this.me.visible && (this.locking = !0, h.Inst.me.east_north_out.play(0, !1), Laya.timer.once(200, this, function() {
  975. t.me.visible = !1, t.locking = !1, Laya.timer.clearAll(t)
  976. }))
  977. }, e.prototype._fetchPlayerCount = function() {
  978. var e = this;
  979. if (game.LobbyNetMgr.Inst.isOK && this._last_fetch_success && !(Laya.timer.currTimer < this._last_fetch_time + 7e3)) {
  980. this._last_fetch_time = Laya.timer.currTimer;
  981. for (var i = [], n = 0; n < this.list_mode.length; n++) this.list_mode[n].met && i.push(this.list_mode[n].id);
  982. this._last_fetch_success = !1, app.NetAgent.sendReq2Lobby("Lobby", "fetchCurrentMatchInfo", {
  983. mode_list: i
  984. }, function(i, n) {
  985. if (i || n.error) {
  986. t.UIMgr.Inst.showNetReqError("fetchCurrentMatchInfo", i, n);
  987. for (a = 0; a < 4; a++) e.p1.getChildByName("content").getChildByName("btn" + a).getChildByName("count").text = "--";
  988. e._last_fetch_success = !1
  989. } else try {
  990. app.Log.log(JSON.stringify(n));
  991. for (var a = 0; a < n.matches.length; a++) {
  992. for (var r = n.matches[a].mode_id, s = n.matches[a].playing_count, o = -1, l = 0; l < e.list_mode.length; l++)
  993. if (e.list_mode[l].id == r) {
  994. o = l;
  995. break
  996. } - 1 != o && (e.p1.getChildByName("content").getChildByName("btn" + o).getChildByName("count").text = s.toString())
  997. }
  998. e._last_fetch_success = !0
  999. } catch (i) {}
  1000. })
  1001. }
  1002. }, e
  1003. }(),
  1004. l = function() {
  1005. function e(e) {
  1006. var i = this;
  1007. this.me = e;
  1008. for (var n = function(n) {
  1009. e.getChildAt(n).clickHandler = Laya.Handler.create(a, function() {
  1010. h.Inst.locking || (0 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1011. t.UI_Sushe.Inst.show()
  1012. })) : 5 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1013. t.UI_Shop.Inst.show()
  1014. })) : 3 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1015. t.UI_PaiPu.Inst.show()
  1016. })) : 1 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1017. t.UI_Friend.Inst.show()
  1018. })) : 2 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1019. t.UI_Ob.Inst.show()
  1020. })) : 4 == n ? h.Inst.Hide(Laya.Handler.create(i, function() {
  1021. t.UI_Bag.Inst.show()
  1022. })) : 6 == n && h.Inst.Hide(Laya.Handler.create(i, function() {
  1023. t.UI_Treasure.Inst.show()
  1024. })))
  1025. }, null, !1)
  1026. }, a = this, r = 0; r < 7; r++) n(r)
  1027. }
  1028. return e.prototype.onEnable = function() {
  1029. this.me.getChildAt(1).getChildByName("redpoint").visible = game.FriendMgr.friendapply_list && game.FriendMgr.friendapply_list.length > 0
  1030. }, e
  1031. }(),
  1032. h = function(h) {
  1033. function c() {
  1034. var t = h.call(this, new ui.lobby.lobbyUI) || this;
  1035. return t.top = null, t.page0 = null, t.page_rank = null, t.page_friend = null, t.page_match = null, t.page_east_north = null, t.btns = null, t.page_title = null, t.chat_id = 0, t.container_chat = null, t.chat_block = null, t.character_skin = null, t.nowpage = 0, t.locking = !1, t.sound_channel = null, t.firstIn = !0, c.Inst = t, t
  1036. }
  1037. return __extends(c, h), c.prototype.onCreate = function() {
  1038. var h = this;
  1039. this.top = new e(this.me.getChildByName("container_top")), this.page0 = new i(this.me.getChildByName("page0")), this.page_rank = new a(this.me.getChildByName("container_pages").getChildByName("page_rank")), this.page_friend = new r(this.me.getChildByName("container_pages").getChildByName("page_friend")), this.page_match = new s(this.me.getChildByName("container_pages").getChildByName("page_match")), this.page_east_north = new o(this.me.getChildByName("container_pages").getChildByName("page_east_north")), this.page_title = new n(this.me.getChildByName("container_pages").getChildByName("container_title")), this.btns = new l(this.me.getChildByName("container_btns")), this.character_skin = new t.UI_Character_Skin(this.me.getChildByName("illust").getChildByName("illust")), this.container_chat = this.me.getChildByName("illust").getChildByName("chat"), this.container_chat.visible = !1, this.chat_block = new t.UI_Character_Chat(this.container_chat), this.me.getChildByName("illust").getChildByName("btn").clickHandler = Laya.Handler.create(this, function() {
  1040. c.login_helloed && (h.sound_channel ? h.stopsay() : h.say("lobby_normal"))
  1041. }, null, !1)
  1042. }, c.prototype.onEnable = function() {
  1043. this.showEnter(), t.UI_TanfangRoot.Inst.beginload(), t.UI_Invite.Inst.enable = !0, 0 == app.PlayerBehaviorStatistic.get_val(app.EBehaviorType.XinShouYinDao) && (app.PlayerBehaviorStatistic.update_val(app.EBehaviorType.XinShouYinDao, 2), app.PlayerBehaviorStatistic.google_trace_pending(app.EBehaviorType.G_tutorial_jump, 1), app.PlayerBehaviorStatistic.tw_trace_pending(app.EBehaviorType.TW_Tutorial_Completed, 1)), app.PlayerBehaviorStatistic.fb_trace_pending(app.EBehaviorType.Purchase, app.PlayerBehaviorStatistic.recharged_count), app.PlayerBehaviorStatistic.google_trace_pending(app.EBehaviorType.G_tutorial_complete, 1), app.PlayerBehaviorStatistic.google_trace_pending(app.EBehaviorType.G_Purchase, app.PlayerBehaviorStatistic.recharged_count), app.PlayerBehaviorStatistic.recharged_count > 0 && app.PlayerBehaviorStatistic.google_trace_pending(app.EBehaviorType.G_Purchase_first, 1), app.PlayerBehaviorStatistic.tw_trace_pending(app.EBehaviorType.TW_Purchase, app.PlayerBehaviorStatistic.recharged_count), this.firstIn && (this.firstIn = !1, t.UI_PaiPu.init());
  1044. var e = 0;
  1045. switch (GameMgr.Inst.account_data.level.id) {
  1046. case 10101:
  1047. e = 1;
  1048. break;
  1049. case 10102:
  1050. e = 2;
  1051. break;
  1052. case 10103:
  1053. e = 3;
  1054. break;
  1055. case 10201:
  1056. e = 4;
  1057. break;
  1058. case 10202:
  1059. e = 5;
  1060. break;
  1061. case 10203:
  1062. e = 6;
  1063. break;
  1064. case 10301:
  1065. e = 7;
  1066. break;
  1067. case 10302:
  1068. e = 8;
  1069. break;
  1070. case 10303:
  1071. e = 9;
  1072. break;
  1073. case 10401:
  1074. e = 10;
  1075. break;
  1076. case 10402:
  1077. e = 11;
  1078. break;
  1079. case 10403:
  1080. e = 12;
  1081. break;
  1082. case 10501:
  1083. e = 13;
  1084. break;
  1085. case 10502:
  1086. e = 14;
  1087. break;
  1088. case 10503:
  1089. e = 15;
  1090. break;
  1091. case 10601:
  1092. e = 16
  1093. }
  1094. 10102 === GameMgr.Inst.account_data.level.id && app.PlayerBehaviorStatistic.fb_trace_pending(app.EBehaviorType.Level_2, 1), 10103 === GameMgr.Inst.account_data.level.id && app.PlayerBehaviorStatistic.fb_trace_pending(app.EBehaviorType.Level_3, 1);
  1095. for (var i = 0; i < e; i++) app.PlayerBehaviorStatistic.google_trace_pending(app.EBehaviorType.G_Role_level_1 + i, 1)
  1096. }, c.prototype.onDisable = function() {
  1097. this.page0.onDisable(0), this.page_rank.close(), this.page_friend.close(), this.page_match.close(), this.page_title.close(), this.page_east_north.close(), this.character_skin.clear(), this.stopsay()
  1098. }, c.prototype.showEnter = function() {
  1099. var t = this;
  1100. this.refreshInfo(), this.page0.me.visible = !0, this.page_rank.me.visible = !1, this.page_friend.me.visible = !1, this.page_match.me.visible = !1, this.page_title.me.visible = !1, this.page_east_north.me.visible = !1, this.nowpage = 0, this.locking = !0, this.me.in.play(0, !1), this.page0.onEnable(567), this.btns.onEnable(), Laya.timer.once(700, this, function() {
  1101. t.locking = !1
  1102. }), game.Scene_Lobby.Inst.change_bg("yard", !1), c.login_helloed || Laya.timer.once(500, this, function() {
  1103. c.login_helloed = !0, t.say("lobby_playerlogin")
  1104. })
  1105. }, c.prototype.refreshInfo = function() {
  1106. GameMgr.Inst.account_data;
  1107. this.top.refresh(),
  1108. //打完之后刷新用户数据,重新赋值为寮舍选择人物 -----fxxk
  1109. (GameMgr.Inst.account_data.avatar_id = GameMgr.Inst.account_data.my_character.skin),
  1110. //end
  1111. this.character_skin.setSkin(GameMgr.Inst.account_data.avatar_id, "full"), this.character_skin.me.visible = !0
  1112. }, c.prototype.Hide = function(t) {
  1113. var e = this;
  1114. switch (this.locking = !0, this.nowpage) {
  1115. case 0:
  1116. this.page0.onDisable(0);
  1117. break;
  1118. case 1:
  1119. this.page_rank.close();
  1120. break;
  1121. case 2:
  1122. this.page_friend.close();
  1123. break;
  1124. case 3:
  1125. this.page_match.close()
  1126. }
  1127. this.page_east_north.close(), this.page_title.close(), this.me.out.play(0, !1), Laya.timer.once(250, this, function() {
  1128. e.locking = !1, e.enable = !1, t && t.run()
  1129. })
  1130. }, c.prototype.setPage = function(t) {
  1131. var e = this;
  1132. if (!this.locking && this.nowpage != t) {
  1133. switch (this.locking = !0, this.nowpage) {
  1134. case 0:
  1135. this.page0.onDisable(0);
  1136. break;
  1137. case 1:
  1138. this.page_rank.close(), this.page_title.close();
  1139. break;
  1140. case 2:
  1141. this.page_friend.close(), this.page_title.close();
  1142. break;
  1143. case 3:
  1144. this.page_match.close(), this.page_title.close()
  1145. }
  1146. this.nowpage = t;
  1147. var i = 750;
  1148. Laya.timer.once(200, this, function() {
  1149. switch (e.nowpage) {
  1150. case 0:
  1151. e.page0.onEnable(0);
  1152. break;
  1153. case 1:
  1154. e.page_rank.show();
  1155. break;
  1156. case 2:
  1157. e.page_friend.show();
  1158. break;
  1159. case 3:
  1160. e.page_match.show(), i = 500
  1161. }
  1162. }), Laya.timer.once(i, this, function() {
  1163. e.locking = !1
  1164. })
  1165. }
  1166. }, c.prototype.say = function(e) {
  1167. var i = this,
  1168. n = t.UI_Sushe.main_chara_info;
  1169. this.chat_id++;
  1170. var a = this.chat_id,
  1171. r = view.AudioMgr.PlayCharactorSound(n, e, Laya.Handler.create(this, function() {
  1172. Laya.timer.once(1e3, i, function() {
  1173. i.chat_id == a && i.stopsay()
  1174. })
  1175. }));
  1176. r && (this.chat_block.show(r.words), this.sound_channel = r.sound)
  1177. }, c.prototype.stopsay = function() {
  1178. this.chat_block.close(!1), this.sound_channel && (this.sound_channel.stop(), Laya.SoundManager.removeChannel(this.sound_channel), this.sound_channel = null)
  1179. }, c.Inst = null, c.login_helloed = !1, c
  1180. }(t.UIBase);
  1181. t.UI_Lobby = h
  1182. }(uiscript || (uiscript = {}));
  1183. //屏蔽切换角色的网络请求
  1184. !(function(t) {
  1185. var e = (function(e) {
  1186. function i() {
  1187. var t = e.call(this, new ui.lobby.nicknameUI()) || this;
  1188. return (t.locking = !1), (t.btn_cd = 0), t;
  1189. }
  1190. return (__extends(i, e), (i.show = function() {
  1191. var e = new i();
  1192. t.UIMgr.Inst.AddLobbyUI(e),
  1193. Laya.timer.frameOnce(5, this, function() {
  1194. e.show();
  1195. });
  1196. }), (i.prototype.onCreate = function() {
  1197. var e = this;
  1198. (this.root = this.me.getChildByName("root")), (this.lb = this.root.getChildByName("lb")), (this.input = this.root.getChildByName("txtinput")), (this.yes = this.root.getChildByName("yes")), (this.no = this.root.getChildByName("no")), (this.btn_confirm = this.root.getChildByName("btn_confirm")), (this.btn_confirm.clickHandler = Laya.Handler.create(this, this.onBtnConfrim, null, !1)),
  1199. this.input.on("focus", this, function() {
  1200. (e.lb.visible = !1), (e.yes.visible = !1), (e.no.visible = !1);
  1201. }),
  1202. this.input.on("blur", this, function() {
  1203. e.lb.visible = !e.input.text || "" == e.input.text;
  1204. }),
  1205. this.input.on("input", this, function() {
  1206. e.input.text && e.input.text;
  1207. }), (this.root_xinshou = this.me.getChildByName("root_xinshou")), (this.root_xinshou.getChildByName("btn_no").clickHandler = Laya.Handler.create(this, function() {
  1208. e.locking || e.close_course();
  1209. }, null, !1)), (this.root_xinshou.getChildByName("btn_yes").clickHandler = Laya.Handler.create(this, function() {
  1210. e.locking || ((e.enable = !1), t.UI_Rules.Inst.show(1, Laya.Handler.create(e, function() {
  1211. e.destroy(),
  1212. game.Scene_Lobby.Inst.pending_enter_event();
  1213. })));
  1214. }, null, !1)), (this.root.getChildByName("en_no_space").visible = "en" == GameMgr.client_language);
  1215. }), (i.prototype.show = function() {
  1216. var e = this;
  1217. (this.enable = !0), (this.locking = !0), (this.yes.visible = !1), (this.no.visible = !1), (this.root_xinshou.visible = !1),
  1218. t.UIBase.anim_pop_out(this.root, Laya.Handler.create(this, function() {
  1219. e.locking = !1;
  1220. }));
  1221. }), (i.prototype.close_nickname = function() {
  1222. var e = this;
  1223. (this.locking = !0),
  1224. t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  1225. (e.locking = !1), (e.root.visible = !1), (e.enable = !1),
  1226. e.destroy(),
  1227. t.UI_XinShouYinDao.Inst.show(0, Laya.Handler.create(e, function() {
  1228. game.Scene_Lobby.Inst.pending_enter_event();
  1229. }));
  1230. }));
  1231. }), (i.prototype.show_course = function() {
  1232. var e = this;
  1233. (this.root_xinshou.visible = !0), (this.root_xinshou.getChildByName("name").text = this.input.text + " " + game.Tools.strOfLocalization(2150)), (this.locking = !0),
  1234. t.UIBase.anim_pop_out(this.root_xinshou, Laya.Handler.create(this, function() {
  1235. e.locking = !1;
  1236. }));
  1237. }), (i.prototype.close_course = function() {
  1238. var e = this;
  1239. (this.locking = !0),
  1240. t.UIBase.anim_pop_hide(this.root_xinshou, Laya.Handler.create(this, function() {
  1241. (e.locking = !1), (e.enable = !1),
  1242. e.destroy(),
  1243. game.Scene_Lobby.Inst.pending_enter_event();
  1244. }));
  1245. }), (i.prototype.have_invalid_char = function(t) {
  1246. for (var e = 0; e < t.length; e++) {
  1247. var i = t.charCodeAt(e);
  1248. if (!(i >= "0".charCodeAt(0) && i <= "9".charCodeAt(0)) && !(
  1249. (i >= "a".charCodeAt(0) && i <= "z".charCodeAt(0)) || (i >= "A".charCodeAt(0) && i <= "Z".charCodeAt(0)) || (i >= 11904 && i <= 40959))) {
  1250. for (var n = !1, a = 0; a < "~@!#%&()_+={}:;<>".length; a++)
  1251. if ("~@!#%&()_+={}:;<>" [a] == t[e]) {
  1252. n = !0;
  1253. break;
  1254. }
  1255. if (!n) return !0;
  1256. }
  1257. }
  1258. return !1;
  1259. }), (i.prototype.onBtnConfrim = function() {
  1260. var e = this;
  1261. if (!this.locking && "" != this.input.text) {
  1262. for (var i = this.input.text, n = 0, a = 0, r = 0; r < i.length; r++) {
  1263. if (i.charCodeAt(r) > 255) {
  1264. if (n + 2 > 14) break;
  1265. n += 2;
  1266. } else {
  1267. if (n + 1 > 14) break;
  1268. n += 1;
  1269. }
  1270. a++;
  1271. }
  1272. if (a == i.length) {
  1273. var s = this.input.text;
  1274. if (this.have_invalid_char(s) || t.UI_Entrance.Accountforbidden(s)) this.no.visible = !0;
  1275. else if (!(Laya.timer.currTimer < this.btn_cd)) {
  1276. this.btn_cd = Laya.timer.currTimer + 700;
  1277. var o = {};
  1278. (o.nickname = s),
  1279. GameMgr.Inst._ad_str && (o.advertise_str = GameMgr.Inst._ad_str),
  1280. app.NetAgent.sendReq2Lobby("Lobby", "createNickname", o, function(i, n) {
  1281. (e.btn_cd = 0),
  1282. i || n.error ? t.UIMgr.Inst.showNetReqError("createNickname", i, n) : (app.PlayerBehaviorStatistic.fb_trace_force(app.EBehaviorType.Level_1), (GameMgr.Inst.account_data.nickname = s), GameMgr.Inst.fetch_login_info(), (GameMgr.Inst.account_setting[game.EAccountSetKey.user_xieyi.toString()] = 1), e.close_nickname());
  1283. }),
  1284. app.NetAgent.sendReq2Lobby("Lobby", "updateAccountSettings", {
  1285. setting: {
  1286. key: game.EAccountSetKey.user_xieyi,
  1287. value: 1
  1288. }
  1289. }, function(t, e) {});
  1290. var l = t.UI_Sushe.characters,
  1291. h = Math.floor(Math.random() * l.length);
  1292. (t.UI_Sushe.main_character_id = t.UI_Sushe.characters[h].charid),
  1293. //屏蔽切换角色的网络请求(不知道这是怎么触发的,反正屏蔽就对了) ----fxxk
  1294. //app.NetAgent.sendReq2Lobby(
  1295. //"Lobby",
  1296. //"changeMainCharacter",
  1297. //{
  1298. // character_id: t.UI_Sushe.main_character_id
  1299. //},
  1300. // function(t, e) {}
  1301. //),
  1302. (GameMgr.Inst.account_data.my_charid = t.UI_Sushe.main_character_id), (GameMgr.Inst.account_data.avatar_id = t.UI_Sushe.characters[h])
  1303. }
  1304. } else t.UIMgr.Inst.ShowErrorInfo(game.Tools.strOfLocalization(2750));
  1305. }
  1306. }), i);
  1307. })(t.UIBase);
  1308. t.UI_Nickname = e;
  1309. })(uiscript || (uiscript = {}));
  1310. //读取战绩
  1311. ! function(t) {
  1312. var e = function(e) {
  1313. function i() {
  1314. var t = e.call(this, "chs" == GameMgr.client_language ? new ui.both_ui.otherplayerinfoUI : new ui.both_ui.otherplayerinfo_enUI) || this;
  1315. return t.account_id = 0, t.origin_x = 0, t.origin_y = 0, t.root = null, t.title = null, t.level = null, t.btn_addfriend = null, t.illust = null, t.label_name = null, t.detail_data = null, t.locking = !1, t.tab_info4 = null, t.tab_info3 = null, t.tab_note = null, t.tab_img_dark = "", t.tab_img_chosen = "", t.player_data = null, t.tab_index = 1, i.Inst = t, t
  1316. }
  1317. return __extends(i, e), i.prototype.onCreate = function() {
  1318. var e = this;
  1319. "chs" == GameMgr.client_language ? (this.tab_img_chosen = game.Tools.localUISrc("myres/bothui/info_tab_chosen.png"), this.tab_img_dark = game.Tools.localUISrc("myres/bothui/info_tab_dark.png")) : (this.tab_img_chosen = game.Tools.localUISrc("myres/bothui/info_tabheng_chosen.png"), this.tab_img_dark = game.Tools.localUISrc("myres/bothui/info_tabheng_dark.png")), this.root = this.me.getChildByName("root"), this.origin_x = this.root.x, this.origin_y = this.root.y, this.container_info = this.root.getChildByName("container_info"), this.title = new t.UI_PlayerTitle(this.container_info.getChildByName("title")), this.label_name = this.container_info.getChildByName("ID"), this.level = new t.UI_Level(this.container_info.getChildByName("rank")), this.detail_data = new t.UI_PlayerData(this.container_info.getChildByName("data")), this.illust = new t.UI_Character_Skin(this.root.getChildByName("illust").getChildByName("illust")), this.btn_addfriend = this.container_info.getChildByName("btn_add"), this.btn_addfriend.clickHandler = Laya.Handler.create(this, function() {
  1320. e.btn_addfriend.visible = !1, app.NetAgent.sendReq2Lobby("Lobby", "applyFriend", {
  1321. target_id: e.account_id
  1322. }, function(t, e) {})
  1323. }, null, !1), this.root.getChildByName("btn_close").clickHandler = Laya.Handler.create(this, function() {
  1324. e.close()
  1325. }, null, !1), this.note = new t.UI_PlayerNote(this.root.getChildByName("container_note"), null), this.tab_info4 = this.root.getChildByName("tab_info4"), this.tab_info4.clickHandler = Laya.Handler.create(this, function() {
  1326. e.locking || 1 != e.tab_index && e.changeMJCategory(1)
  1327. }, null, !1), this.tab_info3 = this.root.getChildByName("tab_info3"), this.tab_info3.clickHandler = Laya.Handler.create(this, function() {
  1328. e.locking || 2 != e.tab_index && e.changeMJCategory(2)
  1329. }, null, !1), this.tab_note = this.root.getChildByName("tab_note"), this.tab_note.clickHandler = Laya.Handler.create(this, function() {
  1330. if (!e.locking) {
  1331. var i = Date.now();
  1332. "chs" == GameMgr.client_language && i >= 15595776e5 && i <= 15601824e5 ? t.UIMgr.Inst.ShowErrorInfo("该功能正在维护") : e.container_info.visible && (e.container_info.visible = !1, e.tab_info4.skin = e.tab_img_dark, e.tab_info3.skin = e.tab_img_dark, e.tab_note.skin = e.tab_img_chosen, e.tab_index = 3, e.note.show())
  1333. }
  1334. }, null, !1), this.locking = !1
  1335. }, i.prototype.show = function(e, i) {
  1336. var n = this;
  1337. void 0 === i && (i = 1), GameMgr.Inst.BehavioralStatistics(14), this.account_id = e, this.enable = !0, this.locking = !0, this.root.y = 560, this.player_data = null, t.UIBase.anim_pop_out(this.root, Laya.Handler.create(this, function() {
  1338. n.locking = !1
  1339. })), this.detail_data.reset(), app.NetAgent.sendReq2Lobby("Lobby", "fetchAccountStatisticInfo", {
  1340. account_id: e
  1341. }, function(e, i) {
  1342. e || i.error ? t.UIMgr.Inst.showNetReqError("fetchAccountStatisticInfo", e, i) : (n.detail_data.setData(i), n.changeMJCategory(n.tab_index))
  1343. }), this.note.init_data(e), this.refreshBaseInfo(), this.tab_index = i, this.container_info.visible = !0, this.tab_info4.skin = 1 == this.tab_index ? this.tab_img_chosen : this.tab_img_dark, this.tab_info3.skin = 2 == this.tab_index ? this.tab_img_chosen : this.tab_img_dark, this.tab_note.skin = this.tab_img_dark, this.note.close(), this.player_data ? (this.level.id = this.player_data[1 == this.tab_index ? "level" : "level3"].id, this.level.exp = this.player_data[1 == this.tab_index ? "level" : "level3"].score) : (this.level.id = 1 == this.tab_index ? 10101 : 20101, this.level.exp = 0)
  1344. }, i.prototype.refreshBaseInfo = function() {
  1345. var e = this;
  1346. this.title.id = 0, this.illust.me.visible = !1, this.label_name.text = "", this.btn_addfriend.visible = !1, app.NetAgent.sendReq2Lobby("Lobby", "fetchAccountInfo", {
  1347. account_id: this.account_id
  1348. }, function(i, n) {
  1349. if (i || n.error) t.UIMgr.Inst.showNetReqError("fetchAccountInfo", i, n);
  1350. else {
  1351. var a = n.account;
  1352. //修复读取战绩信息时人物皮肤不一致问题 ----fxxk
  1353. if (a.account_id == GameMgr.Inst.account_id) {
  1354. a.avatar_id = GameMgr.Inst.account_data.my_character.skin;
  1355. }
  1356. //end
  1357. e.player_data = a, e.label_name.text = a.nickname, e.title.id = game.Tools.titleLocalization(a.account_id, a.title), e.level.id = a.level.id, e.level.id = e.player_data[1 == e.tab_index ? "level" : "level3"].id, e.level.exp = e.player_data[1 == e.tab_index ? "level" : "level3"].score, e.illust.me.visible = !0, e.illust.setSkin(a.avatar_id, "waitingroom"), game.Tools.is_same_zone(GameMgr.Inst.account_id, e.account_id) && e.account_id != GameMgr.Inst.account_id && null == game.FriendMgr.find(e.account_id) ? e.btn_addfriend.visible = !0 : e.btn_addfriend.visible = !1, e.note.sign.setSign(a.signature)
  1358. }
  1359. })
  1360. }, i.prototype.changeMJCategory = function(t) {
  1361. this.tab_index = t, this.container_info.visible = !0, this.detail_data.changeMJCategory(t), this.tab_info4.skin = 1 == this.tab_index ? this.tab_img_chosen : this.tab_img_dark, this.tab_info3.skin = 2 == this.tab_index ? this.tab_img_chosen : this.tab_img_dark, this.tab_note.skin = this.tab_img_dark, this.note.close(), this.player_data ? (this.level.id = this.player_data[1 == this.tab_index ? "level" : "level3"].id, this.level.exp = this.player_data[1 == this.tab_index ? "level" : "level3"].score) : (this.level.id = 1 == this.tab_index ? 10101 : 20101, this.level.exp = 0)
  1362. }, i.prototype.close = function() {
  1363. var e = this;
  1364. this.enable && (this.locking || (this.locking = !0, this.detail_data.close(), t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  1365. e.locking = !1, e.enable = !1
  1366. }))))
  1367. }, i.prototype.onDisable = function() {
  1368. this.detail_data.close(), this.illust.clear(), Laya.loader.clearTextureRes(this.level.icon.skin)
  1369. }, i.Inst = null, i
  1370. }(t.UIBase);
  1371. t.UI_OtherPlayerInfo = e
  1372. }(uiscript || (uiscript = {}));
  1373. //宿舍相关
  1374. ! function(t) {
  1375. var e = function() {
  1376. function e(t, e) {
  1377. var i = this;
  1378. this.scale = 1, this.during_move = !1, this.mouse_start_x = 0, this.mouse_start_y = 0, this.me = t, this.container_illust = e, this.illust = this.container_illust.getChildByName("illust"), this.container_move = t.getChildByName("move"), this.container_move.on("mousedown", this, function() {
  1379. i.during_move = !0, i.mouse_start_x = i.container_move.mouseX, i.mouse_start_y = i.container_move.mouseY
  1380. }), this.container_move.on("mousemove", this, function() {
  1381. i.during_move && (i.move(i.container_move.mouseX - i.mouse_start_x, i.container_move.mouseY - i.mouse_start_y), i.mouse_start_x = i.container_move.mouseX, i.mouse_start_y = i.container_move.mouseY)
  1382. }), this.container_move.on("mouseup", this, function() {
  1383. i.during_move = !1
  1384. }), this.container_move.on("mouseout", this, function() {
  1385. i.during_move = !1
  1386. }), this.btn_big = t.getChildByName("btn_big"), this.btn_big.clickHandler = Laya.Handler.create(this, function() {
  1387. i.locking || i.bigger()
  1388. }, null, !1), this.btn_small = t.getChildByName("btn_small"), this.btn_small.clickHandler = Laya.Handler.create(this, function() {
  1389. i.locking || i.smaller()
  1390. }, null, !1), this.btn_close = t.getChildByName("btn_close"), this.btn_close.clickHandler = Laya.Handler.create(this, function() {
  1391. i.locking || i.close()
  1392. }, null, !1)
  1393. }
  1394. return e.prototype.show = function(e) {
  1395. var n = this;
  1396. this.locking = !0, this.when_close = e, this.illust_start_x = this.illust.x, this.illust_start_y = this.illust.y, this.illust_center_x = this.illust.x + 984 - 446, this.illust_center_y = this.illust.y + 11 - 84, this.container_illust.getChildByName("container_name").visible = !1, this.container_illust.getChildByName("container_name_en").visible = !1, this.container_illust.getChildByName("btn").visible = !1, i.Inst.stopsay(), this.scale = 1, Laya.Tween.to(this.illust, {
  1397. x: this.illust_center_x,
  1398. y: this.illust_center_y
  1399. }, 200), t.UIBase.anim_pop_out(this.btn_big, null), t.UIBase.anim_pop_out(this.btn_small, null), t.UIBase.anim_pop_out(this.btn_close, null), this.during_move = !1, Laya.timer.once(250, this, function() {
  1400. n.locking = !1
  1401. }), this.me.visible = !0
  1402. }, e.prototype.close = function() {
  1403. var e = this;
  1404. this.locking = !0, "chs" == GameMgr.client_language ? this.container_illust.getChildByName("container_name").visible = !0 : this.container_illust.getChildByName("container_name_en").visible = !0, this.container_illust.getChildByName("btn").visible = !0, Laya.Tween.to(this.illust, {
  1405. x: this.illust_start_x,
  1406. y: this.illust_start_y,
  1407. scaleX: 1,
  1408. scaleY: 1
  1409. }, 200), t.UIBase.anim_pop_hide(this.btn_big, null), t.UIBase.anim_pop_hide(this.btn_small, null), t.UIBase.anim_pop_hide(this.btn_close, null), Laya.timer.once(250, this, function() {
  1410. e.locking = !1, e.me.visible = !1, e.when_close.run()
  1411. })
  1412. }, e.prototype.bigger = function() {
  1413. 1.1 * this.scale > 1.5 || (this.scale *= 1.1, Laya.Tween.to(this.illust, {
  1414. scaleX: this.scale,
  1415. scaleY: this.scale
  1416. }, 100, null, null, 0, !0, !0))
  1417. }, e.prototype.smaller = function() {
  1418. this.scale / 1.1 < .5 || (this.scale /= 1.1, Laya.Tween.to(this.illust, {
  1419. scaleX: this.scale,
  1420. scaleY: this.scale
  1421. }, 100, null, null, 0, !0, !0))
  1422. }, e.prototype.move = function(t, e) {
  1423. var i = this.illust.x + t,
  1424. n = this.illust.y + e;
  1425. i < this.illust_center_x - 600 ? i = this.illust_center_x - 600 : i > this.illust_center_x + 600 && (i = this.illust_center_x + 600), n < this.illust_center_y - 1200 ? n = this.illust_center_y - 1200 : n > this.illust_center_y + 800 && (n = this.illust_center_y + 800), this.illust.x = i, this.illust.y = n
  1426. }, e
  1427. }(),
  1428. i = function(i) {
  1429. function n() {
  1430. var t = i.call(this, new ui.lobby.susheUI) || this;
  1431. return t.contianer_illust = null, t.illust = null, t.container_name = null, t.label_name = null, t.label_cv = null, t.container_page = null, t.container_look_illust = null, t.page_select_character = null, t.page_visit_character = null, t.origin_illust_x = 0, t.chat_id = 0, t.select_index = 0, t.container_chat = null, t.sound_channel = null, t.chat_block = null, n.Inst = t, t
  1432. }
  1433. return __extends(n, i), n.init = function(e) {
  1434. var i = this;
  1435. app.NetAgent.sendReq2Lobby("Lobby", "fetchCharacterInfo", {}, function(n, a) {
  1436. if (n || a.error) t.UIMgr.Inst.showNetReqError("fetchCharacterInfo", n, a);
  1437. else {
  1438. if (app.Log.log("fetchCharacterInfo: " + JSON.stringify(a)), (a = JSON.parse(JSON.stringify(a))).main_character_id && a.characters) {
  1439. console.log(a.characters);
  1440. // if (i.characters = [], a.characters)
  1441. // for (r = 0; r < a.characters.length; r++) i.characters.push(a.characters[r]);
  1442. // if (i.skin_map = {}, a.skins)
  1443. // for (var r = 0; r < a.skins.length; r++) i.skin_map[a.skins[r]] = 1;
  1444. // i.main_character_id = a.main_character_id
  1445. //人物初始化修改寮舍人物(皮肤好感额外表情)----fxxk
  1446. i.characters = [];
  1447. for (var j = 1; j <= 17; j++) {
  1448. var id = 200000 + j;
  1449. var skin = 400002 + j * 100;
  1450. if(j==1||j==5||j==6||j==8){
  1451. skin++
  1452. i.skin_map[400003 + j * 100] = 1;
  1453. }
  1454. //只有占卜师不能结婚
  1455. if (j == 10) skin--;
  1456. i.characters.push({
  1457. charid: id,
  1458. level: 5,
  1459. exp: 0,
  1460. views: [{
  1461. slot: 1,
  1462. item_id: setitemlizhibang
  1463. }, {
  1464. slot: 2,
  1465. item_id: setitemhupai
  1466. }, {
  1467. slot: 3,
  1468. item_id: setlizhi
  1469. }, {
  1470. slot: 4,
  1471. item_id: setshou
  1472. }, {
  1473. slot: 5,
  1474. item_id: setmusic
  1475. }],
  1476. skin: skin,
  1477. is_upgraded: 1,
  1478. extra_emoji: ["10", "11", "12"]
  1479. });
  1480. i.skin_map[400001 + j * 100] = 1;
  1481. i.skin_map[400002 + j * 100] = 1;
  1482. }
  1483. // console.log(i.skin_map)
  1484.  
  1485. (i.main_character_id = 200000 + setcharacter), (GameMgr.Inst.account_data.my_charid = 200000 + setcharacter), (GameMgr.Inst.account_data.my_character = i.characters[setcharacter - 1]);
  1486. if (setskin) {
  1487. (GameMgr.Inst.account_data.my_character.skin = setskin);
  1488. }
  1489. //end
  1490. } else i.characters = [], i.characters.push({
  1491. charid: 200001,
  1492. level: 0,
  1493. exp: 0,
  1494. views: [],
  1495. skin: 400101,
  1496. is_upgraded: !1,
  1497. extra_emoji: []
  1498. }), i.characters.push({
  1499. charid: 200002,
  1500. level: 0,
  1501. exp: 0,
  1502. views: [],
  1503. skin: 400201,
  1504. is_upgraded: !1,
  1505. extra_emoji: []
  1506. }), i.skin_map[400101] = 1, i.skin_map[400201] = 1, i.main_character_id = 200001;
  1507. i.send_gift_count = 0, i.send_gift_limit = 0, a.send_gift_count && (i.send_gift_count = a.send_gift_count), a.send_gift_limit && (i.send_gift_limit = a.send_gift_limit), e.run()
  1508. }
  1509. })
  1510. }, n.on_data_updata = function(e) {
  1511. if (e.character) {
  1512. var i = JSON.parse(JSON.stringify(e.character));
  1513. if (i.characters)
  1514. for (var n = i.characters, a = 0; a < n.length; a++) {
  1515. for (var r = !1, s = 0; s < this.characters.length; s++)
  1516. if (this.characters[s].charid == n[a].charid) {
  1517. this.characters[s] = n[a], t.UI_Sushe_Visit.Inst && t.UI_Sushe_Visit.Inst.chara_info && t.UI_Sushe_Visit.Inst.chara_info.charid == this.characters[s].charid && (t.UI_Sushe_Visit.Inst.chara_info = this.characters[s]), r = !0;
  1518. break
  1519. }
  1520. r || this.characters.push(n[a])
  1521. }
  1522. if (i.skins) {
  1523. for (var o = i.skins, a = 0; a < o.length; a++) this.skin_map[o[a]] = 1;
  1524. t.UI_Bag.Inst.on_skin_change()
  1525. }
  1526. }
  1527. }, n.chara_owned = function(t) {
  1528. for (var e = 0; e < this.characters.length; e++)
  1529. if (this.characters[e].charid == t) return !0;
  1530. return !1
  1531. }, n.skin_owned = function(t) {
  1532. return this.skin_map.hasOwnProperty(t.toString())
  1533. }, n.add_skin = function(t) {
  1534. this.skin_map[t] = 1
  1535. }, Object.defineProperty(n, "main_chara_info", {
  1536. get: function() {
  1537. for (var t = 0; t < this.characters.length; t++)
  1538. if (this.characters[t].charid == this.main_character_id) return this.characters[t];
  1539. return null
  1540. },
  1541. enumerable: !0,
  1542. configurable: !0
  1543. }), n.prototype.onCreate = function() {
  1544. var i = this;
  1545. this.contianer_illust = this.me.getChildByName("illust"), this.illust = new t.UI_Character_Skin(this.contianer_illust.getChildByName("illust").getChildByName("illust")), this.container_chat = this.contianer_illust.getChildByName("chat"), this.chat_block = new t.UI_Character_Chat(this.container_chat), this.contianer_illust.getChildByName("btn").clickHandler = Laya.Handler.create(this, function() {
  1546. i.page_visit_character.me.visible && i.page_visit_character.cannot_click_say || (i.sound_channel ? i.stopsay() : i.say("lobby_normal"))
  1547. }, null, !1), this.container_name = null, "chs" == GameMgr.client_language ? (this.container_name = this.contianer_illust.getChildByName("container_name"), this.contianer_illust.getChildByName("container_name_en").visible = !1) : (this.container_name = this.contianer_illust.getChildByName("container_name_en"), this.contianer_illust.getChildByName("container_name").visible = !1), this.label_name = this.container_name.getChildByName("label_name"), this.label_cv = this.container_name.getChildByName("label_CV"), this.origin_illust_x = this.contianer_illust.x, this.container_page = this.me.getChildByName("container_page"), this.page_select_character = new t.UI_Sushe_Select, this.container_page.addChild(this.page_select_character.me), this.page_visit_character = new t.UI_Sushe_Visit, this.container_page.addChild(this.page_visit_character.me), this.container_look_illust = new e(this.me.getChildByName("look_illust"), this.contianer_illust)
  1548. }, n.prototype.show = function() {
  1549. GameMgr.Inst.BehavioralStatistics(15), game.Scene_Lobby.Inst.change_bg("indoor", !1), this.enable = !0, this.page_visit_character.me.visible = !1;
  1550. for (var t = 0, e = 0; e < n.characters.length; e++)
  1551. if (n.characters[e].charid == n.main_character_id) {
  1552. t = e;
  1553. break
  1554. }
  1555. this.change_select(t), this.show_page_select(), this.container_look_illust.me.visible = !1
  1556. }, n.prototype.starup_back = function() {
  1557. this.enable = !0, this.change_select(this.select_index), this.show_page_visit(!0)
  1558. }, n.prototype.go2Lobby = function() {
  1559. this.close(Laya.Handler.create(this, function() {
  1560. t.UIMgr.Inst.showLobby()
  1561. }))
  1562. }, n.prototype.close = function(e) {
  1563. var i = this;
  1564. t.UIBase.anim_alpha_out(this.contianer_illust, {
  1565. x: -30
  1566. }, 150, 0), Laya.timer.once(150, this, function() {
  1567. i.enable = !1, e.run()
  1568. })
  1569. }, n.prototype.onDisable = function() {
  1570. this.illust.clear(), this.stopsay(), this.container_look_illust.me.visible && this.container_look_illust.close()
  1571. }, n.prototype.show_page_select = function() {
  1572. this.page_select_character.show(this.select_index)
  1573. }, n.prototype.show_page_visit = function(t) {
  1574. this.page_visit_character.show(n.characters[this.select_index], t)
  1575. }, n.prototype.change_select = function(e) {
  1576. //把chartid和skin写入cookie
  1577. var d = new Date();
  1578. d.setTime(d.getTime() + (360 * 24 * 60 * 60 * 1000));
  1579. var expires = "expires=" + d.toGMTString();
  1580. document.cookie = "charid" + "=" + n.characters[e].charid + "; " + expires;
  1581. document.cookie = "skin" + "=" + n.characters[e].skin + "; " + expires;
  1582. console.log("cookie:" + document.cookie);
  1583. //
  1584. this.select_index = e, this.illust.clear();
  1585. var i = n.characters[e];
  1586. console.log(n.characters[e]);
  1587. this.label_name.text = cfg.item_definition.character.get(i.charid)["name_" + GameMgr.client_language], "chs" == GameMgr.client_language ? this.label_cv.text = "CV" + cfg.item_definition.character.get(i.charid)["desc_cv_" + GameMgr.client_language] : this.label_cv.text = "CV:" + cfg.item_definition.character.get(i.charid)["desc_cv_" + GameMgr.client_language], this.illust.setSkin(i.skin, "full"), Laya.Tween.clearAll(this.contianer_illust), this.contianer_illust.x = this.origin_illust_x, this.contianer_illust.alpha = 1, t.UIBase.anim_alpha_in(this.contianer_illust, {
  1588. x: -30
  1589. }, 230), this.stopsay()
  1590. }, n.prototype.onChangeSkin = function(t) {
  1591. n.characters[this.select_index].skin = t, this.change_select(this.select_index), n.characters[this.select_index].charid == n.main_character_id && (GameMgr.Inst.account_data.avatar_id = t), app.NetAgent.sendReq2Lobby("Lobby", "changeCharacterSkin", {
  1592. character_id: n.characters[this.select_index].charid,
  1593. skin: t
  1594. }, function(t, e) {})
  1595. }, n.prototype.say = function(t) {
  1596. var e = this,
  1597. i = n.characters[this.select_index];
  1598. this.chat_id++;
  1599. var a = this.chat_id,
  1600. r = view.AudioMgr.PlayCharactorSound(i, t, Laya.Handler.create(this, function() {
  1601. Laya.timer.once(1e3, e, function() {
  1602. a == e.chat_id && e.stopsay()
  1603. })
  1604. }));
  1605. r && (this.chat_block.show(r.words), this.sound_channel = r.sound)
  1606. }, n.prototype.stopsay = function() {
  1607. this.chat_block.close(!1), this.sound_channel && (this.sound_channel.stop(), Laya.SoundManager.removeChannel(this.sound_channel), this.sound_channel = null)
  1608. }, n.prototype.to_look_illust = function() {
  1609. var t = this;
  1610. this.container_look_illust.show(Laya.Handler.create(this, function() {
  1611. t.page_select_character.show(t.select_index)
  1612. }))
  1613. }, n.characters = [], n.skin_map = {}, n.main_character_id = 0, n.send_gift_count = 0, n.send_gift_limit = 0, n.Inst = null, n
  1614. }(t.UIBase);
  1615. t.UI_Sushe = i
  1616. }(uiscript || (uiscript = {}));
  1617. //屏蔽改变宿舍角色的网络请求
  1618. !(function(t) {
  1619. var e = (function(e) {
  1620. function i() {
  1621. var t = e.call(this, "chs" == GameMgr.client_language ? new ui.lobby.sushe_selectUI() : new ui.lobby.sushe_select_enUI()) || this;
  1622. return (
  1623. (t.container_top = null), (t.container_heads = null), (t.scrollview = null), (t.btn_visit = null), (t.btn_look = null), (t.select_index = 0), (t.locking = !1), t);
  1624. }
  1625. return (__extends(i, e), (i.prototype.onCreate = function() {
  1626. var e = this;
  1627. (this.container_top = this.me.getChildByName("top")), (this.container_heads = this.me.getChildByName("heads")), (this.scrollview = this.container_heads.scriptMap["capsui.CScrollView"]),
  1628. this.scrollview.init_scrollview(new Laya.Handler(this, this.render_character_cell), -1, 3), (this.btn_visit = this.me.getChildByName("heads").getChildByName("btn_visit")), (this.btn_visit.clickHandler = Laya.Handler.create(this, function() {
  1629. e.locking || (e.close(), Laya.timer.once(150, e, function() {
  1630. t.UI_Sushe.Inst.show_page_visit(!1);
  1631. }));
  1632. }, null, !1)), (this.btn_look = this.me.getChildByName("btn_look")), (this.btn_look.clickHandler = Laya.Handler.create(this, function() {
  1633. e.locking || (e.close(), Laya.timer.once(150, e, function() {
  1634. t.UI_Sushe.Inst.to_look_illust();
  1635. }));
  1636. }, null, !1)), (this.container_top.getChildByName("btn_back").clickHandler = Laya.Handler.create(this, function() {
  1637. e.locking || (e.close(), t.UI_Sushe.Inst.go2Lobby());
  1638. }, null, !1));
  1639. }), (i.prototype.show = function(e) {
  1640. var i = this;
  1641. (this.enable = !0), (this.locking = !0),
  1642. t.UIBase.anim_alpha_in(this.container_top, {
  1643. y: -30
  1644. }, 200),
  1645. t.UIBase.anim_alpha_in(this.container_heads, {
  1646. x: 30
  1647. }, 200),
  1648. t.UIBase.anim_alpha_in(this.btn_look, {
  1649. x: 30
  1650. }, 200),
  1651. Laya.timer.once(200, this, function() {
  1652. i.locking = !1;
  1653. }), (this.select_index = e),
  1654. this.scrollview.reset(),
  1655. this.scrollview.addItem(t.UI_Sushe.characters.length);
  1656. }), (i.prototype.close = function() {
  1657. var e = this;
  1658. (this.locking = !0),
  1659. t.UIBase.anim_alpha_out(this.container_top, {
  1660. y: -30
  1661. }, 150),
  1662. t.UIBase.anim_alpha_out(this.container_heads, {
  1663. x: 30
  1664. }, 150, 0),
  1665. t.UIBase.anim_alpha_out(this.btn_look, {
  1666. x: 30
  1667. }, 150),
  1668. Laya.timer.once(150, this, function() {
  1669. (e.locking = !1), (e.enable = !1);
  1670. });
  1671. }), (i.prototype.onDisable = function() {
  1672. for (var e = 0; e < t.UI_Sushe.characters.length; e++) Laya.loader.clearTextureRes(cfg.item_definition.skin.get(t.UI_Sushe.characters[e].skin) + "/bighead.png");
  1673. }), (i.prototype.render_character_cell = function(e) {
  1674. var i = this,
  1675. n = e.index,
  1676. a = e.container,
  1677. r = e.cache_data;
  1678. (r.index = n),
  1679. r.inited || ((r.inited = !0), (a.getChildByName("btn").clickHandler = new Laya.Handler(this, function() {
  1680. i.onClickAtHead(r.index);
  1681. })), (r.skin = new t.UI_Character_Skin(a.getChildByName("btn").getChildByName("head"))));
  1682. var s = a.getChildByName("btn");
  1683. (s.getChildByName("choose").visible = n == this.select_index),
  1684. r.skin.setSkin(t.UI_Sushe.characters[n].skin, "bighead"), (s.getChildByName("using").visible = t.UI_Sushe.characters[n].charid == t.UI_Sushe.main_character_id), (s.getChildByName("label_name").text = cfg.item_definition.character.find(t.UI_Sushe.characters[n].charid)["name_" + GameMgr.client_language]);
  1685. }), (i.prototype.onClickAtHead = function(e) {
  1686. if (this.select_index == e) {
  1687. if (t.UI_Sushe.characters[e].charid != t.UI_Sushe.main_character_id) {
  1688. var i = t.UI_Sushe.main_character_id;
  1689. (t.UI_Sushe.main_character_id = t.UI_Sushe.characters[e].charid),
  1690. // app.NetAgent.sendReq2Lobby(
  1691. // "Lobby",
  1692. // "changeMainCharacter",
  1693. // {
  1694. // character_id: t.UI_Sushe.main_character_id
  1695. // },
  1696. // function(t, e) {}
  1697. // ),
  1698. console.log(t.UI_Sushe.characters[e].skin), (GameMgr.Inst.account_data.my_charid = t.UI_Sushe.main_character_id), (GameMgr.Inst.account_data.my_character = t.UI_Sushe.characters[e])
  1699. for (var n = 0; n < t.UI_Sushe.characters.length; n++) {
  1700. if (t.UI_Sushe.characters[n].charid == i) {
  1701. this.scrollview.wantToRefreshItem(n);
  1702. } else {
  1703. this.scrollview.wantToRefreshItem(n);
  1704. }
  1705. }
  1706. this.scrollview.wantToRefreshItem(e);
  1707. }
  1708. } else {
  1709. var a = this.select_index;
  1710. (this.select_index = e),
  1711. this.scrollview.wantToRefreshItem(a),
  1712. this.scrollview.wantToRefreshItem(e),
  1713. t.UI_Sushe.Inst.change_select(e);
  1714. }
  1715. }), i);
  1716. })(t.UIBase);
  1717. t.UI_Sushe_Select = e;
  1718. })(uiscript || (uiscript = {}));
  1719. //屏蔽立直道具变更的网络请求,还有皮肤相关
  1720. ! function(t) {
  1721. var e = function() {
  1722. function t(t) {
  1723. var e = this;
  1724. this.speed = .001, this.hearts = [], this.heart_masks = [], this.exp_limits = [], this.preframe_time = 0, this.heart_count = 5, this.during_change = !1, this.btn_heart = null, this.label_val = null, this.is_upgraded = !1, this.val_show_starttime = -1, this.me = t, this.container_hearts = this.me.getChildByName("hearts");
  1725. for (n = 0; n < 5; n++) {
  1726. var i = this.container_hearts.getChildByName("h" + n);
  1727. this.hearts.push(i), this.heart_masks.push(i.getChildByName("v").mask)
  1728. }
  1729. this.bg_hearts = this.me.getChildByName("bg_hearts"), this.exp_limits = [];
  1730. for (var n = 0; n < 5; n++) this.exp_limits.push(cfg.level_definition.character.find(n + 1).exp);
  1731. this.btn_heart = this.me.getChildByName("btn_heart"), this.label_val = this.container_hearts.getChildByName("heartval"), this.btn_heart.clickHandler = Laya.Handler.create(this, function() {
  1732. e.is_upgraded || (e.label_val.visible ? e.label_val.visible = !1 : (e.label_val.visible = !0, e.val_show_starttime = Laya.timer.currTimer))
  1733. }, null, !1)
  1734. }
  1735. return t.prototype.show = function(t) {
  1736. Laya.timer.clearAll(this), t.is_upgraded ? this.bg_hearts.skin = game.Tools.localUISrc("myres/sushe/heart_full.png") : this.bg_hearts.skin = game.Tools.localUISrc("myres/sushe/heart_normal.png"), this.current_level = t.level, this.current_exp_rate = t.exp / this.exp_limits[this.current_level], this.isupgrad = t.is_upgraded, this.label_val.visible = !1, this.refresh_heart(this.current_level, this.current_exp_rate, t.is_upgraded), this.during_change = !1, this.preframe_time = Laya.timer.currTimer, Laya.timer.frameLoop(1, this, this.update)
  1737. }, t.prototype.update = function() {
  1738. if (this.label_val.visible) {
  1739. Laya.timer.currTimer - this.val_show_starttime >= 5e3 && (this.label_val.visible = !1)
  1740. }
  1741. var t = Laya.timer.currTimer - this.preframe_time;
  1742. this.preframe_time = Laya.timer.currTimer, this.during_change && (this.target_level != this.current_level ? (this.during_change = !1, this.current_level = this.target_level, this.current_exp_rate = this.target_exp_rate, this.refresh_heart(this.target_level, this.target_exp_rate, this.isupgrad)) : (this.current_exp_rate += t * this.speed, this.target_exp_rate < this.current_exp_rate ? (this.during_change = !1, this.current_level = this.target_level, this.current_exp_rate = this.target_exp_rate, this.refresh_heart(this.target_level, this.target_exp_rate, this.isupgrad)) : this.refresh_heart(this.target_level, this.current_exp_rate, this.isupgrad)))
  1743. }, t.prototype.refresh_heart = function(t, e, i) {
  1744. this.is_upgraded = i;
  1745. for (var n = 0; n < this.heart_count; n++) {
  1746. var a = this.heart_masks[n];
  1747. this.current_level > n ? a.scaleY = 1 : this.current_level == n ? (a.scaleY = .82 * e + .1, this.label_val.x = this.hearts[n].x, this.label_val.text = Math.ceil(e * this.exp_limits[n]).toString() + "/" + this.exp_limits[n].toString()) : a.scaleY = 0, this.hearts[n].getChildByName("v").getChildByName("h").skin = i ? game.Tools.localUISrc("myres/bothui/heart_gold.png") : game.Tools.localUISrc("myres/bothui/bf_heart.png")
  1748. }
  1749. }, t.prototype.close = function() {
  1750. Laya.timer.clearAll(this)
  1751. }, t.prototype.after_give = function(t, e) {
  1752. var i = this,
  1753. n = t.exp / this.exp_limits[t.level],
  1754. a = game.FrontEffect.Inst.create_ui_effect(this.hearts[this.current_level], e ? "scene/effect_heartup_favor.lh" : "scene/effect_heartup.lh", new Laya.Point(0, 0), 1);
  1755. if (Laya.timer.once(2e3, null, function() {
  1756. a.destory()
  1757. }), t.level > this.current_level) {
  1758. this.target_level = this.current_level, this.target_exp_rate = 1, this.during_change = !0;
  1759. var r = (1 - this.current_exp_rate) / this.speed;
  1760. Laya.timer.once(r + 200, this, function() {
  1761. var t = game.FrontEffect.Inst.create_ui_effect(i.hearts[i.current_level], "scene/effect_heartlevelup.lh", new Laya.Point(0, 0), 1);
  1762. Laya.timer.once(2e3, null, function() {
  1763. t.destory()
  1764. }), view.AudioMgr.PlayAudio(111)
  1765. })
  1766. } else t.level == this.current_level && n > this.current_exp_rate ? (this.target_level = t.level, this.target_exp_rate = n, this.during_change = !0) : Laya.timer.once(500, this, function() {
  1767. i.target_level = t.level, i.target_exp_rate = n, i.during_change = !0
  1768. })
  1769. }, t
  1770. }(),
  1771. i = function() {
  1772. function e(t, e, i) {
  1773. var n = this;
  1774. this.items = [], this.tab_index = 0, this.gift_choose_index = -1, this.content_inshow = !1, this.give_cd = 0, this.sound_channel = null, this.content = t, this.block_exp = i, this.container_tabs = e, this.btn_gift = this.container_tabs.getChildByName("send"), this.btn_gift.clickHandler = Laya.Handler.create(this, function() {
  1775. 2 != n.tab_index && n.change_tab(2)
  1776. }, null, !1), this.btn_qiyue = this.container_tabs.getChildByName("sign"), this.btn_qiyue.clickHandler = Laya.Handler.create(this, function() {
  1777. 1 != n.tab_index && n.change_tab(1)
  1778. }, null, !1), this.scrollview = this.content.scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1), -1, 4), this.container_qiyue = this.content.getChildByName("page_qiyue"), this.container_gift = this.content.getChildByName("page_gift"), this.content.getChildByName("btn_close").clickHandler = Laya.Handler.create(this, function() {
  1779. n.change_tab(0)
  1780. }, null, !1)
  1781. }
  1782. return e.prototype.reset = function() {
  1783. this.content.visible = !1, this.content_inshow = !1, this.tab_index = 0, this.gift_choose_index = -1
  1784. }, e.prototype.show = function(t) {
  1785. this.reset(), this.chara_info = t, this.btn_gift.visible = t.level < 5;
  1786. var e = cfg.item_definition.character.get(t.charid);
  1787. this.btn_qiyue.visible = !t.is_upgraded && e.can_marry > 0, game.Tools.child_align_center(this.container_tabs, [7]), this.change_tab(0)
  1788. }, e.prototype.change_tab = function(e) {
  1789. var i = this;
  1790. if (this.items = [], this.scrollview.reset(), this.container_gift.visible = !1, this.container_qiyue.visible = !1, this.tab_index = e, 1 == e) {
  1791. this.btn_qiyue.getChildByName("chosen").visible = !0, this.btn_qiyue.getChildByName("label").color = "#000000";
  1792. for (var n = cfg.item_definition.character.get(this.chara_info.charid).star_5_material.split(","), a = !0, r = 0; r < n.length; r++) {
  1793. for (var s = n[r].split("-"), o = s[0].split("|"), l = 0, h = 0, u = 0; u < o.length; u++) l = parseInt(o[u]), h += t.UI_Bag.get_item_count(l);
  1794. var _ = parseInt(s[1]);
  1795. _ > h && (a = !1), this.items.push({
  1796. id: l,
  1797. need: _,
  1798. count: h
  1799. })
  1800. }
  1801. if (this.container_qiyue.visible = !0, this.chara_info.level >= 5) {
  1802. this.container_qiyue.getChildByName("nomet").visible = !1;
  1803. var d = this.container_qiyue.getChildByName("container_tupo_btn"),
  1804. f = d.getChildByName("send");
  1805. f.clickHandler = Laya.Handler.create(this, this._tupo, null, !1), a ? game.Tools.setGrayDisable(f, !1) : game.Tools.setGrayDisable(f, !0), d.visible = !0
  1806. } else this.container_qiyue.getChildByName("container_tupo_btn").visible = !1, this.container_qiyue.getChildByName("nomet").visible = !0
  1807. } else this.btn_qiyue.getChildByName("chosen").visible = !1, this.btn_qiyue.getChildByName("label").color = "#cfcdcc";
  1808. if (2 == e) {
  1809. this.btn_gift.getChildByName("chosen").visible = !0, this.btn_gift.getChildByName("label").color = "#000000", this.items = t.UI_Bag.find_items_by_category(t.EItemCategory.gift), this.container_gift.visible = !0;
  1810. this.container_gift.getChildByName("send").clickHandler = Laya.Handler.create(this, this._send_gift, null, !1), this.gift_choose_index = -1, this.refresh_gift_bottom_btns()
  1811. } else this.btn_gift.getChildByName("chosen").visible = !1, this.btn_gift.getChildByName("label").color = "#cfcdcc", this.sound_channel && (this.sound_channel.stop(), Laya.SoundManager.removeChannel(this.sound_channel), this.sound_channel = null), c.Inst.closechat(!1);
  1812. this.scrollview.addItem(this.items.length), 1 == e || 2 == e ? this.content_inshow || (this.content_inshow = !0, this.content.visible = !0, Laya.Tween.clearAll(this.content), t.UIBase.anim_alpha_in(this.content, {
  1813. y: -50
  1814. }, 150, 0, null, Laya.Ease.strongIn)) : this.content_inshow && (this.content_inshow = !1, Laya.Tween.clearAll(this.content), t.UIBase.anim_alpha_out(this.content, {
  1815. y: -50
  1816. }, 150, 0, Laya.Handler.create(this, function() {
  1817. i.content.visible = !1
  1818. }), Laya.Ease.strongIn))
  1819. }, e.prototype.render_item = function(t) {
  1820. var e = t.index,
  1821. i = t.container;
  1822. 2 == this.tab_index ? this.render_item_gift(e, i) : 1 == this.tab_index && this.render_item_qiyue(e, i)
  1823. }, e.prototype.render_item_qiyue = function(e, i) {
  1824. var n = this.items[e],
  1825. a = cfg.item_definition.item.get(n.id);
  1826. i.getChildByName("name").visible = !1;
  1827. var r = i.getChildByName("counts");
  1828. r.visible = !0, r.getChildByName("count_need").text = "/" + n.need.toString();
  1829. var s = r.getChildByName("count_have");
  1830. s.text = n.count.toString(), s.color = n.count >= n.need ? "#00ff00" : "#ff0000", game.Tools.child_align_center(r);
  1831. var o = i.getChildByName("btn");
  1832. o.clickHandler = Laya.Handler.create(this, function() {
  1833. t.UI_ItemDetail.Inst.show(n.id)
  1834. }, null, !1), o.getChildByName("choosed").visible = !1, game.LoadMgr.setImgSkin(o.getChildByName("icon"), a.icon), o.getChildByName("num").visible = !1
  1835. }, e.prototype.render_item_gift = function(e, i) {
  1836. var n = this,
  1837. a = this.items[e].item_id,
  1838. r = cfg.item_definition.item.get(a),
  1839. s = i.getChildByName("name");
  1840. s.text = r["name_" + GameMgr.client_language], s.visible = !0, i.getChildByName("counts").visible = !1;
  1841. var o = i.getChildByName("btn"),
  1842. l = o.getChildByName("choosed");
  1843. l.visible = this.gift_choose_index == e, o.clickHandler = Laya.Handler.create(this, function() {
  1844. if (n.gift_choose_index != e) {
  1845. var i = n.gift_choose_index;
  1846. n.gift_choose_index = e, l.visible = !0, i >= 0 && i < n.items.length && n.scrollview.wantToRefreshItem(i), n.refresh_gift_bottom_btns()
  1847. } else t.UI_ItemDetail.Inst.show(a)
  1848. }, null, !1), game.LoadMgr.setImgSkin(o.getChildByName("icon"), r.icon);
  1849. var h = o.getChildByName("num");
  1850. this.items[e].count > 1 ? (h.text = this.items[e].count.toString(), h.visible = !0) : h.visible = !1
  1851. }, e.prototype.refresh_gift_bottom_btns = function() {
  1852. var e = t.UI_Sushe.send_gift_limit - t.UI_Sushe.send_gift_count;
  1853. e < 0 && (e = 0), this.container_gift.getChildByName("count").text = e.toString();
  1854. var i = this.container_gift.getChildByName("send");
  1855. game.Tools.setGrayDisable(i, !1), game.Tools.sprite_align_center([this.container_gift.getChildByName("label_send"), this.container_gift.getChildByName("count")], 450, [10])
  1856. }, e.prototype._tupo = function() {
  1857. var e = this;
  1858. if (t.UI_PiPeiYuYue.Inst.enable) t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null);
  1859. else {
  1860. var i = this.container_qiyue.getChildByName("container_tupo_btn").getChildByName("send");
  1861. game.Tools.setGrayDisable(i, !0), app.NetAgent.sendReq2Lobby("Lobby", "upgradeCharacter", {
  1862. character_id: this.chara_info.charid
  1863. }, function(n, a) {
  1864. n || a.error ? (t.UIMgr.Inst.showNetReqError("upgradeCharacter", n, a), game.Tools.setGrayDisable(i, !1)) : (c.Inst.close(), Laya.timer.once(150, e, function() {
  1865. if (e.chara_info.is_upgraded = !0, t.UI_Character_star_up.Inst.show(e.chara_info, Laya.Handler.create(e, function() {
  1866. t.UI_Sushe.Inst.starup_back()
  1867. })), a.character) {
  1868. var i = a.character;
  1869. if (i.extra_emoji) {
  1870. e.chara_info.extra_emoji = [];
  1871. for (var n = 0; n < i.extra_emoji.length; n++) e.chara_info.extra_emoji.push(i.extra_emoji[n])
  1872. }
  1873. }
  1874. }))
  1875. })
  1876. }
  1877. }, e.prototype.close_audio = function() {
  1878. this.sound_channel && (this.sound_channel.stop(), Laya.SoundManager.removeChannel(this.sound_channel), this.sound_channel = null), c.Inst.closechat(!1)
  1879. }, e.prototype._send_gift = function() {
  1880. var e = this;
  1881. if (t.UI_PiPeiYuYue.Inst.enable) t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(204), null);
  1882. else if (!(this.gift_choose_index < 0 || this.gift_choose_index >= this.items.length || Laya.timer.currTimer < this.give_cd)) {
  1883. var i = this.chara_info.charid,
  1884. n = this.items[this.gift_choose_index].item_id;
  1885. if (99 != cfg.item_definition.item.get(n).type && t.UI_Sushe.send_gift_limit - t.UI_Sushe.send_gift_count <= 0) t.UI_Popout.PopOutNoTitle(game.Tools.strOfLocalization(2213), null);
  1886. else {
  1887. this.give_cd = Laya.timer.currTimer + 1e4;
  1888. var a = this.container_gift.getChildByName("send");
  1889. game.Tools.setGrayDisable(a, !0), app.NetAgent.sendReq2Lobby("Lobby", "sendGiftToCharacter", {
  1890. character_id: i,
  1891. gifts: [{
  1892. item_id: n,
  1893. count: 1
  1894. }]
  1895. }, function(r, s) {
  1896. if (r || s.error) game.Tools.setGrayDisable(a, !1), e.give_cd = 0, t.UIMgr.Inst.showNetReqError("sendGiftToCharacter", r, s);
  1897. else {
  1898. if (app.Log.log("sendGiftToCharacter: " + JSON.stringify(s)), e.chara_info.charid == i) {
  1899. if (2 == e.tab_index)
  1900. for (_ = 0; _ < e.items.length; _++)
  1901. if (e.items[_].item_id == n) {
  1902. if (e.items[_].count <= 1) {
  1903. for (var o = _; o < e.items.length - 1; o++) e.items[o] = e.items[o + 1];
  1904. e.items.pop(), e.gift_choose_index = -1, e.scrollview.reset(), e.scrollview.addItem(e.items.length)
  1905. } else e.items[_].count--, e.scrollview.wantToRefreshItem(_);
  1906. break
  1907. }
  1908. var l = cfg.item_definition.item.get(n).type == cfg.item_definition.character.get(i).favorite;
  1909. if (s.level > e.block_exp.current_level) {
  1910. c.Inst.locking = !0;
  1911. var h = (1 - e.block_exp.current_exp_rate) / e.block_exp.speed;
  1912. e.block_exp.after_give(s, l), Laya.timer.once(h + 600, e, function() {
  1913. e.chara_info.level = s.level, e.chara_info.exp = s.exp, t.UI_Character_star_up.Inst.show(e.chara_info, Laya.Handler.create(e, function() {
  1914. t.UI_Sushe.Inst.starup_back()
  1915. })), Laya.timer.once(600, e, function() {
  1916. c.Inst.close()
  1917. }), e.give_cd = 0
  1918. });
  1919. for (var u = function(i) {
  1920. var n = 50 * (i + 1);
  1921. Laya.timer.once(n + h + 600, e, function() {
  1922. e.sound_channel && (e.sound_channel.volume *= .5), 3 == i && (t.UI_Sushe.Inst.stopsay(), c.Inst.closechat(!0))
  1923. })
  1924. }, _ = 0; _ < 4; _++) u(_)
  1925. } else {
  1926. if (e.block_exp.after_give(s, l), e.give_cd = 0, game.Tools.setGrayDisable(a, !1), !e.sound_channel) {
  1927. var d = "";
  1928. d = cfg.item_definition.character.get(i).favorite == cfg.item_definition.item.get(n).type ? "lobby_gift_favor" : "lobby_gift";
  1929. var f = view.AudioMgr.PlayCharactorSound(e.chara_info, d, Laya.Handler.create(e, function() {
  1930. e.sound_channel = null, c.Inst.closechat(!1)
  1931. }));
  1932. c.Inst.chat(f.words), e.sound_channel = f.sound, t.UI_Sushe.Inst.stopsay()
  1933. }
  1934. e.chara_info.exp = s.exp
  1935. }
  1936. } else {
  1937. for (_ = 0; _ < t.UI_Sushe.characters.length; _++)
  1938. if (t.UI_Sushe.characters[_].charid == i) {
  1939. t.UI_Sushe.characters[_].level = s.level, t.UI_Sushe.characters[_].exp = s.exp;
  1940. break
  1941. }
  1942. e.give_cd = 0
  1943. }
  1944. 99 != cfg.item_definition.item.get(n).type && t.UI_Sushe.send_gift_count++, e.refresh_gift_bottom_btns()
  1945. }
  1946. })
  1947. }
  1948. }
  1949. }, e
  1950. }(),
  1951. n = function() {
  1952. function n(n) {
  1953. var a = this;
  1954. this.head = null, this.emos = [], this._scrollbar = null, this._scrollpoint = null, this._drag_scroll = !1, this.me = n, this.me.visible = !1, this.block_exp = new e(n.getChildByName("container_heart")), this.block_gift = new i(n.getChildByName("container_gift"), n.getChildByName("tabs"), this.block_exp), this.container_intro = n.getChildByName("intro"), this.content = this.container_intro.getChildByName("content"), this.content.vScrollBarSkin = "", this.head = new t.UI_Character_Skin(this.container_intro.getChildByName("content").getChildByName("container_head").getChildByName("head"));
  1955. var r = this.content.getChildByName("container_emj").getChildByName("container").getChildByName("emo_templete");
  1956. r.visible = !1;
  1957. for (var s = 0; s < 20; s++) this.emos.push(new t.UI_Character_Emo(r.scriptMap["capsui.UICopy"].getNodeClone())), this.emos[s].me.x = s % 4 * 184, this.emos[s].me.y = 184 * Math.floor(s / 4);
  1958. this.content.getChildByName("container_emj").height = 652, this.content.getChildByName("container_head").getChildByName("btn_skin").clickHandler = Laya.Handler.create(this, function() {
  1959. c.Inst.open_skin(new Laya.Handler(a, a.change_skin))
  1960. }, null, !1), this._scrollbar = this.container_intro.getChildByName("scrollbar"), this._scrollpoint = this._scrollbar.getChildByName("scrollpoint"), this._scrollbar && (this._scrollbar.on("mousedown", this, function() {
  1961. a._drag_scroll = !0;
  1962. var t = a._scrollbar.mouseY / a._scrollbar.height;
  1963. a.content.vScrollBar.value = a.content.vScrollBar.max * t
  1964. }), this._scrollbar.on("mousemove", this, function() {
  1965. if (a._drag_scroll) {
  1966. var t = a._scrollbar.mouseY / a._scrollbar.height;
  1967. a.content.vScrollBar.value = a.content.vScrollBar.max * t
  1968. }
  1969. }), this._scrollbar.on("mouseup", this, function() {
  1970. a._drag_scroll = !1
  1971. }), this._scrollbar.on("mouseout", this, function() {
  1972. a._drag_scroll = !1
  1973. }), this.content.vScrollBar.on("change", this, function() {
  1974. var t = a.content.vScrollBar.value / a.content.vScrollBar.max;
  1975. a._scrollpoint.y = a._scrollbar.height * t
  1976. }))
  1977. }
  1978. return n.prototype.show = function(t) {
  1979. var e = this.content.getChildByName("container_text"),
  1980. i = cfg.item_definition.character.get(t.charid);
  1981. if (e.getChildByName("height").text = i["desc_stature_" + GameMgr.client_language], e.getChildByName("birth").text = i["desc_birth_" + GameMgr.client_language], e.getChildByName("age").text = i["desc_age_" + GameMgr.client_language], e.getChildByName("bloodtype").text = i.desc_bloodtype, e.getChildByName("cv").text = i["desc_cv_" + GameMgr.client_language], e.getChildByName("hobby").text = i["desc_hobby_" + GameMgr.client_language], e.getChildByName("desc").text = i["desc_" + GameMgr.client_language], "en" == GameMgr.client_language) {
  1982. var n = [new Laya.ColorFilter([.7, 0, 0, 0, 0, 0, .7, 0, 0, 0, 0, 0, .7, 0, 0, 0, 0, 0, 1, 0])];
  1983. e.getChildByName("height").font = "en_shuhun", e.getChildByName("height").filters = n, e.getChildByName("birth").font = "en_shuhun", e.getChildByName("birth").filters = n, e.getChildByName("age").font = "en_shuhun", e.getChildByName("age").filters = n, e.getChildByName("bloodtype").font = "en_shuhun", e.getChildByName("bloodtype").filters = n, e.getChildByName("cv").font = "en_shuhun", e.getChildByName("cv").filters = n, e.getChildByName("hobby").font = "en_shuhun", e.getChildByName("hobby").filters = n, e.getChildByName("desc").font = "en_shuhun", e.getChildByName("desc").filters = n
  1984. }
  1985. for (o = 0; o < 12; o += 2) {
  1986. var a = e.getChildAt(o);
  1987. e.getChildAt(o + 1).x = a.textField.textWidth * a.scaleX + a.x + 10
  1988. }
  1989. this.head.setSkin(t.skin, "bighead");
  1990. this.content.getChildByName("container_emj").y = e.getChildByName("desc").textField.textHeight * e.getChildByName("desc").scaleY + 561 - 194;
  1991. for (var r = [], s = {}, o = 0; o < 9; o++) r.push({
  1992. sub_id: o,
  1993. unlock_desc: "",
  1994. time_limit: !1,
  1995. after_unlock_desc: ""
  1996. }), s[o] = 1;
  1997. if (t.extra_emoji && t.extra_emoji.length > 0)
  1998. for (o = 0; o < t.extra_emoji.length; o++) s[t.extra_emoji[o]] = 1;
  1999. var l = cfg.character.emoji.getGroup(t.charid);
  2000. if (l)
  2001. for (o = 0; o < l.length; o++) {
  2002. var h = l[o];
  2003. 1 == h.unlock_type ? r.push({
  2004. sub_id: h.sub_id,
  2005. unlock_desc: h["unlock_desc_" + GameMgr.client_language],
  2006. time_limit: !1,
  2007. after_unlock_desc: ""
  2008. }) : 2 == h.unlock_type && s[h.sub_id] && r.push({
  2009. sub_id: h.sub_id,
  2010. unlock_desc: h["unlock_desc_" + GameMgr.client_language],
  2011. time_limit: !0,
  2012. after_unlock_desc: h.after_unlock_desc
  2013. })
  2014. }
  2015. this.content.getChildByName("container_emj").height = 100 + 184 * Math.ceil(r.length / 4);
  2016. for (o = 0; o < this.emos.length; o++)
  2017. if (o >= r.length) this.emos[o].me.visible = !1;
  2018. else {
  2019. var c = r[o],
  2020. u = c.sub_id;
  2021. this.emos[o].me.visible = !0, this.emos[o].setSkin(t.charid, u), s.hasOwnProperty(u.toString()) ? (this.emos[o].me.getChildByName("lock").visible = !1, this.emos[o].me.getChildByName("time_limit").visible = c.time_limit, c.after_unlock_desc ? (this.emos[o].me.getChildByName("info").visible = !0, this.emos[o].me.getChildByName("info").getChildByName("info").text = c.after_unlock_desc) : this.emos[o].me.getChildByName("info").visible = !1) : (this.emos[o].me.getChildByName("lock").visible = !0, this.emos[o].me.getChildByName("info").visible = !0, this.emos[o].me.getChildByName("info").getChildByName("info").text = c.unlock_desc, this.emos[o].me.getChildByName("time_limit").visible = c.time_limit)
  2022. }
  2023. this.content.refresh(), this._drag_scroll = !1, this.block_exp.show(t), this.block_gift.show(t), this.me.visible = !0
  2024. }, n.prototype.change_skin = function(e) {
  2025. t.UI_Sushe.Inst.onChangeSkin(e), this.head.setSkin(e, "bighead")
  2026. }, n.prototype.close = function() {
  2027. this.me.visible = !1;
  2028. for (var t = 0; t < this.emos.length; t++) this.emos[t].clear()
  2029. }, n
  2030. }(),
  2031. a = function() {
  2032. function t(t) {
  2033. var e = this;
  2034. this.solts = [1, 2, 3, 4, 5], this.slot_bg = ["myres/sushe/slot_liqibang.jpg", "myres/sushe/slot_hule.jpg", "myres/sushe/slot_liqi.jpg", "myres/sushe/slot_hand.jpg", "myres/sushe/slot_bgm.jpg"], this.solt_btns = [], this.chara_info = null, this.me = t, this.me.visible = !1;
  2035. for (var i = function(t) {
  2036. var i = n.me.getChildByName("slot" + t);
  2037. n.solt_btns.push(i), i.clickHandler = Laya.Handler.create(n, function() {
  2038. t < 4 ? c.Inst.pop_effect_choose(1 + t, Laya.Handler.create(e, function(i) {
  2039. e.on_change_view(1 + t, i)
  2040. })) : c.Inst.show_pop_bgm(Laya.Handler.create(e, function(t) {
  2041. e.on_change_view(5, t)
  2042. }))
  2043. }, null, !1)
  2044. }, n = this, a = 0; a < 5; a++) i(a)
  2045. }
  2046. return t.prototype.render_item = function(t) {
  2047. var e = this.solts[t],
  2048. i = -1;
  2049. if (this.chara_info.views)
  2050. for (var n = 0; n < this.chara_info.views.length; n++)
  2051. if (this.chara_info.views[n].slot == e) {
  2052. i = this.chara_info.views[n].item_id;
  2053. break
  2054. }
  2055. var a = this.solt_btns[t]; - 1 == i || 0 == i ? (a.getChildByName("icon").skin = game.Tools.localUISrc(this.slot_bg[t]), a.getChildByName("desc").text = game.Tools.strOfLocalization(411 + t)) : (game.LoadMgr.setImgSkin(a.getChildByName("icon"), cfg.item_definition.item.get(i).icon), a.getChildByName("desc").text = cfg.item_definition.item.get(i)["name_" + GameMgr.client_language])
  2056. }, t.prototype.on_change_view = function(t, e) {
  2057. var i = !1;
  2058. if (this.chara_info.views)
  2059. for (n = 0; n < this.chara_info.views.length; n++)
  2060. if (this.chara_info.views[n].slot == t) {
  2061. i = !0, this.chara_info.views[n].item_id == e ? (this.chara_info.views[n].item_id = 0, e = 0) : this.chara_info.views[n].item_id = e;
  2062. break
  2063. }
  2064. i || (this.chara_info.views || (this.chara_info.views = []), this.chara_info.views.push({
  2065. slot: t,
  2066. item_id: e
  2067. }));
  2068. //屏蔽立直道具变更的网络请求
  2069. // app.NetAgent.sendReq2Lobby("Lobby", "changeCharacterView", {
  2070. // character_id: this.chara_info.charid,
  2071. // slot: t,
  2072. // item_id: e
  2073. // }, function(t, e) {});
  2074. for (var n = 0; n < this.solts.length; n++) this.render_item(n)
  2075. }, t.prototype.show = function(t) {
  2076. this.chara_info = t;
  2077. for (var e = 0; e < 5; e++) this.render_item(e);
  2078. this.me.visible = !0
  2079. }, t.prototype.close = function() {
  2080. this.me.visible = !1
  2081. }, t
  2082. }(),
  2083. r = function() {
  2084. function e(t) {
  2085. this.sounds = [], this.chara_info = null, this.current_play_index = -1, this.current_soundchannel = null, this.volume_fixed = 0, this.me = t, this.me.visible = !1, this.scrollview = this.me.scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1))
  2086. }
  2087. return e.prototype.show = function(e) {
  2088. this.chara_info = e, this.sounds = [];
  2089. for (var i = cfg.voice.sound.getGroup(cfg.item_definition.character.get(e.charid).sound), n = 0; n < i.length; n++) this.sounds.push(i[n]);
  2090. this.volume_fixed = cfg.item_definition.character.get(e.charid).sound_volume, this.scrollview.reset(), this.scrollview.addItem(this.sounds.length), this.me.visible = !0, view.AudioMgr.refresh_music_volume(!0), this.current_play_index = -1, t.UI_Sushe.Inst.stopsay()
  2091. }, e.prototype.close = function() {
  2092. this.me.visible && (this.me.visible = !1, view.AudioMgr.refresh_music_volume(!1), this.current_soundchannel && (this.current_soundchannel.stop(), Laya.SoundManager.removeChannel(this.current_soundchannel), this.current_soundchannel = null, this.current_play_index = -1, c.Inst.closechat(!1)))
  2093. }, e.prototype.render_item = function(t) {
  2094. var e = this,
  2095. i = t.index,
  2096. n = t.container,
  2097. a = this.sounds[i];
  2098. n.getChildByName("desc").text = a["name_" + GameMgr.client_language];
  2099. var r = n.getChildByName("btn_play"),
  2100. s = r.getChildByName("img");
  2101. s.skin = game.Tools.localUISrc(this.current_play_index == i ? "myres/bothui/bf_pause.png" : "myres/bothui/bf_play.png"), r.clickHandler = Laya.Handler.create(this, function() {
  2102. if (e.current_play_index == i) e.current_soundchannel && (e.current_soundchannel.stop(), Laya.SoundManager.removeChannel(e.current_soundchannel), e.current_soundchannel = null), c.Inst.closechat(!1), s.skin = game.Tools.localUISrc("myres/bothui/bf_play.png"), e.current_play_index = -1;
  2103. else {
  2104. var t = e.current_play_index;
  2105. e.current_play_index = i, t >= 0 && t < e.sounds.length && e.scrollview.wantToRefreshItem(t), e.current_soundchannel && (Laya.SoundManager.removeChannel(e.current_soundchannel), e.current_soundchannel.stop(), e.current_soundchannel = null), s.skin = game.Tools.localUISrc("myres/bothui/bf_pause.png");
  2106. var n = Laya.timer.currTimer,
  2107. r = Laya.SoundManager.playSound(a.path + view.AudioMgr.suffix, 1, new Laya.Handler(e, function() {
  2108. var t = n + 2e3 - Laya.timer.currTimer;
  2109. t < 0 && (t = 0), Laya.timer.once(t, e, function() {
  2110. if (e.current_soundchannel == r) {
  2111. e.current_soundchannel = null;
  2112. var t = e.current_play_index;
  2113. e.current_play_index = -1, t >= 0 && t < e.sounds.length && e.scrollview.wantToRefreshItem(t), c.Inst.closechat(!1)
  2114. }
  2115. })
  2116. }));
  2117. e.current_soundchannel = r, view.AudioMgr.getCVmute(e.chara_info.charid) ? e.current_soundchannel.volume = 0 : e.current_soundchannel.volume = e.volume_fixed * view.AudioMgr.getCVvolume(e.chara_info.charid), view.AudioMgr.yuyinMuted ? e.current_soundchannel.volume = 0 : e.current_soundchannel.volume *= view.AudioMgr.yuyinVolume, c.Inst.chat(a["words_" + GameMgr.client_language])
  2118. }
  2119. }, null, !1);
  2120. var o = n.getChildByName("lock");
  2121. this.chara_info.level >= a.level_limit ? (o.visible = !1, r.visible = !0) : (o.visible = !0, r.visible = !1, o.getChildByName("info").text = game.Tools.strOfLocalization(2192, [a.level_limit.toString()]))
  2122. }, e
  2123. }(),
  2124. s = function() {
  2125. function e(t) {
  2126. var e = this;
  2127. this.items = [], this.current_using_item_id = -1, this.me = t, this.root = t.getChildByName("root"), this.title = this.root.getChildByName("title"), this.root.getChildByName("btn_close").clickHandler = Laya.Handler.create(this, function() {
  2128. e.close()
  2129. }, null, !1), this.scrollview = this.root.scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1), -1, 3)
  2130. }
  2131. return e.prototype.show = function(e, i, n) {
  2132. this.me.visible = !0, this.root.scaleX = this.root.scaleY = 1, t.UIBase.anim_pop_out(this.root, null), this.chara_info = e, this.slot_id = i, this.when_change = n, this.items = [];
  2133. for (var a = t.UI_Bag.find_items_by_category(t.EItemCategory.character_view), r = 0; r < a.length; r++) {
  2134. cfg.item_definition.item.get(a[r].item_id).type == i && this.items.push(a[r].item_id)
  2135. }
  2136. if (this.current_using_item_id = -1, e.views)
  2137. for (r = 0; r < e.views.length; r++)
  2138. if (e.views[r].slot == this.slot_id) {
  2139. this.current_using_item_id = e.views[r].item_id;
  2140. break
  2141. }
  2142. switch (this.title.text = "", i) {
  2143. case 1:
  2144. this.title.text = game.Tools.strOfLocalization(2193);
  2145. break;
  2146. case 2:
  2147. this.title.text = game.Tools.strOfLocalization(2194);
  2148. break;
  2149. case 3:
  2150. this.title.text = game.Tools.strOfLocalization(2195);
  2151. break;
  2152. case 4:
  2153. this.title.text = game.Tools.strOfLocalization(2214)
  2154. }
  2155. this.root.getChildByName("no_info").visible = 0 == this.items.length, this.scrollview.reset(), this.scrollview.addItem(this.items.length)
  2156. }, e.prototype.close = function() {
  2157. var e = this;
  2158. this.when_change = null, t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  2159. e.me.visible = !1
  2160. }))
  2161. }, e.prototype.render_item = function(e) {
  2162. var i = this,
  2163. n = e.index,
  2164. a = e.container,
  2165. r = e.cache_data,
  2166. s = a.getChildByName("btn");
  2167. s.clickHandler = Laya.Handler.create(this, function() {
  2168. i.when_change && i.when_change.runWith(i.items[n]), i.close()
  2169. }, null, !1), r.icon || (r.icon = new t.UI_Item_Skin(s.getChildByName("icon"))), r.icon.setSkin(cfg.item_definition.item.get(this.items[n]).icon);
  2170. a.getChildByName("using").visible = this.current_using_item_id == this.items[n]
  2171. }, e
  2172. }(),
  2173. o = function() {
  2174. function e(t) {
  2175. var e = this;
  2176. this.items = [], this.current_using_item_id = -1, this.current_listening = -1, this.me = t, this.root = t.getChildByName("root"), this.title = this.root.getChildByName("title"), this.root.getChildByName("btn_close").clickHandler = Laya.Handler.create(this, function() {
  2177. e.close()
  2178. }, null, !1), this.scrollview = this.root.scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1), -1, 3)
  2179. }
  2180. return e.prototype.show = function(e, i) {
  2181. this.me.visible = !0, this.root.scaleX = this.root.scaleY = 1, t.UIBase.anim_pop_out(this.root, null), this.chara_info = e, this.when_change = i, this.items = [];
  2182. for (var n = t.UI_Bag.find_items_by_category(t.EItemCategory.character_view), a = 0; a < n.length; a++) {
  2183. cfg.item_definition.item.get(n[a].item_id).type == game.EPlayerView.liqi_bgm && this.items.push(n[a].item_id)
  2184. }
  2185. if (this.current_using_item_id = -1, e.views)
  2186. for (a = 0; a < e.views.length; a++)
  2187. if (e.views[a].slot == game.EPlayerView.liqi_bgm) {
  2188. this.current_using_item_id = e.views[a].item_id;
  2189. break
  2190. }
  2191. this.current_listening = -1, this.root.getChildByName("no_info").visible = 0 == this.items.length, this.scrollview.reset(), this.scrollview.addItem(this.items.length)
  2192. }, e.prototype.close = function() {
  2193. var e = this;
  2194. this.when_change = null, this.current_listening >= 0 && (view.BgmListMgr.stopBgm(0), view.BgmListMgr.PlayLobbyBgm()), t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  2195. e.me.visible = !1
  2196. }))
  2197. }, e.prototype.render_item = function(t) {
  2198. var e = this,
  2199. i = t.index,
  2200. n = t.container,
  2201. a = n.getChildByName("btn");
  2202. a.clickHandler = Laya.Handler.create(this, function() {
  2203. e.when_change && e.when_change.runWith(e.items[i]), e.close()
  2204. }, null, !1);
  2205. var r = a.getChildByName("icon"),
  2206. s = cfg.item_definition.item.get(this.items[i]);
  2207. game.LoadMgr.setImgSkin(r, s.icon);
  2208. a.getChildByName("using").visible = this.current_using_item_id == this.items[i];
  2209. var o = a.getChildByName("img_play");
  2210. i == this.current_listening ? o.skin = game.Tools.localUISrc("myres/bothui/bf_pause.png") : o.skin = game.Tools.localUISrc("myres/bothui/bf_play.png");
  2211. n.getChildByName("btn_play").clickHandler = Laya.Handler.create(this, function() {
  2212. i == e.current_listening ? (e.current_listening = -1, view.BgmListMgr.stopBgm(0), view.BgmListMgr.PlayLobbyBgm()) : (e.current_listening = i, view.AudioMgr.PlayLiqiBgm(s.sargs[0])), e.scrollview.wantToRefreshAll()
  2213. }, null, !1), a.getChildByName("label_name").text = s["name_" + GameMgr.client_language]
  2214. }, e
  2215. }(),
  2216. l = function() {
  2217. function e(t) {
  2218. var e = this;
  2219. this.skins = [], this.me = t, this.root = t.getChildByName("root"), this.root.getChildByName("btn_close").clickHandler = Laya.Handler.create(this, function() {
  2220. e.close()
  2221. }, null, !1), this.scrollview = this.root.scriptMap["capsui.CScrollView"], this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1), -1, 3)
  2222. }
  2223. return e.prototype.show = function(e, i) {
  2224. var n = this;
  2225. this.me.visible = !0, t.UIBase.anim_pop_out(this.root, null), this.chara_info = e, this.when_change = i, this.skins = [];
  2226. var a = cfg.item_definition.character.get(e.charid);
  2227. if (this.skins.push(a.init_skin), a.can_marry && this.skins.push(a.full_fetter_skin), a.skin_lib)
  2228. for (var r = 0; r < a.skin_lib.length; r++) a.skin_lib[r] && this.skins.push(a.skin_lib[r]);
  2229. cfg.item_definition.skin.forEach(function(t) {
  2230. 0 != t.type && 1 != t.type && t.character_id == e.charid && n.skins.push(t.id)
  2231. }), this.scrollview.reset(), this.scrollview.addItem(this.skins.length)
  2232. }, e.prototype.close = function() {
  2233. var e = this;
  2234. this.when_change = null, t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  2235. e.me.visible = !1
  2236. }))
  2237. }, e.prototype.render_item = function(e) {
  2238. var i = this,
  2239. n = e.index,
  2240. a = e.container,
  2241. r = e.cache_data,
  2242. s = a.getChildByName("btn");
  2243. r.skin || (r.skin = new t.UI_Character_Skin(s.getChildByName("icon")));
  2244. a.getChildByName("using").visible = this.skins[n] == this.chara_info.skin;
  2245. var o = cfg.item_definition.skin.get(this.skins[n]);
  2246. r.skin.setSkin(this.skins[n], "bighead");
  2247. var l = s.getChildByName("locked");
  2248. t.UI_Sushe.skin_owned(this.skins[n]) ? (l.visible = !1, s.clickHandler = Laya.Handler.create(this, function() {
  2249. i.skins[n] != i.chara_info.skin && i.when_change && i.when_change.runWith(i.skins[n]), i.close()
  2250. }, null, !1)) : (l.visible = !0, l.getChildByName("info").text = o["lock_tips_" + GameMgr.client_language], s.clickHandler = null)
  2251. }, e
  2252. }(),
  2253. h = function() {
  2254. function t(t) {
  2255. var e = this;
  2256. this.locking = !1, this.me = t, this.info = this.me.getChildByName("info"), this.me.on("mousedown", this, function() {
  2257. e.locking || e.close()
  2258. })
  2259. }
  2260. return t.prototype.show = function(t) {
  2261. var e = this;
  2262. this.info.text = t, this.me.height = 120 + this.info.textField.textHeight, this.me.visible = !0, this.locking = !0, this.me.scaleY = 0, Laya.timer.clearAll(this), Laya.Tween.to(this.me, {
  2263. scaleY: 1
  2264. }, 150, null, Laya.Handler.create(this, function() {
  2265. e.locking = !1
  2266. })), Laya.timer.once(3e3, this, function() {
  2267. e.close()
  2268. })
  2269. }, t.prototype.close = function() {
  2270. var t = this;
  2271. this.locking = !0, Laya.timer.clearAll(this), Laya.Tween.to(this.me, {
  2272. scaleY: 0
  2273. }, 150, null, Laya.Handler.create(this, function() {
  2274. t.locking = !1, t.me.visible = !1
  2275. }))
  2276. }, t
  2277. }(),
  2278. c = function(e) {
  2279. function i() {
  2280. var t = e.call(this, new ui.lobby.visitUI) || this;
  2281. return t.tabs = [], t.page_intro = null, t.page_effect = null, t.page_sound = null, t.block_chat = null, t.pop_effect = null, t.pop_bgm = null, t.pop_skin = null, t.locking = !1, t.current_page = -1, t.chara_info = null, t.tab_img_dark = "", t.tab_img_chosen = "", i.Inst = t, t
  2282. }
  2283. return __extends(i, e), Object.defineProperty(i.prototype, "cannot_click_say", {
  2284. get: function() {
  2285. return 1 == this.current_page || null != this.page_intro.block_gift.sound_channel
  2286. },
  2287. enumerable: !0,
  2288. configurable: !0
  2289. }), i.prototype.onCreate = function() {
  2290. var e = this;
  2291. this.container_top = this.me.getChildByName("top"), this.container_top.getChildByName("btn_back").clickHandler = Laya.Handler.create(this, function() {
  2292. e.locking || e.back2select()
  2293. }, null, !1), "chs" == GameMgr.client_language ? (this.tab_img_chosen = game.Tools.localUISrc("myres/sushe/bf_chosen.png"), this.tab_img_dark = game.Tools.localUISrc("myres/sushe/bf_unchooesd.png")) : (this.tab_img_chosen = game.Tools.localUISrc("myres/sushe/bf_chosen_en.png"), this.tab_img_dark = game.Tools.localUISrc("myres/sushe/bf_unchooesd_en.png")), this.container_right = this.me.getChildByName("right");
  2294. for (var i = function(t) {
  2295. "chs" == GameMgr.client_language ? (c.tabs.push(c.container_right.getChildByName("btn_page" + t)), c.container_right.getChildByName("btn_page" + t + "_en").visible = !1) : (c.container_right.getChildByName("btn_page" + t).visible = !1, c.tabs.push(c.container_right.getChildByName("btn_page" + t + "_en"))), c.tabs[t].clickHandler = Laya.Handler.create(c, function() {
  2296. e.locking || e.current_page != t && e.change_page(t)
  2297. }, null, !1)
  2298. }, c = this, u = 0; u < 3; u++) i(u);
  2299. this.page_intro = new n(this.container_right.getChildByName("page_intro")), this.page_effect = new a(this.container_right.getChildByName("effect")), this.page_sound = new r(this.container_right.getChildByName("sound")), this.block_chat = new t.UI_Character_Chat(this.me.getChildByName("chat")), this.block_chat.me.visible = !1, this.pop_effect = new s(this.me.getChildByName("pop_effect")), this.pop_bgm = new o(this.me.getChildByName("pop_bgm")), this.pop_skin = new l(this.me.getChildByName("pop_skin")), this.info_levelup = new h(this.me.getChildByName("levelup"))
  2300. }, i.prototype.show = function(e, i) {
  2301. var n = this;
  2302. this.chara_info = e;
  2303. for (var a = 0; a < this.tabs.length; a++) this.tabs[a].skin = this.tab_img_dark;
  2304. this.page_intro.close(), this.page_effect.close(), this.page_sound.close(), this.current_page = -1, this.change_page(0), this.block_chat.me.visible = !1, this.pop_effect.me.visible = !1, this.pop_bgm.me.visible = !1, this.pop_skin.me.visible = !1, this.info_levelup.me.visible = !1, this.me.visible = !0, this.locking = !0, t.UIBase.anim_alpha_in(this.container_top, {
  2305. y: -30
  2306. }, 150), t.UIBase.anim_alpha_in(this.container_right, {
  2307. x: 30
  2308. }, 150), t.UIBase.anim_alpha_in(this.block_chat.me, {
  2309. y: 30
  2310. }, 150), Laya.timer.once(150, this, function() {
  2311. n.locking = !1
  2312. }), i && Laya.timer.once(150, this, function() {
  2313. n.chara_info.is_upgraded ? n.info_levelup.show(game.Tools.strOfLocalization(2196)) : n.info_levelup.show(cfg.level_definition.character.get(n.chara_info.level)["unlock_desc_" + GameMgr.client_language])
  2314. })
  2315. }, i.prototype.close = function() {
  2316. var e = this;
  2317. this.locking = !0, t.UIBase.anim_alpha_out(this.container_top, {
  2318. y: -30
  2319. }, 150), t.UIBase.anim_alpha_out(this.container_right, {
  2320. x: 30
  2321. }, 150), t.UIBase.anim_alpha_out(this.block_chat.me, {
  2322. y: 30
  2323. }, 150), Laya.timer.once(150, this, function() {
  2324. e.locking = !1, e.me.visible = !1, e.page_sound.me.visible && e.page_sound.close(), e.pop_bgm.me.visible && e.pop_bgm.close(), e.page_intro.block_gift.close_audio()
  2325. })
  2326. }, i.prototype.back2select = function() {
  2327. this.close(), Laya.timer.once(150, this, function() {
  2328. t.UI_Sushe.Inst.show_page_select()
  2329. })
  2330. }, i.prototype.change_page = function(t) {
  2331. if (this.current_page >= 0) switch (this.tabs[this.current_page].skin = this.tab_img_dark, this.current_page) {
  2332. case 0:
  2333. this.page_intro.close();
  2334. break;
  2335. case 1:
  2336. this.page_sound.close();
  2337. break;
  2338. case 2:
  2339. this.page_effect.close()
  2340. }
  2341. if (this.current_page = t, this.current_page >= 0) switch (this.tabs[this.current_page].skin = this.tab_img_chosen, this.current_page) {
  2342. case 0:
  2343. this.page_intro.show(this.chara_info);
  2344. break;
  2345. case 1:
  2346. this.page_sound.show(this.chara_info);
  2347. break;
  2348. case 2:
  2349. this.page_effect.show(this.chara_info)
  2350. }
  2351. }, i.prototype.open_skin = function(t) {
  2352. this.pop_skin.show(this.chara_info, t)
  2353. }, i.prototype.pop_effect_choose = function(t, e) {
  2354. this.pop_effect.show(this.chara_info, t, e)
  2355. }, i.prototype.show_pop_bgm = function(t) {
  2356. this.pop_bgm.show(this.chara_info, t)
  2357. }, i.prototype.chat = function(t) {
  2358. this.block_chat.show(t)
  2359. }, i.prototype.closechat = function(t) {
  2360. this.block_chat.close(t)
  2361. }, i
  2362. }(t.UIBase);
  2363. t.UI_Sushe_Visit = c
  2364. }(uiscript || (uiscript = {}));
  2365. //友人房
  2366. !(function(t) {
  2367. var e = (function() {
  2368. function e(t) {
  2369. var e = this;
  2370. (this.friends = []), (this.sortlist = []), (this.me = t), (this.me.visible = !1), (this.blackbg = t.getChildByName("blackbg")), (this.blackbg.clickHandler = Laya.Handler.create(this, function() {
  2371. e.locking || e.close();
  2372. }, null, !1)), (this.root = t.getChildByName("root")), (this.scrollview = this.root.scriptMap["capsui.CScrollView"]),
  2373. this.scrollview.init_scrollview(Laya.Handler.create(this, this.render_item, null, !1)), (this.noinfo = this.root.getChildByName("noinfo"));
  2374. }
  2375. return (
  2376. (e.prototype.show = function() {
  2377. var e = this;
  2378. (this.locking = !0), (this.me.visible = !0),
  2379. this.scrollview.reset(), (this.friends = []), (this.sortlist = []);
  2380. for (var i = game.FriendMgr.friend_list, n = 0; n < i.length; n++) this.sortlist.push(n);
  2381. this.sortlist = this.sortlist.sort(function(t, e) {
  2382. var n = i[t],
  2383. a = 0;
  2384. if (n.state.is_online) {
  2385. (a += "" != (o = game.Tools.playState2Desc(n.state.playing)) ? 3e10 : 6e10), (a += -n.state.login_time);
  2386. } else a += n.state.logout_time;
  2387. var r = i[e],
  2388. s = 0;
  2389. if (r.state.is_online) {
  2390. var o = game.Tools.playState2Desc(r.state.playing);
  2391. (s += "" != o ? 3e10 : 6e10), (s += -r.state.login_time);
  2392. } else s += r.state.logout_time;
  2393. return s - a;
  2394. });
  2395. for (n = 0; n < i.length; n++) this.friends.push({
  2396. f: i[n],
  2397. invited: !1
  2398. });
  2399. (this.noinfo.visible = 0 == this.friends.length),
  2400. this.scrollview.addItem(this.friends.length),
  2401. t.UIBase.anim_pop_out(this.root, Laya.Handler.create(this, function() {
  2402. e.locking = !1;
  2403. }));
  2404. }), (e.prototype.close = function() {
  2405. var e = this;
  2406. (this.locking = !0),
  2407. t.UIBase.anim_pop_hide(this.root, Laya.Handler.create(this, function() {
  2408. (e.locking = !1), (e.me.visible = !1);
  2409. }));
  2410. }), (e.prototype.render_item = function(e) {
  2411. var n = e.index,
  2412. a = e.container,
  2413. r = e.cache_data;
  2414. r.head || ((r.head = new t.UI_Head(a.getChildByName("head"))), (r.name = a.getChildByName("label_name")), (r.state = a.getChildByName("label_state")), (r.btn = a.getChildByName("btn_invite")), (r.invited = a.getChildByName("invited")));
  2415. var s = this.friends[this.sortlist[n]];
  2416. (r.head.id = s.f.base.avatar_id), (r.name.text = s.f.base.nickname);
  2417. var o = !1;
  2418. if (s.f.state.is_online) {
  2419. var l = game.Tools.playState2Desc(s.f.state.playing);
  2420. "" != l ? ((r.state.text = game.Tools.strOfLocalization(2069, [l])), (r.state.color = "#a9d94d"), (r.name.color = "#a9d94d")) : ((r.state.text = game.Tools.strOfLocalization(2071)), (r.state.color = "#58c4db"), (r.name.color = "#58c4db"), (o = !0));
  2421. } else(r.state.text = game.Tools.strOfLocalization(2072)), (r.state.color = "#8c8c8c"), (r.name.color = "#8c8c8c");
  2422. s.invited ? ((r.btn.visible = !1), (r.invited.visible = !0)) : ((r.btn.visible = !0), (r.invited.visible = !1), game.Tools.setGrayDisable(r.btn, !o), o && (r.btn.clickHandler = Laya.Handler.create(this, function() {
  2423. game.Tools.setGrayDisable(r.btn, !0);
  2424. var e = {
  2425. room_id: i.Inst.room_id,
  2426. mode: i.Inst.room_mode,
  2427. nickname: GameMgr.Inst.account_data.nickname,
  2428. account_id: GameMgr.Inst.account_id
  2429. };
  2430. app.NetAgent.sendReq2Lobby("Lobby", "sendClientMessage", {
  2431. target_id: s.f.base.account_id,
  2432. type: game.EFriendMsgType.room_invite,
  2433. content: JSON.stringify(e)
  2434. }, function(e, i) {
  2435. e || i.error ? (game.Tools.setGrayDisable(r.btn, !1), t.UIMgr.Inst.showNetReqError("sendClientMessage", e, i)) : ((r.btn.visible = !1), (r.invited.visible = !0), (s.invited = !0));
  2436. });
  2437. }, null, !1)));
  2438. }), e);
  2439. })(),
  2440. i = (function(i) {
  2441. function n() {
  2442. var e = i.call(this, new ui.lobby.waitingroomUI()) || this;
  2443. return (
  2444. (e.skin_ready = "myres/room/btn_ready.png"), (e.skin_cancel = "myres/room/btn_cancel.png"), (e.skin_start = "myres/room/btn_start.png"), (e.skin_start_no = "myres/room/btn_start_no.png"), (e.label_rommid = null), (e.player_cells = []), (e.btn_ok = null), (e.btn_invite_friend = null), (e.btn_add_robot = null), (e.beReady = !1), (e.room_id = -1), (e.owner_id = -1), (e.tournament_id = 0), (e.max_player_count = 0), (e.players = []), (e.container_rules = null), (e.container_top = null), (e.container_right = null), (e.locking = !1), (e.mousein_copy = !1), (e.popout = null), (e.room_link = null), (e.btn_copy_link = null), (e.last_start_room = 0), (e.invitefriend = null), (e.pre_choose = null), (e.ai_name = game.Tools.strOfLocalization(2003)), (n.Inst = e), app.NetAgent.AddListener2Lobby("NotifyRoomPlayerReady", Laya.Handler.create(e, function(t) {
  2445. app.Log.log("NotifyRoomPlayerReady:" + JSON.stringify(t)),
  2446. e.onReadyChange(t.account_id, t.ready);
  2447. })), app.NetAgent.AddListener2Lobby("NotifyRoomPlayerUpdate", Laya.Handler.create(e, function(t) {
  2448. app.Log.log("NotifyRoomPlayerUpdate:" + JSON.stringify(t)),
  2449. e.onPlayerChange(t);
  2450. })), app.NetAgent.AddListener2Lobby("NotifyRoomGameStart", Laya.Handler.create(e, function(t) {
  2451. e.enable && (app.Log.log("NotifyRoomGameStart:" + JSON.stringify(t)), e.onGameStart(t));
  2452. })), app.NetAgent.AddListener2Lobby("NotifyRoomKickOut", Laya.Handler.create(e, function(t) {
  2453. app.Log.log("NotifyRoomKickOut:" + JSON.stringify(t)),
  2454. e.onBeKictOut();
  2455. })), game.LobbyNetMgr.Inst.add_connect_listener(Laya.Handler.create(e, function() {
  2456. e.enable && e.hide(Laya.Handler.create(e, function() {
  2457. t.UI_Lobby.Inst.enable = !0;
  2458. }));
  2459. }, null, !1)), e);
  2460. }
  2461. return (__extends(n, i), Object.defineProperty(n.prototype, "inRoom", {
  2462. get: function() {
  2463. return -1 != this.room_id;
  2464. },
  2465. enumerable: !0,
  2466. configurable: !0
  2467. }), Object.defineProperty(n.prototype, "robot_count", {
  2468. get: function() {
  2469. for (var t = 0, e = 0; e < this.players.length; e++) 2 == this.players[e].category && t++;
  2470. return t;
  2471. },
  2472. enumerable: !0,
  2473. configurable: !0
  2474. }), (n.prototype.resetData = function() {
  2475. (this.room_id = -1), (this.owner_id = -1), (this.room_mode = {}), (this.max_player_count = 0), (this.players = []);
  2476. }), (n.prototype.updateData = function(t) {
  2477. if (t) {
  2478. (this.room_id = t.room_id), (this.owner_id = t.owner_id), (this.room_mode = t.mode), (this.public_live = t.public_live), (this.tournament_id = 0),
  2479. t.tournament_id && (this.tournament_id = t.tournament_id), (this.ai_name = game.Tools.strOfLocalization(2003)),
  2480. this.room_mode.detail_rule && (1 === this.room_mode.detail_rule.ai_level && (this.ai_name = game.Tools.strOfLocalization(2003)), 2 === this.room_mode.detail_rule.ai_level && (this.ai_name = game.Tools.strOfLocalization(2004))), (this.max_player_count = t.max_player_count), (this.players = []);
  2481. for (i = 0; i < t.persons.length; i++) {
  2482. var e = t.persons[i];
  2483. //修改友人房间立绘 -----fxxk
  2484. if (e.account_id == GameMgr.Inst.account_id) e.avatar_id = GameMgr.Inst.account_data.my_character.skin;
  2485. //end
  2486. (e.ready = !1), (e.cell_index = -1), (e.category = 1),
  2487. this.players.push(e);
  2488. }
  2489. for (i = 0; i < t.robot_count; i++) this.players.push({
  2490. //修改友人房间机器人的立绘 -----fxxk
  2491. category: 2,
  2492. cell_index: -1,
  2493. account_id: 0,
  2494. level: {
  2495. id: 10101,
  2496. score: 0
  2497. },
  2498. nickname: this.ai_name,
  2499. ready: !0,
  2500. title: 0,
  2501. avatar_id: 400101
  2502. //end
  2503. });
  2504. for (var i = 0; i < t.ready_list.length; i++)
  2505. for (var n = 0; n < this.players.length; n++)
  2506. if (this.players[n].account_id == t.ready_list[i]) {
  2507. this.players[n].ready = !0;
  2508. break;
  2509. }
  2510. } else this.resetData();
  2511. }), (n.prototype.onReadyChange = function(t, e) {
  2512. for (var i = 0; i < this.players.length; i++)
  2513. if (this.players[i].account_id == t) {
  2514. (this.players[i].ready = e),
  2515. this._onPlayerReadyChange(this.players[i]);
  2516. break;
  2517. }
  2518. }), (n.prototype.onPlayerChange = function(t) {
  2519. t = t.toJSON();
  2520. for (var e = [], i = 0; i < this.players.length; i++) 0 != this.players[i].category && e.push(this.players[i]);
  2521. if (((this.players = e), t.update_list))
  2522. for (i = 0; i < t.update_list.length; i++) {
  2523. for (var n = t.update_list[i], a = n.account_id, r = !0, s = 0; s < this.players.length; s++)
  2524. if (this.players[s] && this.players[s].account_id == a) {
  2525. n.avatar_id && (this.players[s].avatar_id = n.avatar_id),
  2526. n.title && (this.players[s].avatar_id = n.title),
  2527. n.nickname && (this.players[s].avatar_id = n.nickname),
  2528. n.level && (this.players[s].level = n.level),
  2529. this._refreshPlayerInfo(this.players[s]), (r = !1);
  2530. break;
  2531. }
  2532. if (r) {
  2533. var o = -1;
  2534. if (this.enable) {
  2535. for (var l = [!1, !1, !1, !1], h = 0; h < this.players.length; h++) l[this.players[h].cell_index] = !0;
  2536. for (s = 0; s < this.max_player_count; s++)
  2537. if (!l[s]) {
  2538. o = s;
  2539. break;
  2540. }
  2541. }
  2542. (n.cell_index = o), (n.ready = !1), (n.category = 1),
  2543. this.players.push(n),
  2544. this._refreshPlayerInfo(this.players[this.players.length - 1]);
  2545. }
  2546. }
  2547. if (t.remove_list)
  2548. for (i = 0; i < t.remove_list.length; i++)
  2549. for (var a = t.remove_list[i], s = 0; s < this.players.length; s++)
  2550. if (this.players[s] && this.players[s].account_id == a) {
  2551. for (var c = this.players[s].cell_index, u = s; u < this.players.length - 1; u++) this.players[u] = this.players[u + 1];
  2552. this.players.pop(), this._clearCell(c);
  2553. break;
  2554. }
  2555. if (null != t.robot_count && void 0 != t.robot_count) {
  2556. var _ = t.robot_count;
  2557. _ < this.robot_count && this.pre_choose && 2 == this.pre_choose.category && ((this.pre_choose.category = 0), this._clearCell(this.pre_choose.cell_index), (this.pre_choose = null));
  2558. for (i = 0; i < this.players.length; i++) {
  2559. var d = this.players[i];
  2560. 2 == d.category && (0 == _ ? ((this.players[i].category = 0), this._clearCell(d.cell_index)) : _--);
  2561. }
  2562. for (; _ > 0;) {
  2563. for (var f = -1, i = 0; i < this.players.length; i++)
  2564. if (0 == this.players[i].category) {
  2565. f = i;
  2566. break;
  2567. }
  2568. if (-1 == f) {
  2569. if (!(this.players.length < this.max_player_count)) {
  2570. app.Log.Error("同步机器人数量有问题");
  2571. break;
  2572. }
  2573. _--;
  2574. for (var c = -1, l = [!1, !1, !1, !1], i = 0; i < this.players.length; i++) l[this.players[i].cell_index] = !0;
  2575. for (s = 0; s < this.max_player_count; s++)
  2576. if (!l[s]) {
  2577. c = s;
  2578. break;
  2579. }
  2580. this.players.push({
  2581. category: 2,
  2582. cell_index: c,
  2583. account_id: 0,
  2584. level: {
  2585. id: 10101,
  2586. score: 0
  2587. },
  2588. nickname: this.ai_name,
  2589. ready: !0,
  2590. title: 0,
  2591. avatar_id: 400101
  2592. }),
  2593. this._refreshPlayerInfo(this.players[this.players.length - 1]);
  2594. } else _--, (this.players[f].category = 2), (this.players[f].cell_index = f), (this.players[f].account_id = 0), (this.players[f].level = {
  2595. id: 10101,
  2596. score: 0
  2597. }), (this.players[f].nickname = this.ai_name), (this.players[f].ready = !0), (this.players[f].title = 0), (this.players[f].avatar_id = 400101),
  2598. this._refreshPlayerInfo(this.players[f]);
  2599. }
  2600. }
  2601. if (t.owner_id) {
  2602. if (((this.owner_id = t.owner_id), this.enable))
  2603. if (this.owner_id == GameMgr.Inst.account_id) this.refreshAsOwner();
  2604. else
  2605. for (s = 0; s < this.players.length; s++)
  2606. if (this.players[s] && this.players[s].account_id == this.owner_id) {
  2607. this._refreshPlayerInfo(this.players[s]);
  2608. break;
  2609. }
  2610. } else if (this.enable)
  2611. if (this.owner_id == GameMgr.Inst.account_id) this.refreshAsOwner();
  2612. else
  2613. for (s = 0; s < this.players.length; s++)
  2614. if (this.players[s] && this.players[s].account_id == this.owner_id) {
  2615. this._refreshPlayerInfo(this.players[s]);
  2616. break;
  2617. }
  2618. }), (n.prototype.onBeKictOut = function() {
  2619. this.resetData(),
  2620. this.enable && ((this.enable = !1), (t.UI_Lobby.Inst.enable = !0), t.UIMgr.Inst.ShowErrorInfo(game.Tools.strOfLocalization(52)));
  2621. }), (n.prototype.onCreate = function() {
  2622. var i = this;
  2623. this.last_start_room = 0;
  2624. var n = this.me.getChildByName("root");
  2625. (this.container_top = n.getChildByName("top")), (this.container_right = n.getChildByName("right")), (this.label_rommid = this.container_top.getChildByName("label_roomid"));
  2626. for (var a = function(e) {
  2627. var a = n.getChildByName("player_" + e.toString()),
  2628. s = {};
  2629. (s.index = e), (s.container = a), (s.container_flag = a.getChildByName("flag")), (s.container_name = a.getChildByName("container_name")), (s.name = a.getChildByName("container_name").getChildByName("label_name")), (s.btn_t = a.getChildByName("btn_t")), (s.container_illust = a.getChildByName("container_illust")), (s.illust = new t.UI_Character_Skin(a.getChildByName("container_illust").getChildByName("illust"))), (s.host = a.getChildByName("host")), (s.title = new t.UI_PlayerTitle(a.getChildByName("container_name").getChildByName("title"))), (s.rank = new t.UI_Level(a.getChildByName("container_name").getChildByName("rank"))), (s.is_robot = !1);
  2630. var o = 0;
  2631. (s.btn_t.clickHandler = Laya.Handler.create(r, function() {
  2632. if (!(i.locking || Laya.timer.currTimer < o)) {
  2633. o = Laya.timer.currTimer + 500;
  2634. for (var t = 0; t < i.players.length; t++)
  2635. if (i.players[t].cell_index == e) {
  2636. i.kickPlayer(t);
  2637. break;
  2638. }
  2639. }
  2640. }, null, !1)), (s.btn_info = a.getChildByName("btn_info")), (s.btn_info.clickHandler = Laya.Handler.create(r, function() {
  2641. if (!i.locking)
  2642. for (var n = 0; n < i.players.length; n++)
  2643. if (i.players[n].cell_index == e) {
  2644. i.players[n].account_id && i.players[n].account_id > 0 && t.UI_OtherPlayerInfo.Inst.show(i.players[n].account_id);
  2645. break;
  2646. }
  2647. }, null, !1)),
  2648. r.player_cells.push(s);
  2649. },
  2650. r = this,
  2651. s = 0; s < 4; s++) a(s);
  2652. (this.btn_ok = n.getChildByName("btn_ok")), (this.btn_ok.clickHandler = Laya.Handler.create(this, function() {
  2653. i.owner_id == GameMgr.Inst.account_id ? i.getStart() : i.switchReady();
  2654. }, null, !1)), (this.container_top.getChildByName("btn_leave").clickHandler = Laya.Handler.create(this, function() {
  2655. i.leaveRoom();
  2656. }, null, !1)), (this.btn_invite_friend = this.container_right.getChildByName("btn_friend")), (this.btn_invite_friend.clickHandler = Laya.Handler.create(this, function() {
  2657. i.locking || i.invitefriend.show();
  2658. }, null, !1)), (this.btn_add_robot = this.container_right.getChildByName("btn_robot"));
  2659. var o = 0;
  2660. (this.btn_add_robot.clickHandler = Laya.Handler.create(this, function() {
  2661. i.locking || Laya.timer.currTimer < o || ((o = Laya.timer.currTimer + 1e3), app.NetAgent.sendReq2Lobby("Lobby", "modifyRoom", {
  2662. robot_count: i.robot_count + 1
  2663. }, function(e, i) {
  2664. (e || (i.error && 1111 != i.error.code)) && t.UIMgr.Inst.showNetReqError("modifyRoom_add", e, i), (o = 0);
  2665. }));
  2666. }, null, !1)), (this.container_right.getChildByName("btn_help").clickHandler = Laya.Handler.create(this, function() {
  2667. i.locking || t.UI_Rules.Inst.show();
  2668. }, null, !1));
  2669. var l = this.container_right.getChildByName("btn_copy");
  2670. l.on("mouseover", this, function() {
  2671. i.mousein_copy = !0;
  2672. }),
  2673. l.on("mouseout", this, function() {
  2674. i.mousein_copy = !1;
  2675. }), (l.clickHandler = Laya.Handler.create(this, function() {
  2676. i.popout.visible || (GameMgr.Inst.BehavioralStatistics(12), (i.popout.visible = !0), t.UIBase.anim_pop_out(i.popout, null));
  2677. }, null, !1)), (this.container_rules = this.container_right.getChildByName("container_rules")), (this.container_rules.visible = !0), (this.popout = this.me.getChildByName("pop")), (this.room_link = this.popout.getChildByName("input").getChildByName("txtinput")), (this.room_link.editable = !1), (this.btn_copy_link = this.popout.getChildByName("btn_copy")), (this.btn_copy_link.visible = !1),
  2678. GameMgr.inConch ? ((this.btn_copy_link.visible = !0), (this.btn_copy_link.clickHandler = Laya.Handler.create(this, function() {
  2679. Laya.PlatformClass.createClass("layaair.majsoul.mjmgr").call("setSysClipboardText", i.room_link.text),
  2680. t.UIBase.anim_pop_hide(i.popout, Laya.Handler.create(i, function() {
  2681. i.popout.visible = !1;
  2682. })),
  2683. t.UI_FlyTips.ShowTips(game.Tools.strOfLocalization(2125));
  2684. }, null, !1))) : GameMgr.iniOSWebview && ((this.btn_copy_link.visible = !0), (this.btn_copy_link.clickHandler = Laya.Handler.create(this, function() {
  2685. Laya.Browser.window.wkbridge.callNative("copy2clip", i.room_link.text, function() {}),
  2686. t.UIBase.anim_pop_hide(i.popout, Laya.Handler.create(i, function() {
  2687. i.popout.visible = !1;
  2688. })),
  2689. t.UI_FlyTips.ShowTips(game.Tools.strOfLocalization(2125));
  2690. }, null, !1))), (this.popout.visible = !1), (this.popout.getChildByName("btn_cancel").clickHandler = Laya.Handler.create(this, function() {
  2691. t.UIBase.anim_pop_hide(i.popout, Laya.Handler.create(i, function() {
  2692. i.popout.visible = !1;
  2693. }));
  2694. }, null, !1)), (this.invitefriend = new e(this.me.getChildByName("invite_friend")));
  2695. }), (n.prototype.show = function() {
  2696. var e = this;
  2697. game.Scene_Lobby.Inst.change_bg("indoor", !1), (this.mousein_copy = !1), (this.beReady = !1), (this.invitefriend.me.visible = !1), (this.btn_add_robot.visible = !1), (this.btn_invite_friend.visible = !1), (this.pre_choose = null);
  2698. for (h = 0; h < 4; h++) this.player_cells[h].container.visible = h < this.max_player_count;
  2699. for (h = 0; h < this.max_player_count; h++) this._clearCell(h);
  2700. for (h = 0; h < this.players.length; h++)
  2701. (this.players[h].cell_index = h),
  2702. this._refreshPlayerInfo(this.players[h]);
  2703. this.owner_id == GameMgr.Inst.account_id ? ((this.btn_ok.skin = game.Tools.localUISrc(this.skin_start)), this.refreshAsOwner()) : ((this.btn_ok.skin = game.Tools.localUISrc(this.skin_ready)), game.Tools.setGrayDisable(this.btn_ok, !1)), "en" == GameMgr.client_language ? (this.label_rommid.text = "#" + this.room_id.toString()) : (this.label_rommid.text = this.room_id.toString()), (this.container_rules.visible = !0);
  2704. for (h = 0; h < this.container_rules.numChildren; h++) this.container_rules.getChildAt(h).visible = !1;
  2705. var i = [];
  2706. i.push(game.Tools.room_mode_desc(this.room_mode.mode));
  2707. var n = this.room_mode.detail_rule;
  2708. if (n) {
  2709. var a = 5,
  2710. r = 20;
  2711. if (
  2712. (null != n.time_fixed && (a = n.time_fixed), null != n.time_add && (r = n.time_add), i.push(a.toString() + "+" + r.toString() + game.Tools.strOfLocalization(2019)), 0 != this.tournament_id)) {
  2713. var s = cfg.tournament.tournaments.get(this.tournament_id);
  2714. s && i.push(s.name);
  2715. }
  2716. if (
  2717. (null != n.init_point && i.push(game.Tools.strOfLocalization(2199) + n.init_point), null != n.fandian && i.push(game.Tools.strOfLocalization(2094) + ":" + n.fandian), null != n.dora_count)) switch (n.dora_count) {
  2718. case 0:
  2719. i.push(game.Tools.strOfLocalization(2044));
  2720. break;
  2721. case 2:
  2722. i.push(game.Tools.strOfLocalization(2047));
  2723. break;
  2724. case 3:
  2725. i.push(game.Tools.strOfLocalization(2045));
  2726. break;
  2727. case 4:
  2728. i.push(game.Tools.strOfLocalization(2046));
  2729. }
  2730. null != n.shiduan && 1 != n.shiduan && i.push(game.Tools.strOfLocalization(2137)),
  2731. null != n.bianjietishi && 1 != n.bianjietishi && i.push(game.Tools.strOfLocalization(2200)),
  2732. this.room_mode.mode >= 10 && this.room_mode.mode <= 14 && (null != n.have_zimosun && 1 != n.have_zimosun ? i.push(game.Tools.strOfLocalization(2202)) : i.push(game.Tools.strOfLocalization(2203)));
  2733. }
  2734. this.public_live && i.push(game.Tools.strOfLocalization(2220));
  2735. for (h = 0; h < i.length; h++) {
  2736. var o = this.container_rules.getChildAt(h);
  2737. (o.visible = !0), (o.x = 6), (o.y = 334 - 68 * (i.length - 1 - h));
  2738. var l = o.getChildAt(0);
  2739. (l.fontSize = 40),
  2740. i[h].length <= 5 ? (l.fontSize = 40) : i[h].length <= 9 ? (l.fontSize = 52.5 - 2.5 * i[h].length) : (l.fontSize = 30), (l.text = i[h]);
  2741. }
  2742. (this.enable = !0), (this.locking = !0),
  2743. t.UIBase.anim_alpha_in(this.container_top, {
  2744. y: -30
  2745. }, 200);
  2746. for (var h = 0; h < this.player_cells.length; h++) t.UIBase.anim_alpha_in(this.player_cells[h].container, {
  2747. x: 80
  2748. }, 150, 150 + 50 * h, null, Laya.Ease.backOut);
  2749. t.UIBase.anim_alpha_in(this.btn_ok, {}, 100, 600),
  2750. t.UIBase.anim_alpha_in(this.container_right, {
  2751. x: 20
  2752. }, 100, 500),
  2753. Laya.timer.once(600, this, function() {
  2754. e.locking = !1;
  2755. });
  2756. var c = game.Tools.room_mode_desc(this.room_mode.mode);
  2757. (this.room_link.text = game.Tools.strOfLocalization(2221, [
  2758. this.room_id.toString()
  2759. ])), "" != c && (this.room_link.text += "(" + c + ")"), (this.room_link.text += ": " + GameMgr.Inst.link_url + "?room=" + this.room_id);
  2760. }), (n.prototype.leaveRoom = function() {
  2761. var e = this;
  2762. this.locking || app.NetAgent.sendReq2Lobby("Lobby", "leaveRoom", {}, function(i, n) {
  2763. i || n.error ? t.UIMgr.Inst.showNetReqError("leaveRoom", i, n) : e.hide(Laya.Handler.create(e, function() {
  2764. t.UI_Lobby.Inst.enable = !0;
  2765. }));
  2766. });
  2767. }), (n.prototype.tryToClose = function(e) {
  2768. var i = this;
  2769. app.NetAgent.sendReq2Lobby("Lobby", "leaveRoom", {}, function(n, a) {
  2770. n || a.error ? (t.UIMgr.Inst.showNetReqError("leaveRoom", n, a), e.runWith(!1)) : ((i.enable = !1), e.runWith(!0));
  2771. });
  2772. }), (n.prototype.hide = function(e) {
  2773. var i = this;
  2774. (this.locking = !0),
  2775. t.UIBase.anim_alpha_out(this.container_top, {
  2776. y: -30
  2777. }, 150);
  2778. for (var n = 0; n < this.player_cells.length; n++) t.UIBase.anim_alpha_out(this.player_cells[n].container, {
  2779. x: 80
  2780. }, 150, 0, null);
  2781. t.UIBase.anim_alpha_out(this.btn_ok, {}, 150),
  2782. t.UIBase.anim_alpha_out(this.container_right, {
  2783. x: 20
  2784. }, 150),
  2785. Laya.timer.once(200, this, function() {
  2786. (i.locking = !1), (i.enable = !1), e && e.run();
  2787. }), (document.getElementById("layaCanvas").onclick = null);
  2788. }), (n.prototype.onDisbale = function() {
  2789. Laya.timer.clearAll(this);
  2790. for (var t = 0; t < this.player_cells.length; t++) Laya.loader.clearTextureRes(this.player_cells[t].illust.skin);
  2791. document.getElementById("layaCanvas").onclick = null;
  2792. }), (n.prototype.switchReady = function() {
  2793. this.owner_id != GameMgr.Inst.account_id && ((this.beReady = !this.beReady), (this.btn_ok.skin = game.Tools.localUISrc(this.beReady ? this.skin_cancel : this.skin_ready)), app.NetAgent.sendReq2Lobby("Lobby", "readyPlay", {
  2794. ready: this.beReady
  2795. }, function(t, e) {}));
  2796. }), (n.prototype.getStart = function() {
  2797. this.owner_id == GameMgr.Inst.account_id && (Laya.timer.currTimer < this.last_start_room + 2e3 || ((this.last_start_room = Laya.timer.currTimer), app.NetAgent.sendReq2Lobby("Lobby", "startRoom", {}, function(e, i) {
  2798. (e || i.error) && t.UIMgr.Inst.showNetReqError("startRoom", e, i);
  2799. })));
  2800. }), (n.prototype.kickPlayer = function(e) {
  2801. if (this.owner_id == GameMgr.Inst.account_id) {
  2802. var i = this.players[e];
  2803. 1 == i.category ? app.NetAgent.sendReq2Lobby("Lobby", "kickPlayer", {
  2804. account_id: this.players[e].account_id
  2805. }, function(t, e) {}) : 2 == i.category && ((this.pre_choose = i), app.NetAgent.sendReq2Lobby("Lobby", "modifyRoom", {
  2806. robot_count: this.robot_count - 1
  2807. }, function(e, i) {
  2808. (e || i.error) && t.UIMgr.Inst.showNetReqError("modifyRoom_minus", e, i);
  2809. }));
  2810. }
  2811. }), (n.prototype._clearCell = function(t) {
  2812. if (!(t < 0 || t >= this.player_cells.length)) {
  2813. var e = this.player_cells[t];
  2814. (e.container_flag.visible = !1), (e.container_illust.visible = !1), (e.name.visible = !1), (e.container_name.visible = !1), (e.btn_t.visible = !1), (e.host.visible = !1);
  2815. }
  2816. }), (n.prototype._refreshPlayerInfo = function(t) {
  2817. var e = t.cell_index;
  2818. if (!(e < 0 || e >= this.player_cells.length)) {
  2819. var i = this.player_cells[e];
  2820. (i.container_illust.visible = !0), (i.container_name.visible = !0), (i.name.visible = !0), (i.name.text = t.nickname), (i.btn_t.visible = this.owner_id == GameMgr.Inst.account_id && t.account_id != GameMgr.Inst.account_id),
  2821. this.owner_id == t.account_id && ((i.container_flag.visible = !0), (i.host.visible = !0)),
  2822. i.illust.setSkin(t.avatar_id, "waitingroom"), (i.title.id = game.Tools.titleLocalization(t.account_id, t.title)), (i.rank.id = t.level.id),
  2823. this._onPlayerReadyChange(t);
  2824. }
  2825. }), (n.prototype._onPlayerReadyChange = function(t) {
  2826. var e = t.cell_index;
  2827. if (!(e < 0 || e >= this.player_cells.length)) {
  2828. var i = this.player_cells[e];
  2829. this.owner_id == t.account_id ? (i.container_flag.visible = !0) : (i.container_flag.visible = t.ready),
  2830. this.refreshStart();
  2831. }
  2832. }), (n.prototype.refreshAsOwner = function() {
  2833. if (this.owner_id == GameMgr.Inst.account_id) {
  2834. for (var t = 0, e = 0; e < this.players.length; e++) 0 != this.players[e].category && (this._refreshPlayerInfo(this.players[e]), t++);
  2835. (this.btn_add_robot.visible = !0), (this.btn_invite_friend.visible = !0),
  2836. game.Tools.setGrayDisable(this.btn_add_robot, t == this.max_player_count),
  2837. this.refreshStart();
  2838. }
  2839. }), (n.prototype.refreshStart = function() {
  2840. if (this.owner_id == GameMgr.Inst.account_id) {
  2841. this.btn_ok.skin = game.Tools.localUISrc(this.skin_start);
  2842. for (var t = 0, e = 0; e < this.players.length; e++)
  2843. if (0 != this.players[e].category && (!this.players[e] || this.players[e].account_id != this.owner_id)) {
  2844. if (!this.players[e] || null == this.players[e].ready || void 0 == this.players[e].ready || !this.players[e].ready) return void game.Tools.setGrayDisable(this.btn_ok, !0);
  2845. t++;
  2846. }
  2847. game.Tools.setGrayDisable(this.btn_ok, t + 1 != this.max_player_count);
  2848. }
  2849. }), (n.prototype.onGameStart = function(t) {
  2850. game.Tools.setGrayDisable(this.btn_ok, !0), (this.enable = !1),
  2851. game.MJNetMgr.Inst.OpenConnect(t.connect_token, t.game_uuid, t.location, !1, null);
  2852. }), (n.Inst = null), n);
  2853. })(t.UIBase);
  2854. t.UI_WaitingRoom = i;
  2855. })(uiscript || (uiscript = {}));
  2856. }, 5000);
  2857. })(), 100);