Status
Not open for further replies.

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
When you choose a battle command there's a little flickering effect highlighting your choice. Is there any way to deactivate it or turn the flickering's opacity to zero?

I found it inside rpg_windows - Window_Selectable.prototype.itemRect = function(index)
but couldn't quite figure it out.

Basically, I'm using a battle system based on common events. I removed every single battle command but the selection item keeps flickering, even though there's nothing u can choose.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,685
Reaction score
1,800
First Language
Dutch
Primarily Uses
RMMV
if you say, based on common events, does it based on images?
if so, it does that the first time, the 2nd time it does not, but you
can preload those with galv_ImageCache.

if it's the normal window of commands, than you need to look at
the windows or scenes in battle, and not window_Selectable on itemRect,
because it's probably not related to battle commands. (can be wrong).

so you can show an image, or small video to show the issue to make it
more clear what flickering you exactly mean.
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
Here's how it looks.
I though the selectable item was ineversal for every scene - window, but maybe I'm wrong.

1632331832900.png
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
First Language
EN
Primarily Uses
RMMZ
itemRect is the area the engine uses to draw that item (text, icon, etc). The window cursor is a separate sprite inherited from Window.prototype (rpg_core.js).

To stop the blinking, you can save this as a .js file and import as a plugin:
JavaScript:
(function(alias) {
	Window_Selectable.prototype._updateCursor = function() {
		alias.call(this);
		this._windowCursorSprite.alpha = this.contentsOpacity / 255;
	};
})(Window.prototype._updateCursor);
Alternatively I have a plugin that contains this option (No Menu Cursor Blink parameter):
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
I will take a look. Many thx!
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
First Language
EN
Primarily Uses
RMMZ
I hope it helps!
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
Getting the same error for both solutions, unfortunately:
Uncaught TypeError: Cannot set property 'alpha' of undefined

Uncaught TypeError: Cannot set property 'alpha' of undefined
at Window_Gold.Window_Selectable._updateCursor (BlinkingCursor.js:4)
at Window_Gold.Window.updateTransform (rmmz_core.js:3874)
at WindowLayer.updateTransform (pixi.js:8377)
at Scene_Map.updateTransform (pixi.js:8377)
at Renderer.render (pixi.js:24751)
at Application.render (pixi.js:26174)
at Function.Graphics._onTick (rmmz_core.js:803)
at TickerListener.emit (pixi.js:9474)
at Ticker.update (pixi.js:9928)
at Ticker._tick (pixi.js:9679)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
First Language
EN
Primarily Uses
RMMZ
Getting the same error for both solutions, unfortunately:
Uncaught TypeError: Cannot set property 'alpha' of undefined

Uncaught TypeError: Cannot set property 'alpha' of undefined
at Window_Gold.Window_Selectable._updateCursor (BlinkingCursor.js:4)
at Window_Gold.Window.updateTransform (rmmz_core.js:3874)
at WindowLayer.updateTransform (pixi.js:8377)
at Scene_Map.updateTransform (pixi.js:8377)
at Renderer.render (pixi.js:24751)
at Application.render (pixi.js:26174)
at Function.Graphics._onTick (rmmz_core.js:803)
at TickerListener.emit (pixi.js:9474)
at Ticker.update (pixi.js:9928)
at Ticker._tick (pixi.js:9679)
That trace says you're using RMMZ, which needs a different approach. I assumed you wanted an MV solution because the thread was labelled "RMMV" and you mentioned rpg_windows.js in your opening post...

Try one of these instead:
  1. MZ plugin code:
    JavaScript:
    Window.prototype._makeCursorAlpha = function() {
      return this.contentsOpacity / 255;
    };

  2. MZ version of my plugin: Cae_MenuDisplayOpts (Google Drive) [MZ].
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
447
Reaction score
80
First Language
Spanish
Primarily Uses
RMMV
U're right. I switched to MZ recently. This works thx.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
First Language
EN
Primarily Uses
RMMZ
Great! And I'll change the thread prefix. :kaohi:

If you'd like the thread to be closed, just report it with a reason like "Solved".
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,245
Reaction score
9,014
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png
Monday December 6th 2021 at 7PM Hawkzombie will stream A Thief's Voyage on his Twitch.

Hawkzombie Twitch

Check it out.​

Forum statistics

Threads
117,166
Messages
1,105,091
Members
153,258
Latest member
ssjmeech
Top