I’m using CGMZ_WindowCursor and have deleted the semi-transparent selection on the Window.png file (circled in the picture). What I want is for the text to flash instead of the default selection.
rom what I can see on its page, CGMZ Window Cursor only styles the cursor sprite itself (image, hue, float, rotation and so on), so I don’t think it has a text flash option. Casper Gaming takes suggestions in their Discord if you want to ask for one.
In the meantime this small plugin should do it. It pulses the selected item’s text toward a color on the same 40 frame rhythm the default cursor blinks at. Save it as BazFlashText.js in your js/plugins folder and turn it on in the Plugin Manager:
/*:
* @target MZ
* @plugindesc Flashes the selected item's text in selection windows.
* @author Baz
*/
(() => {
// [red, green, blue, strength] the text pulses toward, each 0 to 255
const FLASH_COLOR = [255, 220, 90, 255];
// frames for one full pulse, the default cursor blink is 40
const FLASH_FRAMES = 40;
const _initialize = Window_Selectable.prototype.initialize;
Window_Selectable.prototype.initialize = function(rect) {
_initialize.call(this, rect);
this._flashTextSprite = new Sprite();
this._flashTextSprite.setBlendColor(FLASH_COLOR);
this.addInnerChild(this._flashTextSprite);
};
const _update = Window_Selectable.prototype.update;
Window_Selectable.prototype.update = function() {
_update.call(this);
const sprite = this._flashTextSprite;
const rect = this._cursorRect;
sprite.visible = this.active && this.index() >= 0 && rect.width > 0;
if (!sprite.visible) return;
sprite.bitmap = this.contents;
sprite.setFrame(rect.x, rect.y, rect.width, rect.height);
sprite.move(rect.x, rect.y);
const t = (1 - Math.cos((this._animationCount * Math.PI * 2) / FLASH_FRAMES)) / 2;
sprite.opacity = t * this.contentsOpacity;
};
})();
The two lines at the top are the ones to tweak. MZ’s default text color is white, so a white flash color won’t show anything. Everything drawn in the selected row flashes with it, so icons and actor faces get tinted too. Lowering the last number in FLASH_COLOR softens that.
