Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
GUIKeyChangeMenu Class Reference

#include <guiKeyChangeMenu.h>

+ Inheritance diagram for GUIKeyChangeMenu:
+ Collaboration diagram for GUIKeyChangeMenu:

Public Member Functions

 GUIKeyChangeMenu (gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, IMenuManager *menumgr, ISimpleTextureSource *tsrc)
 
 ~GUIKeyChangeMenu ()
 
void regenerateGui (v2u32 screensize)
 
void drawMenu ()
 
bool acceptInput ()
 
bool OnEvent (const SEvent &event)
 
bool pausesGame ()
 
- Public Member Functions inherited from GUIModalMenu
 GUIModalMenu (gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, IMenuManager *menumgr, bool remap_dbl_click=true)
 
virtual ~GUIModalMenu ()
 
void allowFocusRemoval (bool allow)
 
bool canTakeFocus (gui::IGUIElement *e)
 
void draw ()
 
void quitMenu ()
 
virtual bool preprocessEvent (const SEvent &event)
 

Protected Member Functions

std::wstring getLabelByID (s32 id)
 
std::string getNameByID (s32 id)
 
- Protected Member Functions inherited from GUIModalMenu
ScalingInfo getScalingInfo (v2u32 screensize, v2u32 base_size)
 

Private Member Functions

void init_keys ()
 
bool resetMenu ()
 
void add_key (int id, std::wstring button_name, const std::string &setting_name)
 

Private Attributes

bool shift_down = false
 
key_settingactive_key = nullptr
 
gui::IGUIStaticText * key_used_text = nullptr
 
std::vector< key_setting * > key_settings
 
ISimpleTextureSourcem_tsrc
 

Additional Inherited Members

- Protected Attributes inherited from GUIModalMenu
v2s32 m_pointer
 
v2s32 m_old_pointer
 
v2u32 m_screensize_old
 
float m_gui_scale
 
bool m_second_touch = false
 

Constructor & Destructor Documentation

◆ GUIKeyChangeMenu()

GUIKeyChangeMenu::GUIKeyChangeMenu ( gui::IGUIEnvironment * env,
gui::IGUIElement * parent,
s32 id,
IMenuManager * menumgr,
ISimpleTextureSource * tsrc )

References init_keys().

+ Here is the call graph for this function:

◆ ~GUIKeyChangeMenu()

GUIKeyChangeMenu::~GUIKeyChangeMenu ( )

References key_settings, and key_used_text.

Member Function Documentation

◆ acceptInput()

bool GUIKeyChangeMenu::acceptInput ( )

References clearKeyCache(), g_gamecallback, g_settings, Settings::getLayer(), GUI_ID_CB_AUTOJUMP, GUI_ID_CB_AUX1_DESCENDS, GUI_ID_CB_DOUBLETAP_JUMP, key_settings, Settings::remove(), Settings::set(), Settings::setBool(), MainGameCallback::signalKeyConfigChange(), and SL_DEFAULTS.

Referenced by OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_key()

void GUIKeyChangeMenu::add_key ( int id,
std::wstring button_name,
const std::string & setting_name )
private

References key_setting::button_name, getKeySetting(), key_setting::id, key_setting::key, key_settings, and key_setting::setting_name.

Referenced by init_keys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawMenu()

void GUIKeyChangeMenu::drawMenu ( )
virtual

Implements GUIModalMenu.

◆ getLabelByID()

std::wstring GUIKeyChangeMenu::getLabelByID ( s32 id)
inlineprotectedvirtual

Implements GUIModalMenu.

◆ getNameByID()

std::string GUIKeyChangeMenu::getNameByID ( s32 id)
inlineprotectedvirtual

Implements GUIModalMenu.

◆ init_keys()

◆ OnEvent()

bool GUIKeyChangeMenu::OnEvent ( const SEvent & event)
virtual

Reimplemented from GUIModalMenu.

References acceptInput(), active_key, irr::gui::StaticText::add(), key_setting::button, GUIModalMenu::canTakeFocus(), FATAL_ERROR_IF, GUI_ID_ABORT_BUTTON, GUI_ID_BACK_BUTTON, infostream, key_setting::key, key_settings, key_used_text, KeyPress::name(), GUIModalMenu::quitMenu(), resetMenu(), shift_down, KeyPress::sym(), and wstrgettext().

+ Here is the call graph for this function:

◆ pausesGame()

bool GUIKeyChangeMenu::pausesGame ( )
inlinevirtual

Reimplemented from GUIModalMenu.

◆ regenerateGui()

◆ resetMenu()

bool GUIKeyChangeMenu::resetMenu ( )
private

References active_key, key_setting::button, key_setting::key, KeyPress::name(), and wstrgettext().

Referenced by OnEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ active_key

key_setting* GUIKeyChangeMenu::active_key = nullptr
private

Referenced by OnEvent(), and resetMenu().

◆ key_settings

std::vector<key_setting *> GUIKeyChangeMenu::key_settings
private

◆ key_used_text

gui::IGUIStaticText* GUIKeyChangeMenu::key_used_text = nullptr
private

◆ m_tsrc

ISimpleTextureSource* GUIKeyChangeMenu::m_tsrc
private

Referenced by regenerateGui().

◆ shift_down

bool GUIKeyChangeMenu::shift_down = false
private

Referenced by OnEvent().


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