The base panel (fl_base_panel) that most Flux panels derive from. It holds the common appearance fields with their accessors (SetDrawBackground, SetBackgroundColor, SetTextColor, SetMainColor, SetAccentColor, SetTitle and SetFont), leaves painting and thinking to the active theme's PaintPanel and PanelThink hooks, and gives every derived panel the MVC helpers push, pull and request for exchanging data with the server. Register your own panels with fl_base_panel as their base rather than using it on its own.

Summary

Methods

Init()client
Gives the panel the theme's 'main_font', the 'flRoboto' font scaled to the screen, unless it has been given a font of its own.
Delegates drawing of the panel to the active theme's PaintPanel hook.
Registers a callback for data the server pushes to this client under the name.
Sends an MVC request to the server-side handlers registered under the name.
Sends an MVC request to the server and registers a one-time callback for its response.
Think()client
Runs the active theme's PanelThink hook for this panel.

Methods

Gives the panel the theme's 'main_font', the 'flRoboto' font scaled to the screen, unless it has been given a font of its own. This happens when the panel is created rather than when the file is loaded, which is before the theme and its fonts exist.

PANEL:Paint(width, height)

client packages/active_ui/views/base/cl_basepanel.lua:40

Delegates drawing of the panel to the active theme's PaintPanel hook.

Parameters

  • width Number panel width
  • height Number panel height

PANEL:pull(name, handler, prevent_remove)

client packages/active_ui/views/base/cl_basepanel.lua:63

Registers a callback for data the server pushes to this client under the name. The callback is removed after it has run once unless prevent_remove is set.

Parameters

  • name String name of the MVC response to wait for
  • handler Function called with the values sent by the server
  • prevent_remove Boolean optional, defaults to false keep the handler registered after it has run

See also

Sends an MVC request to the server-side handlers registered under the name.

Parameters

  • name String name of the MVC handler
  • ... Vararg data passed to the server-side handler

See also

PANEL:request(name, handler, ...)

client packages/active_ui/views/base/cl_basepanel.lua:79

Sends an MVC request to the server and registers a one-time callback for its response.

self:request('fl_create_character', function(response)
  if response.success then
    self:clear_data()
  end
end, self.char_data)

Parameters

  • name String name of the MVC handler
  • handler Function called once with the values the server responds with
  • ... Vararg data passed to the server-side handler

See also

Runs the active theme's PanelThink hook for this panel.

Defined in