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_darkandbackground_light: the darkest layers, behind everything else.surface: the cards and windows that content sits on;surface_raisedfor rows, hovered things and controls that sit on a surface;surface_sunkenandfieldfor lists, text fields and other wells.borderandborder_light: the outlines of cards and fields.text,text_mutedandtext_dim: primary, secondary and disabled text.accent,accent_dark,accent_lightandaccent_text: the highlight color, its darker and lighter shades for text on dark backgrounds, and the text drawn on top of it.success,warning,dangerandinfo: 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
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:611Draws 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:856Draws the card behind the chat history, leaving out the text entry.
Parameters
- panel Panel the chatbox
- width Number panel width
- height Number panel height
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
Draws the background of a HUD bar.
Parameters
- bar_info Map data of the bar, as stored by Flux.Bars
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
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
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:180Draws 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
nilborder; the 'border' color of the theme when omitted, false for no border
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
nilfont; the 'section_title' font of the theme when omitted
Returns
- Number width of the tag
- Number height of the tag
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.
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:929Draws 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:918Draws 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:907Draws the title of the character creation screen.
Parameters
- _panel Panel the character creation panel
- w Number panel width
- h Number panel height
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
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:464Draws 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
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:787Draws the card around an inventory panel.
Parameters
- _panel Panel the inventory panel
- w Number panel width
- h Number panel height
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:319Draws 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:839Draws 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:644Draws 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:246Draws 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.darkwhether this is one of the darker rows - hovered Boolean optional, defaults to
nilwhether the row is hovered; checked on the panel when omitted
THEME:PaintScoreboard(panel, width, height)
client packages/active_ui/themes/cl_theme_factory.lua:693Draws 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
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:229Draws 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
Draws the background of an fl_sidebar.
Parameters
- _panel Panel the sidebar being painted
- width Number panel width
- height Number panel height
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:807Draws 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
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:751Draws 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
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