summaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2016-01-24 14:19:17 +0100
committerest31 <MTest31@outlook.com>2016-02-07 19:51:55 +0100
commit6cd2b3b445bf558fda1e5a7908adef8e3a45449a (patch)
treee8c48b85e55f4e86246ee21e093cee7f80146c04 /src/guiFormSpecMenu.h
parentbf884e37a06e0a8dd6c31789a69921f07ec5a9a9 (diff)
downloadminetest-6cd2b3b445bf558fda1e5a7908adef8e3a45449a.tar.gz
minetest-6cd2b3b445bf558fda1e5a7908adef8e3a45449a.tar.bz2
minetest-6cd2b3b445bf558fda1e5a7908adef8e3a45449a.zip
Use meshes to display inventory items
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r--src/guiFormSpecMenu.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index 2ba47f7ff..9b892f192 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -143,21 +143,32 @@ class GUIFormSpecMenu : public GUIModalMenu
{
}
ImageDrawSpec(const std::string &a_name,
- v2s32 a_pos, v2s32 a_geom):
+ const std::string &a_item_name,
+ const v2s32 &a_pos, const v2s32 &a_geom):
name(a_name),
+ item_name (a_item_name),
pos(a_pos),
geom(a_geom)
{
scale = true;
}
ImageDrawSpec(const std::string &a_name,
- v2s32 a_pos):
+ const v2s32 &a_pos, const v2s32 &a_geom):
+ name(a_name),
+ pos(a_pos),
+ geom(a_geom)
+ {
+ scale = true;
+ }
+ ImageDrawSpec(const std::string &a_name,
+ const v2s32 &a_pos):
name(a_name),
pos(a_pos)
{
scale = false;
}
std::string name;
+ std::string item_name;
v2s32 pos;
v2s32 geom;
bool scale;
@@ -282,7 +293,7 @@ public:
void regenerateGui(v2u32 screensize);
ItemSpec getItemAtPos(v2s32 p) const;
- void drawList(const ListDrawSpec &s, int phase);
+ void drawList(const ListDrawSpec &s, int phase, bool &item_hovered);
void drawSelectedItem();
void drawMenu();
void updateSelectedItem();
@@ -334,6 +345,8 @@ protected:
std::vector<std::pair<FieldSpec,gui::IGUIScrollBar*> > m_scrollbars;
ItemSpec *m_selected_item;
+ f32 m_timer1;
+ f32 m_timer2;
u32 m_selected_amount;
bool m_selected_dragging;
@@ -373,6 +386,7 @@ private:
TextDest *m_text_dst;
unsigned int m_formspec_version;
std::string m_focused_element;
+ bool m_selection_active;
typedef struct {
bool explicit_size;