How do I remove the highlight/rectangle cursor?

FinalBossMan

Villager
Member
Joined
May 16, 2020
Messages
8
Reaction score
5
First Language
English
Primarily Uses
RMMV
I've been struggling for hours trying to find a solution to this issue. I'm trying to disable/remove the highlighted cursor in menus (where a blinking rectangle pops up underneath the selection), and instead use a regular cursor (I'm using GALVs plugin atm). I'm a noob to JS so I'm not sure what exactly it is I need to change. I've been able to stop the blinking, but not remove the rectangle altogether.

I could settle for the rectangle to have a transparent fill and rounded edges, but I'm not familiar with how to code that (or where).

From what I read on here and other sites, the windows are pretty complicated, so I hope asking for help isn't too much trouble! Thanks in advance!
 

Lay

Veteran
Veteran
Joined
Jul 18, 2019
Messages
124
Reaction score
47
First Language
French
Primarily Uses
RMMV
Okay so first of all, I'm note sure it will be compatible with plugins to do such a thing.

If you never want to use a blinking cursor, one option is to edit the _updateCursor methods in rpg_core.js

Find the function below in rpg_core.js and modify this function as follow :

JavaScript:
Window.prototype._updateCursor = function() {
 
    // ADDED SECTION
    this._windowCursorSprite.alpha = 1; // change this value for lower opacity. must be between 0 and 1.
    this._windowCursorSprite.visible = this.isOpen();
    return;
    // END OF ADDED SECTION

    var blinkCount = this._animationCount % 40;
    var cursorOpacity = this.contentsOpacity;
    if (this.active) {
        if (blinkCount < 20) {
            cursorOpacity -= blinkCount * 8;
        } else {
            cursorOpacity -= (40 - blinkCount) * 8;
        }
    }
    this._windowCursorSprite.alpha = cursorOpacity / 255;
    this._windowCursorSprite.visible = this.isOpen();
};
As a consequence, all selectable windows that use a blinking cursor will see their cursor update always set to opacity 1 in this case. For a totally transparent cursor, set this value to 0.

This edit is clearly not the best because the cursor will still be drawn in window. But if you're not comfortable with JS, I think this is the best you can do thanks to the low amount of modifications it needs. Meanwhile, those modifications are easy to understand so, even if you're "noob" in JS, you should understand what this modification does. I always prefer to give modification that could be understood by the user. Otherwise, if you meet an issue, you will not be able to think about it properly.

All the code below // END OF ADDED SECTION will never run. However, this code correspond to the original function code. I've left it to make an easy come back to default.
 
Last edited:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,696
Reaction score
3,007
First Language
Tagalog
Primarily Uses
RMVXA
If you want the rectangle to be removed from all menus, you can just delete it from the Window.png file inside you project's img/system folder

Windowcursor.PNG
 

FinalBossMan

Villager
Member
Joined
May 16, 2020
Messages
8
Reaction score
5
First Language
English
Primarily Uses
RMMV
Simple and clean solution, thanks for the help!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

What is your favourite rpg maker plugin?
Hopefully this gets fixed before release..
Where's this sudden heatwave come from? It's not even sunny, it's just hot. Hate it!
I'm slightly disappointed that the MZ codebase still uses core.js, managers.js, objects.js, scenes.js, sprites.js and windows.js instead of core/Bitmap.js, core/Graphics.js, managers/AudioManager.js, managers/DataManager.js, etc...
just a few more hours until the toughest, most pressure 72 hours of my life, wish me luck guys

Forum statistics

Threads
100,564
Messages
977,268
Members
132,148
Latest member
jcamp10565
Top