028596f1c2bec2447564ff3f8a959a9bf739859b.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Sprite, Label, ProgressBar, ListItem, ResUtil, _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _crd, ccclass, property, GunAttrItem;
  4. function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
  5. function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
  6. function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
  7. function _reportPossibleCrUseOfListItem(extras) {
  8. _reporterNs.report("ListItem", "../../third/ListItem", _context.meta, extras);
  9. }
  10. function _reportPossibleCrUseOfResUtil(extras) {
  11. _reporterNs.report("ResUtil", "../../utils/ResUtil", _context.meta, extras);
  12. }
  13. return {
  14. setters: [function (_unresolved_) {
  15. _reporterNs = _unresolved_;
  16. }, function (_cc) {
  17. _cclegacy = _cc.cclegacy;
  18. __checkObsolete__ = _cc.__checkObsolete__;
  19. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  20. _decorator = _cc._decorator;
  21. Sprite = _cc.Sprite;
  22. Label = _cc.Label;
  23. ProgressBar = _cc.ProgressBar;
  24. }, function (_unresolved_2) {
  25. ListItem = _unresolved_2.default;
  26. }, function (_unresolved_3) {
  27. ResUtil = _unresolved_3.ResUtil;
  28. }],
  29. execute: function () {
  30. _crd = true;
  31. _cclegacy._RF.push({}, "2de32DH/ZFOOK0Lwiy3r4Yj", "GunAttrItem", undefined);
  32. __checkObsolete__(['_decorator', 'Sprite', 'Label', 'ProgressBar']);
  33. ({
  34. ccclass,
  35. property
  36. } = _decorator); //枪的属性数据
  37. /*attr_name attr_value attr_icon max_value attribute_lang*/
  38. _export("GunAttrItem", GunAttrItem = (_dec = ccclass('GunAttrItem'), _dec2 = property({
  39. type: Sprite,
  40. tooltip: "枪的属性图片"
  41. }), _dec3 = property({
  42. type: ProgressBar,
  43. tooltip: "属性值的最大进度"
  44. }), _dec4 = property({
  45. type: Label,
  46. tooltip: "属性值的数据文本"
  47. }), _dec5 = property({
  48. type: Label,
  49. tooltip: "枪的属性多语言名字"
  50. }), _dec(_class = (_class2 = class GunAttrItem extends (_crd && ListItem === void 0 ? (_reportPossibleCrUseOfListItem({
  51. error: Error()
  52. }), ListItem) : ListItem) {
  53. constructor() {
  54. super(...arguments);
  55. _initializerDefineProperty(this, "attr_sp", _descriptor, this);
  56. _initializerDefineProperty(this, "progressBar", _descriptor2, this);
  57. _initializerDefineProperty(this, "atts_label", _descriptor3, this);
  58. _initializerDefineProperty(this, "attribute_lang_lable", _descriptor4, this);
  59. this.data = null;
  60. }
  61. start() {}
  62. /**
  63. * 数据填充
  64. * @param data 数据
  65. * @param cb 回调
  66. */
  67. init(data, cb) {
  68. if (!data) return;
  69. this.data = data; //设置属性图标
  70. (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
  71. error: Error()
  72. }), ResUtil) : ResUtil).setSpriteFrame(data.attr_icon, this.attr_sp); // 设置进度条 当前值/最大值
  73. this.progressBar.progress = data.attr_value / data.totalValue; //设置属性数值文本
  74. this.atts_label.string = data.attr_value + "/" + data.totalValue; //设置多语言属性名称
  75. this.attribute_lang_lable.string = data.attribute_lang;
  76. }
  77. }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "attr_sp", [_dec2], {
  78. configurable: true,
  79. enumerable: true,
  80. writable: true,
  81. initializer: null
  82. }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "progressBar", [_dec3], {
  83. configurable: true,
  84. enumerable: true,
  85. writable: true,
  86. initializer: null
  87. }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "atts_label", [_dec4], {
  88. configurable: true,
  89. enumerable: true,
  90. writable: true,
  91. initializer: null
  92. }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "attribute_lang_lable", [_dec5], {
  93. configurable: true,
  94. enumerable: true,
  95. writable: true,
  96. initializer: null
  97. })), _class2)) || _class));
  98. _cclegacy._RF.pop();
  99. _crd = false;
  100. }
  101. };
  102. });
  103. //# sourceMappingURL=028596f1c2bec2447564ff3f8a959a9bf739859b.js.map