]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiFormSpecMenu.h
Remove superfluous pointer null checks
[minetest.git] / src / guiFormSpecMenu.h
index 18ccf1c3ad2b1f19562ca53a1defce5cd31cb4a6..d08bb4ab59cdbdebed78c896365a7ea2423c3810 100644 (file)
@@ -310,18 +310,14 @@ class GUIFormSpecMenu : public GUIModalMenu
        // form_src is deleted by this GUIFormSpecMenu
        void setFormSource(IFormSource *form_src)
        {
-               if (m_form_src != NULL) {
-                       delete m_form_src;
-               }
+               delete m_form_src;
                m_form_src = form_src;
        }
 
        // text_dst is deleted by this GUIFormSpecMenu
        void setTextDest(TextDest *text_dst)
        {
-               if (m_text_dst != NULL) {
-                       delete m_text_dst;
-               }
+               delete m_text_dst;
                m_text_dst = text_dst;
        }
 
@@ -397,7 +393,7 @@ class GUIFormSpecMenu : public GUIModalMenu
        std::vector<ImageDrawSpec> m_images;
        std::vector<ImageDrawSpec> m_itemimages;
        std::vector<BoxDrawSpec> m_boxes;
-       UNORDERED_MAP<std::string, bool> field_close_on_enter;
+       std::unordered_map<std::string, bool> field_close_on_enter;
        std::vector<FieldSpec> m_fields;
        std::vector<StaticTextSpec> m_static_texts;
        std::vector<std::pair<FieldSpec,GUITable*> > m_tables;
@@ -420,8 +416,8 @@ class GUIFormSpecMenu : public GUIModalMenu
        v2s32 m_old_pointer;  // Mouse position after previous mouse event
        gui::IGUIStaticText *m_tooltip_element;
 
-       u32 m_tooltip_show_delay;
-       s64 m_hovered_time;
+       u64 m_tooltip_show_delay;
+       u64 m_hovered_time;
        s32 m_old_tooltip_id;
        std::wstring m_old_tooltip;
 
@@ -460,7 +456,7 @@ class GUIFormSpecMenu : public GUIModalMenu
                GUITable::TableOptions table_options;
                GUITable::TableColumns table_columns;
                // used to restore table selection/scroll/treeview state
-               UNORDERED_MAP<std::string, GUITable::DynamicData> table_dyndata;
+               std::unordered_map<std::string, GUITable::DynamicData> table_dyndata;
        } parserData;
 
        typedef struct {
@@ -517,6 +513,9 @@ class GUIFormSpecMenu : public GUIModalMenu
 
        void tryClose();
 
+       void showTooltip(const std::wstring &text, const irr::video::SColor &color,
+               const irr::video::SColor &bgcolor);
+
        /**
         * check if event is part of a double click
         * @param event event to evaluate