/*:
* @target MV MZ
* @plugindesc Change the windowskin cursor corner size.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/threads/173698/
* @help Free to use and/or modify for any project, no credit required.
*/
Window.prototype._refreshCursor = Utils.RPGMAKER_NAME === "MZ" ? function() {
const drect = this._cursorRect.clone();
const srect = { x: 96, y: 96, width: 48, height: 48 };
const m = 8; // <- originally 4
for (const child of this._cursorSprite.children) {
child.bitmap = this._windowskin;
}
this._setRectPartsGeometry(this._cursorSprite, srect, drect, m);
} : function() {
var pad = this._padding;
var x = this._cursorRect.x + pad - this.origin.x;
var y = this._cursorRect.y + pad - this.origin.y;
var w = this._cursorRect.width;
var h = this._cursorRect.height;
var m = 8; // <- originally 4
var x2 = Math.max(x, pad);
var y2 = Math.max(y, pad);
var ox = x - x2;
var oy = y - y2;
var w2 = Math.min(w, this._width - pad - x2);
var h2 = Math.min(h, this._height - pad - y2);
var bitmap = new Bitmap(w2, h2);
this._windowCursorSprite.bitmap = bitmap;
this._windowCursorSprite.setFrame(0, 0, w2, h2);
this._windowCursorSprite.move(x2, y2);
if (w > 0 && h > 0 && this._windowskin) {
var skin = this._windowskin;
var p = 96;
var q = 48;
bitmap.blt(skin, p+m, p+m, q-m*2, q-m*2, ox+m, oy+m, w-m*2, h-m*2);
bitmap.blt(skin, p+m, p+0, q-m*2, m, ox+m, oy+0, w-m*2, m);
bitmap.blt(skin, p+m, p+q-m, q-m*2, m, ox+m, oy+h-m, w-m*2, m);
bitmap.blt(skin, p+0, p+m, m, q-m*2, ox+0, oy+m, m, h-m*2);
bitmap.blt(skin, p+q-m, p+m, m, q-m*2, ox+w-m, oy+m, m, h-m*2);
bitmap.blt(skin, p+0, p+0, m, m, ox+0, oy+0, m, m);
bitmap.blt(skin, p+q-m, p+0, m, m, ox+w-m, oy+0, m, m);
bitmap.blt(skin, p+0, p+q-m, m, m, ox+0, oy+h-m, m, m);
bitmap.blt(skin, p+q-m, p+q-m, m, m, ox+w-m, oy+h-m, m, m);
}
};