HelperCatInfoItem.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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});
  17. const s = t("StopAutoDeclare"),
  18. o = t("GameText"),
  19. a = t("CostumeBagItem"),
  20. n = t("MainCat"),
  21. {ccclass: r, property: l} = cc._decorator;
  22. t = class extends s.default {
  23. constructor() {
  24. super(...arguments),
  25. (this.equipCostumeNode = null),
  26. (this.mainCat = null),
  27. (this.costumeBagEquipItems = []),
  28. (this.mainCatNode = null),
  29. (this.nameLab = null),
  30. (this.data = null);
  31. }
  32. onLoad() {
  33. for (const t of this.equipCostumeNode.children)
  34. this.costumeBagEquipItems.push(t.getComponent(a.CostumeBagItem));
  35. this.mainCat = this.mainCatNode.getComponent(n.default);
  36. }
  37. setData(e) {
  38. this.data = e;
  39. let i = this.costumeBagEquipItems.length;
  40. for (let t = 0; t < i; t++) {
  41. const i = this.costumeBagEquipItems[t],
  42. s = e.equipItems[t + 1];
  43. i.setData(s);
  44. }
  45. this.mainCat.updateSlot(e.equipItems), (this.nameLab.string = o.GameText.getTextByStr(e.cfg.name));
  46. }
  47. };
  48. e([l({type: cc.Node})], t.prototype, "equipCostumeNode", void 0),
  49. e([l(cc.Node)], t.prototype, "mainCatNode", void 0),
  50. e([l({type: cc.Label})], t.prototype, "nameLab", void 0),
  51. (t = e([r], t)),
  52. (i.default = t);