Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1995
Modified Files:
ChangeLog basechar.h configure.py console.h dragdrop.cpp
gumps.h inlines.h items.h npc.h player.h server.cpp server.h
skills.h spawnregions.h targetrequests.cpp targetrequests.h
territories.h timing.h wolfpack.pro world.cpp world.h
Added Files:
objectdef.h
Log Message:
- Fixed translations
- It's possible to disable translations in compile time
Index: world.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** world.h 10 Sep 2004 04:06:26 -0000 1.22
--- world.h 24 Sep 2004 04:47:38 -0000 1.23
***************
*** 33,36 ****
--- 33,37 ----
#include "typedefs.h"
#include "singleton.h"
+ #include "objectdef.h"
// Library Includes
***************
*** 80,83 ****
--- 81,85 ----
class cWorld : public cComponent
{
+ OBJECTDEF(cWorld)
friend class cCharIterator;
friend class cItemIterator;
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** targetrequests.h 19 Aug 2004 01:55:56 -0000 1.74
--- targetrequests.h 24 Sep 2004 04:47:38 -0000 1.75
***************
*** 40,48 ****
#include "muls/tilecache.h"
#include "npc.h"
!
#include "ai/ai.h"
class cKillTarget : public cTargetRequest
{
public:
virtual bool responsed( cUOSocket* socket, cUORxTarget* target )
--- 40,49 ----
#include "muls/tilecache.h"
#include "npc.h"
! #include "objectdef.h"
#include "ai/ai.h"
class cKillTarget : public cTargetRequest
{
+ OBJECTDEF(cKillTarget)
public:
virtual bool responsed( cUOSocket* socket, cUORxTarget* target )
***************
*** 78,81 ****
--- 79,83 ----
class cSetTarget : public cTargetRequest
{
+ OBJECTDEF(cSetTarget)
QString key, value;
public:
***************
*** 88,91 ****
--- 90,94 ----
class cRemoveTarget : public cTargetRequest
{
+ OBJECTDEF(cRemoveTarget)
public:
bool responsed( cUOSocket* socket, cUORxTarget* target );
***************
*** 118,121 ****
--- 121,125 ----
class cShowTarget : public cTargetRequest
{
+ OBJECTDEF(cShowTarget)
private:
QString key;
***************
*** 130,133 ****
--- 134,138 ----
class cSetTagTarget : public cTargetRequest
{
+ OBJECTDEF(cSetTagTarget)
private:
Q_UINT8 type_;
***************
*** 187,190 ****
--- 192,196 ----
class cGetTagTarget : public cTargetRequest
{
+ OBJECTDEF(cGetTagTarget)
private:
QString key_;
***************
*** 221,224 ****
--- 227,231 ----
class cRemoveTagTarget : public cTargetRequest
{
+ OBJECTDEF(cRemoveTagTarget)
private:
QString key_;
***************
*** 296,299 ****
--- 303,307 ----
class cMoveTarget : public cTargetRequest
{
+ OBJECTDEF(cMoveTarget)
private:
Q_INT16 x, y, z;
***************
*** 355,358 ****
--- 363,367 ----
class cRestockTarget : public cTargetRequest
{
+ OBJECTDEF(cRestockTarget)
public:
virtual bool responsed( cUOSocket* socket, cUORxTarget* target )
Index: skills.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** skills.h 19 Aug 2004 01:55:56 -0000 1.33
--- skills.h 24 Sep 2004 04:47:37 -0000 1.34
***************
*** 33,36 ****
--- 33,37 ----
#include "typedefs.h"
#include "targetrequests.h"
+ #include "objectdef.h"
// Library Includes
***************
*** 49,52 ****
--- 50,54 ----
class cSkills
{
+ OBJECTDEF(cSkills)
private:
QStringList skillRanks;
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -d -r1.103 -r1.104
*** targetrequests.cpp 10 Aug 2004 03:15:57 -0000 1.103
--- targetrequests.cpp 24 Sep 2004 04:47:38 -0000 1.104
***************
*** 108,112 ****
}
else
! socket->sysMessage( "You need to select either an item or a character" );
return true;
}
--- 108,112 ----
}
else
! socket->sysMessage( tr("You need to select either an item or a character") );
return true;
}
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.211
retrieving revision 1.212
diff -C2 -d -r1.211 -r1.212
*** wolfpack.pro 18 Sep 2004 21:23:00 -0000 1.211
--- wolfpack.pro 24 Sep 2004 04:47:38 -0000 1.212
***************
*** 177,181 ****
INTERFACES =
TRANSLATIONS = \
! languages/wolfpack_pt-BR.ts \
languages/wolfpack_it.ts \
languages/wolfpack_nl.ts \
--- 177,181 ----
INTERFACES =
TRANSLATIONS = \
! languages/wolfpack_pt_br.ts \
languages/wolfpack_it.ts \
languages/wolfpack_nl.ts \
Index: spawnregions.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** spawnregions.h 13 Aug 2004 19:51:04 -0000 1.28
--- spawnregions.h 24 Sep 2004 04:47:38 -0000 1.29
***************
*** 32,35 ****
--- 32,36 ----
#include "singleton.h"
#include "server.h"
+ #include "objectdef.h"
#include <map>
***************
*** 37,40 ****
--- 38,42 ----
class cSpawnRegion : public cBaseRegion
{
+ OBJECTDEF(cSpawnRegion)
public:
cSpawnRegion( const cElement* Tag )
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.217
retrieving revision 1.218
diff -C2 -d -r1.217 -r1.218
*** items.h 22 Sep 2004 05:34:47 -0000 1.217
--- items.h 24 Sep 2004 04:47:25 -0000 1.218
***************
*** 35,38 ****
--- 35,39 ----
#include "network/uotxpackets.h"
#include "singleton.h"
+ #include "objectdef.h"
// Library Includes
***************
*** 54,57 ****
--- 55,59 ----
class cItem : public cUObject
{
+ OBJECTDEF(cItem)
friend class cBaseChar;
private:
Index: server.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** server.cpp 19 Sep 2004 16:50:41 -0000 1.25
--- server.cpp 24 Sep 2004 04:47:37 -0000 1.26
***************
*** 57,70 ****
#include "persistentbroker.h"
#include "profile.h"
! // System Includes
#include <qwaitcondition.h>
#include <qptrvector.h>
#include <qapplication.h>
! #include "python/engine.h"
! #include "verinfo.h"
! #include "network/network.h"
- #include "sqlite/sqlite.h"
#if defined(MYSQL_DRIVER)
#if defined(Q_OS_WIN32)
--- 57,71 ----
#include "persistentbroker.h"
#include "profile.h"
+ #include "python/engine.h"
+ #include "verinfo.h"
+ #include "network/network.h"
+ #include "sqlite/sqlite.h"
! // Qt Includes
#include <qwaitcondition.h>
#include <qptrvector.h>
#include <qapplication.h>
! #include <qtextcodec.h>
#if defined(MYSQL_DRIVER)
#if defined(Q_OS_WIN32)
***************
*** 260,264 ****
new QApplication ( argc, argv, false );
- QTranslator translator( 0 );
// Load wolfpack.xml
--- 261,264 ----
***************
*** 279,293 ****
setupConsole();
// Start the QT translator
! QString languageFile = Config::instance()->getString( "General", "Language File", "", true );
if ( !languageFile.isEmpty() )
{
! if ( !translator.load( languageFile, "." ) )
{
Console::instance()->log( LOG_ERROR, "Couldn't load translator.\n" );
return false;
}
! qApp->installTranslator( &translator );
}
// Load all subcomponents
--- 279,299 ----
setupConsole();
+ #if !defined( QT_NO_TRANSLATION )
// Start the QT translator
! QString languageFile = Config::instance()->getString( "General", "Language File", QString("wolfpack_") + QTextCodec::locale(), true );
if ( !languageFile.isEmpty() )
{
! QTranslator* translator = new QTranslator( qApp );
! if ( !translator->load( languageFile, "." ) )
{
Console::instance()->log( LOG_ERROR, "Couldn't load translator.\n" );
return false;
}
! else
! {
! qApp->installTranslator( translator );
! }
}
+ #endif
// Load all subcomponents
***************
*** 396,400 ****
Console::instance()->stop();
ScriptManager::instance()->onServerStop(); // Notify python scripts about shutdown
! Network::instance()->broadcast( "The server is shutting down." );
unload();
--- 402,406 ----
Console::instance()->stop();
ScriptManager::instance()->onServerStop(); // Notify python scripts about shutdown
! Network::instance()->broadcast( tr("The server is shutting down.") );
unload();
***************
*** 430,434 ****
QString UnicodeType("UCS-2");
#endif
! Console::instance()->send( tr("Compiled for Python %1 %2 (Using: %3 )\n").arg(PY_VERSION, UnicodeType, pythonBuild) );
Console::instance()->send( "Compiled with SQLite " SQLITE_VERSION "\n" );
#if defined (MYSQL_DRIVER)
--- 436,440 ----
QString UnicodeType("UCS-2");
#endif
! Console::instance()->send( tr("Compiled for Python %1 %2 (Using: %3)\n").arg(PY_VERSION, UnicodeType, pythonBuild) );
Console::instance()->send( "Compiled with SQLite " SQLITE_VERSION "\n" );
#if defined (MYSQL_DRIVER)
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** basechar.h 16 Sep 2004 01:40:16 -0000 1.86
--- basechar.h 24 Sep 2004 04:47:23 -0000 1.87
***************
*** 44,47 ****
--- 44,48 ----
#include "territories.h"
#include "log.h"
+ #include "objectdef.h"
// include for ceilf()
***************
*** 55,58 ****
--- 56,60 ----
class cBaseChar : public cUObject
{
+ OBJECTDEF(cBaseChar)
public:
const char* objectID() const
Index: server.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/server.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** server.h 31 Aug 2004 17:44:37 -0000 1.5
--- server.h 24 Sep 2004 04:47:37 -0000 1.6
***************
*** 33,36 ****
--- 33,37 ----
#include <qvaluevector.h>
#include "singleton.h"
+ #include "objectdef.h"
enum enServerState
***************
*** 122,125 ****
--- 123,127 ----
class cServer
{
+ OBJECTDEF(cServer)
private:
class Private;
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** player.h 4 Sep 2004 21:20:07 -0000 1.59
--- player.h 24 Sep 2004 04:47:37 -0000 1.60
***************
*** 37,40 ****
--- 37,41 ----
#include "basechar.h"
#include "accounts.h"
+ #include "objectdef.h"
class cGuild;
***************
*** 43,46 ****
--- 44,48 ----
class cPlayer : public cBaseChar
{
+ OBJECTDEF(cPlayer)
public:
const char* objectID() const
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.245
retrieving revision 1.246
diff -C2 -d -r1.245 -r1.246
*** dragdrop.cpp 16 Sep 2004 01:40:17 -0000 1.245
--- dragdrop.cpp 24 Sep 2004 04:47:23 -0000 1.246
***************
*** 44,51 ****
#include "inlines.h"
- #undef DBGFILE
- #define DBGFILE "dragdrop.cpp"
-
-
// New Class implementation
void DragAndDrop::grabItem( cUOSocket* socket, cUORxDragItem* packet )
--- 44,47 ----
Index: territories.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** territories.h 19 Aug 2004 01:22:53 -0000 1.30
--- territories.h 24 Sep 2004 04:47:38 -0000 1.31
***************
*** 31,34 ****
--- 31,35 ----
#include "baseregion.h"
#include "singleton.h"
+ #include "objectdef.h"
#include <map>
***************
*** 251,254 ****
--- 252,256 ----
class cTerritories : public cComponent
{
+ OBJECTDEF(cTerritories)
private:
QMap<uint, QPtrList<cTerritory> > topregions;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** ChangeLog 22 Sep 2004 05:34:46 -0000 1.74
--- ChangeLog 24 Sep 2004 04:47:22 -0000 1.75
***************
*** 48,51 ****
--- 48,53 ----
- Added the ability to dynamically determine the sell value of an item using the
onGetSellPrice event.
+ - Fixed translation support.
+ - Added ability to disable translation support during compile time thru configure.py
Wolfpack 12.9.10 Beta (10. September 2004)
Index: timing.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timing.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** timing.h 10 Aug 2004 03:15:57 -0000 1.4
--- timing.h 24 Sep 2004 04:47:38 -0000 1.5
***************
*** 31,34 ****
--- 31,35 ----
#include "singleton.h"
#include "typedefs.h"
+ #include "objectdef.h"
#include <qpair.h>
***************
*** 37,40 ****
--- 38,42 ----
class cTiming
{
+ OBJECTDEF(cTiming)
private:
unsigned int nextSpawnRegionCheck;
Index: gumps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** gumps.h 19 Aug 2004 01:22:52 -0000 1.43
--- gumps.h 24 Sep 2004 04:47:25 -0000 1.44
***************
*** 30,33 ****
--- 30,34 ----
#include "typedefs.h"
+ #include "objectdef.h"
#include <qstringlist.h>
***************
*** 243,246 ****
--- 244,248 ----
class cSpawnRegionInfoGump : public cGump
{
+ OBJECTDEF(cSpawnRegionInfoGump)
protected:
cSpawnRegion* region_;
***************
*** 254,257 ****
--- 256,260 ----
class cPagesGump : public cGump
{
+ OBJECTDEF(cPagesGump)
private:
uint page_;
***************
*** 268,271 ****
--- 271,275 ----
class cPageInfoGump : public cGump
{
+ OBJECTDEF(cPageInfoGump)
private:
cPage* page_;
***************
*** 279,282 ****
--- 283,287 ----
class cHelpGump : public cGump
{
+ OBJECTDEF(cHelpGump)
private:
SERIAL char_;
Index: inlines.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** inlines.h 16 Sep 2004 01:41:02 -0000 1.29
--- inlines.h 24 Sep 2004 04:47:25 -0000 1.30
***************
*** 32,42 ****
#include <algorithm>
#include <math.h>
! #include "qapplication.h"
! #include "qstring.h"
!
! inline QString tr( const QString& text, const char* comment = 0, const char* context = "@default" )
! {
! return qApp->translate( context, text.latin1(), comment );
! }
inline bool isHair( Q_UINT16 model )
--- 32,36 ----
#include <algorithm>
#include <math.h>
! #include <qglobal.h>
inline bool isHair( Q_UINT16 model )
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** console.h 14 Sep 2004 18:05:15 -0000 1.19
--- console.h 24 Sep 2004 04:47:23 -0000 1.20
***************
*** 34,37 ****
--- 34,38 ----
#include "singleton.h"
#include "server.h"
+ #include "objectdef.h"
// System Includes
***************
*** 69,72 ****
--- 70,74 ----
class cConsole
{
+ OBJECTDEF(cConsole)
private:
QString linebuffer_;
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** npc.h 29 Aug 2004 20:40:50 -0000 1.59
--- npc.h 24 Sep 2004 04:47:37 -0000 1.60
***************
*** 37,40 ****
--- 37,41 ----
// wolfpack includes
#include "basechar.h"
+ #include "objectdef.h"
class AbstractAI;
***************
*** 43,46 ****
--- 44,48 ----
class cNPC : public cBaseChar
{
+ OBJECTDEF(cNPC)
public:
const char* objectID() const
--- NEW FILE: objectdef.h ---
/*
* Wolfpack Emu (WP)
* UO Server Emulation Program
*
* Copyright 2001-2004 by holders identified in AUTHORS.txt
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
*
* In addition to that license, if you are running this program or modified
* versions of it on a public system you HAVE TO make the complete source of
* the version used by you available or provide people with a location to
* download it.
*
* Wolfpack Homepage: http://wpdev.sf.net/
*/
#if !defined( __OBJECTDEF_H__ )
#define __OBJECTDEF_H__
#ifndef QT_H
#include <qglobal.h>
#include <qapplication.h>
#endif // QT_H
/*!
Since we are not using QObject due to memory footprint, moc won't create some nice functions
either, we need some macro magic to get them ( or disabling some ) without doing too much
mess
*/
#ifndef QT_NO_TRANSLATION
inline QString tr( const QString& text, const char* comment = 0, const char* context = "@default" )
{
return qApp->translate( context, text.latin1(), comment );
}
# ifndef QT_NO_TEXTCODEC
// full set of tr functions
# define WP_TR_FUNCTIONS(classname) \
static QString tr( const char* s, const char* c = 0 ) \
{ \
if ( qApp ) \
return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \
else \
return QString::fromLatin1( s ); \
} \
\
static QString trUtf8( const char* s, const char* c = 0 ) \
{ \
if ( qApp ) \
return qApp->translate( #classname, s, c, QApplication::UnicodeUTF8 ); \
else \
return QString::fromUtf8( s ); \
}
# else
// no QTextCodec, no utf8
# define WP_TR_FUNCTIONS \
static QString tr( const char* s, const char* c = 0 ) \
{ \
if ( qApp ) \
return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \
else \
return QString::fromLatin1( s ); \
}
# endif
#else
# define WP_TR_FUNCTIONS(classname)
# define tr(x) QString(x)
#endif
#define OBJECTDEF(classname) \
public: \
/*virtual const char *className() const { return #classname; }*/ \
WP_TR_FUNCTIONS(classname) \
private:
#endif // __OBJECTDEF_H__
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -C2 -d -r1.128 -r1.129
*** world.cpp 19 Sep 2004 16:50:41 -0000 1.128
--- world.cpp 24 Sep 2004 04:47:38 -0000 1.129
***************
*** 501,505 ****
guild->load(reader, reader.version());
Guilds::instance()->registerGuild(guild);
! } catch (wpException& e) {
delete guild;
}
--- 501,505 ----
guild->load(reader, reader.version());
Guilds::instance()->registerGuild(guild);
! } catch (wpException& ) {
delete guild;
}
***************
*** 614,618 ****
continue; // Move on...
! Console::instance()->send( "\n" + tr( "Loading " ) + QString::number( count ) + tr( " objects of type " ) + type );
res = PersistentBroker::instance()->query( PersistentFactory::instance()->findSqlQuery( type ) );
--- 614,618 ----
continue; // Move on...
! Console::instance()->send( "\n" + tr( "Loading %1 objects of type %2" ).arg( count ).arg( type ) );
res = PersistentBroker::instance()->query( PersistentFactory::instance()->findSqlQuery( type ) );
Index: configure.py
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/configure.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** configure.py 19 Sep 2004 05:07:05 -0000 1.36
--- configure.py 24 Sep 2004 04:47:23 -0000 1.37
***************
*** 282,285 ****
--- 282,286 ----
parser.add_option("--enable-aidebug", action="store_true", dest="enable_aidebug", help="Enabled debugging of NPC AI.")
parser.add_option("--enable-mysql", action="store_true", dest="enable_mysql", help="Enables MySQL support.")
+ parser.add_option("--disable-translation", action="store_true", dest="disable_translation", help="Disable non-English language support.")
(options, args) = parser.parse_args()
***************
*** 294,297 ****
--- 295,301 ----
checkQt()
+ if options.disable_translation:
+ DEFINES += "QT_NO_TRANSLATION "
+
# Create config.pri
global py_libpath
|