The factory theme: Flux's default theme and the base that other themes derive from. on_loaded defines the default options, sounds, colors, fonts and materials that the interface reads through Theme.get_option, Theme.get_color, Theme.get_font and their siblings, and registers the 'tab_menu' panel. The Paint... and Draw... methods are the theme hooks that panels and HUD code call through Theme.hook to draw frames, buttons, bars, the scoreboard, the tab menu, the inventories and the character screens. The 'Flux' Derma skin is recolored from the colors of the theme when it is loaded (see SKIN:apply_theme); THEME.skin holds any further overrides of single skin fields. A schema theme sets THEME.parent = 'factory' and overrides only what it changes.

The look is a dark, slightly cool palette on blurred backgrounds. The semantic colors are:

  • background, background_dark and background_light: the darkest layers, behind everything else.
  • surface: the cards and windows that content sits on; surface_raised for rows, hovered things and controls that sit on a surface; surface_sunken and field for lists, text fields and other wells.
  • border and border_light: the outlines of cards and fields.
  • text, text_muted and text_dim: primary, secondary and disabled text.
  • accent, accent_dark, accent_light and accent_text: the highlight color, its darker and lighter shades for text on dark backgrounds, and the text drawn on top of it.
  • success, warning, danger and info: states.
  • scrim: the dark tint over the blurred game behind the menus; hud_backdrop: the box behind HUD elements.

main, main_dark, main_light, outline, menu_background and schema_text are kept for the themes and plugins that read them.

The drawing helpers DrawCard and DrawTitleTag, and the generic hooks PaintSurface, PaintSectionTitle, PaintRow and PaintTextEntry, are what the panels of Flux use for their cards, titles, list rows and fields, so a theme that overrides them restyles all of those at once.

Summary

Methods

Draws the footer below the admin panel with the Steam name and user group of the local player and the version of the admin mod.
Draws the card behind the chat history, leaving out the text entry.
Called when the main menu is created, so that a theme can customize it.
Draws the background of a HUD bar.
Draws the filled portion of a HUD bar in the color of the bar.
Draws the hindered portion at the right end of a HUD bar.
Draws the text of a HUD bar with a shadow, so that it stays readable over the filled and the empty portions alike, and the hindrance text when the hindrance is displayed.
Draws a rounded card: a box with a one pixel border.
Draws a title tag: a small rounded label that sits on the top left corner of a card.
Returns the corner radius of a HUD bar: its own, or the small radius of the theme.
Defines the defaults of the factory theme: options, sounds, assets, colors, fonts, materials and the tab menu panel.
Draws an fl_button: the background, the outline, the title and the FontAwesome icon, according to the settings of the button.
Draws the card of a character creation stage and its title, if the panel has one.
Draws the title of the character loading screen.
Draws the title of the character creation screen.
Draws a character card: its background, the name of the character in a tag at its top and an accent outline if it belongs to the active character of the local player.
Draws the background of a line of the config editor: every other line darker, and a highlight while it is hovered.
Draws the death screen with the respawn countdown and progress bar, and sets up the white fade for the last 3 seconds before the respawn.
Draws an fl_frame: a rounded card with a header band and the title of the frame in it.
Draws the card around an inventory panel.
Draws a faint sheen over an inventory item slot.
Draws the background of the main menu: the blurred game under a dark tint, a band across the top with the schema's logo (or name), and its description and author below it.
Draws the title of an inventory above its panel, if it has one.
Draws a button of the permission editor as a pill colored after its permission value: filled while it is the selected value, outlined otherwise, with a clock icon for temporary permissions.
Draws the background of a row of a list: every other row darker, and a highlight while it is hovered.
Draws the card, the title tag and the column headers of the scoreboard, with the amount of players online in the middle of the header.
Draws the card of a player on the scoreboard, highlighted while it is hovered.
Draws the title of a content panel as a tag that sticks out above its top left corner.
Draws the background of an fl_sidebar.
Draws the surface that a content panel sits on: a rounded card in the 'surface' color.
Draws the card and the character name around the player model of the inventory tab.
Blurs the screen behind the tab menu, easing the blur size toward the blur target of the menu, and tints it so that the panels on top of it stand out.
Draws the bar at the top of the tab menu that holds its buttons.
Draws an fl_text_entry: a sunken field with a border that takes the accent color while the entry has focus, and its text.

Methods

