"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("../../utils");
var Medal = (function (_super) {
    __extends(Medal, _super);
    function Medal(data) {
        var _this = _super.call(this) || this;
        _this.data = null;
        _this.skinName = utils_1.getSkinPath('Objs/Medal');
        _this.data = data || null;
        _this.initUI(); // 设置显示
        return _this;
    }
    Medal.prototype.initUI = function () {
        this.light.mask = this.light_mask;
        this.data.name ? this.label.text = this.data.name : this.label.visible = false;
        this.x = (this.data.index % 2 == 0) ? 55 : 249;
        this.y = 43 + ~~(this.data.index / 2) * 230;
        this.label.textColor = this.data.active ? 0xFFE595 : 0xbbbbbb;
        this.img.source = this.data.active ? this.data.key + "_png" : 'sp_achv_0_png';
        this.light_mask.source = this.data.active ? this.data.key + "_png" : 'sp_achv_0_png';
        (this.data.active) ? function () {
            var _this = this;
            setTimeout(function () {
                egret.Tween.get(_this.light, { loop: true })
                    .set({ x: -90 })
                    .to({ x: 100 }, 1000)
                    .wait(1000);
            }, 1330 + 670 * this.data.index);
        }.bind(this)() : 0;
    };
    Medal.prototype.destroy = function () {
        egret.Tween.removeTweens(this.light);
    };
    return Medal;
}(eui.Component));
exports.default = Medal;
__reflect(Medal.prototype, "\"/Users/haiyoucuv/Documents/Web/\u5DE5\u884C\u5361\u4E2D\u5FC3--\u6B22\u8DA3\u5E84\u56ED\u6D3B\u52A8/JoyousManor/egret/src/Scenes/RoomScene/Medal\".Medal");
//# sourceMappingURL=Medal.js.map