|
|
|
@ -18,6 +18,9 @@
|
|
|
|
|
#include "nelgui_widget.h"
|
|
|
|
|
#include "nel/misc/path.h"
|
|
|
|
|
#include "nel/gui/view_renderer.h"
|
|
|
|
|
#include "nel/gui/interface_group.h"
|
|
|
|
|
#include "nel/gui/widget_manager.h"
|
|
|
|
|
#include "nel/misc/path.h"
|
|
|
|
|
#include <set>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
@ -38,7 +41,9 @@ namespace GUIEditor
|
|
|
|
|
|
|
|
|
|
void NelGUIWidget::init()
|
|
|
|
|
{
|
|
|
|
|
NLMISC::CPath::addSearchPath( "fonts" );
|
|
|
|
|
NLMISC::CPath::remapExtension( "dds", "tga", true );
|
|
|
|
|
NLMISC::CPath::remapExtension( "dds", "png", true );
|
|
|
|
|
NLMISC::CPath::remapExtension( "png", "tga", true );
|
|
|
|
|
|
|
|
|
|
Nel3DWidget::init();
|
|
|
|
|
createTextContext( "Ryzom.ttf" );
|
|
|
|
@ -48,5 +53,42 @@ namespace GUIEditor
|
|
|
|
|
NLGUI::CViewRenderer::hwCursors = &hwCursors;
|
|
|
|
|
NLGUI::CViewRenderer::getInstance()->init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool NelGUIWidget::parse( SProjectFiles &files )
|
|
|
|
|
{
|
|
|
|
|
CWidgetManager::getInstance()->reset();
|
|
|
|
|
IParser *parser = CWidgetManager::getInstance()->getParser();
|
|
|
|
|
parser->removeAll();
|
|
|
|
|
CViewRenderer::getInstance()->reset();
|
|
|
|
|
|
|
|
|
|
std::vector< std::string >::iterator itr;
|
|
|
|
|
for( itr = files.mapFiles.begin(); itr != files.mapFiles.end(); ++itr )
|
|
|
|
|
{
|
|
|
|
|
std::string &file = *itr;
|
|
|
|
|
std::string::size_type i = file.find_last_of( '.' );
|
|
|
|
|
std::string mapFile = file.substr( 0, i );
|
|
|
|
|
mapFile.append( ".txt" );
|
|
|
|
|
|
|
|
|
|
if( !CViewRenderer::getInstance()->loadTextures( file, mapFile, false ) )
|
|
|
|
|
{
|
|
|
|
|
CViewRenderer::getInstance()->reset();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !parser->parseInterface( files.guiFiles, false ) )
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
CWidgetManager::getInstance()->updateAllLocalisedElements();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NelGUIWidget::draw()
|
|
|
|
|
{
|
|
|
|
|
getDriver()->clearBuffers( NLMISC::CRGBA::Black );
|
|
|
|
|
CWidgetManager::getInstance()->checkCoords();
|
|
|
|
|
CWidgetManager::getInstance()->drawViews( 0 );
|
|
|
|
|
getDriver()->swapBuffers();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|