theme.Theme themeclient
Theme defined in cl_theme.lua
Defines the HL2RP schema's client theme, built with cw.theme:Begin and registered with cw.theme:Finish.
It creates the hl2_* fonts, sets the theme's colours, logo and font options, draws the HUD bars as rows of
segments, and overrides the Derma skin painters for frames, buttons, menus, tabs and list views with a flat dark
look. The gradient and logo images are downloaded into data/catwork/ at start-up, and the character and main menu
hooks are empty stubs.
Summary
Methods
hl2_* fonts (Exo 2, Kelly Slab and Roboto Condensed) with cw.fonts:Add.information colour.Methods
Registers the theme's hl2_* fonts (Exo 2, Kelly Slab and Roboto Condensed) with cw.fonts:Add.
Called when the limit of a bar should be drawn.
Fills the part of the bar above maxValue in yellow with the translated limitText, when the bar has
one.
Parameters
- barInfo Map The bar: position, size,
maximum,maxValueandlimitText
Returns
- Boolean Always
true, replacing the default limit drawing
THEME.skin:DrawGenericBackground(x, y, w, h, color)
client gamemodes/cwhl2rp/schema/cl_theme.lua:368Fills a rectangle with a colour; the skin's painters use it for backgrounds and borders.
Parameters
- x Number The X position
- y Number The Y position
- w Number The width
- h Number The height
- color Color The fill colour
Sets the theme's colours, logo and font options and downloads its gradient and logo images.
The images are saved to data/catwork/ with Schema:DownloadMaterial.
Lays out a frame's title in black uppercase text and its close button in the top-right corner.
Parameters
- panel Panel The
DFrame
Sizes a menu option to its text plus padding, at least as wide as the menu, and places its sub-menu arrow.
Parameters
- panel Panel The menu option
- w Number The width
- h Number The height
Paints a button with a black border, lighter when hovered and white with black text when pressed.
Parameters
- panel Panel The
DButton - w Number The width
- h Number The height
Paints a collapsible category's dark header and sets the header font.
Parameters
- panel Panel The
DCollapsibleCategory - w Number The width
- h Number The height
Paints a frame's dark body and a title bar in a darkened information colour.
Parameters
- panel Panel The
DFrame - w Number The width
- h Number The height
Paints a list view's white background, when it has one.
Parameters
- panel Panel The
DListView - w Number The width
- h Number The height
Paints a list view line in grey, white when selected, and sets its columns' text colour to match.
Parameters
- panel Panel The list view line
Paints a menu's near-black background.
Parameters
- panel Panel The
DMenu - w Number The width
- h Number The height
Paints a hovered menu option white with black text.
Parameters
- panel Panel The menu option
- w Number The width
- h Number The height
Paints over a menu; overridden to draw nothing.
Parameters
- panel Panel The
DMenu
Paints a scroll bar grip as a black box with a white border.
Parameters
- panel Panel The grip
Paints a property sheet tab, darker when it is not the active one.
Parameters
- panel Panel The tab
- w Number The width
- h Number The height
Called after the character menu has initialized; the theme does nothing here.
Parameters
- panel Panel The character menu
Called after a character menu panel is opened; the theme does nothing here.
Parameters
- panel Panel The opened panel
Called after the character menu is painted; the theme does nothing here.
Parameters
- panel Panel The character menu
Called every frame the character menu is open; the theme does nothing here.
Parameters
- panel Panel The character menu
Called just after a bar is drawn.
Draws the progress of unnamed bars as segmented blocks and of named bars as a coloured gradient
labelled with the bar's uniqueID.
Parameters
- barInfo Map The bar: position, size,
color,progressWidthanduniqueID
Called after the main menu has initialized; the theme does nothing here.
Parameters
- panel Panel The main menu
THEME.hooks:PostMainMenuOpenPanel(panel, panelToOpen)
client gamemodes/cwhl2rp/schema/cl_theme.lua:324Called after a main menu panel is opened; the theme does nothing here.
Parameters
- panel Panel The main menu
- panelToOpen Panel The opened panel
Called after the main menu is painted; the theme does nothing here.
Parameters
- panel Panel The main menu
Called after the main menu is rebuilt; the theme does nothing here.
Parameters
- panel Panel The main menu
Called every frame the main menu is open; the theme does nothing here.
Parameters
- panel Panel The main menu
Called just before a bar is drawn.
Draws a light frame for unnamed bars and a dark gradient for bars with a uniqueID, disables the
default background and progress drawing and uppercases the bar text.
Parameters
- barInfo Map The bar:
x,y,width,height,uniqueID,text,drawBackgroundanddrawProgress, changed in place
THEME.module:PreDrawPlayerInfo(boxInfo, information, subInformation)
client gamemodes/cwhl2rp/schema/cl_theme.lua:293Called just before the local player's info box is drawn; hides the box's background.
Parameters
- boxInfo Map The box;
drawBackgroundis set tofalse - information List The info lines
- subInformation List The sub-info lines
Called just before the weapon selection info is drawn; draws a grey box instead of the default background.
Parameters
- info Map The box:
x,y,width,heightanddrawBackground
Styles a form's label as white uppercase text with a shadow.
Parameters
- panel Panel The
DForm
Styles a list view label with white text and a small inset.
Parameters
- panel Panel The label
Styles a menu option with white text.
Parameters
- panel Panel The menu option