123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2"], function (_export, _context) {
- "use strict";
- 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;
- 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 }); }
- 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; }
- 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.'); }
- function _reportPossibleCrUseOfListItem(extras) {
- _reporterNs.report("ListItem", "../../third/ListItem", _context.meta, extras);
- }
- function _reportPossibleCrUseOfResUtil(extras) {
- _reporterNs.report("ResUtil", "../../utils/ResUtil", _context.meta, extras);
- }
- return {
- setters: [function (_unresolved_) {
- _reporterNs = _unresolved_;
- }, function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- Sprite = _cc.Sprite;
- Label = _cc.Label;
- ProgressBar = _cc.ProgressBar;
- }, function (_unresolved_2) {
- ListItem = _unresolved_2.default;
- }, function (_unresolved_3) {
- ResUtil = _unresolved_3.ResUtil;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "2de32DH/ZFOOK0Lwiy3r4Yj", "GunAttrItem", undefined);
- __checkObsolete__(['_decorator', 'Sprite', 'Label', 'ProgressBar']);
- ({
- ccclass,
- property
- } = _decorator); //枪的属性数据
- /*attr_name attr_value attr_icon max_value attribute_lang*/
- _export("GunAttrItem", GunAttrItem = (_dec = ccclass('GunAttrItem'), _dec2 = property({
- type: Sprite,
- tooltip: "枪的属性图片"
- }), _dec3 = property({
- type: ProgressBar,
- tooltip: "属性值的最大进度"
- }), _dec4 = property({
- type: Label,
- tooltip: "属性值的数据文本"
- }), _dec5 = property({
- type: Label,
- tooltip: "枪的属性多语言名字"
- }), _dec(_class = (_class2 = class GunAttrItem extends (_crd && ListItem === void 0 ? (_reportPossibleCrUseOfListItem({
- error: Error()
- }), ListItem) : ListItem) {
- constructor() {
- super(...arguments);
- _initializerDefineProperty(this, "attr_sp", _descriptor, this);
- _initializerDefineProperty(this, "progressBar", _descriptor2, this);
- _initializerDefineProperty(this, "atts_label", _descriptor3, this);
- _initializerDefineProperty(this, "attribute_lang_lable", _descriptor4, this);
- this.data = null;
- }
- start() {}
- /**
- * 数据填充
- * @param data 数据
- * @param cb 回调
- */
- init(data, cb) {
- if (!data) return;
- this.data = data; //设置属性图标
- (_crd && ResUtil === void 0 ? (_reportPossibleCrUseOfResUtil({
- error: Error()
- }), ResUtil) : ResUtil).setSpriteFrame(data.attr_icon, this.attr_sp); // 设置进度条 当前值/最大值
- this.progressBar.progress = data.attr_value / data.totalValue; //设置属性数值文本
- this.atts_label.string = data.attr_value + "/" + data.totalValue; //设置多语言属性名称
- this.attribute_lang_lable.string = data.attribute_lang;
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "attr_sp", [_dec2], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "progressBar", [_dec3], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "atts_label", [_dec4], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "attribute_lang_lable", [_dec5], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: null
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=028596f1c2bec2447564ff3f8a959a9bf739859b.js.map
|