ManaPlus
Public Member Functions | Private Attributes
GuiConfigListener Class Reference

#include <guiconfiglistener.h>

Inheritance diagram for GuiConfigListener:
ConfigListener

Public Member Functions

 GuiConfigListener (Gui *const g)
 
 ~GuiConfigListener ()
 
void optionChanged (const std::string &name)
 
- Public Member Functions inherited from ConfigListener
 ConfigListener ()
 
virtual ~ConfigListener ()
 

Private Attributes

GuimGui
 

Detailed Description

Definition at line 35 of file guiconfiglistener.h.

Constructor & Destructor Documentation

◆ GuiConfigListener()

GuiConfigListener::GuiConfigListener ( Gui *const  g)
inlineexplicit

Definition at line 38 of file guiconfiglistener.h.

38  :
39  mGui(g)
40  {}

◆ ~GuiConfigListener()

GuiConfigListener::~GuiConfigListener ( )
inline

Definition at line 44 of file guiconfiglistener.h.

45  {
47  }
#define CHECKLISTENERS
Definition: localconsts.h:277

References CHECKLISTENERS.

Member Function Documentation

◆ optionChanged()

void GuiConfigListener::optionChanged ( const std::string &  name)
inlinevirtual

Called when an option changed. The config listener will have to be registered to the option name first.

Implements ConfigListener.

Definition at line 49 of file guiconfiglistener.h.

50  {
51  if (mGui == nullptr)
52  return;
53  if (name == "customcursor")
54  mGui->setUseCustomCursor(config.getBoolValue("customcursor"));
55  else if (name == "doubleClick")
56  mGui->setDoubleClick(config.getBoolValue("doubleClick"));
57  }
bool getBoolValue(const std::string &key) const
void setUseCustomCursor(const bool customCursor)
Definition: gui.cpp:554
void setDoubleClick(const bool b)
Definition: gui.h:199
Configuration config

References config, Configuration::getBoolValue(), mGui, Gui::setDoubleClick(), and Gui::setUseCustomCursor().

Field Documentation

◆ mGui

Gui* GuiConfigListener::mGui
private

Definition at line 59 of file guiconfiglistener.h.

Referenced by optionChanged().


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