System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2"], function (_export, _context) { "use strict"; var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Size, Sprite, SpriteFrame, UITransform, Hall, ch, _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _crd, ccclass, property, UI_Head_Icon; 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 _reportPossibleCrUseOfHall(extras) { _reporterNs.report("Hall", "../../hall/Hall", _context.meta, extras); } function _reportPossibleCrUseOfch(extras) { _reporterNs.report("ch", "db://assets/ch/ch", _context.meta, extras); } return { setters: [function (_unresolved_) { _reporterNs = _unresolved_; }, function (_cc) { _cclegacy = _cc.cclegacy; __checkObsolete__ = _cc.__checkObsolete__; __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__; _decorator = _cc._decorator; Component = _cc.Component; Size = _cc.Size; Sprite = _cc.Sprite; SpriteFrame = _cc.SpriteFrame; UITransform = _cc.UITransform; }, function (_unresolved_2) { Hall = _unresolved_2.Hall; }, function (_unresolved_3) { ch = _unresolved_3.ch; }], execute: function () { _crd = true; _cclegacy._RF.push({}, "32da00Ug65PLLJF/VDL1/LR", "UI_Head_Icon", undefined); __checkObsolete__(['_decorator', 'Component', 'Node', 'Size', 'Sprite', 'SpriteFrame', 'UITransform', 'Vec2']); ({ ccclass, property } = _decorator); _export("UI_Head_Icon", UI_Head_Icon = (_dec = ccclass('UI_Head_Icon'), _dec2 = property(Sprite), _dec3 = property([SpriteFrame]), _dec(_class = (_class2 = class UI_Head_Icon extends Component { constructor() { super(...arguments); _initializerDefineProperty(this, "head", _descriptor, this); _initializerDefineProperty(this, "default_head", _descriptor2, this); } start() {} update(deltaTime) {} show(uid, head) { var rc = this.default_head[(_crd && ch === void 0 ? (_reportPossibleCrUseOfch({ error: Error() }), ch) : ch).util.getRandomInt(0, this.default_head.length - 1)]; (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().head_icon.showIcon(uid, head, this.head, rc).then(spf => { if (spf != null) this.adaptationIcon(this.head, spf, new Size(55, 55)); }); } adaptationIcon(icon, spriteFrameIcon, tSize) { if (spriteFrameIcon) { var size = spriteFrameIcon.originalSize; //适配图片 var iconSize = new Size(); var raito = size.width / size.height; if (raito < 1) { iconSize.height = tSize.height; iconSize.width = tSize.height * raito; } else { iconSize.width = tSize.width; iconSize.height = tSize.width / raito; } icon.spriteFrame = spriteFrameIcon; icon.getComponent(UITransform).setContentSize(iconSize); } } }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "head", [_dec2], { configurable: true, enumerable: true, writable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "default_head", [_dec3], { configurable: true, enumerable: true, writable: true, initializer: function initializer() { return []; } })), _class2)) || _class)); _cclegacy._RF.pop(); _crd = false; } }; }); //# sourceMappingURL=47c8e77781a159f10d589db5916314688580bc33.js.map