Defines cw.menuButton, the cwFAButton used for a tab in the main menu, and adds the cwMenuButtonSmall font.

SetupLabel gives it the menu item's translated text, icon and tooltip and a callback that opens the item's panel through cw.menu.

Summary

Methods

Sets the button up for a menu item: translated upper-case text, icon, tooltip and a click callback that opens the item's tab.
Sets the button to its fixed size of 200 by 32 pixels.

Methods

PANEL:SetupLabel(menuItem, panel)

client gamemodes/catwork/gamemode/core/derma/cl_menubutton.lua:26

Sets the button up for a menu item: translated upper-case text, icon, tooltip and a click callback that opens the item's tab.

A # is added to the item's text when it lacks one, so it is looked up as a language phrase. The icon comes from iconData.path (bars when empty), offset by iconData.size when set.

Parameters

  • menuItem Map Menu item with text, tip and iconData (path and size), as stored in cw.menuitems.stored
  • panel Panel The tab panel the button opens

Sets the button to its fixed size of 200 by 32 pixels.

Defined in