• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

OTClient OTClient button tooltip

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
I'm trying to make the button change when the mouse hovers over it — that part works, but the tooltip doesn't show up. Does anyone have any tips?


LUA:
function createShop()
  if shop then return end
  shop = g_ui.displayUI('shop')
  shop:hide()
  shopButton = modules.client_topmenu.addRightButton('shopButton', tr('Shop'), '/images/topbuttons/shop', toggle, false, 8)
  shopButton.onHoverChange = function(self, hovered)
        if hovered then
            self:setIcon('/images/topbuttons/shop')
            
        else
            self:setIcon('/images/topbuttons/shop1')
        end
    end

  connect(shop.categories, { onChildFocusChange = changeCategory })
end
 
Back
Top