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

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 a rectangle with a colour; the skin's painters use it for backgrounds and borders.
Sets the theme's colours, logo and font options and downloads its gradient and logo images.
Lays out a frame's title in black uppercase text and its close button in the top-right corner.
Sizes a menu option to its text plus padding, at least as wide as the menu, and places its sub-menu arrow.
Paints a button with a black border, lighter when hovered and white with black text when pressed.
Paints a collapsible category's dark header and sets the header font.
Paints a frame's dark body and a title bar in a darkened information colour.
Paints a list view's white background, when it has one.
Paints a list view line in grey, white when selected, and sets its columns' text colour to match.
Paints a menu's near-black background.
Paints a hovered menu option white with black text.
Paints over a menu; overridden to draw nothing.
Paints a scroll bar grip as a black box with a white border.
Paints a property sheet tab, darker when it is not the active one.
Called after the character menu has initialized; the theme does nothing here.
Called after a character menu panel is opened; the theme does nothing here.
Called after the character menu is painted; the theme does nothing here.
Called every frame the character menu is open; the theme does nothing here.
Called just after a bar is drawn.
Called after the main menu has initialized; the theme does nothing here.
Called after a main menu panel is opened; the theme does nothing here.
Called after the main menu is painted; the theme does nothing here.
Called after the main menu is rebuilt; the theme does nothing here.
Called every frame the main menu is open; the theme does nothing here.
Called just before a bar is drawn.
Called just before the local player's info box is drawn; hides the box's background.
Called just before the weapon selection info is drawn; draws a grey box instead of the default background.
Styles a form's label as white uppercase text with a shadow.
Styles a list view label with white text and a small inset.
Styles a menu option with white text.

Methods

THEME:CreateFonts()

client gamemodes/cwhl2rp/schema/cl_theme.lua:11

Registers the theme's hl2_* fonts (Exo 2, Kelly Slab and Roboto Condensed) with cw.fonts:Add.

THEME.module:DrawBarLimit(barInfo)

client gamemodes/cwhl2rp/schema/cl_theme.lua:260

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, maxValue and limitText

Returns

  • Boolean Always true, replacing the default limit drawing

THEME.skin:DrawGenericBackground(x, y, w, h, color)

client gamemodes/cwhl2rp/schema/cl_theme.lua:368

Fills 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

THEME:Initialize()

client gamemodes/cwhl2rp/schema/cl_theme.lua:118

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.

THEME.skin:LayoutFrame(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:375

Lays out a frame's title in black uppercase text and its close button in the top-right corner.

Parameters

  • panel Panel The DFrame

THEME.skin:LayoutMenuOption(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:491

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

THEME.skin:PaintButton(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:508

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

THEME.skin:PaintCollapsibleCategory(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:560

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

THEME.skin:PaintFrame(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:543

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

THEME.skin:PaintListView(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:414

Paints a list view's white background, when it has one.

Parameters

  • panel Panel The DListView
  • w Number The width
  • h Number The height

THEME.skin:PaintListViewLine(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:423

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

THEME.skin:PaintMenu(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:455

Paints a menu's near-black background.

Parameters

  • panel Panel The DMenu
  • w Number The width
  • h Number The height

THEME.skin:PaintMenuOption(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:474

Paints a hovered menu option white with black text.

Parameters

  • panel Panel The menu option
  • w Number The width
  • h Number The height

THEME.skin:PaintOverMenu(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:462

Paints over a menu; overridden to draw nothing.

Parameters

  • panel Panel The DMenu

THEME.skin:PaintScrollBarGrip(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:532

Paints a scroll bar grip as a black box with a white border.

Parameters

  • panel Panel The grip

THEME.skin:PaintTab(panel, w, h)

client gamemodes/cwhl2rp/schema/cl_theme.lua:402

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

THEME.hooks:PostCharacterMenuInit(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:299

Called after the character menu has initialized; the theme does nothing here.

Parameters

  • panel Panel The character menu

THEME.hooks:PostCharacterMenuOpenPanel(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:311

Called after a character menu panel is opened; the theme does nothing here.

Parameters

  • panel Panel The opened panel

THEME.hooks:PostCharacterMenuPaint(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:307

Called after the character menu is painted; the theme does nothing here.

Parameters

  • panel Panel The character menu

THEME.hooks:PostCharacterMenuThink(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:303

Called every frame the character menu is open; the theme does nothing here.

Parameters

  • panel Panel The character menu

THEME.module:PostDrawBar(barInfo)

client gamemodes/cwhl2rp/schema/cl_theme.lua:226

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, progressWidth and uniqueID

THEME.hooks:PostMainMenuInit(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:315

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:324

Called after a main menu panel is opened; the theme does nothing here.

Parameters

  • panel Panel The main menu
  • panelToOpen Panel The opened panel

THEME.hooks:PostMainMenuPaint(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:328

Called after the main menu is painted; the theme does nothing here.

Parameters

  • panel Panel The main menu

THEME.hooks:PostMainMenuRebuild(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:319

Called after the main menu is rebuilt; the theme does nothing here.

Parameters

  • panel Panel The main menu

THEME.hooks:PostMainMenuThink(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:332

Called every frame the main menu is open; the theme does nothing here.

Parameters

  • panel Panel The main menu

THEME.module:PreDrawBar(barInfo)

client gamemodes/cwhl2rp/schema/cl_theme.lua:204

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, drawBackground and drawProgress, changed in place

THEME.module:PreDrawPlayerInfo(boxInfo, information, subInformation)

client gamemodes/cwhl2rp/schema/cl_theme.lua:293

Called just before the local player's info box is drawn; hides the box's background.

Parameters

  • boxInfo Map The box; drawBackground is set to false
  • information List The info lines
  • subInformation List The sub-info lines

THEME.module:PreDrawWeaponSelectionInfo(info)

client gamemodes/cwhl2rp/schema/cl_theme.lua:283

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, height and drawBackground

THEME.skin:SchemeForm(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:391

Styles a form's label as white uppercase text with a shadow.

Parameters

  • panel Panel The DForm

THEME.skin:SchemeListViewLabel(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:446

Styles a list view label with white text and a small inset.

Parameters

  • panel Panel The label

THEME.skin:SchemeMenuOption(panel)

client gamemodes/cwhl2rp/schema/cl_theme.lua:466

Styles a menu option with white text.

Parameters

  • panel Panel The menu option

Defined in