summaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-16 11:25:52 +0200
committerGitHub <noreply@github.com>2017-06-16 11:25:52 +0200
commit76be103a91d6987527af19e87d93007be8ba8a67 (patch)
treec83c21e7c0adc37251f77788023eb3c242a751ca /src/guiFormSpecMenu.h
parent49d6e5f4ab79078d1608c22a9cce286b3cf86eb9 (diff)
downloadminetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.gz
minetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.bz2
minetest-76be103a91d6987527af19e87d93007be8ba8a67.zip
C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)
* C++11 patchset 9: move hardcoded init parameters to class definitions C++11 introduced the possibility to define the default values directly in class definitions, do it on current code Also remove some unused attributes * CollisionInfo::bouncy * collisionMoveResult::collides_xy * collisionMoveResult::standing_on_unloaded * Clouds::speed * More constructor cleanups + some variables removal * remove only write guiFormSpecMenu::m_old_tooltip * move header included inside defintions in genericobject.h * remove some unused since years exception classes * remove unused & empty debug_stacks_init * remove unused & empty content_nodemeta_serialize_legacy * remove forgotten useless bool (bouncy) in collision.cpp code
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r--src/guiFormSpecMenu.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index d08bb4ab5..66b9b019a 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -402,9 +402,9 @@ protected:
std::vector<std::pair<FieldSpec,gui::IGUIScrollBar*> > m_scrollbars;
std::vector<std::pair<FieldSpec, std::vector<std::string> > > m_dropdowns;
- ItemSpec *m_selected_item;
- u32 m_selected_amount;
- bool m_selected_dragging;
+ ItemSpec *m_selected_item = nullptr;
+ u32 m_selected_amount = 0;
+ bool m_selected_dragging = false;
// WARNING: BLACK MAGIC
// Used to guess and keep up with some special things the server can do.
@@ -414,17 +414,16 @@ protected:
v2s32 m_pointer;
v2s32 m_old_pointer; // Mouse position after previous mouse event
- gui::IGUIStaticText *m_tooltip_element;
+ gui::IGUIStaticText *m_tooltip_element = nullptr;
u64 m_tooltip_show_delay;
- u64 m_hovered_time;
- s32 m_old_tooltip_id;
- std::wstring m_old_tooltip;
+ u64 m_hovered_time = 0;
+ s32 m_old_tooltip_id = -1;
- bool m_rmouse_auto_place;
+ bool m_rmouse_auto_place = false;
- bool m_allowclose;
- bool m_lock;
+ bool m_allowclose = true;
+ bool m_lock = false;
v2u32 m_lockscreensize;
bool m_bgfullscreen;
@@ -439,8 +438,8 @@ protected:
private:
IFormSource *m_form_src;
TextDest *m_text_dst;
- unsigned int m_formspec_version;
- std::string m_focused_element;
+ u32 m_formspec_version = 0;
+ std::string m_focused_element = "";
JoystickController *m_joystick;
typedef struct {
@@ -467,7 +466,7 @@ private:
} fs_key_pendig;
fs_key_pendig current_keys_pending;
- std::string current_field_enter_pending;
+ std::string current_field_enter_pending = "";
void parseElement(parserData* data, const std::string &element);
@@ -531,7 +530,7 @@ private:
clickpos m_doubleclickdetect[2];
int m_btn_height;
- gui::IGUIFont *m_font;
+ gui::IGUIFont *m_font = nullptr;
std::wstring getLabelByID(s32 id);
std::string getNameByID(s32 id);