Fix inventory items draggable state (issue #78)
--HG-- branch : misc-patches
This commit is contained in:
parent
3cd6ecdb82
commit
0bad9f2f5e
4 changed files with 15 additions and 0 deletions
|
@ -84,6 +84,8 @@ CDBGroupListSheet::CDBGroupListSheet(const TCtorParam ¶m)
|
||||||
_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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -69,6 +69,7 @@ CDBGroupListSheetText::CDBGroupListSheetText(const TCtorParam ¶m)
|
||||||
_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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue