From 9072c944a23d1909d23f4e47fa2799ea7b6e0461 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 3 Jan 2014 20:31:14 +0200 Subject: [PATCH] Fix inventory items draggable state (issue #78) --- code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp | 7 +++++++ code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h | 1 + .../client/src/interface_v3/dbgroup_list_sheet_text.cpp | 6 ++++++ .../client/src/interface_v3/dbgroup_list_sheet_text.h | 1 + 4 files changed, 15 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp index b5092be67..74bd2be47 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.cpp @@ -84,6 +84,8 @@ CDBGroupListSheet::CDBGroupListSheet(const TCtorParam ¶m) _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) { diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h index a78ce8308..546b80b0d 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet.h @@ -171,6 +171,7 @@ protected: bool _Squarify : 1; bool _CanDrop : 1; + bool _Draggable : 1; // Children bool _Setuped; diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp index 9d108926c..a05d1e4aa 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.cpp @@ -69,6 +69,7 @@ CDBGroupListSheetText::CDBGroupListSheetText(const TCtorParam ¶m) _AnimalStatus= NULL; _CacheAnimalStatus= -1; _CanDrop= false; + _Draggable= false; for(uint i=0;igetDbProp((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); diff --git a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h index 2ae903c25..e607883d3 100644 --- a/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h +++ b/code/ryzom/client/src/interface_v3/dbgroup_list_sheet_text.h @@ -224,6 +224,7 @@ protected: bool _GrayTextWithCtrlState; bool _CanDrop; + bool _Draggable; // Common Info for ctrl and group CCtrlSheetInfo _CtrlInfo;