Fix inventory items draggable state (issue #78)

--HG--
branch : misc-patches
This commit is contained in:
Nimetu 2014-01-03 20:31:14 +02:00
parent 3cd6ecdb82
commit 0bad9f2f5e
4 changed files with 15 additions and 0 deletions

View file

@ -84,6 +84,8 @@ CDBGroupListSheet::CDBGroupListSheet(const TCtorParam &param)
_CacheAnimalStatus= -1;
_ListLeaveSpace= false;
_Draggable = false;
}
// ***************************************************************************
@ -227,6 +229,10 @@ bool CDBGroupListSheet::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
_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;
}
@ -864,6 +870,7 @@ void CDBGroupListSheet::setup()
ctrl->setToolTipParent(getToolTipParent());
ctrl->setToolTipParentPosRef(getToolTipParentPosRef());
ctrl->setToolTipPosRef(getToolTipPosRef());
ctrl->setDraggable(_Draggable);
// link on the element i+_StartDbIdx
if (_DisplayEmptySlot)
{

View file

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

View file

@ -69,6 +69,7 @@ CDBGroupListSheetText::CDBGroupListSheetText(const TCtorParam &param)
_AnimalStatus= NULL;
_CacheAnimalStatus= -1;
_CanDrop= false;
_Draggable= false;
for(uint i=0;i<CHARACTERISTICS::NUM_CHARACTERISTICS;i++)
_LastPlayerCharac[i]= 0;
@ -214,6 +215,10 @@ bool CDBGroupListSheetText::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
_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;
}
@ -855,6 +860,7 @@ void CDBGroupListSheetText::setup()
ctrl->setParamsOnLeftClick(toString(i));
ctrl->setActionOnRightClick("lst_rclick");
ctrl->setParamsOnRightClick(toString(i));
ctrl->setDraggable(_Draggable);
// Add it to the list.
_List->addCtrl(ctrl);

View file

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