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

63 lines
1.9 KiB
JavaScript

/*:ja
* @target MZ
* @author ル
*/
var Nore;
(function (Nore) {
var _Window_Selectable_prototype_select = Window_Selectable.prototype.select;
Window_Selectable.prototype.select = function (index) {
var last = this._index;
_Window_Selectable_prototype_select.call(this, index);
if (this._index != last) {
this.callHandler("change");
}
};
var _Window_Selectable_prototype_activate =
Window_Selectable.prototype.activate;
Window_Selectable.prototype.activate = function () {
_Window_Selectable_prototype_activate.call(this);
this.callHandler("change");
};
var _Window_Selectable_prototype_processTouch =
Window_Selectable.prototype.processTouch;
Window_Selectable.prototype.processTouch = function () {
_Window_Selectable_prototype_processTouch.call(this);
if (!this._parentCommandWindow) {
return;
}
if (!this.isHandled("activate")) {
return;
}
if (!this._parentCommandWindow.active) {
return;
}
if (TouchInput.isClicked()) {
if (this.isOpen() && this.visible) {
if (!this.active) {
if (this.isTouchedInsideFrame()) {
this.callHandler("activate");
}
}
}
}
};
Window_Selectable.prototype.setParentCommandWindow = function (window) {
this._parentCommandWindow = window;
};
/*
Window_Selectable.prototype.drawBackgroundRect = function(rect) {
const c1 = ColorManager.itemBackColor1();
const c2 = ColorManager.itemBackColor2();
const x = rect.x;
const y = rect.y;
const w = rect.width;
const h = rect.height;
const bitmap = ImageManager.loadSystem('itemBack');
this.contentsBack.blt(bitmap, 0, 0, bitmap.width, bitmap.height, x, y, w, h);
//this.contentsBack.strokeRect(x, y, w, h, c1);
};
*/
})(Nore || (Nore = {}));