#include "constants.h"
#include "keycode.h"
#include "strfnd.h"
+#include <IGUICheckBox.h>
+#include <IGUIEditBox.h>
+#include <IGUIButton.h>
+#include <IGUIStaticText.h>
+#include <IGUIFont.h>
+#include "log.h"
void drawInventoryItem(video::IVideoDriver *driver,
gui::IGUIFont *font,
}
if(event.EventType==EET_MOUSE_INPUT_EVENT)
{
- if(event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN
- || event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN)
+ char amount = -1;
+
+ if(event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
+ amount = 0;
+ else if(event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN)
+ amount = 1;
+ else if(event.MouseInput.Event == EMIE_MMOUSE_PRESSED_DOWN)
+ amount = 10;
+
+ if(amount >= 0)
{
- bool right = (event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN);
v2s32 p(event.MouseInput.X, event.MouseInput.Y);
- //dstream<<"Mouse down at p=("<<p.X<<","<<p.Y<<")"<<std::endl;
+ //infostream<<"Mouse down at p=("<<p.X<<","<<p.Y<<")"<<std::endl;
ItemSpec s = getItemAtPos(p);
if(s.isValid())
{
- dstream<<"Mouse down on "<<s.inventoryname
+ infostream<<"Mouse down on "<<s.inventoryname
<<"/"<<s.listname<<" "<<s.i<<std::endl;
if(m_selected_item)
{
InventoryList *list_to =
inv_to->getList(s.listname);
if(list_from == NULL)
- dstream<<"from list doesn't exist"<<std::endl;
+ infostream<<"from list doesn't exist"<<std::endl;
if(list_to == NULL)
- dstream<<"to list doesn't exist"<<std::endl;
+ infostream<<"to list doesn't exist"<<std::endl;
// Indicates whether source slot completely empties
bool source_empties = false;
if(list_from && list_to
&& list_from->getItem(m_selected_item->i) != NULL)
{
- dstream<<"Handing IACTION_MOVE to manager"<<std::endl;
+ infostream<<"Handing IACTION_MOVE to manager"<<std::endl;
IMoveAction *a = new IMoveAction();
- a->count = right ? 1 : 0;
+ a->count = amount;
a->from_inv = m_selected_item->inventoryname;
a->from_list = m_selected_item->listname;
a->from_i = m_selected_item->i;
}
// Remove selection if target was left-clicked or source
// slot was emptied
- if(right == false || source_empties)
+ if(amount == 0 || source_empties)
{
delete m_selected_item;
m_selected_item = NULL;
{
if(!canTakeFocus(event.GUIEvent.Element))
{
- dstream<<"GUIInventoryMenu: Not allowing focus change."
+ infostream<<"GUIInventoryMenu: Not allowing focus change."
<<std::endl;
// Returning true disables focus change
return true;
while(f.atend() == false)
{
std::string type = trim(f.next("["));
- //dstream<<"type="<<type<<std::endl;
+ //infostream<<"type="<<type<<std::endl;
if(type == "list")
{
std::string name = f.next(";");
s32 pos_y = stoi(f.next(";"));
s32 geom_x = stoi(f.next(","));
s32 geom_y = stoi(f.next(";"));
- dstream<<"list name="<<name<<", subname="<<subname
+ infostream<<"list name="<<name<<", subname="<<subname
<<", pos=("<<pos_x<<","<<pos_y<<")"
<<", geom=("<<geom_x<<","<<geom_y<<")"
<<std::endl;
{
invsize.X = stoi(f.next(","));
invsize.Y = stoi(f.next(";"));
- dstream<<"invsize ("<<invsize.X<<","<<invsize.Y<<")"<<std::endl;
+ infostream<<"invsize ("<<invsize.X<<","<<invsize.Y<<")"<<std::endl;
f.next("]");
}
else
{
// Ignore others
std::string ts = f.next("]");
- dstream<<"Unknown DrawSpec: type="<<type<<", data=\""<<ts<<"\""
+ infostream<<"Unknown DrawSpec: type="<<type<<", data=\""<<ts<<"\""
<<std::endl;
}
}