6b4eb702-4f49-4486-8659-589195734612.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. "use strict";
  2. cc._RF.push(module, '6b4ebcCT0lEhoZZWJGVc0YS', 'UIUpgradePanel');
  3. // scripts/UI/UIUpgradePanel.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  25. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  26. return new (P || (P = Promise))(function (resolve, reject) {
  27. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  29. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  30. step((generator = generator.apply(thisArg, _arguments || [])).next());
  31. });
  32. };
  33. var __generator = (this && this.__generator) || function (thisArg, body) {
  34. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  35. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  36. function verb(n) { return function (v) { return step([n, v]); }; }
  37. function step(op) {
  38. if (f) throw new TypeError("Generator is already executing.");
  39. while (_) try {
  40. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  41. if (y = 0, t) op = [op[0] & 2, t.value];
  42. switch (op[0]) {
  43. case 0: case 1: t = op; break;
  44. case 4: _.label++; return { value: op[1], done: false };
  45. case 5: _.label++; y = op[1]; op = [0]; continue;
  46. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  47. default:
  48. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  49. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  50. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  51. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  52. if (t[2]) _.ops.pop();
  53. _.trys.pop(); continue;
  54. }
  55. op = body.call(thisArg, _);
  56. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  57. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  58. }
  59. };
  60. Object.defineProperty(exports, "__esModule", { value: true });
  61. var UIPage_1 = require("../Framework/UIPage");
  62. var Constant_1 = require("../Framework/Constant");
  63. var CocosZ_1 = require("../Framework/CocosZ");
  64. var Utils_1 = require("../../common-plugin/Scripts/Utils");
  65. var TweenEffect_1 = require("../Framework/TweenEffect");
  66. var UpgradeMgr_1 = require("../Game/UpgradeMgr");
  67. var PlatUtils_1 = require("../../common-plugin/Scripts/PlatUtils");
  68. var gameMgr_1 = require("../Game/gameMgr");
  69. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  70. /**
  71. * 皮肤试用面板
  72. */
  73. var UIUpgradePanel = /** @class */ (function (_super) {
  74. __extends(UIUpgradePanel, _super);
  75. function UIUpgradePanel() {
  76. var _this = _super.call(this, Constant_1.PanelName.UIUpgradePanel) || this;
  77. _this._mask = null;
  78. _this._panel = null;
  79. _this._skill0 = null;
  80. _this._skill1 = null;
  81. _this._skill2 = null;
  82. _this._skill3 = null;
  83. _this._skill4 = null;
  84. _this._btnRefresh = null;
  85. _this._betterArr = [];
  86. _this._otherArr = []; // 可以获取的技能数组
  87. _this._uiSkillIdArr = []; // 随机4个技能
  88. _this._curIndex = -1; // 当前选中下标
  89. _this._canClick = true; // 能否点击
  90. _this._lockArr = [false, false, false, false, false];
  91. _this.isValid() && _this.onLoad();
  92. return _this;
  93. }
  94. UIUpgradePanel.prototype.onLoad = function () {
  95. this._mask = this._page.getChildByName("Mask");
  96. this._panel = this._page.getChildByName("Panel");
  97. var btnNames = ["skill0", "skill1", "skill2", "skill3", "skill4", "btnRefresh"];
  98. for (var i = 0; i < btnNames.length; i++) {
  99. var btn = cc.find(btnNames[i], this._panel);
  100. if (btn) {
  101. btn.on(cc.Node.EventType.TOUCH_END, this._onBtnClickedHandler, this);
  102. if (btn.name == "skill0") {
  103. this._skill0 = btn;
  104. }
  105. else if (btn.name == "skill1") {
  106. this._skill1 = btn;
  107. }
  108. else if (btn.name == "skill2") {
  109. this._skill2 = btn;
  110. }
  111. else if (btn.name == "skill3") {
  112. this._skill3 = btn;
  113. }
  114. else if (btn.name == "skill4") {
  115. this._skill4 = btn;
  116. }
  117. else if (btn.name == "btnRefresh") {
  118. this._btnRefresh = btn;
  119. btn.active = CocosZ_1.cocosz.isADON;
  120. }
  121. }
  122. }
  123. // 服务器锁的数量
  124. var serverValue = CocosZ_1.cocosz.getConfigByKey("skillLockNum");
  125. if (Number.isInteger(serverValue)) {
  126. for (var i = 0; i < 5; i++) {
  127. if (i + serverValue >= 5) {
  128. this._lockArr[i] = true;
  129. }
  130. else {
  131. this._lockArr[i] = false;
  132. }
  133. }
  134. }
  135. };
  136. UIUpgradePanel.prototype.onOpen = function () {
  137. Utils_1.utils.SendEvent("页面-技能");
  138. // 优先技能数组
  139. var better = [
  140. UpgradeMgr_1.SkillType.双发, UpgradeMgr_1.SkillType.子弹碎片, UpgradeMgr_1.SkillType.枪林弹雨, UpgradeMgr_1.SkillType.谢幕,
  141. UpgradeMgr_1.SkillType.瞬斩, UpgradeMgr_1.SkillType.冰霜精通, UpgradeMgr_1.SkillType.火焰精通, UpgradeMgr_1.SkillType.萃取,
  142. UpgradeMgr_1.SkillType.再生, UpgradeMgr_1.SkillType.护甲靴子, UpgradeMgr_1.SkillType.疾走, UpgradeMgr_1.SkillType.神圣守护,
  143. UpgradeMgr_1.SkillType.通灵匕首, UpgradeMgr_1.SkillType.飞轮, UpgradeMgr_1.SkillType.闪电, UpgradeMgr_1.SkillType.燃烧瓶
  144. ];
  145. // 可以获取的技能数组
  146. for (var i = 0; i <= 34; i++) {
  147. if ([UpgradeMgr_1.SkillType.雷电精通, UpgradeMgr_1.SkillType.龙卵, UpgradeMgr_1.SkillType.通灵镰刀].includes(i)) {
  148. // 剔除的技能
  149. }
  150. else if (UpgradeMgr_1.upgradeMgr && UpgradeMgr_1.upgradeMgr.isValid && UpgradeMgr_1.upgradeMgr.upgradeSkillArr[i] >= UpgradeMgr_1.upgradeMgr.upgradeSkillMaxLevelArr[i]) {
  151. // 达到最大级
  152. }
  153. else if (better.includes(i)) {
  154. // 优先数组
  155. this._betterArr.push(i);
  156. }
  157. else {
  158. // 其它数组
  159. this._otherArr.push(i);
  160. }
  161. }
  162. this._initPanel();
  163. if (PlatUtils_1.default.IsWechat) {
  164. Utils_1.utils.adManager.hideCustomAd({ location: 3 });
  165. Utils_1.utils.adManager.hideCustomAd({ location: 4 });
  166. }
  167. };
  168. UIUpgradePanel.prototype.onClose = function () {
  169. CocosZ_1.cocosz.pauseCount--;
  170. if (PlatUtils_1.default.IsWechat) {
  171. Utils_1.utils.adManager.showCustomAd({ location: 3 });
  172. Utils_1.utils.adManager.showCustomAd({ location: 4 });
  173. }
  174. };
  175. UIUpgradePanel.prototype._initPanel = function () {
  176. TweenEffect_1.default.panel_mask_opacity(this._mask);
  177. TweenEffect_1.default.panel_open_moveY(this._panel);
  178. this._curIndex = -1;
  179. // 刷新技能
  180. this._skill_refresh();
  181. };
  182. /**
  183. * 所有按钮点击事件
  184. * @param event
  185. * @param data
  186. */
  187. UIUpgradePanel.prototype._onBtnClickedHandler = function (event, data) {
  188. return __awaiter(this, void 0, void 0, function () {
  189. var callback_1, lockNode;
  190. var _this = this;
  191. return __generator(this, function (_a) {
  192. switch (_a.label) {
  193. case 0:
  194. //播放按钮点击音效
  195. return [4 /*yield*/, CocosZ_1.cocosz.audioMgr.playBtnEffect().catch()];
  196. case 1:
  197. //播放按钮点击音效
  198. _a.sent();
  199. if (!this._canClick)
  200. return [2 /*return*/];
  201. switch (event.target.name) {
  202. case "btnRefresh": {
  203. this._canClick = false;
  204. // 分享
  205. if (event.target.getChildByName("share") && event.target.getChildByName("share").active) {
  206. Utils_1.utils.SendEvent("分享-刷新技能");
  207. CocosZ_1.cocosz.share(function () {
  208. Utils_1.utils.SendEvent("分享-刷新技能-成功");
  209. _this._skill_refresh();
  210. _this._canClick = true;
  211. }, function () {
  212. Utils_1.utils.SendEvent("分享-刷新技能-失败");
  213. _this._canClick = true;
  214. });
  215. }
  216. // 视频
  217. else if (event.target.getChildByName("video") && event.target.getChildByName("video").active) {
  218. Utils_1.utils.SendEvent("视频-技能刷新(地下城僵尸)-播放");
  219. CocosZ_1.cocosz.watchAD(function () {
  220. Utils_1.utils.SendEvent("视频-技能刷新(地下城僵尸)-成功");
  221. _this._skill_refresh();
  222. _this._canClick = true;
  223. }, function () {
  224. Utils_1.utils.SendEvent("视频-技能刷新(地下城僵尸)-失败");
  225. _this._canClick = true;
  226. });
  227. }
  228. break;
  229. }
  230. case "skill0":
  231. case "skill1":
  232. case "skill2":
  233. case "skill3":
  234. case "skill4": {
  235. this._canClick = false;
  236. callback_1 = function () {
  237. if ("skill0" == event.target.name)
  238. _this._curIndex = 0;
  239. else if ("skill1" == event.target.name)
  240. _this._curIndex = 1;
  241. else if ("skill2" == event.target.name)
  242. _this._curIndex = 2;
  243. else if ("skill3" == event.target.name)
  244. _this._curIndex = 3;
  245. else if ("skill4" == event.target.name)
  246. _this._curIndex = 4;
  247. // 刷新
  248. _this.updateFrame();
  249. // 选中技能
  250. _this._selectSkill();
  251. };
  252. lockNode = event.target.getChildByName("lock");
  253. if (lockNode && lockNode.active) {
  254. // 分享
  255. if (lockNode.getChildByName("share") && lockNode.getChildByName("share").active) {
  256. Utils_1.utils.SendEvent("分享-技能解锁");
  257. CocosZ_1.cocosz.share(function () {
  258. Utils_1.utils.SendEvent("分享-技能解锁-成功");
  259. callback_1 && callback_1();
  260. }, function () {
  261. Utils_1.utils.SendEvent("分享-技能解锁-失败");
  262. _this._canClick = true;
  263. });
  264. }
  265. // 视频
  266. else if (lockNode.getChildByName("video") && lockNode.getChildByName("video").active) {
  267. Utils_1.utils.SendEvent("视频-技能解锁-播放");
  268. CocosZ_1.cocosz.watchAD(function () {
  269. Utils_1.utils.SendEvent("视频-技能解锁-成功");
  270. callback_1 && callback_1();
  271. }, function () {
  272. Utils_1.utils.SendEvent("视频-技能解锁-失败");
  273. _this._canClick = true;
  274. });
  275. }
  276. else {
  277. callback_1 && callback_1();
  278. }
  279. }
  280. else {
  281. callback_1 && callback_1();
  282. }
  283. break;
  284. }
  285. }
  286. return [2 /*return*/];
  287. }
  288. });
  289. });
  290. };
  291. UIUpgradePanel.prototype._selectSkill = function () {
  292. var _this = this;
  293. this._canClick = false;
  294. // 获取技能
  295. if (this._uiSkillIdArr[this._curIndex]) {
  296. UpgradeMgr_1.upgradeMgr && UpgradeMgr_1.upgradeMgr.isValid && UpgradeMgr_1.upgradeMgr.getSkill(this._uiSkillIdArr[this._curIndex]);
  297. }
  298. // 卡片效果
  299. var arr = [this._skill0, this._skill1, this._skill2, this._skill3, this._skill4];
  300. arr.forEach(function (v, i) {
  301. if (i == _this._curIndex) {
  302. _this.card_click(v);
  303. }
  304. else {
  305. _this.card_recycle(v);
  306. }
  307. });
  308. // 关闭弹窗
  309. CocosZ_1.cocosz.scheduleOnce(function () {
  310. CocosZ_1.cocosz.uiMgr.closePanel(Constant_1.PanelName.UIUpgradePanel);
  311. if (gameMgr_1.gameMgr && gameMgr_1.gameMgr.playerTs && gameMgr_1.gameMgr.playerTs.isValid) {
  312. gameMgr_1.gameMgr.playerTs.avoidInjury(2);
  313. }
  314. }, 1.5);
  315. };
  316. UIUpgradePanel.prototype._getSkillIDName = function (id) {
  317. return id + (UpgradeMgr_1.upgradeMgr.upgradeSkillMaxLevelArr[id] > 1 ? "_" + (UpgradeMgr_1.upgradeMgr.upgradeSkillArr[id] + 1) : "");
  318. };
  319. UIUpgradePanel.prototype._skill_load = function (card, id) {
  320. // 名字
  321. var node_name = card.getChildByName("name");
  322. if (node_name) {
  323. var spr_name_1 = node_name.getComponent(cc.Sprite);
  324. if (spr_name_1) {
  325. CocosZ_1.cocosz.resMgr.loadAndCacheRes("i18n/tex_zombie/" + CocosZ_1.cocosz.curLanguage + "/zombieSkill_name_" + this._getSkillIDName(id), cc.SpriteFrame, null, function (err, res) {
  326. if (spr_name_1 && spr_name_1.isValid) {
  327. spr_name_1.spriteFrame = res;
  328. }
  329. });
  330. }
  331. }
  332. // 图标
  333. var node_icon = card.getChildByName("icon");
  334. if (node_icon) {
  335. var spr_icon_1 = node_icon.getComponent(cc.Sprite);
  336. if (spr_icon_1) {
  337. CocosZ_1.cocosz.resMgr.loadAndCacheRes("tex_zombie/zombieSkill_icon_" + this._getSkillIDName(id), cc.SpriteFrame, null, function (err, res) {
  338. if (spr_icon_1 && spr_icon_1.isValid) {
  339. spr_icon_1.spriteFrame = res;
  340. }
  341. });
  342. }
  343. }
  344. // 介绍
  345. var node_introduce = card.getChildByName("introduce");
  346. if (node_introduce) {
  347. var spr_introduce_1 = node_introduce.getComponent(cc.Sprite);
  348. if (spr_introduce_1) {
  349. CocosZ_1.cocosz.resMgr.loadAndCacheRes("i18n/tex_zombie/" + CocosZ_1.cocosz.curLanguage + "/zombieSkill_introduce_" + this._getSkillIDName(id), cc.SpriteFrame, null, function (err, res) {
  350. if (spr_introduce_1 && spr_introduce_1.isValid) {
  351. spr_introduce_1.spriteFrame = res;
  352. }
  353. });
  354. }
  355. }
  356. };
  357. /** 技能刷新 */
  358. UIUpgradePanel.prototype._skill_refresh = function () {
  359. var _a;
  360. this._uiSkillIdArr.length = 0;
  361. // 从技能数组中获取5个技能
  362. if (this._betterArr.length) {
  363. for (var i = Math.min(5 - this._uiSkillIdArr.length, this._betterArr.length); i > 0; i--) {
  364. var index = Math.floor(Math.random() * this._betterArr.length);
  365. if (this._betterArr[index] >= 0) {
  366. this._uiSkillIdArr.push(this._betterArr[index]);
  367. this._betterArr.splice(index, 1);
  368. }
  369. }
  370. }
  371. if (this._otherArr.length) {
  372. for (var i = Math.min(5 - this._uiSkillIdArr.length, this._otherArr.length); i > 0; i--) {
  373. var index = Math.floor(Math.random() * this._otherArr.length);
  374. if (this._otherArr[index] >= 0) {
  375. this._uiSkillIdArr.push(this._otherArr[index]);
  376. this._otherArr.splice(index, 1);
  377. }
  378. }
  379. }
  380. // 排序
  381. for (var i = 0; i < this._uiSkillIdArr.length; i++) {
  382. // 3级技能(非视频位置)
  383. if (UpgradeMgr_1.upgradeMgr.upgradeSkillArr[this._uiSkillIdArr[i]] == 2 && !this._lockArr[i]) {
  384. // 与视频位置交换
  385. for (var j = this._uiSkillIdArr.length - 1; j > i; j--) {
  386. if (this._lockArr[j] && UpgradeMgr_1.upgradeMgr.upgradeSkillArr[this._uiSkillIdArr[j]] != 2) {
  387. // 交换
  388. _a = [this._uiSkillIdArr[j], this._uiSkillIdArr[i]], this._uiSkillIdArr[i] = _a[0], this._uiSkillIdArr[j] = _a[1];
  389. }
  390. }
  391. }
  392. }
  393. // 技能0 ///////////////////////////////////////////////////////////////////////////////////////////////
  394. if (this._uiSkillIdArr[0] >= 0) {
  395. this._skill0.active = true;
  396. var id = this._uiSkillIdArr[0];
  397. this._skill_load(this._skill0, id);
  398. }
  399. else {
  400. this._skill0.active = false;
  401. }
  402. // 技能1 ///////////////////////////////////////////////////////////////////////////////////////////////
  403. if (this._uiSkillIdArr[1] >= 0) {
  404. this._skill1.active = true;
  405. var id = this._uiSkillIdArr[1];
  406. this._skill_load(this._skill1, id);
  407. }
  408. else {
  409. this._skill1.active = false;
  410. }
  411. // 技能2 ///////////////////////////////////////////////////////////////////////////////////////////////
  412. if (this._uiSkillIdArr[2] >= 0) {
  413. this._skill2.active = true;
  414. var id = this._uiSkillIdArr[2];
  415. this._skill_load(this._skill2, id);
  416. }
  417. else {
  418. this._skill2.active = false;
  419. }
  420. // 技能3 ///////////////////////////////////////////////////////////////////////////////////////////////
  421. if (this._uiSkillIdArr[3] >= 0) {
  422. this._skill3.active = true;
  423. var id = this._uiSkillIdArr[3];
  424. this._skill_load(this._skill3, id);
  425. }
  426. else {
  427. this._skill3.active = false;
  428. }
  429. // 技能4 ///////////////////////////////////////////////////////////////////////////////////////////////
  430. if (this._uiSkillIdArr[4] >= 0) {
  431. this._skill4.active = true;
  432. var id = this._uiSkillIdArr[4];
  433. this._skill_load(this._skill4, id);
  434. }
  435. else {
  436. this._skill4.active = false;
  437. }
  438. // 视频按钮隐藏
  439. if (this._otherArr.length == 0 && this._btnRefresh && this._btnRefresh.active) {
  440. this._btnRefresh.active = false;
  441. }
  442. this.updateFrame();
  443. };
  444. // 更新外发光
  445. UIUpgradePanel.prototype.updateFrame = function () {
  446. // 选中框
  447. this._skill0.children[0].active = (this._curIndex == 0);
  448. this._skill1.children[0].active = (this._curIndex == 1);
  449. this._skill2.children[0].active = (this._curIndex == 2);
  450. this._skill3.children[0].active = (this._curIndex == 3);
  451. this._skill4.children[0].active = (this._curIndex == 4);
  452. // 解锁框
  453. this._skill0.children[5].active = this._lockArr[0] && this._curIndex != 0;
  454. this._skill1.children[5].active = this._lockArr[1] && this._curIndex != 1;
  455. this._skill2.children[5].active = this._lockArr[2] && this._curIndex != 2;
  456. this._skill3.children[5].active = this._lockArr[3] && this._curIndex != 3;
  457. this._skill4.children[5].active = this._lockArr[4] && this._curIndex != 4;
  458. };
  459. /** 卡牌选中特效 */
  460. UIUpgradePanel.prototype.card_click = function (card) {
  461. card.zIndex = cc.macro.MAX_ZINDEX;
  462. cc.tween(card)
  463. .to(0.5, { x: 0, y: 200 }, { easing: "sineIn" })
  464. .to(1, { scale: 2, opacity: 0 }, { easing: "fade" })
  465. .start();
  466. };
  467. /** 卡牌回收 */
  468. UIUpgradePanel.prototype.card_recycle = function (card) {
  469. var btnUnLock = card.getChildByName("btnUnLock");
  470. if (btnUnLock)
  471. btnUnLock.active = false;
  472. cc.tween(card)
  473. .to(0.5, { opacity: 0 }, { easing: "sineIn" })
  474. .start();
  475. };
  476. UIUpgradePanel = __decorate([
  477. ccclass
  478. ], UIUpgradePanel);
  479. return UIUpgradePanel;
  480. }(UIPage_1.default));
  481. exports.default = UIUpgradePanel;
  482. cc._RF.pop();