CHANGED: #1471 CGroupTable and CGroupCell no longer depend on CInterfaceManager, and a Ryzom game global.

--HG--
branch : gui-refactoring
This commit is contained in:
dfighter1985 2012-06-29 06:15:56 +02:00
parent 4ba859dc7c
commit baee35347b
4 changed files with 15 additions and 18 deletions

View file

@ -51,6 +51,7 @@ namespace NLGUI
virtual void addLuaClassAssociation( CInterfaceGroup *group, const std::string &luaScript ) = 0; virtual void addLuaClassAssociation( CInterfaceGroup *group, const std::string &luaScript ) = 0;
virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, const std::pair< std::string, std::string > *templateParams, uint numParams, bool updateLinks = true ) = 0; virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, const std::pair< std::string, std::string > *templateParams, uint numParams, bool updateLinks = true ) = 0;
virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, std::vector< std::pair< std::string, std::string > > &templateParams, bool updateLinks = true ) = 0; virtual CInterfaceGroup* createGroupInstance( const std::string &templateName, const std::string &parentID, std::vector< std::pair< std::string, std::string > > &templateParams, bool updateLinks = true ) = 0;
virtual bool parseGroupChildren( xmlNodePtr cur, CInterfaceGroup * parentGroup, bool reload );
}; };
/// Manages the GUI widgets /// Manages the GUI widgets

View file

@ -15,27 +15,21 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdpch.h"
#include "group_table.h" #include "group_table.h"
#include "interface_manager.h" #include "nel/gui/widget_manager.h"
#include "nel/gui/interface_element.h" #include "nel/gui/interface_element.h"
#include "../client_chat_manager.h"
#include "nel/gui/view_bitmap.h" #include "nel/gui/view_bitmap.h"
#include "nel/gui/view_text_id.h" #include "nel/gui/view_text_id.h"
#include "nel/gui/group_container.h" #include "nel/gui/group_container.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"
#include "nel/misc/i18n.h" #include "nel/misc/i18n.h"
#include "nel/misc/xml_auto_ptr.h" #include "nel/misc/xml_auto_ptr.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
extern CClientChatManager ChatMngr;
extern bool DebugUICell; bool CGroupCell::DebugUICell = false;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
CGroupCell::CGroupCell(const TCtorParam &param) CGroupCell::CGroupCell(const TCtorParam &param)
@ -91,7 +85,7 @@ bool CGroupCell::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup, uint colum
Group->setId(parentGroup->getId() + Group->getId()); Group->setId(parentGroup->getId() + Group->getId());
setEnclosedGroupDefaultParams(); setEnclosedGroupDefaultParams();
// parse the children // parse the children
bool ok = CInterfaceManager::getInstance()->parseGroupChildren(cur, Group, false); bool ok = CWidgetManager::parser->parseGroupChildren(cur, Group, false);
if (!ok) return false; if (!ok) return false;
// align // align
ptr = (char*) xmlGetProp( cur, (xmlChar*)"align" ); ptr = (char*) xmlGetProp( cur, (xmlChar*)"align" );
@ -191,8 +185,7 @@ bool CGroupCell::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup, uint colum
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void CGroupCell::draw () void CGroupCell::draw ()
{ {
CInterfaceManager *pIM = CInterfaceManager::getInstance(); if ( CGroupCell::DebugUICell )
if (DebugUICell)
{ {
// Draw cell // Draw cell
CViewRenderer &rVR = *CViewRenderer::getInstance(); CViewRenderer &rVR = *CViewRenderer::getInstance();
@ -791,7 +784,7 @@ void CGroupTable::checkCoords ()
} }
else else
{ {
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CCtrlBase *pCB = CWidgetManager::getInstance()->getCapturePointerLeft(); CCtrlBase *pCB = CWidgetManager::getInstance()->getCapturePointerLeft();
if (pCB != NULL) if (pCB != NULL)
{ {
@ -944,7 +937,6 @@ void CGroupTable::draw ()
sint32 border = Border + CellSpacing + CellPadding; sint32 border = Border + CellSpacing + CellPadding;
if (border) if (border)
{ {
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CRGBA finalColor; CRGBA finalColor;
finalColor.modulateFromColor (BgColor, CWidgetManager::getInstance()->getGlobalColor()); finalColor.modulateFromColor (BgColor, CWidgetManager::getInstance()->getGlobalColor());
finalColor.A = CurrentAlpha; finalColor.A = CurrentAlpha;

View file

@ -22,7 +22,6 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/gui/group_frame.h" #include "nel/gui/group_frame.h"
#include "nel/gui/view_text.h" #include "nel/gui/view_text.h"
#include "view_link.h"
#include "nel/gui/ctrl_button.h" #include "nel/gui/ctrl_button.h"
/** /**
@ -101,8 +100,12 @@ public:
void setTextureTile(bool tiled); void setTextureTile(bool tiled);
void setTextureScale(bool scaled); void setTextureScale(bool scaled);
static void setDebugUICell( bool d ){ DebugUICell = d; }
static bool getDebugUICell(){ return DebugUICell; }
private: private:
void setEnclosedGroupDefaultParams(); void setEnclosedGroupDefaultParams();
static bool DebugUICell;
}; };
/** /**

View file

@ -146,6 +146,7 @@
#include "string_manager_client.h" #include "string_manager_client.h"
#include "nel/gui/lua_manager.h" #include "nel/gui/lua_manager.h"
#include "interface_v3/group_table.h"
/////////// ///////////
@ -317,7 +318,6 @@ uint32 OldWidth; // Last Width of the window.
uint32 OldHeight; // Last Height of the window. uint32 OldHeight; // Last Height of the window.
bool ShowInterface = true; // Do the Chat OSD have to be displayed. bool ShowInterface = true; // Do the Chat OSD have to be displayed.
bool DebugUICell = false;
bool DebugUIView = false; bool DebugUIView = false;
bool DebugUICtrl = false; bool DebugUICtrl = false;
bool DebugUIGroup = false; bool DebugUIGroup = false;
@ -4394,7 +4394,8 @@ NLMISC_COMMAND(debugUI, "Debug the ui : show/hide quads of bboxs and hotspots",
else else
fromString(args[0], on); fromString(args[0], on);
} }
DebugUICell = on;
CGroupCell::setDebugUICell( on );
DebugUIView = on; DebugUIView = on;
DebugUICtrl = on; DebugUICtrl = on;
DebugUIGroup = on; DebugUIGroup = on;
@ -4426,7 +4427,7 @@ NLMISC_COMMAND(debugUIGroup, "Debug the ui : show/hide quads of bboxs and hotspo
// show hide the debuging of cells // show hide the debuging of cells
NLMISC_COMMAND(debugUICell, "Debug the ui : show/hide quads of bboxs for cells", "") NLMISC_COMMAND(debugUICell, "Debug the ui : show/hide quads of bboxs for cells", "")
{ {
DebugUICell = !DebugUICell; CGroupCell::setDebugUICell( !CGroupCell::getDebugUICell() )
return true; return true;
} }