Fix inventory items draggable state (issue #78)

This commit is contained in:
Nimetu 2014-01-03 20:31:14 +02:00
parent 913e653f5b
commit 9072c944a2
4 changed files with 15 additions and 0 deletions

View file

@ -84,6 +84,8 @@ CDBGroupListSheet::CDBGroupListSheet(const TCtorParam &param)
_CacheAnimalStatus= -1; _CacheAnimalStatus= -1;
_ListLeaveSpace= false; _ListLeaveSpace= false;
_Draggable = false;
} }
// *************************************************************************** // ***************************************************************************
@ -227,6 +229,10 @@ bool CDBGroupListSheet::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
_AnimalStatus= NLGUI::CDBManager::getInstance()->getDbProp((const char*)prop, false); _AnimalStatus= NLGUI::CDBManager::getInstance()->getDbProp((const char*)prop, false);
} }
// issue #78: dragable is not parsed by _CtrlInfo, need to do it here.
prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" );
if (prop) _Draggable = convertBool(prop);
return true; return true;
} }
@ -864,6 +870,7 @@ void CDBGroupListSheet::setup()
ctrl->setToolTipParent(getToolTipParent()); ctrl->setToolTipParent(getToolTipParent());
ctrl->setToolTipParentPosRef(getToolTipParentPosRef()); ctrl->setToolTipParentPosRef(getToolTipParentPosRef());
ctrl->setToolTipPosRef(getToolTipPosRef()); ctrl->setToolTipPosRef(getToolTipPosRef());
ctrl->setDraggable(_Draggable);
// link on the element i+_StartDbIdx // link on the element i+_StartDbIdx
if (_DisplayEmptySlot) if (_DisplayEmptySlot)
{ {

View file

@ -171,6 +171,7 @@ protected:
bool _Squarify : 1; bool _Squarify : 1;
bool _CanDrop : 1; bool _CanDrop : 1;
bool _Draggable : 1;
// Children // Children
bool _Setuped; bool _Setuped;

View file

@ -69,6 +69,7 @@ CDBGroupListSheetText::CDBGroupListSheetText(const TCtorParam &param)
_AnimalStatus= NULL; _AnimalStatus= NULL;
_CacheAnimalStatus= -1; _CacheAnimalStatus= -1;
_CanDrop= false; _CanDrop= false;
_Draggable= false;
for(uint i=0;i<CHARACTERISTICS::NUM_CHARACTERISTICS;i++) for(uint i=0;i<CHARACTERISTICS::NUM_CHARACTERISTICS;i++)
_LastPlayerCharac[i]= 0; _LastPlayerCharac[i]= 0;
@ -214,6 +215,10 @@ bool CDBGroupListSheetText::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
_AnimalStatus= NLGUI::CDBManager::getInstance()->getDbProp((const char*)prop, false); _AnimalStatus= NLGUI::CDBManager::getInstance()->getDbProp((const char*)prop, false);
} }
// issue #78: dragable is not parsed by _CtrlInfo, need to do it here.
prop = (char*) xmlGetProp( cur, (xmlChar*)"dragable" );
if (prop) _Draggable = convertBool(prop);
return true; return true;
} }
@ -855,6 +860,7 @@ void CDBGroupListSheetText::setup()
ctrl->setParamsOnLeftClick(toString(i)); ctrl->setParamsOnLeftClick(toString(i));
ctrl->setActionOnRightClick("lst_rclick"); ctrl->setActionOnRightClick("lst_rclick");
ctrl->setParamsOnRightClick(toString(i)); ctrl->setParamsOnRightClick(toString(i));
ctrl->setDraggable(_Draggable);
// Add it to the list. // Add it to the list.
_List->addCtrl(ctrl); _List->addCtrl(ctrl);

View file

@ -224,6 +224,7 @@ protected:
bool _GrayTextWithCtrlState; bool _GrayTextWithCtrlState;
bool _CanDrop; bool _CanDrop;
bool _Draggable;
// Common Info for ctrl and group // Common Info for ctrl and group
CCtrlSheetInfo _CtrlInfo; CCtrlSheetInfo _CtrlInfo;