THEME:AdminPanelPaintOver(_panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:611

Draws the footer below the admin panel with the Steam name and user group of the local player and the version of the admin mod.

Parameters

  • _panel Panel the admin panel
  • width Number panel width
  • height Number panel height

THEME:ChatboxPaintBackground(panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:856

Draws the card behind the chat history, leaving out the text entry.

Parameters

  • panel Panel the chatbox
  • width Number panel width
  • height Number panel height

THEME:CreateMainMenu(_panel)

client packages/active_ui/themes/cl_theme_factory.lua:276

Called when the main menu is created, so that a theme can customize it. Does nothing in the factory theme.

Parameters

  • _panel Panel the main menu

THEME:DrawBarBackground(bar_info)

client packages/active_ui/themes/cl_theme_factory.lua:530

Draws the background of a HUD bar.

Parameters

  • bar_info Map data of the bar, as stored by Flux.Bars

THEME:DrawBarFill(bar_info)

client packages/active_ui/themes/cl_theme_factory.lua:560

Draws the filled portion of a HUD bar in the color of the bar. While the displayed fill is catching up with the actual value, the difference between the two is drawn lighter.

Parameters

  • bar_info Map data of the bar, as stored by Flux.Bars

THEME:DrawBarHindrance(bar_info)

client packages/active_ui/themes/cl_theme_factory.lua:544

Draws the hindered portion at the right end of a HUD bar.

Parameters

  • bar_info Map data of the bar, as stored by Flux.Bars

THEME:DrawBarTexts(bar_info)

client packages/active_ui/themes/cl_theme_factory.lua:584

Draws the text of a HUD bar with a shadow, so that it stays readable over the filled and the empty portions alike, and the hindrance text when the hindrance is displayed.

Parameters

  • bar_info Map data of the bar, as stored by Flux.Bars

THEME:DrawCard(x, y, w, h, radius, fill, border)

client packages/active_ui/themes/cl_theme_factory.lua:180

Draws a rounded card: a box with a one pixel border.

Theme.hook('DrawCard', 0, 0, w, h, Theme.get_option('corner_radius'), Theme.get_color('surface'))

Parameters

  • x Number
  • y Number
  • w Number
  • h Number
  • radius Number corner radius
  • fill Color
  • border Color optional, defaults to nil border; the 'border' color of the theme when omitted, false for no border

THEME:DrawTitleTag(text, x, y, font)

client packages/active_ui/themes/cl_theme_factory.lua:199

Draws a title tag: a small rounded label that sits on the top left corner of a card.

Parameters

  • text String
  • x Number left edge of the tag
  • y Number top edge of the tag
  • font String optional, defaults to nil font; the 'section_title' font of the theme when omitted

Returns

  • Number width of the tag
  • Number height of the tag

THEME:get_bar_radius(bar_info)

client packages/active_ui/themes/cl_theme_factory.lua:518

Returns the corner radius of a HUD bar: its own, or the small radius of the theme.

Parameters

  • bar_info Map data of the bar, as stored by Flux.Bars

Returns

  • Number

Defines the defaults of the factory theme: options, sounds, assets, colors, fonts, materials and the tab menu panel.

THEME:PaintButton(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:378

Draws an fl_button: the background, the outline, the title and the FontAwesome icon, according to the settings of the button. A button that draws a background is a rounded card that brightens while it is hovered and takes the accent color while it is active; a button without one is plain text that shifts toward the accent color instead.

Parameters

  • panel Panel the button being painted
  • w Number panel width
  • h Number panel height

THEME:PaintCharCreationBasePanel(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:929

Draws the card of a character creation stage and its title, if the panel has one.

Parameters

  • panel Panel the stage panel
  • w Number panel width
  • h Number panel height

THEME:PaintCharCreationLoadPanel(_panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:918

Draws the title of the character loading screen.

Parameters

  • _panel Panel the character loading panel
  • w Number panel width
  • h Number panel height

THEME:PaintCharCreationMainPanel(_panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:907

Draws the title of the character creation screen.

Parameters

  • _panel Panel the character creation panel
  • w Number panel width
  • h Number panel height

THEME:PaintCharPanel(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:876

Draws a character card: its background, the name of the character in a tag at its top and an accent outline if it belongs to the active character of the local player.

Parameters

  • panel Panel the character card
  • w Number panel width
  • h Number panel height

THEME:PaintConfigLine(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:633

Draws the background of a line of the config editor: every other line darker, and a highlight while it is hovered.

Parameters

  • panel Panel the config line being painted
  • w Number panel width
  • h Number panel height

THEME:PaintDeathScreen(cur_time, scrw, scrh)

client packages/active_ui/themes/cl_theme_factory.lua:464

Draws the death screen with the respawn countdown and progress bar, and sets up the white fade for the last 3 seconds before the respawn.

Parameters

  • cur_time Number current CurTime()
  • scrw Number screen width
  • scrh Number screen height

THEME:PaintFrame(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:283

Draws an fl_frame: a rounded card with a header band and the title of the frame in it.

Parameters

  • panel Panel the frame being painted
  • w Number panel width
  • h Number panel height

THEME:PaintInventoryBackground(_panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:787

Draws the card around an inventory panel.

Parameters

  • _panel Panel the inventory panel
  • w Number panel width
  • h Number panel height

THEME:PaintItemSlot(_panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:779

Draws a faint sheen over an inventory item slot.

Parameters

  • _panel Panel the item slot
  • w Number panel width
  • h Number panel height

THEME:PaintMainMenu(_panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:319

Draws the background of the main menu: the blurred game under a dark tint, a band across the top with the schema's logo (or name), and its description and author below it.

Parameters

  • _panel Panel the main menu
  • width Number panel width
  • height Number panel height

THEME:PaintOverInventoryBackground(panel, _w, _h)

client packages/active_ui/themes/cl_theme_factory.lua:839

Draws the title of an inventory above its panel, if it has one.

Parameters

  • panel Panel the inventory panel
  • _w Number panel width
  • _h Number panel height

THEME:PaintPermissionButton(_perm_panel, btn, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:644

Draws a button of the permission editor as a pill colored after its permission value: filled while it is the selected value, outlined otherwise, with a clock icon for temporary permissions.

Parameters

  • _perm_panel Panel the permission row the button belongs to
  • btn Panel the button being painted
  • w Number button width
  • h Number button height

THEME:PaintRow(panel, w, h, dark, hovered)

client packages/active_ui/themes/cl_theme_factory.lua:246

Draws the background of a row of a list: every other row darker, and a highlight while it is hovered.

Parameters

  • panel Panel the row being painted
  • w Number panel width
  • h Number panel height
  • dark Boolean optional, defaults to panel.dark whether this is one of the darker rows
  • hovered Boolean optional, defaults to nil whether the row is hovered; checked on the panel when omitted

THEME:PaintScoreboard(panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:693

Draws the card, the title tag and the column headers of the scoreboard, with the amount of players online in the middle of the header.

Parameters

  • panel Panel the scoreboard
  • width Number panel width
  • height Number panel height

THEME:PaintScoreboardPlayer(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:734

Draws the card of a player on the scoreboard, highlighted while it is hovered.

Parameters

  • panel Panel the player card
  • w Number panel width
  • h Number panel height

THEME:PaintSectionTitle(_panel, text, _w, _h)

client packages/active_ui/themes/cl_theme_factory.lua:229

Draws the title of a content panel as a tag that sticks out above its top left corner. The panel is expected to call it from PaintOver or Paint with clipping disabled, as the tag is drawn outside of the panel.

Parameters

  • _panel Panel the panel being painted
  • text String the title, translated
  • _w Number panel width
  • _h Number panel height

THEME:PaintSidebar(_panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:511

Draws the background of an fl_sidebar.

Parameters

  • _panel Panel the sidebar being painted
  • width Number panel width
  • height Number panel height

THEME:PaintSurface(_panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:218

Draws the surface that a content panel sits on: a rounded card in the 'surface' color.

Parameters

  • _panel Panel the panel being painted
  • w Number panel width
  • h Number panel height

THEME:PaintTabInventoryBackground(panel, _w, _h)

client packages/active_ui/themes/cl_theme_factory.lua:807

Draws the card and the character name around the player model of the inventory tab. Does nothing if the panel has no player model.

Parameters

  • panel Panel the inventory menu
  • _w Number panel width
  • _h Number panel height

THEME:PaintTabMenu(panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:764

Blurs the screen behind the tab menu, easing the blur size toward the blur target of the menu, and tints it so that the panels on top of it stand out.

Parameters

  • panel Panel the tab menu
  • width Number panel width
  • height Number panel height

THEME:PaintTabMenuButtonPanel(_panel, width, height)

client packages/active_ui/themes/cl_theme_factory.lua:751

Draws the bar at the top of the tab menu that holds its buttons.

Parameters

  • _panel Panel the tab menu that owns the button bar
  • width Number width of the button bar
  • height Number height of the button bar

THEME:PaintTextEntry(panel, w, h)

client packages/active_ui/themes/cl_theme_factory.lua:264

Draws an fl_text_entry: a sunken field with a border that takes the accent color while the entry has focus, and its text.

Parameters

  • panel Panel the text entry being painted
  • w Number panel width
  • h Number panel height

Defined in