lxgui
Public Member Functions | List of all members
lxgui::gui::addon_registry Class Reference

Loads and owns addons. More...

#include <gui_addon_registry.hpp>

Public Member Functions

 addon_registry (sol::state &lua, localizer &loc, event_emitter &emitter, root &r, virtual_root &vr)
 Constructor. More...
 
 addon_registry (const addon_registry &)=delete
 
 addon_registry (addon_registry &&)=delete
 
addon_registryoperator= (const addon_registry &)=delete
 
addon_registryoperator= (addon_registry &&)=delete
 
void load_addon_directory (const std::string &directory)
 Parse all addons inside a directory. More...
 
const addonget_current_addon ()
 Returns the addon that is being parsed. More...
 
void set_current_addon (const addon *a)
 Sets the current addon. More...
 
void save_variables () const
 Save Lua variables registred for saving for all addons. More...
 

Detailed Description

Loads and owns addons.

Definition at line 29 of file gui_addon_registry.hpp.

Constructor & Destructor Documentation

◆ addon_registry() [1/3]

lxgui::gui::addon_registry::addon_registry ( sol::state &  lua,
localizer loc,
event_emitter emitter,
root r,
virtual_root vr 
)

Constructor.

Parameters
luaThe GUI Lua state
locThe localizer class, to load new translation into
emitterThe event emitter, to fire "addon loaded" events
rThe GUI root, to create new frames into
vrThe virtual root, to create new virtual frames into

Definition at line 22 of file gui_addon_registry.cpp.

◆ addon_registry() [2/3]

lxgui::gui::addon_registry::addon_registry ( const addon_registry )
delete

◆ addon_registry() [3/3]

lxgui::gui::addon_registry::addon_registry ( addon_registry &&  )
delete

Member Function Documentation

◆ get_current_addon()

const addon * lxgui::gui::addon_registry::get_current_addon ( )

Returns the addon that is being parsed.

Returns
The addon that is being parsed

Definition at line 247 of file gui_addon_registry.cpp.

◆ load_addon_directory()

void lxgui::gui::addon_registry::load_addon_directory ( const std::string &  directory)

Parse all addons inside a directory.

Parameters
directoryThe directory to load addons from
Note
The directory must contain a file named addon.txt, and listing all enabled (and possibly disabled) addons. Each addon is then a sub-directory.

Definition at line 132 of file gui_addon_registry.cpp.

◆ operator=() [1/2]

addon_registry& lxgui::gui::addon_registry::operator= ( addon_registry &&  )
delete

◆ operator=() [2/2]

addon_registry& lxgui::gui::addon_registry::operator= ( const addon_registry )
delete

◆ save_variables()

void lxgui::gui::addon_registry::save_variables ( ) const

Save Lua variables registred for saving for all addons.

Definition at line 222 of file gui_addon_registry.cpp.

◆ set_current_addon()

void lxgui::gui::addon_registry::set_current_addon ( const addon a)

Sets the current addon.

Parameters
aThe current addon
Note
The current addon is used to set the addon of each new region. This is normally set by the parser, while loading each addon. For regions created manually, after the loading stage, this is also set by frame, before each call to a handler function.

Definition at line 251 of file gui_addon_registry.cpp.


The documentation for this class was generated from the following files: