CHANGED: #1471 CWidgetManager no longer depends on CGroupInScene.

This commit is contained in:
dfighter1985 2012-06-08 00:28:47 +02:00
parent d9e1fcad72
commit 9f09f4d080
6 changed files with 16 additions and 13 deletions

View file

@ -59,7 +59,7 @@ CGroupInScene::CGroupInScene(const TCtorParam &param)
Position= CVector::Null; Position= CVector::Null;
_ProjCenter= CVector::Null; _ProjCenter= CVector::Null;
_DepthForZSort= 0.f; _IsGroupInScene = true;
} }
// *************************************************************************** // ***************************************************************************

View file

@ -66,9 +66,6 @@ public:
sint32 getOffsetY() const { return _OffsetY; } sint32 getOffsetY() const { return _OffsetY; }
void setOffsetY(sint32 dmh) { _OffsetY = dmh; } void setOffsetY(sint32 dmh) { _OffsetY = dmh; }
// Return the current Depth, with no ZBias applied.
float getDepthForZSort() const { return _DepthForZSort; }
// set/return the ZBias for this group in scene (default 0) // set/return the ZBias for this group in scene (default 0)
void setZBias(float zbias) {_ZBias= zbias;} void setZBias(float zbias) {_ZBias= zbias;}
float getZBias() const {return _ZBias;} float getZBias() const {return _ZBias;}
@ -80,9 +77,6 @@ protected:
// Projected Position memorized. x/y is in window coordinate, while z in is world/camera coordinate // Projected Position memorized. x/y is in window coordinate, while z in is world/camera coordinate
NLMISC::CVector _ProjCenter; NLMISC::CVector _ProjCenter;
// Projected Depth with no ZBias applied
float _DepthForZSort;
// Offset // Offset
sint32 _OffsetX, _OffsetY; sint32 _OffsetX, _OffsetY;

View file

@ -16,8 +16,6 @@
#include "stdpch.h"
#include "group_modal.h" #include "group_modal.h"
#include "interface_manager.h" #include "interface_manager.h"
#include "interface_element.h" #include "interface_element.h"

View file

@ -55,6 +55,7 @@ CInterfaceGroup::CInterfaceGroup(const TCtorParam &param) : CCtrlBase(param)
_UseCursor = true; _UseCursor = true;
_IsGroupContainer = false; _IsGroupContainer = false;
_IsGroupScrollText = false; _IsGroupScrollText = false;
_IsGroupInScene = false;
_AHOnActive = NULL; _AHOnActive = NULL;
_AHOnDeactive = NULL; _AHOnDeactive = NULL;
_AHOnLeftClick = NULL; _AHOnLeftClick = NULL;
@ -63,6 +64,7 @@ CInterfaceGroup::CInterfaceGroup(const TCtorParam &param) : CCtrlBase(param)
_AHOnEscape = NULL; _AHOnEscape = NULL;
_NeedFrameUpdatePos= false; _NeedFrameUpdatePos= false;
_LUAEnvTableCreated= false; _LUAEnvTableCreated= false;
_DepthForZSort= 0.f;
#ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS #ifdef AJM_DEBUG_TRACK_INTERFACE_GROUPS
CInterfaceManager::getInstance()->DebugTrackGroupsCreated( this ); CInterfaceManager::getInstance()->DebugTrackGroupsCreated( this );

View file

@ -249,6 +249,7 @@ public:
// quick way to know if the group is a CGroupContainer // quick way to know if the group is a CGroupContainer
bool isGroupContainer() const { return _IsGroupContainer; } bool isGroupContainer() const { return _IsGroupContainer; }
bool isGroupScrollText() const{ return _IsGroupScrollText; } bool isGroupScrollText() const{ return _IsGroupScrollText; }
bool isGroupInScene() const{ return _IsGroupInScene; }
CInterfaceGroup* getEnclosingContainer(); CInterfaceGroup* getEnclosingContainer();
@ -305,6 +306,9 @@ public:
virtual CInterfaceElement *clone(); virtual CInterfaceElement *clone();
virtual void serial(NLMISC::IStream &f); virtual void serial(NLMISC::IStream &f);
// Return the current Depth, with no ZBias applied.
float getDepthForZSort() const { return _DepthForZSort; }
protected: protected:
void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH); void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH);
@ -347,11 +351,15 @@ protected:
bool _UseCursor : 1; bool _UseCursor : 1;
bool _IsGroupContainer : 1; // faster than a virual call bool _IsGroupContainer : 1; // faster than a virual call
bool _IsGroupScrollText : 1; bool _IsGroupScrollText : 1;
bool _IsGroupInScene : 1;
bool _NeedFrameUpdatePos : 1; // typically For CGroupInScene bool _NeedFrameUpdatePos : 1; // typically For CGroupInScene
sint32 _ResizeFromChildWMargin; sint32 _ResizeFromChildWMargin;
sint32 _ResizeFromChildHMargin; sint32 _ResizeFromChildHMargin;
sint32 _GroupSizeRef; sint32 _GroupSizeRef;
// Projected Depth with no ZBias applied
float _DepthForZSort;
// handler for activation // handler for activation
IActionHandler *_AHOnActive; IActionHandler *_AHOnActive;
CStringShared _AHOnActiveParams; CStringShared _AHOnActiveParams;

View file

@ -17,9 +17,10 @@
#include "widget_manager.h" #include "widget_manager.h"
#include "interface_group.h" #include "interface_group.h"
#include "group_container.h" #include "group_container.h"
#include "group_in_scene.h" #include "group_modal.h"
#include "view_pointer_base.h"
#include "nel/gui/view_renderer.h"
#include "view_pointer_base.h"
#include "group_editbox_base.h" #include "group_editbox_base.h"
#include "ctrl_draggable.h" #include "ctrl_draggable.h"
@ -38,7 +39,7 @@ void CWidgetManager::SMasterGroup::addWindow(CInterfaceGroup *pIG, uint8 nPrio)
// Priority WIN_PRIORITY_WORLD_SPACE is only for CGroupInScene ! // Priority WIN_PRIORITY_WORLD_SPACE is only for CGroupInScene !
// Add this group in another priority list // Add this group in another priority list
nlassert ((nPrio!=WIN_PRIORITY_MAX) || (dynamic_cast<CGroupInScene*>(pIG)!=NULL)); nlassert ((nPrio!=WIN_PRIORITY_MAX) || pIG->isGroupInScene() );
for (uint8 i = 0; i < WIN_PRIORITY_MAX; ++i) for (uint8 i = 0; i < WIN_PRIORITY_MAX; ++i)
{ {
@ -239,7 +240,7 @@ void CWidgetManager::SMasterGroup::sortWorldSpaceGroup ()
sortTable.push_back (CElementToSort ()); sortTable.push_back (CElementToSort ());
CElementToSort &elm = sortTable.back(); CElementToSort &elm = sortTable.back();
elm.pIG = *it; elm.pIG = *it;
elm.Distance = (static_cast<CGroupInScene*>(*it))->getDepthForZSort(); elm.Distance = (*it)->getDepthForZSort();
it++; it++;
} }