MrAntares / roBrowserLegacy

This is a continuation of the original robrowser. All credits to the original creators and the new ones :)
GNU General Public License v3.0
184 stars 118 forks source link

Entity name should be removed while mouse it's over chatbox, vended shop or UI elements #384

Closed kontownik closed 3 weeks ago

kontownik commented 3 months ago

Steps to reproduce

Actual result Chatbox is "focused" which is good. But player entity name it's kept displayed.

Expected result Entity displayed name should be removed when your mouse is over chatbox or shop.

Browser/device info

The same happens when mouse over from Entity directly to ShortCut bar or any UI element.

kontownik commented 3 months ago

I fixed it locally by adding to EntityManager:

    /**
     * Clean all displays
     */
    function cleanAllDisplays() {
        // Remove all display names if mouse over chatroom or vending
        this.forEach(function (entity) {
            if (entity.display.display) {
                entity.display.clean();
            }
        })
    }

and then calling it on mouse over event from EntityRoom.js or ShortCut.js etc. fixing the issue... but... I don't know if it was't dead way as there isaremultiple components (party window, inventory etc.) that I will need to update like this. Additionally I am a bit worried about optimisation here.

            this.ui.mouseover(function(){
                // Remove all display names if mouse over chatroom or vending
                require("Renderer/EntityManager").cleanAllDisplays();
            })

Maybe EntityControl.onMouseOut() should be improved instead.

Any ideas?

MrAntares commented 3 months ago

"Maybe EntityControl.onMouseOut() should be improved instead." I think this is the better way. It is the task of the entity to manage it's own name, not every other UI component's

alisonrag commented 3 weeks ago

need something like: if (mouse over UI && UI has MouseMode == UIComponent.MouseMode.STOP) entityover = null;