CostumeMergeItem.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. e =
  5. (this && this.__decorate) ||
  6. function (t, e, i, s) {
  7. var o,
  8. a = arguments.length,
  9. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  10. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  11. else
  12. for (var r = t.length - 1; 0 <= r; r--)
  13. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  14. return 3 < a && n && Object.defineProperty(e, i, n), n;
  15. };
  16. Object.defineProperty(i, "__esModule", {value: !0}), (i.CostumeMergeItem = void 0);
  17. const s = t("App"),
  18. o = t("ItemRenderer"),
  19. a = (t("ViewConst"), t("GameConst")),
  20. n = t("CostumeConst"),
  21. {ccclass: r, property: l} = cc._decorator;
  22. t = class extends o.default {
  23. constructor() {
  24. super(...arguments),
  25. (this.typeIcon = null),
  26. (this.icon = null),
  27. (this.bgNode = null),
  28. (this.equipNode = null),
  29. (this.lvLab = null),
  30. (this.arrowList = null),
  31. (this.data = null),
  32. (this.redpointImg = null);
  33. }
  34. setData(t) {
  35. (this.data = t),
  36. (this.lvLab.string = "Lv." + t.data.lv),
  37. s.default.CommonUtils.setSpriteFrame(
  38. n.getRarityUrlByGrade(t.data.grade),
  39. this.bgNode.getComponent(cc.Sprite)
  40. ),
  41. (this.equipNode.active = t.isEquip),
  42. s.default.CommonUtils.setSpriteFrameByBundle(a.BundleType.MAP_ICON, t.getIcon(), this.icon),
  43. s.default.CommonUtils.setSpriteFrameByBundle(a.BundleType.MAP_ICON, t.getTypeIcon(), this.typeIcon);
  44. var e = n.getGradeLv(t.data.grade);
  45. const i = this.arrowList.children;
  46. for (let t = 0; t < i.length; t++) i[t].active = t < e;
  47. this.redpointImg.active = t.canMerge;
  48. }
  49. onToucItem() {
  50. s.default.ViewManager.open(26, this.data);
  51. }
  52. };
  53. e([l(cc.Sprite)], t.prototype, "typeIcon", void 0),
  54. e([l(cc.Sprite)], t.prototype, "icon", void 0),
  55. e([l(cc.Node)], t.prototype, "bgNode", void 0),
  56. e([l(cc.Node)], t.prototype, "equipNode", void 0),
  57. e([l(cc.Label)], t.prototype, "lvLab", void 0),
  58. e([l(cc.Node)], t.prototype, "arrowList", void 0),
  59. e([l(cc.Node)], t.prototype, "redpointImg", void 0),
  60. (t = e([r()], t)),
  61. (i.CostumeMergeItem = t);