window.Scene_Achievements = Scene_Achievements; //===========================================================================
// Window_AchievementNotification
//===========================================================================
var Window_AchievementNotification =
/*#__PURE__*/
function (_Window_Base) {
_inherits(Window_AchievementNotification, _Window_Base);
function Window_AchievementNotification(x, y, width, height) {
var _this6;
_classCallCheck(this, Window_AchievementNotification);
_this6 = _possibleConstructorReturn(this, _getPrototypeOf(Window_AchievementNotification).call(this, x, y, width, height));
_this6.opacity = 0;
_this6.contentsOpacity = 0;
_this6._showCount = 0;
_this6._achievement = null;
_this6.refresh();
return _this6;
}
_createClass(Window_AchievementNotification, [{
key: "loadWindowskin",
value: function loadWindowskin() {
this.windowskin = ImageManager.loadSystem(notifyWindowSkin);
}
}, {
key: "updateFadeIn",
value: function updateFadeIn() {
this.opacity += 16;
this.contentsOpacity += 16;
}
}, {
key: "updateFadeOut",
value: function updateFadeOut() {
this.opacity -= 16;
this.contentsOpacity -= 16;
}
}, {
key: "text",
value: function text() {
if (this._achievement) {
var name = "\x1BI[".concat(this._achievement.completeIcon, "]").concat(this._achievement.name);
return notifyMessage.format(name, this._achievement.points);
}
return "";
}
}, {
key: "update",
value: function update() {
Window_Base.prototype.update.call(this);
if (_disablePopups) return;
if ($gameAchievements._notifyQueue.length) {
if (!this._achievement && this.contentsOpacity < 1) {
this._achievement = $gameAchievements._notifyQueue[0];
this.refresh();
this._showCount = notifyShowFrames;
if (notifySound && notifySound.name) AudioManager.playSe(notifySound);
}
if (this._achievement) {
if (this._showCount > 0) {
this.updateFadeIn();
this._showCount--;
} else if (this.contentsOpacity > 0) {
this.updateFadeOut();
} else {
this._achievement = null;
$gameAchievements._notifyQueue.shift();
}
}
}
}
}, {
key: "adjustWidthBasedOnText",
value: function adjustWidthBasedOnText() {
this.width = Math.ceil(this.textWidthEx(this.text()) + this.standardPadding() * 2);
this.createContents();
}
}, {
key: "refresh",
value: function refresh() {
if (this._achievement) {
this.adjustWidthBasedOnText();
this.drawTextEx(this.text(), 0, 0);
}
}
}]);