CostumeMergeTipItem.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 a = t("App"),
  18. s = t("GameText"),
  19. n = t("CostumeConst"),
  20. {ccclass: o, property: r} = cc._decorator;
  21. t = class extends cc.Component {
  22. constructor() {
  23. super(...arguments),
  24. (this.descRichText = null),
  25. (this.baseItem = null),
  26. (this.newItem = null),
  27. (this.head_0 = null),
  28. (this.head_1 = null),
  29. (this.materialItems = []);
  30. }
  31. setData(t) {
  32. this.updateItem(this.baseItem, t.step),
  33. this.updateItem(this.newItem, t.step + 1),
  34. this.updateItem(this.materialItems[0], t.costume_type_grade),
  35. 2 === t.costume_count
  36. ? ((this.materialItems[1].active = !0), this.updateItem(this.materialItems[1], t.costume_type_grade))
  37. : (this.materialItems[1].active = !1);
  38. var e = 2 == t.ingredient_costume_type;
  39. (this.head_0.active = !e),
  40. (this.head_1.active = e),
  41. (this.descRichText.string = s.GameText.getTextByStr(t.costume_merge_desc));
  42. }
  43. updateItem(t, e) {
  44. var i = t.getComponent(cc.Sprite);
  45. a.default.CommonUtils.setSpriteFrame(n.getRarityUrlByGrade(e), i);
  46. const s = t.getChildByName("ArrowList").children;
  47. var o = n.getGradeLv(e);
  48. for (let t = 0; t < s.length; t++) s[t].active = t < o;
  49. }
  50. };
  51. e([r(cc.RichText)], t.prototype, "descRichText", void 0),
  52. e([r(cc.Node)], t.prototype, "baseItem", void 0),
  53. e([r(cc.Node)], t.prototype, "newItem", void 0),
  54. e([r(cc.Node)], t.prototype, "head_0", void 0),
  55. e([r(cc.Node)], t.prototype, "head_1", void 0),
  56. e([r([cc.Node])], t.prototype, "materialItems", void 0),
  57. (t = e([o], t)),
  58. (i.default = t);