s32 start_item_i;
};
+ struct ListRingSpec
+ {
+ ListRingSpec()
+ {
+ }
+ ListRingSpec(const InventoryLocation &a_inventoryloc,
+ const std::string &a_listname):
+ inventoryloc(a_inventoryloc),
+ listname(a_listname)
+ {
+ }
+
+ InventoryLocation inventoryloc;
+ std::string listname;
+ };
+
struct ImageDrawSpec
{
- ImageDrawSpec()
+ ImageDrawSpec():
+ parent_button(NULL)
+ {
+ }
+ ImageDrawSpec(const std::string &a_name,
+ const std::string &a_item_name,
+ gui::IGUIButton *a_parent_button,
+ const v2s32 &a_pos, const v2s32 &a_geom):
+ name(a_name),
+ item_name(a_item_name),
+ parent_button(a_parent_button),
+ pos(a_pos),
+ geom(a_geom),
+ scale(true)
{
}
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),
+ parent_button(NULL),
pos(a_pos),
- geom(a_geom)
+ geom(a_geom),
+ scale(true)
{
- 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)
+ parent_button(NULL),
+ pos(a_pos),
+ geom(a_geom),
+ scale(true)
+ {
+ }
+ ImageDrawSpec(const std::string &a_name,
+ const v2s32 &a_pos):
+ name(a_name),
+ parent_button(NULL),
+ pos(a_pos),
+ scale(false)
{
- scale = false;
}
std::string name;
+ std::string item_name;
+ gui::IGUIButton *parent_button;
v2s32 pos;
v2s32 geom;
bool scale;
irr::video::SColor color;
};
+ struct StaticTextSpec {
+ StaticTextSpec():
+ parent_button(NULL)
+ {
+ }
+ StaticTextSpec(const std::wstring &a_text,
+ const core::rect<s32> &a_rect):
+ text(a_text),
+ rect(a_rect),
+ parent_button(NULL)
+ {
+ }
+ StaticTextSpec(const std::wstring &a_text,
+ const core::rect<s32> &a_rect,
+ gui::IGUIButton *a_parent_button):
+ text(a_text),
+ rect(a_rect),
+ parent_button(a_parent_button)
+ {
+ }
+ std::wstring text;
+ core::rect<s32> rect;
+ gui::IGUIButton *parent_button;
+ };
+
public:
GUIFormSpecMenu(irr::IrrlichtDevice* dev,
gui::IGUIElement* parent, s32 id,
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();
std::vector<ListDrawSpec> m_inventorylists;
+ std::vector<ListRingSpec> m_inventory_rings;
std::vector<ImageDrawSpec> m_backgrounds;
std::vector<ImageDrawSpec> m_images;
std::vector<ImageDrawSpec> m_itemimages;
std::vector<BoxDrawSpec> m_boxes;
std::vector<FieldSpec> m_fields;
+ std::vector<StaticTextSpec> m_static_texts;
std::vector<std::pair<FieldSpec,GUITable*> > m_tables;
std::vector<std::pair<FieldSpec,gui::IGUICheckBox*> > m_checkboxes;
std::map<std::string, TooltipSpec> m_tooltips;
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;
void parseSize(parserData* data,std::string element);
void parseList(parserData* data,std::string element);
+ void parseListRing(parserData* data,std::string element);
void parseCheckbox(parserData* data,std::string element);
void parseImage(parserData* data,std::string element);
void parseItemImage(parserData* data,std::string element);