123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- 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, ch, Hall, _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 _reportPossibleCrUseOfch(extras) {
- _reporterNs.report("ch", "../../../ch/ch", _context.meta, extras);
- }
- function _reportPossibleCrUseOfHall(extras) {
- _reporterNs.report("Hall", "../../hall/Hall", _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) {
- ch = _unresolved_2.ch;
- }, function (_unresolved_3) {
- Hall = _unresolved_3.Hall;
- }],
- 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=d02a4db18b44c0a5a905a8da4cd0296fd426a944.js.map
|