A single option of an fl_menu: a DButton in the theme's colors with an optional icon. Options are created with the menu's add_option; set_icon and set_icon_size put a material on the left side of one.

Summary

Methods

Init()client
Applies the theme's menu font and text color to the item.
Calls DoClick on a left or right click, then forwards to DButton.OnMouseReleased.
Draws the highlight of the item while it is hovered, and its icon if one is set.
Sets the icon drawn on the left side of the item.
Sets the size the icon is drawn at.
Think()client
Fades the hover highlight in and out.

Methods

Applies the theme's menu font and text color to the item.

PANEL:OnMousePressed(mouse)

client packages/active_ui/views/base/cl_menu.lua:61

Calls DoClick on a left or right click, then forwards to DButton.OnMouseReleased.

Parameters

  • mouse Number mouse button code, one of the MOUSE_ enums

Returns

  • Any result of DButton.OnMouseReleased, normally nil

Draws the highlight of the item while it is hovered, and its icon if one is set.

Parameters

  • w Number panel width
  • h Number panel height

PANEL:set_icon(icon)

client packages/active_ui/views/base/cl_menu.lua:73

Sets the icon drawn on the left side of the item.

Parameters

  • icon String path of the material, as accepted by util.get_material

PANEL:set_icon_size(w, h)

client packages/active_ui/views/base/cl_menu.lua:80

Sets the size the icon is drawn at.

Parameters

  • w Number width in pixels
  • h Number optional, defaults to w height in pixels

Fades the hover highlight in and out.

Defined in