Fix inventory items draggable state (issue #78)

--HG--
branch : misc-patches
hg/feature/sse2
Nimetu 11 years ago
parent 3cd6ecdb82
commit 0bad9f2f5e

@ -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)
{

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

@ -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);

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

Loading…
Cancel
Save