mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
CHANGED: #1471 CInterfaceElement no longer depends on CGroupContainer.
--HG-- branch : gui-refactoring
This commit is contained in:
parent
8437a0319d
commit
3c73de81a3
5 changed files with 14 additions and 17 deletions
|
@ -1340,7 +1340,7 @@ static ucstring getFreeTellerName(CInterfaceElement *pCaller)
|
|||
if (!pCaller) return ucstring();
|
||||
CChatGroupWindow *cgw = PeopleInterraction.getChatGroupWindow();
|
||||
if (!cgw) return ucstring();
|
||||
CGroupContainer *freeTeller = pCaller->getParentContainer();
|
||||
CInterfaceGroup *freeTeller = pCaller->getParentContainer();
|
||||
if (!freeTeller) return ucstring();
|
||||
return cgw->getFreeTellerName( freeTeller->getId() );
|
||||
}
|
||||
|
@ -1394,10 +1394,10 @@ public:
|
|||
}
|
||||
if (pCaller)
|
||||
{
|
||||
CGroupContainer *win = prevCaller->getParentContainer();
|
||||
CInterfaceGroup *win = prevCaller->getParentContainer();
|
||||
if (win)
|
||||
{
|
||||
win->setActive(false);
|
||||
static_cast< CGroupContainer* >( win )->setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2165,7 +2165,7 @@ void CGroupMap::setMap(SMap *map)
|
|||
_MapMaterial.setTexture(1, NULL);
|
||||
|
||||
// disable the map_back button for islands (islands can't be seen on the world map)
|
||||
CGroupContainer *gc = getParentContainer();
|
||||
CInterfaceGroup *gc = getParentContainer();
|
||||
if (gc)
|
||||
{
|
||||
CCtrlBase *mapBack = gc->getCtrl("map_back");
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "nel/gui/view_renderer.h"
|
||||
#include "widget_manager.h"
|
||||
#include "nel/gui/db_manager.h"
|
||||
#include "group_container.h"
|
||||
#include "interface_link.h"
|
||||
#include "nel/misc/xml_auto_ptr.h"
|
||||
#include "nel/gui/lua_ihm.h"
|
||||
|
@ -852,13 +851,15 @@ CInterfaceElement* CInterfaceElement::getMasterGroup() const
|
|||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CGroupContainer *CInterfaceElement::getParentContainer()
|
||||
CInterfaceGroup* CInterfaceElement::getParentContainer()
|
||||
{
|
||||
CInterfaceElement *parent = this;
|
||||
while (parent)
|
||||
{
|
||||
CGroupContainer *gc = dynamic_cast<CGroupContainer *>(parent);
|
||||
if (gc) return gc;
|
||||
CInterfaceGroup *gc = dynamic_cast< CInterfaceGroup* >( parent );
|
||||
if( ( gc != NULL ) && gc->isGroupContainer() )
|
||||
return gc;
|
||||
|
||||
parent = parent->getParent();
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
|
||||
using namespace NLGUI;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
class CInterfaceGroup;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class CInterfaceLink;
|
||||
class CInterfaceElement;
|
||||
class CInterfaceGroup;
|
||||
|
@ -147,7 +142,7 @@ public:
|
|||
CInterfaceElement* getMasterGroup() const;
|
||||
|
||||
// get a possible group container
|
||||
CGroupContainer *getParentContainer();
|
||||
CInterfaceGroup* getParentContainer();
|
||||
|
||||
bool getActive() const { return _Active; }
|
||||
|
||||
|
|
|
@ -225,8 +225,9 @@ CGroupContainer *CTool::isMouseOnContainer()
|
|||
if (groupsUnder.empty()) return NULL;
|
||||
for(uint k = 0; k < groupsUnder.size(); ++k)
|
||||
{
|
||||
CGroupContainer *gc = groupsUnder[k]->getParentContainer();
|
||||
if (gc) return gc;
|
||||
CInterfaceGroup* gc = groupsUnder[k]->getParentContainer();
|
||||
if (gc)
|
||||
return static_cast< CGroupContainer* >( gc );
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue