On-hover Sound Effect

Is there a way to have a cursor sound effect play out whenever the mouse hovers to a menu it can interact with? Like the way using directional keys have the cursor sound effect when you go through a menu. I know clicking the menu has a SE, but not when simply hovering over the button.
@caethyril 's Cae_PictureTouch would work wonderfully for that.
:LZScheeze:
If it's a picture-based, evented menu then my plugin can help with that. Otherwise...

Interestingly, the core scripts look like they're designed to play the cursor sound when appropriate. I think there might be a typo, though? You can try saving this as a .js file and loading as a plugin:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Always play touch-based cursor SE for selectable lists.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/160647/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override!
Window_Selectable.prototype.onTouchSelect = function(trigger) {
    this._doubleTouch = false;
    if (this.isCursorMovable()) {
        const lastIndex = this.index();
        const hitIndex = this.hitIndex();
        if (hitIndex >= 0) {
            if (hitIndex === this.index()) {
                this._doubleTouch = true;
            }
            this.select(hitIndex);
        }
        if (/* trigger && */ this.index() !== lastIndex) {  // edit 1 of 1
            this.playCursorSound();
        }
    }
};
By default it only plays the SE if touch was triggered (e.g. mouse button pressed) this frame. But I think that only really makes sense for touch screens. This little plugin just removes that condition: now the sound should play whenever the selected index has changed.
Nice! POG :LZSexcite:
If it's a picture-based, evented menu then my plugin can help with that. Otherwise...

Interestingly, the core scripts look like they're designed to play the cursor sound when appropriate. I think there might be a typo, though? You can try saving this as a .js file and loading as a plugin:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Always play touch-based cursor SE for selectable lists.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/160647/
 * @help Free to use and/or modify for any project, no credit required.
 */
// Override!
Window_Selectable.prototype.onTouchSelect = function(trigger) {
    this._doubleTouch = false;
    if (this.isCursorMovable()) {
        const lastIndex = this.index();
        const hitIndex = this.hitIndex();
        if (hitIndex >= 0) {
            if (hitIndex === this.index()) {
                this._doubleTouch = true;
            }
            this.select(hitIndex);
        }
        if (/* trigger && */ this.index() !== lastIndex) {  // edit 1 of 1
            this.playCursorSound();
        }
    }
};
By default it only plays the SE if touch was triggered (e.g. mouse button pressed) this frame. But I think that only really makes sense for touch screens. This little plugin just removes that condition: now the sound should play whenever the selected index has changed.
Thanks for this! I was able to get the result I was looking for after using this plugin + turning off some other plugin I had.

Just want to ask though if it's possible to make this plugin take priority over others? Cause it seems one plugin I use ends up overwriting the fix. This is the plugin causing issues.

But if this isn't possible, no worries and thanks again!

EDIT: Made a topic specifically for the plugin issue.

Original thread: https://forums.rpgmakerweb.com/threads/on-hover-sound-effect.160647/