dead-bunny/js/plugins/Nore_BattlePreparation.js
2025-01-12 01:21:39 -06:00

75 lines
2.4 KiB
JavaScript

var __extends =
(this && this.__extends) ||
(function () {
var extendStatics = function (d, b) {
extendStatics =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (d, b) {
d.__proto__ = b;
}) ||
function (d, b) {
for (var p in b)
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
};
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError(
"Class extends value " + String(b) + " is not a constructor or null"
);
extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype =
b === null
? Object.create(b)
: ((__.prototype = b.prototype), new __());
};
})();
var Nore;
(function (Nore) {
var Scene_BattlePreparation = /** @class */ (function (_super) {
__extends(Scene_BattlePreparation, _super);
function Scene_BattlePreparation() {
return (_super !== null && _super.apply(this, arguments)) || this;
}
Scene_BattlePreparation.prototype.create = function () {
_super.prototype.create.call(this);
this.createBattleWindow();
};
Scene_BattlePreparation.prototype.createBattleWindow = function () {
this._battleWindow = new Window_BattlePreparation();
this.addChild(this._battleWindow);
this._battleWindow.select(0);
this._battleWindow.activate();
this._battleWindow.setHandler("ok", this.onOk.bind(this));
this._battleWindow.setHandler("cancel", this.onCancel.bind(this));
};
Scene_BattlePreparation.prototype.onOk = function () {
$gameVariables.setValue(
Nore.BATTLE_ID_VAR,
$gameTemp.selectedTroop.troopId()
);
SceneManager.popAllScene();
};
Scene_BattlePreparation.prototype.onCancel = function () {
this.popScene();
};
Scene_BattlePreparation.prototype.popAllScene = function () {};
return Scene_BattlePreparation;
})(Scene_MenuBase);
Nore.Scene_BattlePreparation = Scene_BattlePreparation;
SceneManager.popAllScene = function () {
if (this._stack.length > 0) {
var num = this._stack.length;
for (var i = 0; i < num; i++) {
this.goto(this._stack.pop());
}
} else {
this.exit();
}
};
})(Nore || (Nore = {}));