merge from default
--HG-- branch : branch-tile-edit-ovqt-plugin
|
@ -144,6 +144,8 @@ external
|
||||||
external_stlport
|
external_stlport
|
||||||
3rdParty
|
3rdParty
|
||||||
.svn
|
.svn
|
||||||
|
thumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
# build
|
# build
|
||||||
code/nel/build/*
|
code/nel/build/*
|
||||||
|
|
|
@ -14,6 +14,14 @@ FIND_PATH(DXSDK_DIR
|
||||||
"Include/dxsdkver.h"
|
"Include/dxsdkver.h"
|
||||||
PATHS
|
PATHS
|
||||||
"$ENV{DXSDK_DIR}"
|
"$ENV{DXSDK_DIR}"
|
||||||
|
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)"
|
||||||
|
"C:/Program Files/Microsoft DirectX SDK (June 2010)"
|
||||||
|
"C:/Program Files (x86)/Microsoft DirectX SDK (February 2010)"
|
||||||
|
"C:/Program Files/Microsoft DirectX SDK (February 2010)"
|
||||||
|
"C:/Program Files (x86)/Microsoft DirectX SDK (November 2007)"
|
||||||
|
"C:/Program Files/Microsoft DirectX SDK (November 2007)"
|
||||||
|
"C:/Program Files (x86)/Microsoft DirectX SDK"
|
||||||
|
"C:/Program Files/Microsoft DirectX SDK"
|
||||||
)
|
)
|
||||||
|
|
||||||
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
|
@ -21,9 +29,6 @@ MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
NAMES ${MYLIBRARYNAME}
|
NAMES ${MYLIBRARYNAME}
|
||||||
PATHS
|
PATHS
|
||||||
"${DXSDK_LIBRARY_DIR}"
|
"${DXSDK_LIBRARY_DIR}"
|
||||||
"$ENV{DXSDK_DIR}"
|
|
||||||
"$ENV{DXSDK_DIR}/Lib"
|
|
||||||
"$ENV{DXSDK_DIR}/Lib/x86"
|
|
||||||
)
|
)
|
||||||
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,9 @@ ENDMACRO(NL_TARGET_DRIVER)
|
||||||
# Argument:
|
# Argument:
|
||||||
###
|
###
|
||||||
MACRO(NL_DEFAULT_PROPS name label)
|
MACRO(NL_DEFAULT_PROPS name label)
|
||||||
|
IF(NOT MSVC10)
|
||||||
SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
|
SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
|
||||||
|
ENDIF(NOT MSVC10)
|
||||||
GET_TARGET_PROPERTY(type ${name} TYPE)
|
GET_TARGET_PROPERTY(type ${name} TYPE)
|
||||||
IF(${type} STREQUAL SHARED_LIBRARY)
|
IF(${type} STREQUAL SHARED_LIBRARY)
|
||||||
# Set versions only if target is a shared library
|
# Set versions only if target is a shared library
|
||||||
|
@ -302,27 +304,66 @@ MACRO(NL_SETUP_BUILD)
|
||||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
|
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
|
||||||
|
SET(HOST_CPU ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
|
||||||
# Determine target CPU
|
# Determine target CPU
|
||||||
# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
IF(NOT TARGET_CPU)
|
||||||
|
SET(TARGET_CPU $ENV{DEB_HOST_GNU_CPU})
|
||||||
|
ENDIF(NOT TARGET_CPU)
|
||||||
|
|
||||||
|
# If not specified, use the same CPU as host
|
||||||
|
IF(NOT TARGET_CPU)
|
||||||
|
SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
ENDIF(NOT TARGET_CPU)
|
||||||
|
|
||||||
|
IF(TARGET_CPU MATCHES "amd64")
|
||||||
|
SET(TARGET_CPU "x86_64")
|
||||||
|
ELSEIF(TARGET_CPU MATCHES "i.86")
|
||||||
|
SET(TARGET_CPU "x86")
|
||||||
|
ENDIF(TARGET_CPU MATCHES "amd64")
|
||||||
|
|
||||||
|
# DEB_HOST_ARCH_ENDIAN is 'little' or 'big'
|
||||||
|
# DEB_HOST_ARCH_BITS is '32' or '64'
|
||||||
|
|
||||||
|
# If target and host CPU are the same
|
||||||
|
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
|
||||||
|
# x86-compatible CPU
|
||||||
|
IF(HOST_CPU MATCHES "x86")
|
||||||
IF(NOT CMAKE_SIZEOF_VOID_P)
|
IF(NOT CMAKE_SIZEOF_VOID_P)
|
||||||
INCLUDE (CheckTypeSize)
|
INCLUDE (CheckTypeSize)
|
||||||
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
||||||
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
|
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
|
||||||
|
|
||||||
# Using 32 or 64 bits libraries
|
# Using 32 or 64 bits libraries
|
||||||
SET(TARGET_X86 1)
|
|
||||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
SET(ARCH "x86_64")
|
SET(TARGET_CPU "x86_64")
|
||||||
SET(TARGET_X64 1)
|
|
||||||
ADD_DEFINITIONS(-DHAVE_X86_64)
|
|
||||||
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
SET(ARCH "x86")
|
SET(TARGET_CPU "x86")
|
||||||
ADD_DEFINITIONS(-DHAVE_X86)
|
|
||||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
# ADD_DEFINITIONS(-DHAVE_IA64)
|
ENDIF(HOST_CPU MATCHES "x86")
|
||||||
# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
# TODO: add checks for ARM and PPC
|
||||||
|
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
|
||||||
|
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
|
||||||
|
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
|
||||||
|
|
||||||
IF(WIN32)
|
IF(TARGET_CPU STREQUAL "x86_64")
|
||||||
|
SET(TARGET_X64 1)
|
||||||
|
SET(PLATFORM_CFLAGS "-DHAVE_X86_64")
|
||||||
|
ELSEIF(TARGET_CPU STREQUAL "x86")
|
||||||
|
SET(TARGET_X86 1)
|
||||||
|
SET(PLATFORM_CFLAGS "-DHAVE_X86")
|
||||||
|
ENDIF(TARGET_CPU STREQUAL "x86_64")
|
||||||
|
|
||||||
|
# Fix library paths suffixes for Debian MultiArch
|
||||||
|
IF(NOT CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
SET(CMAKE_LIBRARY_ARCHITECTURE $ENV{DEB_HOST_MULTIARCH})
|
||||||
|
ENDIF(NOT CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
SET(CMAKE_LIBRARY_PATH "/lib/${CMAKE_LIBRARY_ARCHITECTURE};/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE};${CMAKE_LIBRARY_PATH}")
|
||||||
|
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
IF(MSVC10)
|
IF(MSVC10)
|
||||||
# /Ox is working with VC++ 2010, but custom optimizations don't exist
|
# /Ox is working with VC++ 2010, but custom optimizations don't exist
|
||||||
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
|
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
|
||||||
|
@ -364,8 +405,17 @@ MACRO(NL_SETUP_BUILD)
|
||||||
SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}")
|
SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}")
|
||||||
SET(NL_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
|
SET(NL_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
|
||||||
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||||
ELSE(WIN32)
|
ELSE(MSVC)
|
||||||
SET(PLATFORM_CFLAGS "-g -pipe -ftemplate-depth-48 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
|
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
|
||||||
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686")
|
||||||
|
ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
|
||||||
|
|
||||||
|
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
|
||||||
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64")
|
||||||
|
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
|
||||||
|
|
||||||
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -g -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
|
||||||
|
|
||||||
IF(WITH_COVERAGE)
|
IF(WITH_COVERAGE)
|
||||||
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
|
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
|
||||||
ENDIF(WITH_COVERAGE)
|
ENDIF(WITH_COVERAGE)
|
||||||
|
@ -382,12 +432,12 @@ MACRO(NL_SETUP_BUILD)
|
||||||
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
|
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
|
||||||
|
|
||||||
IF(NOT APPLE)
|
IF(NOT APPLE)
|
||||||
SET(PLATFORM_LINKFLAGS "-Wl,--no-undefined -Wl,--as-needed")
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
|
||||||
ENDIF(NOT APPLE)
|
ENDIF(NOT APPLE)
|
||||||
|
|
||||||
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
|
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
|
||||||
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
|
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
|
||||||
ENDIF(WIN32)
|
ENDIF(MSVC)
|
||||||
ENDMACRO(NL_SETUP_BUILD)
|
ENDMACRO(NL_SETUP_BUILD)
|
||||||
|
|
||||||
MACRO(NL_SETUP_BUILD_FLAGS)
|
MACRO(NL_SETUP_BUILD_FLAGS)
|
||||||
|
@ -451,7 +501,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
|
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
||||||
|
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
|
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
|
||||||
|
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDIF(NOT NL_LIB_PREFIX)
|
ENDIF(NOT NL_LIB_PREFIX)
|
||||||
|
|
||||||
|
@ -460,7 +514,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
|
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
|
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
|
||||||
|
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
|
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
|
||||||
|
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
ENDIF(NOT NL_DRIVER_PREFIX)
|
ENDIF(NOT NL_DRIVER_PREFIX)
|
||||||
|
|
||||||
|
|
|
@ -342,6 +342,8 @@ std::string secondsToHumanReadable (uint32 time);
|
||||||
/// Get a bytes or time in string format and convert it in seconds or bytes
|
/// Get a bytes or time in string format and convert it in seconds or bytes
|
||||||
uint32 fromHumanReadable (const std::string &str);
|
uint32 fromHumanReadable (const std::string &str);
|
||||||
|
|
||||||
|
/// Add digit grouping seperator to if value >= 10 000. Assumes input is numerical string.
|
||||||
|
std::string formatThousands(const std::string& s);
|
||||||
|
|
||||||
/// This function executes a program in the background and returns instantly (used for example to launch services in AES).
|
/// This function executes a program in the background and returns instantly (used for example to launch services in AES).
|
||||||
/// The program will be launched in the current directory
|
/// The program will be launched in the current directory
|
||||||
|
|
|
@ -146,6 +146,8 @@ public:
|
||||||
|
|
||||||
TAdditionalInfoCb EntityInfoCallback;
|
TAdditionalInfoCb EntityInfoCallback;
|
||||||
|
|
||||||
|
static void removeShardFromName(ucstring& name);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// get all eid for a user using the user name or the user id
|
// get all eid for a user using the user name or the user id
|
||||||
void getByUser (uint32 uid, std::vector<NLMISC::CEntityId> &res);
|
void getByUser (uint32 uid, std::vector<NLMISC::CEntityId> &res);
|
||||||
|
|
|
@ -75,7 +75,7 @@ public:
|
||||||
enum TProp {
|
enum TProp {
|
||||||
PropUInt8, PropUInt16, PropUInt32, PropUInt64,
|
PropUInt8, PropUInt16, PropUInt32, PropUInt64,
|
||||||
PropSInt8, PropSInt16, PropSInt32, PropSInt64,
|
PropSInt8, PropSInt16, PropSInt32, PropSInt64,
|
||||||
PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropSheetId, PropUKN };
|
PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropSheetId, PropUCString, PropUKN };
|
||||||
// PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropEntityId, PropSheetId, PropUKN };
|
// PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropEntityId, PropSheetId, PropUKN };
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,6 +160,7 @@ public:
|
||||||
case PropString: nlassert(sizeof(T) == sizeof (std::string)); break;
|
case PropString: nlassert(sizeof(T) == sizeof (std::string)); break;
|
||||||
// case PropEntityId: nlassert(sizeof(T) == sizeof (NLMISC::CEntityId)); break;
|
// case PropEntityId: nlassert(sizeof(T) == sizeof (NLMISC::CEntityId)); break;
|
||||||
case PropSheetId: nlassert(sizeof(T) == sizeof (NLMISC::CSheetId)); break;
|
case PropSheetId: nlassert(sizeof(T) == sizeof (NLMISC::CSheetId)); break;
|
||||||
|
case PropUCString: nlassert(sizeof(T) == sizeof (ucstring)); break;
|
||||||
default: nlerror ("property %s have unknown type %d", name.c_str(), type);
|
default: nlerror ("property %s have unknown type %d", name.c_str(), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ void CDriverGL::setLightInternal(uint8 num, const CLight& light)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Deactivate spot properties
|
// Disable spot properties
|
||||||
#ifdef USE_OPENGLES
|
#ifdef USE_OPENGLES
|
||||||
glLightf (lightNum, GL_SPOT_CUTOFF, 180.f);
|
glLightf (lightNum, GL_SPOT_CUTOFF, 180.f);
|
||||||
glLightf (lightNum, GL_SPOT_EXPONENT, 0.f);
|
glLightf (lightNum, GL_SPOT_EXPONENT, 0.f);
|
||||||
|
|
|
@ -149,14 +149,28 @@ static NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode)
|
||||||
|
|
||||||
bool CCocoaEventEmitter::pasteTextFromClipboard(ucstring &text)
|
bool CCocoaEventEmitter::pasteTextFromClipboard(ucstring &text)
|
||||||
{
|
{
|
||||||
#warning "OpenGL Driver: Missing Mac Implementation for pasteTextFromClipboard"
|
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||||
|
NSArray *classArray = [NSArray arrayWithObject:[NSString class]];
|
||||||
|
NSDictionary *options = [NSDictionary dictionary];
|
||||||
|
|
||||||
|
BOOL ok = [pasteboard canReadObjectForClasses:classArray options:options];
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options];
|
||||||
|
NSString *nstext = [objectsToPaste objectAtIndex:0];
|
||||||
|
text.fromUtf8([nstext UTF8String]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCocoaEventEmitter::copyTextToClipboard(const ucstring &text)
|
bool CCocoaEventEmitter::copyTextToClipboard(const ucstring &text)
|
||||||
{
|
{
|
||||||
#warning "OpenGL Driver: Missing Mac Implementation for copyTextToClipboard"
|
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||||
return false;
|
[pasteboard clearContents];
|
||||||
|
NSArray *copiedObjects = [NSArray arrayWithObject:[NSString stringWithUTF8String:text.toUtf8().c_str()]];
|
||||||
|
[pasteboard writeObjects:copiedObjects];
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// convert modifier key state to nel internal modifier key state
|
/// convert modifier key state to nel internal modifier key state
|
||||||
|
|
|
@ -4851,8 +4851,10 @@ typedef ptrdiff_t GLsizeiptrARB;
|
||||||
#ifndef GL_ARB_shader_objects
|
#ifndef GL_ARB_shader_objects
|
||||||
/* GL types for program/shader text and shader object handles */
|
/* GL types for program/shader text and shader object handles */
|
||||||
typedef char GLcharARB;
|
typedef char GLcharARB;
|
||||||
|
#if !defined(MAC_OS_X_VERSION_10_7)
|
||||||
typedef unsigned int GLhandleARB;
|
typedef unsigned int GLhandleARB;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* GL type for "half" precision (s10e5) float data in host memory */
|
/* GL type for "half" precision (s10e5) float data in host memory */
|
||||||
#ifndef GL_ARB_half_float_pixel
|
#ifndef GL_ARB_half_float_pixel
|
||||||
|
|
|
@ -58,7 +58,7 @@ bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow syst
|
||||||
CNELU::Driver = NULL;
|
CNELU::Driver = NULL;
|
||||||
|
|
||||||
// Init driver.
|
// Init driver.
|
||||||
#if defined(NL_OS_WINDOWS)
|
#ifdef NL_OS_WINDOWS
|
||||||
if (direct3d)
|
if (direct3d)
|
||||||
{
|
{
|
||||||
CNELU::Driver= CDRU::createD3DDriver();
|
CNELU::Driver= CDRU::createD3DDriver();
|
||||||
|
@ -75,6 +75,7 @@ bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow syst
|
||||||
nlwarning ("CNELU::initDriver: no driver found");
|
nlwarning ("CNELU::initDriver: no driver found");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CNELU::Driver->init())
|
if (!CNELU::Driver->init())
|
||||||
{
|
{
|
||||||
nlwarning ("CNELU::initDriver: init() failed");
|
nlwarning ("CNELU::initDriver: init() failed");
|
||||||
|
|
|
@ -1018,8 +1018,8 @@ void CPatchDLMContext::computeTextureFar()
|
||||||
// compute src pixel
|
// compute src pixel
|
||||||
const CRGBA *srcPixel= pTile->getPixels(CTileFarBank::diffuse, CTileFarBank::order1);
|
const CRGBA *srcPixel= pTile->getPixels(CTileFarBank::diffuse, CTileFarBank::order1);
|
||||||
// compute src info, for this tile rot and 256x256 context.
|
// compute src info, for this tile rot and 256x256 context.
|
||||||
sint srcDeltaX;
|
sint srcDeltaX = 0;
|
||||||
sint srcDeltaY;
|
sint srcDeltaY = 0;
|
||||||
srcPixel= computeTileFarSrcDeltas(nRot, is256x256, uvOff, srcPixel, srcDeltaX, srcDeltaY);
|
srcPixel= computeTileFarSrcDeltas(nRot, is256x256, uvOff, srcPixel, srcDeltaX, srcDeltaY);
|
||||||
|
|
||||||
// compute dst coordinate. start writing at pixel (1,1)
|
// compute dst coordinate. start writing at pixel (1,1)
|
||||||
|
|
|
@ -2118,7 +2118,7 @@ bool CPrimAlias::read (xmlNodePtr xmlNode, const char *filename, uint version, C
|
||||||
xmlNodePtr ptNode = CIXml::getFirstChildNode (xmlNode, "ALIAS");
|
xmlNodePtr ptNode = CIXml::getFirstChildNode (xmlNode, "ALIAS");
|
||||||
if (ptNode)
|
if (ptNode)
|
||||||
{
|
{
|
||||||
int val;
|
sint val = 0;
|
||||||
if (ReadInt ("VALUE", val, filename, ptNode))
|
if (ReadInt ("VALUE", val, filename, ptNode))
|
||||||
{
|
{
|
||||||
_Alias = uint32(val);
|
_Alias = uint32(val);
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "nel/misc/command.h"
|
#include "nel/misc/command.h"
|
||||||
#include "nel/misc/path.h"
|
#include "nel/misc/path.h"
|
||||||
|
#include "nel/misc/i18n.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -526,6 +527,31 @@ void toUpper(char *str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string formatThousands(const std::string& s)
|
||||||
|
{
|
||||||
|
int i, k;
|
||||||
|
int remaining = s.length() - 1;
|
||||||
|
static std::string separator = NLMISC::CI18N::get("uiThousandsSeparator").toUtf8();
|
||||||
|
|
||||||
|
// Don't add separator if the number is < 10k
|
||||||
|
if (remaining < 4) return s;
|
||||||
|
|
||||||
|
std::string ns;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
for (i = remaining, k = 0; i >= 0 && k < 3; --i, ++k )
|
||||||
|
{
|
||||||
|
ns = s[i] + ns; // New char is added to front of ns
|
||||||
|
if ( i > 0 && k == 2) ns = separator + ns; // j > 0 means still more digits
|
||||||
|
}
|
||||||
|
|
||||||
|
remaining -= 3;
|
||||||
|
}
|
||||||
|
while (remaining >= 0);
|
||||||
|
|
||||||
|
return ns;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Exceptions
|
// Exceptions
|
||||||
|
|
|
@ -417,6 +417,17 @@ void CEntityIdTranslator::checkEntity (const CEntityId &eid, const ucstring &ent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEntityIdTranslator::removeShardFromName(ucstring& name)
|
||||||
|
{
|
||||||
|
// The string must contain a '(' and a ')'
|
||||||
|
ucstring::size_type p0= name.find('(');
|
||||||
|
ucstring::size_type p1= name.find(')');
|
||||||
|
if (p0 == ucstring::npos || p1 == ucstring::npos || p1 <= p0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
name = name.substr(0, p0) + name.substr(p1 + 1);
|
||||||
|
}
|
||||||
|
|
||||||
// this callback is call when the file is changed
|
// this callback is call when the file is changed
|
||||||
void cbInvalidEntityNamesFilename(const std::string &invalidEntityNamesFilename)
|
void cbInvalidEntityNamesFilename(const std::string &invalidEntityNamesFilename)
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ static const CStringConversion<TKey>::CPair stringTable [] =
|
||||||
{ "KeyZOOM", KeyZOOM },
|
{ "KeyZOOM", KeyZOOM },
|
||||||
{ "KeyNONAME", KeyNONAME },
|
{ "KeyNONAME", KeyNONAME },
|
||||||
{ "KeyPA1", KeyPA1 },
|
{ "KeyPA1", KeyPA1 },
|
||||||
{ "KeyOEM_CLEAR", KeyOEM_CLEAR },
|
{ "KeyOEM_CLEAR", KeyOEM_CLEAR }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "nel/misc/noise_value.h"
|
#include "nel/misc/noise_value.h"
|
||||||
#include "nel/misc/fast_floor.h"
|
#include "nel/misc/fast_floor.h"
|
||||||
|
#include "nel/misc/random.h"
|
||||||
|
|
||||||
|
|
||||||
namespace NLMISC
|
namespace NLMISC
|
||||||
|
@ -45,7 +45,8 @@ public:
|
||||||
CRandomGrid3D()
|
CRandomGrid3D()
|
||||||
{
|
{
|
||||||
//seed
|
//seed
|
||||||
srand(0);
|
CRandom Random;
|
||||||
|
Random.srand(0);
|
||||||
|
|
||||||
// init the grid
|
// init the grid
|
||||||
for(uint z=0; z<NL3D_NOISE_GRID_SIZE; z++)
|
for(uint z=0; z<NL3D_NOISE_GRID_SIZE; z++)
|
||||||
|
@ -56,7 +57,7 @@ public:
|
||||||
{
|
{
|
||||||
uint id= x + (y<<NL3D_NOISE_GRID_SIZE_SHIFT) + (z<<(NL3D_NOISE_GRID_SIZE_SHIFT*2));
|
uint id= x + (y<<NL3D_NOISE_GRID_SIZE_SHIFT) + (z<<(NL3D_NOISE_GRID_SIZE_SHIFT*2));
|
||||||
// take higher bits of rand gives better result.
|
// take higher bits of rand gives better result.
|
||||||
uint v= rand() >> 5;
|
uint v= Random.rand() >> 5;
|
||||||
_Texture3d[id]= v&255;
|
_Texture3d[id]= v&255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,9 +81,9 @@ public:
|
||||||
// init LevelPhases.
|
// init LevelPhases.
|
||||||
for(i=0; i<NL3D_NOISE_LEVEL; i++)
|
for(i=0; i<NL3D_NOISE_LEVEL; i++)
|
||||||
{
|
{
|
||||||
_LevelPhase[i].x= frand(NL3D_NOISE_GRID_SIZE);
|
_LevelPhase[i].x= Random.frand(NL3D_NOISE_GRID_SIZE);
|
||||||
_LevelPhase[i].y= frand(NL3D_NOISE_GRID_SIZE);
|
_LevelPhase[i].y= Random.frand(NL3D_NOISE_GRID_SIZE);
|
||||||
_LevelPhase[i].z= frand(NL3D_NOISE_GRID_SIZE);
|
_LevelPhase[i].z= Random.frand(NL3D_NOISE_GRID_SIZE);
|
||||||
}
|
}
|
||||||
// not for level 0.
|
// not for level 0.
|
||||||
_LevelPhase[0]= CVector::Null;
|
_LevelPhase[0]= CVector::Null;
|
||||||
|
|
|
@ -643,6 +643,8 @@ bool CRGBA::convertToHLS(float &h, float &l, float &s) const
|
||||||
{
|
{
|
||||||
h = 2.f + (b - r) / diff;
|
h = 2.f + (b - r) / diff;
|
||||||
}
|
}
|
||||||
|
#if defined(GCC_VERSION) && (GCC_VERSION == 40204)
|
||||||
|
// use the fix only if using the specific GCC version
|
||||||
else if (maxV == b)
|
else if (maxV == b)
|
||||||
{
|
{
|
||||||
h = 4.f + (r - g) / diff;
|
h = 4.f + (r - g) / diff;
|
||||||
|
@ -652,6 +654,12 @@ bool CRGBA::convertToHLS(float &h, float &l, float &s) const
|
||||||
// this case is to fix a compiler bug
|
// this case is to fix a compiler bug
|
||||||
h = (g - b) / diff;
|
h = (g - b) / diff;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
else
|
||||||
|
{
|
||||||
|
h = 4.f + (r - g) / diff;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
h *= 60.f; // scale to [0..360]
|
h *= 60.f; // scale to [0..360]
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,13 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA
|
||||||
if ((int)wParam==VK_SHIFT)
|
if ((int)wParam==VK_SHIFT)
|
||||||
_ShiftButton=false;
|
_ShiftButton=false;
|
||||||
|
|
||||||
|
// As Print Screen button does not trigger a WM_KEYDOWN msg, simulate it here
|
||||||
|
if ((int)wParam==VK_SNAPSHOT)
|
||||||
|
{
|
||||||
|
if (wParam < KeyCount)
|
||||||
|
server->postEvent (new CEventKeyDown ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), true, this));
|
||||||
|
}
|
||||||
|
|
||||||
// Post the message
|
// Post the message
|
||||||
if (wParam < KeyCount)
|
if (wParam < KeyCount)
|
||||||
server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));
|
server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));
|
||||||
|
|
|
@ -77,7 +77,7 @@ string typeToString (CTransportClass::TProp type)
|
||||||
string conv[] = {
|
string conv[] = {
|
||||||
"PropUInt8", "PropUInt16", "PropUInt32", "PropUInt64",
|
"PropUInt8", "PropUInt16", "PropUInt32", "PropUInt64",
|
||||||
"PropSInt8", "PropSInt16", "PropSInt32", "PropSInt64",
|
"PropSInt8", "PropSInt16", "PropSInt32", "PropSInt64",
|
||||||
"PropBool", "PropFloat", "PropDouble", "PropString", "PropDataSetRow", "PropSheetId", "PropUKN" };
|
"PropBool", "PropFloat", "PropDouble", "PropString", "PropDataSetRow", "PropSheetId", "PropUCString", "PropUKN" };
|
||||||
// "PropBool", "PropFloat", "PropDouble", "PropString", "PropDataSetRow", "PropEntityId", "PropSheetId", "PropUKN" };
|
// "PropBool", "PropFloat", "PropDouble", "PropString", "PropDataSetRow", "PropEntityId", "PropSheetId", "PropUKN" };
|
||||||
|
|
||||||
if (type > CTransportClass::PropUKN)
|
if (type > CTransportClass::PropUKN)
|
||||||
|
@ -352,6 +352,7 @@ void CTransportClass::init ()
|
||||||
// nlassert (PropDataSetRow < PropUKN); DummyProp[PropDataSetRow] = new CTransportClass::CRegisteredProp<TDataSetRow>;
|
// nlassert (PropDataSetRow < PropUKN); DummyProp[PropDataSetRow] = new CTransportClass::CRegisteredProp<TDataSetRow>;
|
||||||
// nlassert (PropEntityId < PropUKN); DummyProp[PropEntityId] = new CTransportClass::CRegisteredProp<CEntityId>;
|
// nlassert (PropEntityId < PropUKN); DummyProp[PropEntityId] = new CTransportClass::CRegisteredProp<CEntityId>;
|
||||||
nlassert (PropSheetId < PropUKN); DummyProp[PropSheetId] = new CTransportClass::CRegisteredProp<CSheetId>;
|
nlassert (PropSheetId < PropUKN); DummyProp[PropSheetId] = new CTransportClass::CRegisteredProp<CSheetId>;
|
||||||
|
nlassert (PropUCString < PropUKN); DummyProp[PropUCString] = new CTransportClass::CRegisteredProp<ucstring>;
|
||||||
|
|
||||||
// we have to know when a service comes, so add callback (put the callback before all other one because we have to send this message first)
|
// we have to know when a service comes, so add callback (put the callback before all other one because we have to send this message first)
|
||||||
CUnifiedNetwork::getInstance()->setServiceUpCallback("*", cbTCUpService, NULL, false);
|
CUnifiedNetwork::getInstance()->setServiceUpCallback("*", cbTCUpService, NULL, false);
|
||||||
|
|
|
@ -8,6 +8,7 @@ ADD_SUBDIRECTORY(object_viewer)
|
||||||
ADD_SUBDIRECTORY(georges_editor)
|
ADD_SUBDIRECTORY(georges_editor)
|
||||||
ADD_SUBDIRECTORY(translation_manager)
|
ADD_SUBDIRECTORY(translation_manager)
|
||||||
ADD_SUBDIRECTORY(tile_editor)
|
ADD_SUBDIRECTORY(tile_editor)
|
||||||
|
ADD_SUBDIRECTORY(bnp_manager)
|
||||||
# Note: Temporarily disabled until development continues.
|
# Note: Temporarily disabled until development continues.
|
||||||
#ADD_SUBDIRECTORY(zone_painter)
|
#ADD_SUBDIRECTORY(zone_painter)
|
||||||
# Ryzom Specific Plugins
|
# Ryzom Specific Plugins
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
${LIBXML2_INCLUDE_DIR}
|
||||||
|
${QT_INCLUDES})
|
||||||
|
|
||||||
|
FILE(GLOB SRC *.cpp *.h)
|
||||||
|
SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h)
|
||||||
|
|
||||||
|
SET(OVQT_PLUG_BNP_MANAGER_HDR bnp_manager_plugin.h
|
||||||
|
bnp_manager_window.h
|
||||||
|
bnp_dirtree_dialog.h
|
||||||
|
bnp_filesystem_model.h
|
||||||
|
bnp_file.h
|
||||||
|
bnp_filelist_dialog.h
|
||||||
|
bnp_proxy_model.h
|
||||||
|
)
|
||||||
|
SET(OVQT_PLUG_BNP_MANAGER_UIS bnp_dirtree_form.ui
|
||||||
|
bnp_filelist_dialog.ui
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(OVQT_PLUGIN_BNP_MANAGER_RCS bnp_manager.qrc)
|
||||||
|
|
||||||
|
SET(QT_USE_QTGUI TRUE)
|
||||||
|
|
||||||
|
QT4_ADD_RESOURCES(OVQT_PLUGIN_BNP_MANAGER_RC_SRCS ${OVQT_PLUGIN_BNP_MANAGER_RCS})
|
||||||
|
QT4_WRAP_CPP(OVQT_PLUG_BNP_MANAGER_MOC_SRC ${OVQT_PLUG_BNP_MANAGER_HDR})
|
||||||
|
QT4_WRAP_UI(OVQT_PLUG_BNP_MANAGER_UI_HDRS ${OVQT_PLUG_BNP_MANAGER_UIS})
|
||||||
|
|
||||||
|
SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_BNP_MANAGER_UIS} ${OVQT_PLUGIN_BNP_MANAGER_RCS})
|
||||||
|
SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_BNP_MANAGER_UI_HDRS})
|
||||||
|
SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_BNP_MANAGER_MOC_SRC})
|
||||||
|
SOURCE_GROUP("BNP Manager Plugin" FILES ${SRC})
|
||||||
|
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
|
||||||
|
|
||||||
|
ADD_LIBRARY(ovqt_plugin_bnp_manager MODULE ${SRC} ${OVQT_PLUG_BNP_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUGIN_BNP_MANAGER_RC_SRCS} ${OVQT_PLUG_BNP_MANAGER_UI_HDRS})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(ovqt_plugin_bnp_manager ovqt_plugin_core nelmisc nelgeorges ${QT_LIBRARIES})
|
||||||
|
|
||||||
|
NL_DEFAULT_PROPS(ovqt_plugin_bnp_manager "NeL, Tools, 3D: Object Viewer Qt Plugin: BNP Manager")
|
||||||
|
NL_ADD_RUNTIME_FLAGS(ovqt_plugin_bnp_manager)
|
||||||
|
NL_ADD_LIB_SUFFIX(ovqt_plugin_bnp_manager)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS})
|
||||||
|
|
||||||
|
INSTALL(TARGETS ovqt_plugin_bnp_manager LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d)
|
|
@ -0,0 +1,93 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "bnp_dirtree_dialog.h"
|
||||||
|
#include "bnp_filesystem_model.h"
|
||||||
|
#include "bnp_proxy_model.h"
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
CBnpDirTreeDialog::CBnpDirTreeDialog(QString bnpPath, QWidget *parent)
|
||||||
|
: QDockWidget(parent),
|
||||||
|
m_DataPath(bnpPath)
|
||||||
|
{
|
||||||
|
// Setup the dialog
|
||||||
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
|
// Filter settings to only display files with bnp extension.
|
||||||
|
// Could be changed to display all files and react according to the extension:
|
||||||
|
// Bnp file: opened and displayed
|
||||||
|
// all other files: added to the currently opened bnp file
|
||||||
|
QStringList filter;
|
||||||
|
//filter << tr("*.bnp");
|
||||||
|
|
||||||
|
// Setup the directory tree model
|
||||||
|
m_dirModel= new BNPFileSystemModel();
|
||||||
|
m_proxyModel = new BNPSortProxyModel();
|
||||||
|
m_dirModel->setRootPath(m_DataPath);
|
||||||
|
m_dirModel->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||||
|
m_dirModel->setNameFilters(filter);
|
||||||
|
m_dirModel->setNameFilterDisables(0);
|
||||||
|
|
||||||
|
m_proxyModel->setSourceModel(m_dirModel);
|
||||||
|
|
||||||
|
m_ui.dirTree->setModel(m_proxyModel);
|
||||||
|
|
||||||
|
m_ui.dirTree->setRootIndex( m_proxyModel->mapFromSource (m_dirModel->index(m_DataPath) ) );
|
||||||
|
m_ui.dirTree->setSortingEnabled(true);
|
||||||
|
|
||||||
|
// Trigger if one filename is activated
|
||||||
|
// In future drag&drop should be also possible
|
||||||
|
connect(m_ui.dirTree, SIGNAL(activated(QModelIndex)),
|
||||||
|
this, SLOT(fileSelected(QModelIndex)));
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
CBnpDirTreeDialog::~CBnpDirTreeDialog()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void CBnpDirTreeDialog::fileSelected(QModelIndex index)
|
||||||
|
{
|
||||||
|
QModelIndex source = m_proxyModel->mapToSource(index);
|
||||||
|
if (source.isValid() && !m_dirModel->isDir(source))
|
||||||
|
{
|
||||||
|
// emit the according signal to BNPManagerWindow class
|
||||||
|
Q_EMIT selectedFile(m_dirModel->fileInfo(source).filePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void CBnpDirTreeDialog::changeFile(QString file)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void CBnpDirTreeDialog::BnpPathChanged(QString path)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_DIRTREE_DIALOG_H
|
||||||
|
#define BNP_DIRTREE_DIALOG_H
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "ui_bnp_dirtree_form.h"
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
class BNPFileSystemModel;
|
||||||
|
class BNPSortProxyModel;
|
||||||
|
|
||||||
|
class CBnpDirTreeDialog : public QDockWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* \param path to root directory, which should be displayed
|
||||||
|
*/
|
||||||
|
CBnpDirTreeDialog(QString bnpPath, QWidget *parent = 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor
|
||||||
|
*/
|
||||||
|
~CBnpDirTreeDialog();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change the root path for the dir tree view
|
||||||
|
* \param data path to the new directory
|
||||||
|
*/
|
||||||
|
void BnpPathChanged(QString);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
Ui::CBnpDirTreeDialog m_ui;
|
||||||
|
|
||||||
|
// path ro data root directory
|
||||||
|
QString m_DataPath;
|
||||||
|
|
||||||
|
BNPFileSystemModel *m_dirModel;
|
||||||
|
|
||||||
|
BNPSortProxyModel *m_proxyModel;
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void selectedFile(const QString);
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
/**
|
||||||
|
* Triggered if the user activates (double klick on windows)
|
||||||
|
* a file name in the dir tree view
|
||||||
|
* \param selected ModelIndex (filename)
|
||||||
|
*/
|
||||||
|
void fileSelected(QModelIndex index);
|
||||||
|
|
||||||
|
void changeFile(QString file);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CBnpDirTreeDialog</class>
|
||||||
|
<widget class="QDockWidget" name="CBnpDirTreeDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>141</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="features">
|
||||||
|
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>BNP Datapath</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QTreeView" name="dirTree">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../object_viewer_qt.qrc"/>
|
||||||
|
<include location="../core/core.qrc"/>
|
||||||
|
<include location="bnp_manager.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -0,0 +1,313 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "bnp_file.h"
|
||||||
|
|
||||||
|
// Nel includes
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
#include <nel/misc/file.h>
|
||||||
|
#include <nel/misc/path.h>
|
||||||
|
#include <nel/misc/algo.h>
|
||||||
|
#include <nel/misc/common.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
|
||||||
|
using namespace NLMISC;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
PackedFile::PackedFile()
|
||||||
|
{
|
||||||
|
m_size = 0;
|
||||||
|
m_pos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
NLMISC_SAFE_SINGLETON_IMPL(BNPFileHandle);
|
||||||
|
|
||||||
|
BNPFileHandle::BNPFileHandle()
|
||||||
|
{
|
||||||
|
m_offsetFromBeginning = 0;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
BNPFileHandle::~BNPFileHandle()
|
||||||
|
{
|
||||||
|
// Erase the list
|
||||||
|
m_packedFiles.clear();
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::releaseInstance()
|
||||||
|
{
|
||||||
|
if (_Instance)
|
||||||
|
{
|
||||||
|
NLMISC::INelContext::getInstance().releaseSingletonPointer("BNPFileHandle", _Instance);
|
||||||
|
delete _Instance;
|
||||||
|
_Instance = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
bool BNPFileHandle::unpack(const string &dirName, const vector<string>& fileList)
|
||||||
|
{
|
||||||
|
CIFile bnp;
|
||||||
|
bnp.open(m_openedBNPFile);
|
||||||
|
|
||||||
|
TPackedFilesList::iterator it_files = m_packedFiles.begin();
|
||||||
|
|
||||||
|
for (it_files; it_files != m_packedFiles.end(); it_files++)
|
||||||
|
{
|
||||||
|
// Check if the file should be unpacked or not
|
||||||
|
if (find(fileList.begin(), fileList.end(), it_files->m_name) != fileList.end())
|
||||||
|
{
|
||||||
|
string filename = dirName + "/" + it_files->m_name;
|
||||||
|
|
||||||
|
COFile out;
|
||||||
|
if ( out.open(filename) )
|
||||||
|
{
|
||||||
|
bnp.seek(it_files->m_pos, IStream::begin);
|
||||||
|
uint8 *ptr = new uint8[it_files->m_size];
|
||||||
|
bnp.serialBuffer(ptr,it_files->m_size);
|
||||||
|
out.serialBuffer(ptr,it_files->m_size);
|
||||||
|
delete [] ptr;
|
||||||
|
}
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bnp.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
// Read the header from a big file
|
||||||
|
bool BNPFileHandle::readHeader(const std::string &filePath)
|
||||||
|
{
|
||||||
|
m_packedFiles.clear();
|
||||||
|
|
||||||
|
m_openedBNPFile = filePath;
|
||||||
|
|
||||||
|
CIFile bnp;
|
||||||
|
bnp.open (filePath);
|
||||||
|
|
||||||
|
bnp.seek(0, IStream::end);
|
||||||
|
uint32 nFileSize = bnp.getFileSize();
|
||||||
|
bnp.seek(nFileSize-sizeof(uint32), IStream::begin);
|
||||||
|
|
||||||
|
uint32 nOffsetFromBegining;
|
||||||
|
|
||||||
|
bnp.serial(nOffsetFromBegining);
|
||||||
|
|
||||||
|
if ( !bnp.seek (nOffsetFromBegining, IStream::begin) )
|
||||||
|
{
|
||||||
|
nlwarning("Could not read offset from begining");
|
||||||
|
bnp.close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 nNbFile;
|
||||||
|
bnp.serial(nNbFile);
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < nNbFile; ++i)
|
||||||
|
{
|
||||||
|
uint8 nStringSize;
|
||||||
|
char sName[256];
|
||||||
|
|
||||||
|
bnp.serial(nStringSize);
|
||||||
|
bnp.serialBuffer( (uint8*)sName, nStringSize);
|
||||||
|
sName[nStringSize] = 0;
|
||||||
|
|
||||||
|
PackedFile tmpPackedFile;
|
||||||
|
tmpPackedFile.m_name = sName;
|
||||||
|
tmpPackedFile.m_path = m_openedBNPFile;
|
||||||
|
|
||||||
|
bnp.serial(tmpPackedFile.m_size);
|
||||||
|
bnp.serial(tmpPackedFile.m_pos);
|
||||||
|
|
||||||
|
m_packedFiles.push_back (tmpPackedFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
bnp.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::list(TPackedFilesList& FileList)
|
||||||
|
{
|
||||||
|
PackedFile tmpFile;
|
||||||
|
TPackedFilesList::iterator it = m_packedFiles.begin();
|
||||||
|
while (it != m_packedFiles.end() )
|
||||||
|
{
|
||||||
|
tmpFile.m_name = it->m_name;
|
||||||
|
tmpFile.m_pos = it->m_pos;
|
||||||
|
tmpFile.m_size = it->m_size;
|
||||||
|
tmpFile.m_path = it->m_path;
|
||||||
|
FileList.push_back(tmpFile);
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
bool BNPFileHandle::writeHeader( const std::string &filePath, uint32 offset )
|
||||||
|
{
|
||||||
|
COFile bnp;
|
||||||
|
bnp.open(filePath, true);
|
||||||
|
if ( !bnp.isOpen() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
uint32 nNbFile = (uint32)m_packedFiles.size();
|
||||||
|
bnp.serial(nNbFile);
|
||||||
|
|
||||||
|
for (uint32 i = 0; i < nNbFile; ++i)
|
||||||
|
{
|
||||||
|
uint8 nStringSize = (uint8)m_packedFiles[i].m_name.size();
|
||||||
|
bnp.serial( nStringSize );
|
||||||
|
bnp.serialBuffer( (uint8*)m_packedFiles[i].m_name.c_str(), nStringSize );
|
||||||
|
bnp.serial(m_packedFiles[i].m_size);
|
||||||
|
bnp.serial(m_packedFiles[i].m_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
bnp.serial(offset);
|
||||||
|
|
||||||
|
bnp.close();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::fileNames(std::vector<std::string> &fileNames)
|
||||||
|
{
|
||||||
|
TPackedFilesList::iterator it = m_packedFiles.begin();
|
||||||
|
while (it != m_packedFiles.end() )
|
||||||
|
{
|
||||||
|
fileNames.push_back(it->m_name);
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::addFiles( const vector<string> &filePathes)
|
||||||
|
{
|
||||||
|
uint32 OffsetFromBegining = 0;
|
||||||
|
|
||||||
|
// create packed files and add them to the private vector
|
||||||
|
vector<string>::const_iterator it_vec = filePathes.begin();
|
||||||
|
while (it_vec != filePathes.end() )
|
||||||
|
{
|
||||||
|
PackedFile tmpFile;
|
||||||
|
tmpFile.m_name = CFile::getFilename (*it_vec);
|
||||||
|
// Leave position to 0 and set the value during the new bnp file is creating
|
||||||
|
// We need the position only for the header at the end
|
||||||
|
tmpFile.m_pos = 0;
|
||||||
|
tmpFile.m_size = CFile::getFileSize(*it_vec);
|
||||||
|
tmpFile.m_path = *it_vec;
|
||||||
|
m_packedFiles.push_back( tmpFile );
|
||||||
|
|
||||||
|
it_vec++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort packed files alphabetic
|
||||||
|
std::sort ( m_packedFiles.begin(), m_packedFiles.end(), compare );
|
||||||
|
|
||||||
|
// create a new temporary bnp file with extension *.tmp
|
||||||
|
TPackedFilesList::iterator it_packed = m_packedFiles.begin();
|
||||||
|
while (it_packed != m_packedFiles.end() )
|
||||||
|
{
|
||||||
|
append(m_openedBNPFile + ".tmp", *it_packed);
|
||||||
|
// Set now the new offset for the new header
|
||||||
|
it_packed->m_pos = OffsetFromBegining;
|
||||||
|
OffsetFromBegining += it_packed->m_size;
|
||||||
|
|
||||||
|
it_packed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
writeHeader(m_openedBNPFile + ".tmp", OffsetFromBegining);
|
||||||
|
|
||||||
|
CFile::deleteFile( m_openedBNPFile );
|
||||||
|
string src = m_openedBNPFile + ".tmp";
|
||||||
|
CFile::moveFile( m_openedBNPFile.c_str(), src.c_str() );
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::deleteFiles( const vector<string>& fileNames)
|
||||||
|
{
|
||||||
|
vector<string>::const_iterator it_vec;
|
||||||
|
TPackedFilesList::iterator it_packed;
|
||||||
|
uint32 OffsetFromBegining = 0;
|
||||||
|
string tmpFile = m_openedBNPFile + ".tmp";
|
||||||
|
|
||||||
|
// create a new temporary bnp file with extension *.tmp
|
||||||
|
it_packed = m_packedFiles.begin();
|
||||||
|
while (it_packed != m_packedFiles.end() )
|
||||||
|
{
|
||||||
|
// check each packed file if it should be deleted
|
||||||
|
it_vec = find (fileNames.begin(), fileNames.end(), it_packed->m_name );
|
||||||
|
if ( it_vec != fileNames.end() )
|
||||||
|
{
|
||||||
|
nlinfo("Deleting file %s.", it_packed->m_name.c_str() );
|
||||||
|
it_packed = m_packedFiles.erase(it_packed);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
append(tmpFile, *it_packed);
|
||||||
|
// Set now the new offset for the new header
|
||||||
|
it_packed->m_pos = OffsetFromBegining;
|
||||||
|
OffsetFromBegining += it_packed->m_size;
|
||||||
|
|
||||||
|
it_packed++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
writeHeader(tmpFile, OffsetFromBegining);
|
||||||
|
|
||||||
|
CFile::deleteFile( m_openedBNPFile );
|
||||||
|
string src = m_openedBNPFile + ".tmp";
|
||||||
|
CFile::moveFile( m_openedBNPFile.c_str(), src.c_str() );
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPFileHandle::append(const string &destination, const PackedFile &source)
|
||||||
|
{
|
||||||
|
// check if the file exists and create one if not
|
||||||
|
if ( !CFile::fileExists(destination) )
|
||||||
|
CFile::createEmptyFile( destination );
|
||||||
|
|
||||||
|
COFile bnpfile;
|
||||||
|
CIFile packedfile;
|
||||||
|
bnpfile.open(destination, true);
|
||||||
|
packedfile.open(source.m_path);
|
||||||
|
if ( !bnpfile.isOpen() ) return;
|
||||||
|
|
||||||
|
|
||||||
|
uint8 *ptr = new uint8[source.m_size];
|
||||||
|
|
||||||
|
// check if the source is a bnp file.
|
||||||
|
if ( nlstricmp( CFile::getExtension(source.m_path), "bnp" ) == 0 )
|
||||||
|
{
|
||||||
|
// Jump to the file position inside the bnp
|
||||||
|
packedfile.seek(source.m_pos, IStream::begin);
|
||||||
|
}
|
||||||
|
// Read the source
|
||||||
|
packedfile.serialBuffer(ptr, source.m_size);
|
||||||
|
|
||||||
|
// Append the data to the destination
|
||||||
|
bnpfile.serialBuffer(ptr, source.m_size);
|
||||||
|
|
||||||
|
delete [] ptr;
|
||||||
|
|
||||||
|
packedfile.close();
|
||||||
|
bnpfile.close();
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
bool BNPFileHandle::compare(const PackedFile &left, const PackedFile &right)
|
||||||
|
{
|
||||||
|
return nlstricmp (left.m_name.c_str(), right.m_name.c_str()) < 0;
|
||||||
|
}
|
||||||
|
} // namespace BNPManager
|
|
@ -0,0 +1,139 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_FILE_H
|
||||||
|
#define BNP_FILE_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
|
||||||
|
// Nel includes
|
||||||
|
#include "nel/misc/types_nl.h"
|
||||||
|
#include <nel/misc/singleton.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
struct PackedFile
|
||||||
|
{
|
||||||
|
PackedFile();
|
||||||
|
std::string m_name;
|
||||||
|
uint32 m_size;
|
||||||
|
uint32 m_pos;
|
||||||
|
std::string m_path;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::vector<PackedFile> TPackedFilesList;
|
||||||
|
|
||||||
|
class BNPFileHandle
|
||||||
|
{
|
||||||
|
NLMISC_SAFE_SINGLETON_DECL(BNPFileHandle)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private constructor
|
||||||
|
*/
|
||||||
|
BNPFileHandle();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private destructor
|
||||||
|
*/
|
||||||
|
~BNPFileHandle();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// release memory
|
||||||
|
static void releaseInstance();
|
||||||
|
|
||||||
|
/*void append (const QString destFilename, const QString origFilename, uint32 sizeToRead);
|
||||||
|
void packRecurse();*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the header from the bnp file and create a filelist
|
||||||
|
* \param filename (consisting the whole path)
|
||||||
|
*/
|
||||||
|
bool readHeader (const std::string &filePath);
|
||||||
|
|
||||||
|
bool writeHeader (const std::string &filePath, uint32 offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append the header to a created bnp file
|
||||||
|
* \param filename (consisting the whole path)
|
||||||
|
*/
|
||||||
|
void appendHeader (const std::string &filename) {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a vector of all packed files inside the bnp file
|
||||||
|
* \param reference to the vector, which has to be filled
|
||||||
|
*/
|
||||||
|
void list (TPackedFilesList& FileList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a vector of all file names inside the bnp file
|
||||||
|
* \param reference to the vector, which has to be filled
|
||||||
|
*/
|
||||||
|
void fileNames( std::vector<std::string>& fileNames );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add files to the current aktive bnp file
|
||||||
|
* \param vector of file pathes to add
|
||||||
|
*/
|
||||||
|
void addFiles( const std::vector<std::string>& filePathes );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete files from the current aktive bnp file
|
||||||
|
* \param vector of files names
|
||||||
|
*/
|
||||||
|
void deleteFiles (const std::vector<std::string>& fileNames);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unpack the selected packed files into user defined dir
|
||||||
|
* \param directory path, where the files should be unpacked
|
||||||
|
* \param list of files, which has to be unpacked
|
||||||
|
*/
|
||||||
|
bool unpack (const std::string &dirName, const std::vector<std::string>& fileList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two filenames
|
||||||
|
* \param left: left packed file
|
||||||
|
* \param right: right packed file
|
||||||
|
* \return: TODO
|
||||||
|
*/
|
||||||
|
static bool compare(const PackedFile &left, const PackedFile &right);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Append one file to an existing bnp file
|
||||||
|
* \param destination: the active bnp file to append the file
|
||||||
|
* \param source: the source file to pack
|
||||||
|
*/
|
||||||
|
void append( const std::string& destination, const PackedFile& source );
|
||||||
|
|
||||||
|
TPackedFilesList m_packedFiles;
|
||||||
|
|
||||||
|
// currently opened and displayed bnp file
|
||||||
|
std::string m_openedBNPFile;
|
||||||
|
|
||||||
|
// offset where the header of the bnp file begins
|
||||||
|
uint32 m_offsetFromBeginning;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,145 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "bnp_filelist_dialog.h"
|
||||||
|
#include "bnp_file.h"
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
#include <QDragEnterEvent>
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QEvent>
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
BnpFileListDialog::BnpFileListDialog(QString bnpPath, QWidget *parent)
|
||||||
|
: QDockWidget(parent),
|
||||||
|
m_DataPath(bnpPath)
|
||||||
|
{
|
||||||
|
m_ui.setupUi(this);
|
||||||
|
setAcceptDrops(true);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
BnpFileListDialog::~BnpFileListDialog()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BnpFileListDialog::setupTable(int nbrows)
|
||||||
|
{
|
||||||
|
// delete all old entries
|
||||||
|
m_ui.tableWidget->clear();
|
||||||
|
|
||||||
|
// set 2 colums: filename and size
|
||||||
|
m_ui.tableWidget->setColumnCount(2);
|
||||||
|
|
||||||
|
// set number of rows according to the number of files in the bnp file
|
||||||
|
m_ui.tableWidget->setRowCount(nbrows);
|
||||||
|
|
||||||
|
// only entire rows can be selected
|
||||||
|
m_ui.tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
|
||||||
|
// set the horizontal headers
|
||||||
|
QStringList labels;
|
||||||
|
labels << tr("Filename") << tr("Size");
|
||||||
|
m_ui.tableWidget->setHorizontalHeaderLabels(labels);
|
||||||
|
|
||||||
|
m_ui.tableWidget->horizontalHeader()->setResizeMode(0, QHeaderView::Interactive);
|
||||||
|
m_ui.tableWidget->horizontalHeader()->setResizeMode(1, QHeaderView::Stretch );
|
||||||
|
m_ui.tableWidget->verticalHeader()->hide();
|
||||||
|
|
||||||
|
// set vertical size a little bit smaller
|
||||||
|
m_ui.tableWidget->verticalHeader()->setDefaultSectionSize(15);
|
||||||
|
m_ui.tableWidget->setShowGrid(false);
|
||||||
|
m_ui.tableWidget->setObjectName("tablewidget");
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
bool BnpFileListDialog::loadTable(const QString filePath)
|
||||||
|
{
|
||||||
|
// reference to the BNPFileHandle singletone instance
|
||||||
|
BNPFileHandle& myBNPFileHandle = BNPFileHandle::getInstance();
|
||||||
|
// string vector of all packed files inside a bnp
|
||||||
|
TPackedFilesList filelist;
|
||||||
|
int row = 0;
|
||||||
|
|
||||||
|
// read the header from the bnp file
|
||||||
|
if (!myBNPFileHandle.readHeader( filePath.toStdString()) )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
myBNPFileHandle.list( filelist );
|
||||||
|
|
||||||
|
// create table with number of rows
|
||||||
|
setupTable(filelist.size());
|
||||||
|
|
||||||
|
// fill the table items
|
||||||
|
TPackedFilesList::iterator it = filelist.begin();
|
||||||
|
while (it != filelist.end() )
|
||||||
|
{
|
||||||
|
QTableWidgetItem *nameItem = new QTableWidgetItem (it->m_name.c_str() );
|
||||||
|
QTableWidgetItem *sizeItem = new QTableWidgetItem (tr("%1 KB").arg(it->m_size));
|
||||||
|
m_ui.tableWidget->setItem(row, 0, nameItem);
|
||||||
|
m_ui.tableWidget->setItem(row, 1, sizeItem);
|
||||||
|
it++;
|
||||||
|
row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the file path as the widgets title
|
||||||
|
setWindowTitle(filePath);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BnpFileListDialog::getSelections(TSelectionList& SelectionList)
|
||||||
|
{
|
||||||
|
QModelIndex index;
|
||||||
|
QAbstractItemModel *model = m_ui.tableWidget->model();
|
||||||
|
QItemSelectionModel *selection = m_ui.tableWidget->selectionModel();
|
||||||
|
QModelIndexList indexes = selection->selectedRows();
|
||||||
|
|
||||||
|
Q_FOREACH(index, indexes)
|
||||||
|
{
|
||||||
|
QVariant data = model->data(index);
|
||||||
|
QString filename = data.toString();
|
||||||
|
SelectionList.push_back( filename.toStdString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BnpFileListDialog::dragEnterEvent(QDragEnterEvent *event)
|
||||||
|
{
|
||||||
|
// Accept only one file
|
||||||
|
// In the future a tabbed FileListDialog would accept more
|
||||||
|
if ( event->mimeData()->hasUrls() && event->mimeData()->urls().count() == 1)
|
||||||
|
event->acceptProposedAction();
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BnpFileListDialog::dropEvent(QDropEvent *event)
|
||||||
|
{
|
||||||
|
// Excraft the local file url from the drop object and fill the table
|
||||||
|
const QMimeData *mimeData = event->mimeData();
|
||||||
|
QList<QUrl> urlList = mimeData->urls();
|
||||||
|
loadTable( urlList.first().toLocalFile() );
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace BNPManager
|
|
@ -0,0 +1,83 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_FILELIST_DIALOG_H
|
||||||
|
#define BNP_FILELIST_DIALOG_H
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "ui_bnp_filelist_dialog.h"
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
typedef std::vector<std::string> TSelectionList;
|
||||||
|
|
||||||
|
class BnpFileListDialog : public QDockWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
BnpFileListDialog(QString bnpPath, QWidget *parent = 0);
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
~BnpFileListDialog();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the bnp file and setup the table view
|
||||||
|
* \param Filename
|
||||||
|
* \return true if everything went well
|
||||||
|
*/
|
||||||
|
bool loadTable(const QString filePath);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the dimension of the table
|
||||||
|
* \param number of rows
|
||||||
|
*/
|
||||||
|
void setupTable(int nbrows);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill the files selected in the table view to
|
||||||
|
* unpack them.
|
||||||
|
* \param reference to a vector of filenames.
|
||||||
|
* \return true if everything went well
|
||||||
|
*/
|
||||||
|
void getSelections(TSelectionList& SelectionList);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void dragEnterEvent (QDragEnterEvent *event);
|
||||||
|
void dropEvent(QDropEvent *event);
|
||||||
|
private:
|
||||||
|
Ui::BnpFileListDialog m_ui;
|
||||||
|
|
||||||
|
// common data path as root folder for the dirtree view
|
||||||
|
QString m_DataPath;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,70 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>BnpFileListDialog</class>
|
||||||
|
<widget class="QDockWidget" name="BnpFileListDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>141</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="acceptDrops">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="features">
|
||||||
|
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>BNP File List</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
<property name="showGrid">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||||
|
<number>15</number>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../object_viewer_qt.qrc"/>
|
||||||
|
<include location="../core/core.qrc"/>
|
||||||
|
<include location="bnp_manager.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -0,0 +1,51 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
#include "bnp_filesystem_model.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QStyle>
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
BNPFileSystemModel::BNPFileSystemModel(QObject *parent)
|
||||||
|
: QFileSystemModel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
BNPFileSystemModel::~BNPFileSystemModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
int BNPFileSystemModel::columnCount(const QModelIndex &) const
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
QVariant BNPFileSystemModel::data(const QModelIndex& index, int role) const
|
||||||
|
{
|
||||||
|
|
||||||
|
if (role == Qt::DecorationRole)
|
||||||
|
{
|
||||||
|
if (isDir(index))
|
||||||
|
return QApplication::style()->standardIcon(QStyle::SP_DirIcon);
|
||||||
|
}
|
||||||
|
return QFileSystemModel::data(index, role);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
} // namespace BNPManager
|
|
@ -0,0 +1,49 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
#ifndef BNP_FILESYSTEM_MODEL_H
|
||||||
|
#define BNP_FILESYSTEM_MODEL_H
|
||||||
|
|
||||||
|
#include <QtGui/QFileSystemModel>
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
class BNPFileSystemModel : public QFileSystemModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
BNPFileSystemModel(QObject *parent = 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor
|
||||||
|
*/
|
||||||
|
~BNPFileSystemModel();
|
||||||
|
|
||||||
|
int columnCount(const QModelIndex &) const;
|
||||||
|
|
||||||
|
QVariant data(const QModelIndex& index, int role) const ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,9 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource>
|
||||||
|
<file>images/ic_nel_bnp_make.png</file>
|
||||||
|
<file>images/ic_nel_delete_item.png</file>
|
||||||
|
<file>images/ic_nel_add_item.png</file>
|
||||||
|
<file>images/ic_nel_export.png</file>
|
||||||
|
<file>images/ic_nel_reset_all.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
|
@ -0,0 +1,37 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_MANAGER_CONSTANTS_H
|
||||||
|
#define BNP_MANAGER_CONSTANTS_H
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
namespace Constants
|
||||||
|
{
|
||||||
|
//settings
|
||||||
|
const char * const BNP_MANAGER_SECTION = "BNPManager";
|
||||||
|
|
||||||
|
//resources
|
||||||
|
const char *const ICON_ADD = ":/images/ic_nel_add_item.png";
|
||||||
|
const char *const ICON_DELETE = ":/images/ic_nel_delete_item.png";
|
||||||
|
const char *const ICON_UNPACK = ":/images/ic_nel_export.png";
|
||||||
|
const char *const ICON_CLOSE = ":/images/ic_nel_reset_all.png";
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Constants
|
||||||
|
} // namespace Plugin
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,89 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "bnp_manager_plugin.h"
|
||||||
|
#include "bnp_manager_window.h"
|
||||||
|
|
||||||
|
#include "../core/icore.h"
|
||||||
|
#include "../core/core_constants.h"
|
||||||
|
#include "../core/menu_manager.h"
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include "nel/misc/debug.h"
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
BNPManagerPlugin::BNPManagerPlugin()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BNPManagerPlugin::~BNPManagerPlugin()
|
||||||
|
{
|
||||||
|
Q_FOREACH(QObject *obj, m_autoReleaseObjects)
|
||||||
|
{
|
||||||
|
m_plugMan->removeObject(obj);
|
||||||
|
}
|
||||||
|
qDeleteAll(m_autoReleaseObjects);
|
||||||
|
m_autoReleaseObjects.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BNPManagerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)
|
||||||
|
{
|
||||||
|
Q_UNUSED(errorString);
|
||||||
|
m_plugMan = pluginManager;
|
||||||
|
|
||||||
|
addAutoReleasedObject(new BNPManagerContext(this));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BNPManagerPlugin::extensionsInitialized()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void BNPManagerPlugin::shutdown()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void BNPManagerPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
||||||
|
{
|
||||||
|
#ifdef NL_OS_WINDOWS
|
||||||
|
// Ensure that a context doesn't exist yet.
|
||||||
|
// This only applies to platforms without PIC, e.g. Windows.
|
||||||
|
nlassert(!NLMISC::INelContext::isContextInitialised());
|
||||||
|
#endif // NL_OS_WINDOWS
|
||||||
|
m_libContext = new NLMISC::CLibraryContext(*nelContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BNPManagerPlugin::addAutoReleasedObject(QObject *obj)
|
||||||
|
{
|
||||||
|
m_plugMan->addObject(obj);
|
||||||
|
m_autoReleaseObjects.prepend(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*void BNPManagerContext::open()
|
||||||
|
{
|
||||||
|
m_BnpManagerWindow->open();
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_EXPORT_PLUGIN(BNPManager::BNPManagerPlugin)
|
|
@ -0,0 +1,130 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_MANAGER_PLUGIN_H
|
||||||
|
#define BNP_MANAGER_PLUGIN_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "../../extension_system/iplugin.h"
|
||||||
|
#include "../core/icontext.h"
|
||||||
|
#include "bnp_manager_window.h"
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include "nel/misc/app_context.h"
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
|
namespace NLMISC
|
||||||
|
{
|
||||||
|
class CLibraryContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ExtensionSystem
|
||||||
|
{
|
||||||
|
class IPluginSpec;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
class m_BnpManagerWindow;
|
||||||
|
|
||||||
|
class BNPManagerPlugin : public QObject, public ExtensionSystem::IPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(ExtensionSystem::IPlugin)
|
||||||
|
|
||||||
|
public:
|
||||||
|
BNPManagerPlugin();
|
||||||
|
virtual ~BNPManagerPlugin();
|
||||||
|
|
||||||
|
virtual bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
|
||||||
|
virtual void extensionsInitialized();
|
||||||
|
virtual void shutdown();
|
||||||
|
virtual void setNelContext(NLMISC::INelContext *nelContext);
|
||||||
|
|
||||||
|
void addAutoReleasedObject(QObject *obj);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
NLMISC::CLibraryContext *m_libContext;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
ExtensionSystem::IPluginManager *m_plugMan;
|
||||||
|
QList<QObject *> m_autoReleaseObjects;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of the IContext interface
|
||||||
|
*
|
||||||
|
* \date 2011
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BNPManagerContext : public Core::IContext
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Constructor
|
||||||
|
BNPManagerContext(QObject *parent = 0) : IContext(parent)
|
||||||
|
{
|
||||||
|
// run new manager window app
|
||||||
|
m_BnpManagerWindow = new BNPManagerWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
virtual ~BNPManagerContext() {}
|
||||||
|
|
||||||
|
virtual QString id() const
|
||||||
|
{
|
||||||
|
return QLatin1String("BNPManagerContext");
|
||||||
|
}
|
||||||
|
virtual QString trName() const
|
||||||
|
{
|
||||||
|
return tr("BNP Manager");
|
||||||
|
}
|
||||||
|
virtual QIcon icon() const
|
||||||
|
{
|
||||||
|
return QIcon(":/images/ic_nel_bnp_make.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void open()
|
||||||
|
{
|
||||||
|
m_BnpManagerWindow->open();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QUndoStack *undoStack()
|
||||||
|
{
|
||||||
|
return m_BnpManagerWindow->m_undoStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual QWidget *widget()
|
||||||
|
{
|
||||||
|
return m_BnpManagerWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
BNPManagerWindow *m_BnpManagerWindow;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Plugin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // BNP_MANAGER_PLUGIN_H
|
|
@ -0,0 +1,291 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "bnp_manager_window.h"
|
||||||
|
#include "bnp_manager_constants.h"
|
||||||
|
#include "bnp_dirtree_dialog.h"
|
||||||
|
#include "bnp_filelist_dialog.h"
|
||||||
|
#include "bnp_file.h"
|
||||||
|
|
||||||
|
#include "../core/icore.h"
|
||||||
|
#include "../core/menu_manager.h"
|
||||||
|
#include "../core/core_constants.h"
|
||||||
|
#include "../../extension_system/iplugin_spec.h"
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
#include <nel/misc/path.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QTableWidget>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace NLMISC;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
BNPManagerWindow::BNPManagerWindow(QWidget *parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
{
|
||||||
|
// add new mainwindow for sheet dockwidgets
|
||||||
|
QTableWidget* hideWidget = new QTableWidget(0,0,this);
|
||||||
|
setCentralWidget(hideWidget);
|
||||||
|
hideWidget->hide();
|
||||||
|
|
||||||
|
// Read the settings
|
||||||
|
readSettings();
|
||||||
|
|
||||||
|
// create main dialogs and display them
|
||||||
|
createDialogs();
|
||||||
|
|
||||||
|
// create actions like open, close, add etc.
|
||||||
|
createActions();
|
||||||
|
|
||||||
|
// create a toolbar with icons
|
||||||
|
createToolBars();
|
||||||
|
|
||||||
|
// this SLOT is triggered if the user activates a bnp files in the
|
||||||
|
// dirtree view
|
||||||
|
connect(m_BnpDirTreeDialog, SIGNAL(selectedFile(const QString)),
|
||||||
|
this, SLOT(loadFile(const QString)));
|
||||||
|
|
||||||
|
// not used
|
||||||
|
m_undoStack = new QUndoStack(this);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
BNPManagerWindow::~BNPManagerWindow()
|
||||||
|
{
|
||||||
|
writeSettings();
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::createDialogs()
|
||||||
|
{
|
||||||
|
// create dialog to list the contents of the specified
|
||||||
|
// bnp data file directory
|
||||||
|
m_BnpDirTreeDialog = new CBnpDirTreeDialog(tr(m_DataPath.toStdString().c_str()),this);
|
||||||
|
addDockWidget(Qt::LeftDockWidgetArea, m_BnpDirTreeDialog);
|
||||||
|
m_BnpDirTreeDialog->setVisible(true);
|
||||||
|
restoreDockWidget(m_BnpDirTreeDialog);
|
||||||
|
|
||||||
|
// create dialog to list the packed file contents of bnp files on
|
||||||
|
// the right hand side
|
||||||
|
m_BnpFileListDialog = new BnpFileListDialog(m_DataPath,this);
|
||||||
|
addDockWidget(Qt::RightDockWidgetArea, m_BnpFileListDialog);
|
||||||
|
m_BnpFileListDialog->setVisible(true);
|
||||||
|
restoreDockWidget(m_BnpFileListDialog);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::createActions()
|
||||||
|
{
|
||||||
|
// open action
|
||||||
|
m_openAction = new QAction(tr("&Open..."), this);
|
||||||
|
m_openAction->setIcon(QIcon(Core::Constants::ICON_OPEN));
|
||||||
|
m_openAction->setStatusTip(tr("Open file"));
|
||||||
|
connect(m_openAction, SIGNAL(triggered()), this, SLOT( open() ));
|
||||||
|
|
||||||
|
// close action
|
||||||
|
m_closeAction = new QAction(tr("&Close..."), this);
|
||||||
|
m_closeAction->setIcon(QIcon(Constants::ICON_CLOSE));
|
||||||
|
m_closeAction->setStatusTip(tr("Close the BNP File"));
|
||||||
|
connect(m_closeAction, SIGNAL(triggered()), this, SLOT( close() ));
|
||||||
|
|
||||||
|
// add files into the bnp file
|
||||||
|
m_addFilesAction = new QAction(tr("&Add..."), this);
|
||||||
|
m_addFilesAction->setIcon(QIcon(Constants::ICON_ADD));
|
||||||
|
m_addFilesAction->setStatusTip(tr("Add Files to BNP"));
|
||||||
|
connect(m_addFilesAction, SIGNAL(triggered()), this, SLOT( addFiles() ));
|
||||||
|
|
||||||
|
// delete files from the bnp file
|
||||||
|
m_deleteFilesAction = new QAction(tr("&Delete..."), this);
|
||||||
|
m_deleteFilesAction->setIcon(QIcon(Constants::ICON_DELETE));
|
||||||
|
m_deleteFilesAction->setStatusTip(tr("Delete Files"));
|
||||||
|
connect(m_deleteFilesAction, SIGNAL(triggered()), this, SLOT( deleteFiles() ));
|
||||||
|
|
||||||
|
// unpack selected files into user defined dir
|
||||||
|
m_unpackFilesAction = new QAction(tr("&Unpack..."), this);
|
||||||
|
m_unpackFilesAction->setIcon(QIcon(Constants::ICON_UNPACK));
|
||||||
|
m_unpackFilesAction->setStatusTip(tr("Unpack Files"));
|
||||||
|
connect(m_unpackFilesAction, SIGNAL(triggered()), this, SLOT( unpackFiles() ));
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::createToolBars()
|
||||||
|
{
|
||||||
|
m_fileToolBar = addToolBar(tr("&File"));
|
||||||
|
m_fileToolBar->addAction(m_openAction);
|
||||||
|
m_fileToolBar->addAction(m_closeAction);
|
||||||
|
|
||||||
|
m_toolsBar = addToolBar(tr("&Tools"));
|
||||||
|
m_toolsBar->addAction(m_addFilesAction);
|
||||||
|
m_toolsBar->addAction(m_deleteFilesAction);
|
||||||
|
m_toolsBar->addAction(m_unpackFilesAction);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
bool BNPManagerWindow::loadFile(const QString fileName)
|
||||||
|
{
|
||||||
|
m_BnpFileListDialog->loadTable(fileName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::open()
|
||||||
|
{
|
||||||
|
QString fileName;
|
||||||
|
// file dialog to select with file should be opened
|
||||||
|
fileName = QFileDialog::getOpenFileName(this,
|
||||||
|
tr("Open BNP file"), tr(m_DataPath.toStdString().c_str()), tr("BNP Files (*.bnp)"));
|
||||||
|
|
||||||
|
// Check if filename is empty
|
||||||
|
if (fileName.isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_openedBNPFile = fileName;
|
||||||
|
loadFile(fileName);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::close()
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::addFiles()
|
||||||
|
{
|
||||||
|
// reference to the BNPFileHandle singletone instance
|
||||||
|
BNPFileHandle& myBNPFileHandle = BNPFileHandle::getInstance();
|
||||||
|
|
||||||
|
// vector of all current packed filenames
|
||||||
|
vector<string> currentFiles;
|
||||||
|
|
||||||
|
// vector of files to add
|
||||||
|
vector<string> addFiles;
|
||||||
|
|
||||||
|
// open a file dialog and to add files
|
||||||
|
QStringList FileList;
|
||||||
|
|
||||||
|
FileList = QFileDialog::getOpenFileNames(this,tr("Add Files..."),
|
||||||
|
QDir::currentPath(), tr("All Files (*.*)") );
|
||||||
|
|
||||||
|
// get all current filenames from the opened bnp file
|
||||||
|
myBNPFileHandle.fileNames(currentFiles);
|
||||||
|
|
||||||
|
QStringList::iterator it_list = FileList.begin();
|
||||||
|
while (it_list != FileList.end() )
|
||||||
|
{
|
||||||
|
string fileName = CFile::getFilename (it_list->toStdString() );
|
||||||
|
if ( std::find(currentFiles.begin(), currentFiles.end(), fileName ) != currentFiles.end() )
|
||||||
|
{
|
||||||
|
// Ask the user if he wants to override the existing file
|
||||||
|
// atm only warn the user and do not override
|
||||||
|
QMessageBox::warning(this, tr("BNP Manager"),
|
||||||
|
tr("File is already in the list!"),
|
||||||
|
QMessageBox::Ok,
|
||||||
|
QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addFiles.push_back( it_list->toStdString() );
|
||||||
|
// log it
|
||||||
|
nlinfo("Add file %s", fileName.c_str() );
|
||||||
|
}
|
||||||
|
it_list++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !addFiles.empty() )
|
||||||
|
{
|
||||||
|
myBNPFileHandle.addFiles( addFiles );
|
||||||
|
}
|
||||||
|
loadFile(m_openedBNPFile);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::deleteFiles()
|
||||||
|
{
|
||||||
|
QFileDialog filedialog(this);
|
||||||
|
BNPFileHandle& myBNPFileHandle = BNPFileHandle::getInstance();
|
||||||
|
vector<string> selectedRows;
|
||||||
|
|
||||||
|
m_BnpFileListDialog->getSelections(selectedRows);
|
||||||
|
|
||||||
|
// Check if files were selected. If not, inform the user.
|
||||||
|
if (selectedRows.empty())
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("BNP Manager"),
|
||||||
|
tr("No files selected!"),
|
||||||
|
QMessageBox::Ok,
|
||||||
|
QMessageBox::Ok);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
myBNPFileHandle.deleteFiles(selectedRows);
|
||||||
|
loadFile(m_openedBNPFile);
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::unpackFiles()
|
||||||
|
{
|
||||||
|
QFileDialog filedialog(this);
|
||||||
|
BNPFileHandle& myBNPFileHandle = BNPFileHandle::getInstance();
|
||||||
|
vector<string> selectedrows;
|
||||||
|
|
||||||
|
m_BnpFileListDialog->getSelections(selectedrows);
|
||||||
|
|
||||||
|
// Check if files were selected. If not, inform the user.
|
||||||
|
// TODO: Ask the user if nothing was selected, if he wants to unpack all
|
||||||
|
// files. This is more like Winzip.
|
||||||
|
if (selectedrows.empty())
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("BNP Manager"),
|
||||||
|
tr("No files selected!"),
|
||||||
|
QMessageBox::Ok,
|
||||||
|
QMessageBox::Ok);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
|
||||||
|
tr(m_DataPath.toStdString().c_str()),
|
||||||
|
QFileDialog::ShowDirsOnly
|
||||||
|
| QFileDialog::DontResolveSymlinks);
|
||||||
|
|
||||||
|
// If anything went wrong or the user pressed "cancel"
|
||||||
|
if ( dir.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (myBNPFileHandle.unpack(dir.toStdString(),selectedrows))
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, tr("BNP Manager"),
|
||||||
|
tr("All files has been exported successfully."),
|
||||||
|
QMessageBox::Ok,
|
||||||
|
QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::readSettings()
|
||||||
|
{
|
||||||
|
QSettings *settings = Core::ICore::instance()->settings();
|
||||||
|
|
||||||
|
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
|
||||||
|
m_DataPath = settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString();
|
||||||
|
settings->endGroup();
|
||||||
|
}
|
||||||
|
// ***************************************************************************
|
||||||
|
void BNPManagerWindow::writeSettings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
} // namespace BNPManager
|
|
@ -0,0 +1,145 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef BNP_MANAGER_WINDOW_H
|
||||||
|
#define BNP_MANAGER_WINDOW_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
//#include "ui_bnp_manager_window.h"
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
|
#include <QtGui/QLabel>
|
||||||
|
#include <QtGui/QUndoStack>
|
||||||
|
#include <QtGui/QTableWidget>
|
||||||
|
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
class CBnpDirTreeDialog;
|
||||||
|
class BnpFileListDialog;
|
||||||
|
class BNPFileHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main window class. Derived from QMainWindow and implements
|
||||||
|
* the basic layout like menue, toolbars and dialogs.
|
||||||
|
*
|
||||||
|
* \date 2011
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BNPManagerWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
BNPManagerWindow(QWidget *parent = 0);
|
||||||
|
|
||||||
|
//Destructor
|
||||||
|
~BNPManagerWindow();
|
||||||
|
|
||||||
|
|
||||||
|
QUndoStack *m_undoStack;
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a file dialog to choose which file should be opened.
|
||||||
|
* \return Filename string
|
||||||
|
*/
|
||||||
|
void open();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a certain bnp file into the manager
|
||||||
|
* \param Filename
|
||||||
|
* \return true if everything went well
|
||||||
|
*/
|
||||||
|
bool loadFile(const QString fileName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* close an opened bnp file and reset all views
|
||||||
|
*/
|
||||||
|
void close();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add files into an opened bnp file.
|
||||||
|
* \param Filelist
|
||||||
|
*/
|
||||||
|
void addFiles();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unpack the files marked in the filelist dialog into user defined
|
||||||
|
* directory.
|
||||||
|
* \param TBD
|
||||||
|
* \return true if everything went well
|
||||||
|
*/
|
||||||
|
void unpackFiles();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete marked files from the bnp file
|
||||||
|
* \param TBD
|
||||||
|
*/
|
||||||
|
void deleteFiles();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read plugin settings and set the window accordingly
|
||||||
|
*/
|
||||||
|
void readSettings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write plugin settings
|
||||||
|
*/
|
||||||
|
void writeSettings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create all plugin dialogs
|
||||||
|
*/
|
||||||
|
void createDialogs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create all plugin actions
|
||||||
|
*/
|
||||||
|
void createActions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the plugin toolbar
|
||||||
|
*/
|
||||||
|
void createToolBars();
|
||||||
|
|
||||||
|
QToolBar *m_fileToolBar;
|
||||||
|
QToolBar *m_toolsBar;
|
||||||
|
|
||||||
|
QAction *m_openAction;
|
||||||
|
QAction *m_closeAction;
|
||||||
|
QAction *m_addFilesAction;
|
||||||
|
QAction *m_unpackFilesAction;
|
||||||
|
QAction *m_deleteFilesAction;
|
||||||
|
|
||||||
|
CBnpDirTreeDialog *m_BnpDirTreeDialog;
|
||||||
|
BnpFileListDialog *m_BnpFileListDialog;
|
||||||
|
|
||||||
|
QString m_DataPath;
|
||||||
|
QString m_openedBNPFile;
|
||||||
|
|
||||||
|
}; /* class BNPManagerWindow */
|
||||||
|
|
||||||
|
} /* namespace Plugin */
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>BNPManagerWindow</class>
|
||||||
|
<widget class="QMainWindow" name="BNPManagerWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>BNP Manager</string>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QWidget#centralwidget {
|
||||||
|
image: url(:/images/ic_nel_georges_editor.png);
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QTableWidget" name="tableWidget"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="bnp_manager.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
|
@ -0,0 +1,56 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/debug.h>
|
||||||
|
|
||||||
|
// project includes
|
||||||
|
#include "bnp_proxy_model.h"
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
bool BNPSortProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||||
|
{
|
||||||
|
if ( sourceModel()->hasChildren(left) )
|
||||||
|
{
|
||||||
|
if ( !sourceModel()->hasChildren(right) )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString leftString = sourceModel()->data( left ).toString();
|
||||||
|
QString rightString = sourceModel()->data( right ).toString();
|
||||||
|
return QString::localeAwareCompare(leftString, rightString) < 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( sourceModel()->hasChildren(right) )
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QString leftString = sourceModel()->data( left ).toString();
|
||||||
|
QString rightString = sourceModel()->data( right ).toString();
|
||||||
|
return QString::localeAwareCompare(leftString, rightString) < 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace Plugin */
|
||||||
|
|
||||||
|
/* end of file */
|
|
@ -0,0 +1,44 @@
|
||||||
|
// Object Viewer Qt - BNP Manager Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||||
|
// Copyright (C) 2011 Roland Winklmeier <roland.m.winklmeier@googlemail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
#ifndef BNP_PROXY_MODEL_H
|
||||||
|
#define BNP_PROXY_MODEL_H
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
|
namespace BNPManager
|
||||||
|
{
|
||||||
|
|
||||||
|
class BNPSortProxyModel : public QSortFilterProxyModel
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
BNPSortProxyModel(QObject *parent = 0): QSortFilterProxyModel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
~BNPSortProxyModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual bool lessThan ( const QModelIndex & left, const QModelIndex & right ) const;
|
||||||
|
|
||||||
|
};/* class BNPSortProxyModel */
|
||||||
|
|
||||||
|
} // BNPManager
|
||||||
|
|
||||||
|
#endif // BNP_PROXY_MODEL_H
|
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 30 KiB |
|
@ -0,0 +1,10 @@
|
||||||
|
<plugin-spec>
|
||||||
|
<library-name>ovqt_plugin_bnp_manager</library-name>
|
||||||
|
<name>BNPManager</name>
|
||||||
|
<version>0.1</version>
|
||||||
|
<vendor>Krolock</vendor>
|
||||||
|
<description>Edit BNP Files</description>
|
||||||
|
<dependencies>
|
||||||
|
<dependency plugin-name="Core" version="0.8"/>
|
||||||
|
</dependencies>
|
||||||
|
</plugin-spec>
|
|
@ -91,7 +91,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="bankButton">
|
<widget class="QPushButton" name="bankButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
|
|
@ -186,12 +186,11 @@ void CAttribWidget::changeUseScheme(int index)
|
||||||
|
|
||||||
void CAttribWidget::openSchemeBankDialog()
|
void CAttribWidget::openSchemeBankDialog()
|
||||||
{
|
{
|
||||||
CSchemeBankDialog *dialog = new CSchemeBankDialog(this);
|
CSchemeBankDialog dialog(this);
|
||||||
dialog->setModal(true);
|
dialog.setModal(true);
|
||||||
dialog->show();
|
dialog.show();
|
||||||
dialog->exec();
|
dialog.exec();
|
||||||
delete dialog;
|
updateUi();
|
||||||
//updateUi();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAttribWidget::inputValueUpdate(void)
|
void CAttribWidget::inputValueUpdate(void)
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
/// Force to update dialog content
|
/// Force to update dialog content
|
||||||
void updateUi();
|
void updateUi();
|
||||||
|
|
||||||
/// Сonnects all the slots with signals
|
/// Connects all the slots with signals
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
/// Sets the pointer CWorkspaceNode* in the wrappers.
|
/// Sets the pointer CWorkspaceNode* in the wrappers.
|
||||||
|
@ -192,6 +192,7 @@ protected:
|
||||||
QDialog *_SchemeWidget;
|
QDialog *_SchemeWidget;
|
||||||
|
|
||||||
Ui::CAttribWidget _ui;
|
Ui::CAttribWidget _ui;
|
||||||
|
friend class CSchemeBankDialog;
|
||||||
}; /* class CAttribWidget */
|
}; /* class CAttribWidget */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -73,11 +73,14 @@ void CParticleEditor::release()
|
||||||
{
|
{
|
||||||
stop();
|
stop();
|
||||||
closeWorkspace();
|
closeWorkspace();
|
||||||
|
delete _SchemeManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CParticleEditor::setActiveNode(CWorkspaceNode *node)
|
void CParticleEditor::setActiveNode(CWorkspaceNode *node)
|
||||||
{
|
{
|
||||||
if (node == _ActiveNode) return;
|
if (node == _ActiveNode) return;
|
||||||
|
if (node == 0)
|
||||||
|
_ActiveNode->getPSModel()->hide();
|
||||||
_ActiveNode = node;
|
_ActiveNode = node;
|
||||||
|
|
||||||
bool wasRunning = _State == State::RunningSingle;
|
bool wasRunning = _State == State::RunningSingle;
|
||||||
|
|
|
@ -378,6 +378,7 @@ void CParticleWorkspace::removeNode(uint index)
|
||||||
{
|
{
|
||||||
nlassert(index < _Nodes.size());
|
nlassert(index < _Nodes.size());
|
||||||
_Nodes[index] = NULL; // delete the smart-ptr target
|
_Nodes[index] = NULL; // delete the smart-ptr target
|
||||||
|
delete _Nodes[index];
|
||||||
_Nodes.erase(_Nodes.begin() + index);
|
_Nodes.erase(_Nodes.begin() + index);
|
||||||
touch();
|
touch();
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,8 @@ void CParticleWorkspaceDialog::customContextMenu()
|
||||||
_instanciateAction->setEnabled(stopped);
|
_instanciateAction->setEnabled(stopped);
|
||||||
_savePSAction->setEnabled(stopped);
|
_savePSAction->setEnabled(stopped);
|
||||||
_saveAsPSAction->setEnabled(stopped);
|
_saveAsPSAction->setEnabled(stopped);
|
||||||
|
_removeFromWSAction->setEnabled(stopped);
|
||||||
|
_clearContentAction->setEnabled(stopped);
|
||||||
|
|
||||||
popurMenu->exec(QCursor::pos());
|
popurMenu->exec(QCursor::pos());
|
||||||
delete popurMenu;
|
delete popurMenu;
|
||||||
|
@ -369,13 +371,14 @@ void CParticleWorkspaceDialog::clearContent()
|
||||||
|
|
||||||
void CParticleWorkspaceDialog::removePS()
|
void CParticleWorkspaceDialog::removePS()
|
||||||
{
|
{
|
||||||
if (_treeModel->getOwnerNode(_currentItem) == Modules::psEdit().getActiveNode())
|
CWorkspaceNode *node = _currentItem->getNode();
|
||||||
|
if (node == Modules::psEdit().getActiveNode())
|
||||||
Modules::psEdit().setActiveNode(NULL);
|
Modules::psEdit().setActiveNode(NULL);
|
||||||
|
|
||||||
QModelIndex index = _ui.treeView->currentIndex();
|
QModelIndex index = _ui.treeView->currentIndex();
|
||||||
_ui.treeView->setCurrentIndex(index.parent());
|
_ui.treeView->setCurrentIndex(index.parent());
|
||||||
clickedItem(index.parent());
|
clickedItem(index.parent());
|
||||||
Modules::psEdit().getParticleWorkspace()->removeNode(static_cast<CParticleTreeItem *>(index.internalPointer())->getNode());
|
Modules::psEdit().getParticleWorkspace()->removeNode(node);
|
||||||
_treeModel->removeRows(index.row(), index.parent());
|
_treeModel->removeRows(index.row(), index.parent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,17 @@
|
||||||
// Project includes
|
// Project includes
|
||||||
#include "stdpch.h"
|
#include "stdpch.h"
|
||||||
#include "scheme_bank_dialog.h"
|
#include "scheme_bank_dialog.h"
|
||||||
|
#include "scheme_manager.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/file.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QInputDialog>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
namespace NLQT
|
namespace NLQT
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -27,6 +36,16 @@ CSchemeBankDialog::CSchemeBankDialog(CAttribWidget *attribWidget, QWidget *paren
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
_attribWidget = attribWidget;
|
_attribWidget = attribWidget;
|
||||||
|
|
||||||
|
connect(_ui.createButton, SIGNAL(clicked()), this, SLOT(createScheme()));
|
||||||
|
connect(_ui.currentButton, SIGNAL(clicked()), this, SLOT(setCurrentScheme()));
|
||||||
|
connect(_ui.removeButton, SIGNAL(clicked()), this, SLOT(removeScheme()));
|
||||||
|
connect(_ui.loadButton, SIGNAL(clicked()), this, SLOT(loadBank()));
|
||||||
|
connect(_ui.saveButton, SIGNAL(clicked()), this, SLOT(saveBank()));
|
||||||
|
connect(_ui.listWidget, SIGNAL(itemSelectionChanged()), this, SLOT(enableButtons()));
|
||||||
|
connect(_ui.listWidget, SIGNAL(itemChanged(QListWidgetItem *)), this, SLOT(changeNameScheme(QListWidgetItem *)));
|
||||||
|
|
||||||
|
buildList();
|
||||||
}
|
}
|
||||||
|
|
||||||
CSchemeBankDialog::~CSchemeBankDialog()
|
CSchemeBankDialog::~CSchemeBankDialog()
|
||||||
|
@ -35,27 +54,125 @@ CSchemeBankDialog::~CSchemeBankDialog()
|
||||||
|
|
||||||
void CSchemeBankDialog::createScheme()
|
void CSchemeBankDialog::createScheme()
|
||||||
{
|
{
|
||||||
|
bool ok;
|
||||||
|
QString text = QInputDialog::getText(this, tr("Insert new scheme"),
|
||||||
|
tr("Set name:"), QLineEdit::Normal,
|
||||||
|
"new scheme", &ok);
|
||||||
|
if (ok && !text.isEmpty())
|
||||||
|
{
|
||||||
|
NL3D::CPSAttribMakerBase *attribMakerBase = _attribWidget->getCurrentSchemePtr()->clone();
|
||||||
|
Modules::psEdit().getSchemeManager()->insertScheme(text.toStdString(), attribMakerBase);
|
||||||
|
|
||||||
|
CSchemeItem *item = new CSchemeItem(text, _ui.listWidget);
|
||||||
|
item->setUserData(attribMakerBase);
|
||||||
|
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSchemeBankDialog::setCurrentScheme()
|
void CSchemeBankDialog::setCurrentScheme()
|
||||||
{
|
{
|
||||||
//SchemeManager.insertScheme(cn.getName(), getCurrentSchemePtr()->clone());
|
CSchemeItem *item = dynamic_cast<CSchemeItem *>(_ui.listWidget->currentItem());
|
||||||
|
|
||||||
|
NL3D::CPSAttribMakerBase *attrib = item->getUserData();
|
||||||
|
nlassert(attrib);
|
||||||
|
|
||||||
|
_attribWidget->setCurrentSchemePtr(attrib->clone());
|
||||||
|
_attribWidget->updateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSchemeBankDialog::removeScheme()
|
void CSchemeBankDialog::removeScheme()
|
||||||
{
|
{
|
||||||
|
CSchemeItem *item = dynamic_cast<CSchemeItem *>(_ui.listWidget->currentItem());
|
||||||
|
|
||||||
|
NL3D::CPSAttribMakerBase *attrib = item->getUserData();
|
||||||
|
nlassert(attrib);
|
||||||
|
Modules::psEdit().getSchemeManager()->remove(attrib);
|
||||||
|
_ui.listWidget->removeItemWidget(item);
|
||||||
|
delete item;
|
||||||
|
|
||||||
|
if (_ui.listWidget->count() == 0)
|
||||||
|
{
|
||||||
|
_ui.currentButton->setEnabled(false);
|
||||||
|
_ui.removeButton->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSchemeBankDialog::saveBank()
|
void CSchemeBankDialog::saveBank()
|
||||||
{
|
{
|
||||||
|
QString fileName = QFileDialog::getSaveFileName(this,
|
||||||
|
tr("Save scheme bank file"), ".",
|
||||||
|
tr("Scheme bank files (*.scb)"));
|
||||||
|
|
||||||
|
if (!fileName.isEmpty())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
NLMISC::COFile iF;
|
||||||
|
iF.open(fileName.toStdString());
|
||||||
|
NLQT::CSchemeManager *schemeManager = Modules::psEdit().getSchemeManager();
|
||||||
|
iF.serial(*schemeManager);
|
||||||
|
}
|
||||||
|
catch (std::exception &e)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, "Scheme manager", tr("Error saving scheme bank : %1").arg(e.what()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSchemeBankDialog::loadBank()
|
void CSchemeBankDialog::loadBank()
|
||||||
{
|
{
|
||||||
|
QString fileName = QFileDialog::getOpenFileName(this,
|
||||||
|
tr("Open scheme bank file"), ".",
|
||||||
|
tr("Scheme bank files (*.scb)"));
|
||||||
|
|
||||||
|
if (!fileName.isEmpty())
|
||||||
|
{
|
||||||
|
NLQT::CSchemeManager sm;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
NLMISC::CIFile iF;
|
||||||
|
iF.open(fileName.toStdString());
|
||||||
|
iF.serial(sm);
|
||||||
|
Modules::psEdit().getSchemeManager()->swap(sm);
|
||||||
|
}
|
||||||
|
catch (std::exception &e)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, "Scheme manager", tr("Error loading scheme bank : %1").arg(e.what()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
buildList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSchemeBankDialog::changeNameScheme(QListWidgetItem *item)
|
||||||
|
{
|
||||||
|
CSchemeItem *schemeItem = dynamic_cast<CSchemeItem *>(item);
|
||||||
|
|
||||||
|
NL3D::CPSAttribMakerBase *attrib = schemeItem->getUserData();
|
||||||
|
nlassert(attrib);
|
||||||
|
|
||||||
|
Modules::psEdit().getSchemeManager()->rename(attrib, item->text().toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSchemeBankDialog::enableButtons()
|
||||||
|
{
|
||||||
|
_ui.currentButton->setEnabled(true);
|
||||||
|
_ui.removeButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSchemeBankDialog::buildList()
|
void CSchemeBankDialog::buildList()
|
||||||
{
|
{
|
||||||
|
_ui.listWidget->clear();
|
||||||
|
typedef std::vector<NLQT::CSchemeManager::TSchemeInfo> TSchemeVect;
|
||||||
|
static TSchemeVect schemes;
|
||||||
|
Modules::psEdit().getSchemeManager()->getSchemes(_attribWidget->getCurrentSchemePtr()->getType(), schemes);
|
||||||
|
for (TSchemeVect::const_iterator it = schemes.begin(); it != schemes.end(); ++it)
|
||||||
|
{
|
||||||
|
CSchemeItem *item = new CSchemeItem(it->first.c_str(), _ui.listWidget);
|
||||||
|
item->setUserData(it->second);
|
||||||
|
item->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace NLQT */
|
} /* namespace NLQT */
|
|
@ -27,12 +27,37 @@
|
||||||
#include "nel/3d/particle_system.h"
|
#include "nel/3d/particle_system.h"
|
||||||
|
|
||||||
// Project includes
|
// Project includes
|
||||||
|
#include "attrib_widget.h"
|
||||||
#include "ps_wrapper.h"
|
#include "ps_wrapper.h"
|
||||||
|
|
||||||
namespace NLQT
|
namespace NLQT
|
||||||
{
|
{
|
||||||
class CAttribWidget;
|
class CAttribWidget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@class CSchemeItem
|
||||||
|
@brief Contain pointer to NL3D::CPSAttribMakerBase.
|
||||||
|
*/
|
||||||
|
class CSchemeItem: public QListWidgetItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CSchemeItem(const QString &text, QListWidget *parent = 0, int type = UserType ):
|
||||||
|
QListWidgetItem(text, parent, type), _attrib(NULL) {}
|
||||||
|
|
||||||
|
void setUserData(NL3D::CPSAttribMakerBase *attrib)
|
||||||
|
{
|
||||||
|
_attrib = attrib;
|
||||||
|
}
|
||||||
|
NL3D::CPSAttribMakerBase *getUserData() const
|
||||||
|
{
|
||||||
|
return _attrib;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
NL3D::CPSAttribMakerBase *_attrib;
|
||||||
|
}; /* class CSchemeItem */
|
||||||
|
|
||||||
class CSchemeBankDialog: public QDialog
|
class CSchemeBankDialog: public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -47,6 +72,8 @@ private Q_SLOTS:
|
||||||
void removeScheme();
|
void removeScheme();
|
||||||
void saveBank();
|
void saveBank();
|
||||||
void loadBank();
|
void loadBank();
|
||||||
|
void enableButtons();
|
||||||
|
void changeNameScheme(QListWidgetItem *item);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void buildList();
|
void buildList();
|
||||||
|
|
|
@ -14,31 +14,27 @@
|
||||||
<string>Sceme bank</string>
|
<string>Sceme bank</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0" rowspan="8">
|
<item row="0" column="0" rowspan="7">
|
||||||
<widget class="QListWidget" name="listWidget"/>
|
<widget class="QListWidget" name="listWidget"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QPushButton" name="createButton">
|
<widget class="QPushButton" name="createButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Create</string>
|
<string>Put current</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QPushButton" name="renameButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rename</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QPushButton" name="removeButton">
|
<widget class="QPushButton" name="removeButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Remove</string>
|
<string>Remove</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="4" column="1">
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -51,24 +47,33 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QPushButton" name="loadButton">
|
<widget class="QPushButton" name="loadButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load bank</string>
|
<string>Load bank</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QPushButton" name="saveButton">
|
<widget class="QPushButton" name="saveButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save bank</string>
|
<string>Save bank</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="7" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -105,7 +110,10 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QPushButton" name="setCurrentButton">
|
<widget class="QPushButton" name="currentButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Set current</string>
|
<string>Set current</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -17,8 +17,7 @@ SET(OVQT_PLUG_TRANSLATION_MANAGER_HDR translation_manager_plugin.h
|
||||||
ftp_selection.h
|
ftp_selection.h
|
||||||
editor_worksheet.h
|
editor_worksheet.h
|
||||||
editor_phrase.h
|
editor_phrase.h
|
||||||
extract_new_sheet_names.h
|
)
|
||||||
extract_bot_names.h)
|
|
||||||
|
|
||||||
SET(OVQT_PLUG_TRANSLATION_MANAGER_UIS translation_manager_settings_page.ui
|
SET(OVQT_PLUG_TRANSLATION_MANAGER_UIS translation_manager_settings_page.ui
|
||||||
translation_manager_main_window.ui
|
translation_manager_main_window.ui
|
||||||
|
@ -28,7 +27,6 @@ SET(OVQT_PLUG_TRANSLATION_MANAGER_UIS translation_manager_settings_page.ui
|
||||||
SET(OVQT_PLUG_TRANSLATION_MANAGER_RCS ftp_selection.qrc)
|
SET(OVQT_PLUG_TRANSLATION_MANAGER_RCS ftp_selection.qrc)
|
||||||
|
|
||||||
SET(QT_USE_QTGUI TRUE)
|
SET(QT_USE_QTGUI TRUE)
|
||||||
SET(QT_USE_QTOPENGL TRUE)
|
|
||||||
SET(QT_USE_QTNETWORK TRUE)
|
SET(QT_USE_QTNETWORK TRUE)
|
||||||
|
|
||||||
QT4_WRAP_CPP(OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC ${OVQT_PLUG_TRANSLATION_MANAGER_HDR})
|
QT4_WRAP_CPP(OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC ${OVQT_PLUG_TRANSLATION_MANAGER_HDR})
|
||||||
|
@ -42,7 +40,7 @@ SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
|
||||||
|
|
||||||
ADD_LIBRARY(ovqt_plugin_translation_manager MODULE ${SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_UI_HDRS})
|
ADD_LIBRARY(ovqt_plugin_translation_manager MODULE ${SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_TRANSLATION_MANAGER_UI_HDRS})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(ovqt_plugin_translation_manager ovqt_plugin_core nelmisc nel3d nelligo nelgeorges ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${QT_QTNETWORK_LIBRARY} )
|
TARGET_LINK_LIBRARIES(ovqt_plugin_translation_manager ovqt_plugin_core nelmisc nelligo nelgeorges ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${QT_QTNETWORK_LIBRARY} )
|
||||||
|
|
||||||
NL_DEFAULT_PROPS(ovqt_plugin_translation_manager "NeL, Tools, 3D: Object Viewer Qt Plugin: Translation Manager")
|
NL_DEFAULT_PROPS(ovqt_plugin_translation_manager "NeL, Tools, 3D: Object Viewer Qt Plugin: Translation Manager")
|
||||||
NL_ADD_RUNTIME_FLAGS(ovqt_plugin_translation_manager)
|
NL_ADD_RUNTIME_FLAGS(ovqt_plugin_translation_manager)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
// Copyright (C) 2010 Winch Gate Property Limited
|
|
||||||
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -15,32 +14,32 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "editor_phrase.h"
|
||||||
|
#include "translation_manager_constants.h"
|
||||||
|
|
||||||
// Nel includes
|
// Nel includes
|
||||||
#include "nel/misc/path.h"
|
#include "nel/misc/path.h"
|
||||||
#include "nel/misc/diff_tool.h"
|
#include "nel/misc/diff_tool.h"
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
|
#include <QtCore/QFileInfo>
|
||||||
|
#include <QtCore/QByteArray>
|
||||||
|
#include <QtCore/QTextCodec>
|
||||||
|
#include <QtCore/QTextStream>
|
||||||
|
#include <QtGui/QTextCursor>
|
||||||
#include <QtGui/QErrorMessage>
|
#include <QtGui/QErrorMessage>
|
||||||
#include <QtCore/qfileinfo.h>
|
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QtGui/QCloseEvent>
|
#include <QtGui/QCloseEvent>
|
||||||
#include <QtCore/QByteArray>
|
|
||||||
#include <QtCore/qtextcodec.h>
|
|
||||||
#include <QtGui/QTextCursor>
|
|
||||||
#include <QtCore/qtextstream.h>
|
|
||||||
#include <QtCore/qtextcodec.h>
|
|
||||||
|
|
||||||
// Project includes
|
|
||||||
#include "editor_phrase.h"
|
|
||||||
#include "translation_manager_constants.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace TranslationManager {
|
namespace TranslationManager
|
||||||
|
{
|
||||||
|
|
||||||
void CEditorPhrase::open(QString filename)
|
void CEditorPhrase::open(QString filename)
|
||||||
{
|
{
|
||||||
vector<STRING_MANAGER::TPhrase> phrases;
|
std::vector<STRING_MANAGER::TPhrase> phrases;
|
||||||
if(readPhraseFile(filename.toStdString(), phrases, false))
|
if(readPhraseFile(filename.toStdString(), phrases, false))
|
||||||
{
|
{
|
||||||
text_edit = new CTextEdit(this);
|
text_edit = new CTextEdit(this);
|
||||||
|
@ -63,7 +62,9 @@ void CEditorPhrase::open(QString filename)
|
||||||
current_file = filename;
|
current_file = filename;
|
||||||
connect(text_edit->document(), SIGNAL(contentsChanged()), this, SLOT(docContentsChanged()));
|
connect(text_edit->document(), SIGNAL(contentsChanged()), this, SLOT(docContentsChanged()));
|
||||||
connect(text_edit->document(), SIGNAL(undoCommandAdded()), this, SLOT(newUndoCommandAdded()));
|
connect(text_edit->document(), SIGNAL(undoCommandAdded()), this, SLOT(newUndoCommandAdded()));
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage("This file is not a phrase file.");
|
error.showMessage("This file is not a phrase file.");
|
||||||
error.exec();
|
error.exec();
|
||||||
|
@ -97,44 +98,37 @@ void CEditorPhrase::saveAs(QString filename)
|
||||||
QTextStream out(&file);
|
QTextStream out(&file);
|
||||||
out.setCodec("UTF-8");
|
out.setCodec("UTF-8");
|
||||||
out.setGenerateByteOrderMark(true);
|
out.setGenerateByteOrderMark(true);
|
||||||
out<<text_edit->toPlainText();
|
out << text_edit->toPlainText();
|
||||||
current_file = filename;
|
current_file = filename;
|
||||||
setCurrentFile(current_file);
|
setCurrentFile(current_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CEditorPhrase::closeEvent(QCloseEvent *event)
|
void CEditorPhrase::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
if(isWindowModified())
|
if(isWindowModified())
|
||||||
{
|
{
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText("The document has been modified.");
|
msgBox.setIcon(QMessageBox::Question);
|
||||||
msgBox.setInformativeText("Do you want to save your changes?");
|
msgBox.setText(tr("The document has been modified."));
|
||||||
|
msgBox.setInformativeText(tr("Do you want to save your changes?"));
|
||||||
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||||
msgBox.setDefaultButton(QMessageBox::Save);
|
msgBox.setDefaultButton(QMessageBox::Save);
|
||||||
|
|
||||||
int ret = msgBox.exec();
|
int ret = msgBox.exec();
|
||||||
switch (ret)
|
switch (ret)
|
||||||
{
|
{
|
||||||
case QMessageBox::Save:
|
case QMessageBox::Save:
|
||||||
save();
|
save();
|
||||||
event->accept();
|
|
||||||
close();
|
|
||||||
break;
|
break;
|
||||||
case QMessageBox::Discard:
|
case QMessageBox::Discard:
|
||||||
event->accept();
|
|
||||||
close();
|
|
||||||
break;
|
break;
|
||||||
case QMessageBox::Cancel:
|
case QMessageBox::Cancel:
|
||||||
event->ignore();
|
event->ignore();
|
||||||
break;
|
return;
|
||||||
default:
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
event->accept();
|
event->accept();
|
||||||
close();
|
close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -18,6 +18,9 @@
|
||||||
#ifndef EDITOR_PHRASE_H
|
#ifndef EDITOR_PHRASE_H
|
||||||
#define EDITOR_PHRASE_H
|
#define EDITOR_PHRASE_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "translation_manager_editor.h"
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
|
@ -32,23 +35,23 @@
|
||||||
#include <QtGui/QErrorMessage>
|
#include <QtGui/QErrorMessage>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
// Project includes
|
namespace TranslationManager
|
||||||
#include "translation_manager_editor.h"
|
{
|
||||||
|
|
||||||
namespace TranslationManager {
|
|
||||||
|
|
||||||
class CTextEdit : public QTextEdit
|
class CTextEdit : public QTextEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUndoStack* m_undoStack;
|
QUndoStack *m_undoStack;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTextEdit(QWidget* parent = 0) : QTextEdit(parent)
|
CTextEdit(QWidget *parent = 0) : QTextEdit(parent)
|
||||||
{
|
{
|
||||||
setUndoRedoEnabled(true);
|
setUndoRedoEnabled(true);
|
||||||
}
|
}
|
||||||
//void keyPressEvent(QKeyEvent *event);
|
//void keyPressEvent(QKeyEvent *event);
|
||||||
void setUndoStack(QUndoStack* undoStack)
|
void setUndoStack(QUndoStack *undoStack)
|
||||||
{
|
{
|
||||||
m_undoStack = undoStack;
|
m_undoStack = undoStack;
|
||||||
}
|
}
|
||||||
|
@ -57,20 +60,22 @@ public:
|
||||||
class CEditorPhrase : public CEditor
|
class CEditorPhrase : public CEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTextEdit *text_edit;
|
CEditorPhrase(QMdiArea *parent) : CEditor(parent) {}
|
||||||
public:
|
|
||||||
CEditorPhrase(QMdiArea* parent) : CEditor(parent) {}
|
|
||||||
CEditorPhrase() : CEditor() {}
|
CEditorPhrase() : CEditor() {}
|
||||||
void open(QString filename);
|
void open(QString filename);
|
||||||
void save();
|
void save();
|
||||||
void saveAs(QString filename);
|
void saveAs(QString filename);
|
||||||
void activateWindow();
|
void activateWindow();
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void docContentsChanged();
|
void docContentsChanged();
|
||||||
void newUndoCommandAdded();
|
void newUndoCommandAdded();
|
||||||
|
|
||||||
|
private:
|
||||||
|
CTextEdit *text_edit;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CUndoPhraseNewCommand : public QUndoCommand
|
class CUndoPhraseNewCommand : public QUndoCommand
|
||||||
|
@ -79,7 +84,7 @@ public:
|
||||||
CUndoPhraseNewCommand(CTextEdit *textEdit, QUndoCommand *parent = 0)
|
CUndoPhraseNewCommand(CTextEdit *textEdit, QUndoCommand *parent = 0)
|
||||||
: QUndoCommand("Inserting/Removing characters", parent),
|
: QUndoCommand("Inserting/Removing characters", parent),
|
||||||
m_textEdit(textEdit)
|
m_textEdit(textEdit)
|
||||||
{ }
|
{}
|
||||||
|
|
||||||
~CUndoPhraseNewCommand() {}
|
~CUndoPhraseNewCommand() {}
|
||||||
|
|
||||||
|
@ -92,8 +97,9 @@ public:
|
||||||
{
|
{
|
||||||
m_textEdit->redo();
|
m_textEdit->redo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CTextEdit* m_textEdit;
|
CTextEdit *m_textEdit;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SyntaxHighlighter : public QSyntaxHighlighter
|
class SyntaxHighlighter : public QSyntaxHighlighter
|
||||||
|
@ -109,7 +115,6 @@ public:
|
||||||
rule.format = translateStringFormat;
|
rule.format = translateStringFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
|
|
||||||
|
|
||||||
singleLineCommentFormat.setForeground(Qt::red);
|
singleLineCommentFormat.setForeground(Qt::red);
|
||||||
rule.pattern = QRegExp("//[^\n]*");
|
rule.pattern = QRegExp("//[^\n]*");
|
||||||
rule.format = singleLineCommentFormat;
|
rule.format = singleLineCommentFormat;
|
||||||
|
@ -134,10 +139,12 @@ public:
|
||||||
|
|
||||||
void highlightBlock(const QString &text)
|
void highlightBlock(const QString &text)
|
||||||
{
|
{
|
||||||
Q_FOREACH(const HighlightingRule &rule, highlightingRules) {
|
Q_FOREACH(const HighlightingRule &rule, highlightingRules)
|
||||||
|
{
|
||||||
QRegExp expression(rule.pattern);
|
QRegExp expression(rule.pattern);
|
||||||
int index = expression.indexIn(text);
|
int index = expression.indexIn(text);
|
||||||
while (index >= 0) {
|
while (index >= 0)
|
||||||
|
{
|
||||||
int length = expression.matchedLength();
|
int length = expression.matchedLength();
|
||||||
setFormat(index, length, rule.format);
|
setFormat(index, length, rule.format);
|
||||||
index = expression.indexIn(text, index + length);
|
index = expression.indexIn(text, index + length);
|
||||||
|
@ -149,13 +156,17 @@ public:
|
||||||
if (previousBlockState() != 1)
|
if (previousBlockState() != 1)
|
||||||
startIndex = commentStartExpression.indexIn(text);
|
startIndex = commentStartExpression.indexIn(text);
|
||||||
|
|
||||||
while (startIndex >= 0) {
|
while (startIndex >= 0)
|
||||||
|
{
|
||||||
int endIndex = commentEndExpression.indexIn(text, startIndex);
|
int endIndex = commentEndExpression.indexIn(text, startIndex);
|
||||||
int commentLength;
|
int commentLength;
|
||||||
if (endIndex == -1) {
|
if (endIndex == -1)
|
||||||
|
{
|
||||||
setCurrentBlockState(1);
|
setCurrentBlockState(1);
|
||||||
commentLength = text.length() - startIndex;
|
commentLength = text.length() - startIndex;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
commentLength = endIndex - startIndex
|
commentLength = endIndex - startIndex
|
||||||
+ commentEndExpression.matchedLength();
|
+ commentEndExpression.matchedLength();
|
||||||
}
|
}
|
||||||
|
@ -164,7 +175,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct HighlightingRule
|
struct HighlightingRule
|
||||||
{
|
{
|
||||||
QRegExp pattern;
|
QRegExp pattern;
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "editor_worksheet.h"
|
||||||
|
#include "extract_bot_names.h"
|
||||||
|
#include "translation_manager_constants.h"
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QtGui/QErrorMessage>
|
#include <QtGui/QErrorMessage>
|
||||||
#include <QtGui/QTableWidgetItem>
|
#include <QtGui/QTableWidgetItem>
|
||||||
|
@ -24,15 +29,10 @@
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
|
|
||||||
// Project includes
|
|
||||||
#include "editor_worksheet.h"
|
|
||||||
#include "extract_bot_names.h"
|
|
||||||
#include "translation_manager_constants.h"
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace TranslationManager {
|
namespace TranslationManager
|
||||||
|
{
|
||||||
|
|
||||||
void CEditorWorksheet::open(QString filename)
|
void CEditorWorksheet::open(QString filename)
|
||||||
{
|
{
|
||||||
|
@ -45,25 +45,31 @@ void CEditorWorksheet::open(QString filename)
|
||||||
{
|
{
|
||||||
table_editor->setColumnCount(wk_file.ColCount - 1);
|
table_editor->setColumnCount(wk_file.ColCount - 1);
|
||||||
hasHashValue = true;
|
hasHashValue = true;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
table_editor->setColumnCount(wk_file.ColCount);
|
table_editor->setColumnCount(wk_file.ColCount);
|
||||||
}
|
}
|
||||||
table_editor->setRowCount(wk_file.size() - 1);
|
table_editor->setRowCount(wk_file.size() - 1);
|
||||||
|
|
||||||
// read columns name
|
// read columns name
|
||||||
for(unsigned int i = 0; i < wk_file.ColCount; i++)
|
for(uint i = 0; i < wk_file.ColCount; i++)
|
||||||
{
|
{
|
||||||
if(hasHashValue && i == 0)
|
if(hasHashValue && i == 0)
|
||||||
{
|
{
|
||||||
// we don't show the column with hash value
|
// we don't show the column with hash value
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QTableWidgetItem *col = new QTableWidgetItem();
|
QTableWidgetItem *col = new QTableWidgetItem();
|
||||||
ucstring col_name = wk_file.getData(0, i);
|
ucstring col_name = wk_file.getData(0, i);
|
||||||
col->setText(QString(col_name.toString().c_str()));
|
col->setText(QString(col_name.toString().c_str()));
|
||||||
if(hasHashValue)
|
if(hasHashValue)
|
||||||
{
|
{
|
||||||
table_editor->setHorizontalHeaderItem(i - 1, col);
|
table_editor->setHorizontalHeaderItem(i - 1, col);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
table_editor->setHorizontalHeaderItem(i, col);
|
table_editor->setHorizontalHeaderItem(i, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,14 +83,18 @@ void CEditorWorksheet::open(QString filename)
|
||||||
if(hasHashValue && j == 0)
|
if(hasHashValue && j == 0)
|
||||||
{
|
{
|
||||||
// we don't show the column with hash value
|
// we don't show the column with hash value
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QTableWidgetItem *row = new QTableWidgetItem();
|
QTableWidgetItem *row = new QTableWidgetItem();
|
||||||
ucstring row_value = wk_file.getData(i, j);
|
ucstring row_value = wk_file.getData(i, j);
|
||||||
row->setText(QString::fromUtf8(row_value.toUtf8().c_str()));
|
row->setText(QString::fromUtf8(row_value.toUtf8().c_str()));
|
||||||
if(hasHashValue)
|
if(hasHashValue)
|
||||||
{
|
{
|
||||||
table_editor->setItem(i - 1, j - 1, row);
|
table_editor->setItem(i - 1, j - 1, row);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
table_editor->setItem(i - 1, j, row);
|
table_editor->setItem(i - 1, j, row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,23 +107,24 @@ void CEditorWorksheet::open(QString filename)
|
||||||
table_editor->resizeColumnsToContents();
|
table_editor->resizeColumnsToContents();
|
||||||
table_editor->resizeRowsToContents();
|
table_editor->resizeRowsToContents();
|
||||||
// set editor signals
|
// set editor signals
|
||||||
connect(table_editor, SIGNAL(itemChanged(QTableWidgetItem*) ), this, SLOT(worksheetEditorChanged(QTableWidgetItem*)));
|
connect(table_editor, SIGNAL(itemChanged(QTableWidgetItem *) ), this, SLOT(worksheetEditorChanged(QTableWidgetItem *)));
|
||||||
connect(table_editor, SIGNAL(itemDoubleClicked(QTableWidgetItem*) ), this, SLOT(worksheetEditorCellEntered(QTableWidgetItem*)));
|
connect(table_editor, SIGNAL(itemDoubleClicked(QTableWidgetItem *) ), this, SLOT(worksheetEditorCellEntered(QTableWidgetItem *)));
|
||||||
connect (table_editor,SIGNAL(customContextMenuRequested(const QPoint &)), this,SLOT(contextMenuEvent(QContextMenuEvent*)));
|
connect(table_editor,SIGNAL(customContextMenuRequested(const QPoint &)), this,SLOT(contextMenuEvent(QContextMenuEvent *)));
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage("This file is not a worksheet file.");
|
error.showMessage(tr("This file is not a worksheet file."));
|
||||||
error.exec();
|
error.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CEditorWorksheet::contextMenuEvent(QContextMenuEvent *e)
|
void CEditorWorksheet::contextMenuEvent(QContextMenuEvent *e)
|
||||||
{
|
{
|
||||||
QAction *insertRowAct = new QAction("Insert new row", this);
|
QAction *insertRowAct = new QAction(tr("Insert new row"), this);
|
||||||
connect(insertRowAct, SIGNAL(triggered()), this, SLOT(insertRow()));
|
connect(insertRowAct, SIGNAL(triggered()), this, SLOT(insertRow()));
|
||||||
QAction *deleteRowAct = new QAction("Delete row", this);
|
QAction *deleteRowAct = new QAction(tr("Delete row"), this);
|
||||||
connect(deleteRowAct, SIGNAL(triggered()), this, SLOT(deleteRow()));
|
connect(deleteRowAct, SIGNAL(triggered()), this, SLOT(deleteRow()));
|
||||||
|
|
||||||
QMenu *contextMenu = new QMenu(this);
|
QMenu *contextMenu = new QMenu(this);
|
||||||
|
@ -163,7 +174,7 @@ void CEditorWorksheet::saveAs(QString filename)
|
||||||
ucstring tvalue;
|
ucstring tvalue;
|
||||||
for(int j = 0; j < table_editor->columnCount(); j++)
|
for(int j = 0; j < table_editor->columnCount(); j++)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* item = table_editor->item(i, j);
|
QTableWidgetItem *item = table_editor->item(i, j);
|
||||||
tvalue.fromUtf8(std::string(item->text().toUtf8()));
|
tvalue.fromUtf8(std::string(item->text().toUtf8()));
|
||||||
new_file.setData(rowIdx, j + colIdx, tvalue);
|
new_file.setData(rowIdx, j + colIdx, tvalue);
|
||||||
}
|
}
|
||||||
|
@ -189,28 +200,29 @@ void CEditorWorksheet::deleteRow()
|
||||||
{
|
{
|
||||||
int selected_row = table_editor->currentRow();
|
int selected_row = table_editor->currentRow();
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
|
msgBox.setIcon(QMessageBox::Question);
|
||||||
msgBox.setText(tr("The row will be deleted."));
|
msgBox.setText(tr("The row will be deleted."));
|
||||||
msgBox.setInformativeText(tr("Do you want to delete the selected row ?"));
|
msgBox.setInformativeText(tr("Do you want to delete the selected row ?"));
|
||||||
msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
|
msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
|
||||||
msgBox.setDefaultButton(QMessageBox::No);
|
msgBox.setDefaultButton(QMessageBox::No);
|
||||||
|
|
||||||
int ret = msgBox.exec();
|
int ret = msgBox.exec();
|
||||||
if(ret == QMessageBox::Yes)
|
if(ret == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
current_stack->push(new CUndoWorksheetDeleteCommand(table_editor, selected_row));
|
current_stack->push(new CUndoWorksheetDeleteCommand(table_editor, selected_row));
|
||||||
}
|
}
|
||||||
|
|
||||||
table_editor->clearFocus();
|
table_editor->clearFocus();
|
||||||
table_editor->clearSelection();
|
table_editor->clearSelection();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditorWorksheet::worksheetEditorCellEntered(QTableWidgetItem * item)
|
void CEditorWorksheet::worksheetEditorCellEntered(QTableWidgetItem *item)
|
||||||
{
|
{
|
||||||
temp_content = item->text();
|
temp_content = item->text();
|
||||||
current_stack->push(new CUndoWorksheetCommand(table_editor, item, temp_content));
|
current_stack->push(new CUndoWorksheetCommand(table_editor, item, temp_content));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditorWorksheet::worksheetEditorChanged(QTableWidgetItem * item)
|
void CEditorWorksheet::worksheetEditorChanged(QTableWidgetItem *item)
|
||||||
{
|
{
|
||||||
if(temp_content != item->text())
|
if(temp_content != item->text())
|
||||||
{
|
{
|
||||||
|
@ -237,7 +249,7 @@ void CEditorWorksheet::extractBotNames(list<string> filters, string level_design
|
||||||
|
|
||||||
for (; it != last; ++it)
|
for (; it != last; ++it)
|
||||||
{
|
{
|
||||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString(it->first.c_str()), Qt::MatchExactly);
|
QList<QTableWidgetItem *> search_results = table_editor->findItems(QString(it->first.c_str()), Qt::MatchExactly);
|
||||||
if(search_results.size() == 0)
|
if(search_results.size() == 0)
|
||||||
{
|
{
|
||||||
QList<QString> records;
|
QList<QString> records;
|
||||||
|
@ -257,7 +269,7 @@ void CEditorWorksheet::extractBotNames(list<string> filters, string level_design
|
||||||
for (; it != last; ++it)
|
for (; it != last; ++it)
|
||||||
{
|
{
|
||||||
string gnName = "gn_" + ebn.cleanupName(*it);
|
string gnName = "gn_" + ebn.cleanupName(*it);
|
||||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString((*it).c_str()), Qt::MatchExactly);
|
QList<QTableWidgetItem *> search_results = table_editor->findItems(QString((*it).c_str()), Qt::MatchExactly);
|
||||||
if(search_results.size() == 0)
|
if(search_results.size() == 0)
|
||||||
{
|
{
|
||||||
QList<QString> records;
|
QList<QString> records;
|
||||||
|
@ -280,13 +292,13 @@ void CEditorWorksheet::extractBotNames(list<string> filters, string level_design
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordListBuilder& wordListBuilder)
|
void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordListBuilder &wordListBuilder)
|
||||||
{
|
{
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
// **** Load the excel sheet
|
// **** Load the excel sheet
|
||||||
// load
|
// load
|
||||||
TWorksheet workSheet;
|
STRING_MANAGER::TWorksheet workSheet;
|
||||||
if(!loadExcelSheet(filename.toStdString(), workSheet, true))
|
if(!loadExcelSheet(filename.toStdString(), workSheet, true))
|
||||||
{
|
{
|
||||||
nlwarning("Error reading '%s'. Aborted", filename.toStdString().c_str());
|
nlwarning("Error reading '%s'. Aborted", filename.toStdString().c_str());
|
||||||
|
@ -308,7 +320,7 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
||||||
}
|
}
|
||||||
|
|
||||||
// **** List all words with the builder given
|
// **** List all words with the builder given
|
||||||
std::vector<string> allWords;
|
std::vector<std::string> allWords;
|
||||||
if(!wordListBuilder.buildWordList(allWords, filename.toStdString()))
|
if(!wordListBuilder.buildWordList(allWords, filename.toStdString()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -318,7 +330,7 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
||||||
for(i = 0; i < allWords.size(); i++)
|
for(i = 0; i < allWords.size(); i++)
|
||||||
{
|
{
|
||||||
string keyName = allWords[i];
|
string keyName = allWords[i];
|
||||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString(keyName.c_str()), Qt::MatchExactly);
|
QList<QTableWidgetItem *> search_results = table_editor->findItems(QString(keyName.c_str()), Qt::MatchExactly);
|
||||||
if(search_results.size() == 0)
|
if(search_results.size() == 0)
|
||||||
{
|
{
|
||||||
int knPos = 0, nPos = 0;
|
int knPos = 0, nPos = 0;
|
||||||
|
@ -326,7 +338,9 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
||||||
{
|
{
|
||||||
knPos = keyColIndex - 1;
|
knPos = keyColIndex - 1;
|
||||||
nPos = nameColIndex - 1;
|
nPos = nameColIndex - 1;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
knPos = keyColIndex;
|
knPos = keyColIndex;
|
||||||
nPos = nameColIndex;
|
nPos = nameColIndex;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +374,6 @@ void CEditorWorksheet::insertTableRecords(QList<QString> records, QList<CTableWi
|
||||||
new_items.push_back(rec_s);
|
new_items.push_back(rec_s);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CEditorWorksheet::compareWorksheetFile(QString filename)
|
bool CEditorWorksheet::compareWorksheetFile(QString filename)
|
||||||
|
@ -388,10 +401,11 @@ bool CEditorWorksheet::compareWorksheetFile(QString filename)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,12 +426,12 @@ void CEditorWorksheet::mergeWorksheetFile(QString filename)
|
||||||
{
|
{
|
||||||
// search with the first column
|
// search with the first column
|
||||||
ucstring rowId = wk_file.getData(i,colIndex);
|
ucstring rowId = wk_file.getData(i,colIndex);
|
||||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString(rowId.toString().c_str()), Qt::MatchExactly);
|
QList<QTableWidgetItem *> search_results = table_editor->findItems(QString(rowId.toString().c_str()), Qt::MatchExactly);
|
||||||
if(search_results.size() == 0)
|
if(search_results.size() == 0)
|
||||||
{
|
{
|
||||||
const int lastRow = table_editor->rowCount();
|
const int lastRow = table_editor->rowCount();
|
||||||
table_editor->setRowCount(lastRow + 1);
|
table_editor->setRowCount(lastRow + 1);
|
||||||
for(unsigned int j = 0; j < table_editor->columnCount(); j++)
|
for(int j = 0; j < table_editor->columnCount(); j++)
|
||||||
{
|
{
|
||||||
ucstring rowValue = wk_file.getData(i, j + colIndex); // get the value
|
ucstring rowValue = wk_file.getData(i, j + colIndex); // get the value
|
||||||
QTableWidgetItem *row = new QTableWidgetItem();
|
QTableWidgetItem *row = new QTableWidgetItem();
|
||||||
|
@ -426,7 +440,9 @@ void CEditorWorksheet::mergeWorksheetFile(QString filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(tr("This file is not a worksheet file."));
|
error.showMessage(tr("This file is not a worksheet file."));
|
||||||
error.exec();
|
error.exec();
|
||||||
|
@ -438,6 +454,7 @@ void CEditorWorksheet::closeEvent(QCloseEvent *event)
|
||||||
if(isWindowModified())
|
if(isWindowModified())
|
||||||
{
|
{
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
|
msgBox.setIcon(QMessageBox::Question);
|
||||||
msgBox.setText(tr("The document has been modified."));
|
msgBox.setText(tr("The document has been modified."));
|
||||||
msgBox.setInformativeText(tr("Do you want to save your changes?"));
|
msgBox.setInformativeText(tr("Do you want to save your changes?"));
|
||||||
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||||
|
@ -447,23 +464,16 @@ void CEditorWorksheet::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
case QMessageBox::Save:
|
case QMessageBox::Save:
|
||||||
save();
|
save();
|
||||||
event->accept();
|
|
||||||
close();
|
|
||||||
break;
|
break;
|
||||||
case QMessageBox::Discard:
|
case QMessageBox::Discard:
|
||||||
event->accept();
|
|
||||||
close();
|
|
||||||
break;
|
break;
|
||||||
case QMessageBox::Cancel:
|
case QMessageBox::Cancel:
|
||||||
event->ignore();
|
event->ignore();
|
||||||
break;
|
return;
|
||||||
default:
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
event->accept();
|
event->accept();
|
||||||
close();
|
close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -476,7 +486,6 @@ bool CEditorWorksheet::isBotNamesTable()
|
||||||
{
|
{
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,13 +495,21 @@ bool CEditorWorksheet::isSheetTable(QString type)
|
||||||
if(type.toAscii() == Constants::WK_ITEM)
|
if(type.toAscii() == Constants::WK_ITEM)
|
||||||
{
|
{
|
||||||
column_name = "item ID";
|
column_name = "item ID";
|
||||||
} else if(type.toAscii() == Constants::WK_CREATURE) {
|
}
|
||||||
|
else if(type.toAscii() == Constants::WK_CREATURE)
|
||||||
|
{
|
||||||
column_name = "creature ID";
|
column_name = "creature ID";
|
||||||
} else if(type.toAscii() == Constants::WK_SBRICK) {
|
}
|
||||||
|
else if(type.toAscii() == Constants::WK_SBRICK)
|
||||||
|
{
|
||||||
column_name = "sbrick ID";
|
column_name = "sbrick ID";
|
||||||
} else if(type.toAscii() == Constants::WK_SPHRASE) {
|
}
|
||||||
|
else if(type.toAscii() == Constants::WK_SPHRASE)
|
||||||
|
{
|
||||||
column_name = "sphrase ID";
|
column_name = "sphrase ID";
|
||||||
} else if(type.toAscii() == Constants::WK_PLACE) {
|
}
|
||||||
|
else if(type.toAscii() == Constants::WK_PLACE)
|
||||||
|
{
|
||||||
column_name = "placeId";
|
column_name = "placeId";
|
||||||
}
|
}
|
||||||
bool status = true;
|
bool status = true;
|
||||||
|
@ -501,7 +518,6 @@ bool CEditorWorksheet::isSheetTable(QString type)
|
||||||
{
|
{
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,10 @@
|
||||||
#ifndef EDITOR_WORKSHEET_H
|
#ifndef EDITOR_WORKSHEET_H
|
||||||
#define EDITOR_WORKSHEET_H
|
#define EDITOR_WORKSHEET_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "translation_manager_editor.h"
|
||||||
|
#include "extract_new_sheet_names.h"
|
||||||
|
|
||||||
// Nel includes
|
// Nel includes
|
||||||
#include "nel/misc/types_nl.h"
|
#include "nel/misc/types_nl.h"
|
||||||
#include "nel/misc/sheet_id.h"
|
#include "nel/misc/sheet_id.h"
|
||||||
|
@ -34,11 +38,9 @@
|
||||||
#include <QtGui/QUndoCommand>
|
#include <QtGui/QUndoCommand>
|
||||||
#include <QtGui/QUndoStack>
|
#include <QtGui/QUndoStack>
|
||||||
|
|
||||||
// Project includes
|
|
||||||
#include "translation_manager_editor.h"
|
|
||||||
#include "extract_new_sheet_names.h"
|
|
||||||
|
|
||||||
namespace TranslationManager {
|
namespace TranslationManager
|
||||||
|
{
|
||||||
|
|
||||||
struct CTableWidgetItemStore
|
struct CTableWidgetItemStore
|
||||||
{
|
{
|
||||||
|
@ -47,6 +49,7 @@ public:
|
||||||
m_item(item),
|
m_item(item),
|
||||||
m_row(row),
|
m_row(row),
|
||||||
m_column(column) { }
|
m_column(column) { }
|
||||||
|
|
||||||
QTableWidgetItem *m_item;
|
QTableWidgetItem *m_item;
|
||||||
int m_row;
|
int m_row;
|
||||||
int m_column;
|
int m_column;
|
||||||
|
@ -55,37 +58,39 @@ public:
|
||||||
class CEditorWorksheet : public CEditor
|
class CEditorWorksheet : public CEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
|
||||||
QString temp_content;
|
|
||||||
public:
|
public:
|
||||||
CEditorWorksheet(QMdiArea* parent) : CEditor(parent) {}
|
CEditorWorksheet(QMdiArea *parent) : CEditor(parent) {}
|
||||||
CEditorWorksheet() : CEditor() {}
|
CEditorWorksheet() : CEditor() {}
|
||||||
QTableWidget* table_editor;
|
QTableWidget *table_editor;
|
||||||
void open(QString filename);
|
void open(QString filename);
|
||||||
void save();
|
void save();
|
||||||
void saveAs(QString filename);
|
void saveAs(QString filename);
|
||||||
void activateWindow();
|
void activateWindow();
|
||||||
void mergeWorksheetFile(QString filename);
|
void mergeWorksheetFile(QString filename);
|
||||||
bool compareWorksheetFile(QString filename);
|
bool compareWorksheetFile(QString filename);
|
||||||
void extractBotNames(list<string> filters, string level_design_path, NLLIGO::CLigoConfig ligoConfig);
|
void extractBotNames(std::list<std::string> filters, std::string level_design_path, NLLIGO::CLigoConfig ligoConfig);
|
||||||
void extractWords(QString filename, QString columnId, IWordListBuilder &wordListBuilder);
|
void extractWords(QString filename, QString columnId, IWordListBuilder &wordListBuilder);
|
||||||
void insertTableRecords(QList<QString> records, QList<CTableWidgetItemStore> new_items);
|
void insertTableRecords(QList<QString> records, QList<CTableWidgetItemStore> new_items);
|
||||||
bool isBotNamesTable();
|
bool isBotNamesTable();
|
||||||
bool isSheetTable(QString type);
|
bool isSheetTable(QString type);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void worksheetEditorCellEntered(QTableWidgetItem * item);
|
void worksheetEditorCellEntered(QTableWidgetItem *item);
|
||||||
void worksheetEditorChanged(QTableWidgetItem * item);
|
void worksheetEditorChanged(QTableWidgetItem *item);
|
||||||
void insertRow();
|
void insertRow();
|
||||||
void deleteRow();
|
void deleteRow();
|
||||||
void contextMenuEvent(QContextMenuEvent *e);
|
void contextMenuEvent(QContextMenuEvent *e);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString temp_content;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CUndoWorksheetCommand : public QUndoCommand
|
class CUndoWorksheetCommand : public QUndoCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CUndoWorksheetCommand(QTableWidget *table, QTableWidgetItem* item, const QString &ocontent, QUndoCommand *parent = 0) : QUndoCommand("Insert characters in cells", parent), m_table(table), m_item(item), m_ocontent(ocontent)
|
CUndoWorksheetCommand(QTableWidget *table, QTableWidgetItem *item, const QString &ocontent, QUndoCommand *parent = 0) : QUndoCommand("Insert characters in cells", parent), m_table(table), m_item(item), m_ocontent(ocontent)
|
||||||
{
|
{
|
||||||
m_ccontent = m_ocontent;
|
m_ccontent = m_ocontent;
|
||||||
}
|
}
|
||||||
|
@ -106,8 +111,8 @@ public:
|
||||||
m_item->setText(m_ocontent);
|
m_item->setText(m_ocontent);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
QTableWidget* m_table;
|
QTableWidget *m_table;
|
||||||
QTableWidgetItem* m_item;
|
QTableWidgetItem *m_item;
|
||||||
QString m_ocontent;
|
QString m_ocontent;
|
||||||
QString m_ccontent;
|
QString m_ccontent;
|
||||||
};
|
};
|
||||||
|
@ -123,7 +128,7 @@ public:
|
||||||
m_table->setRowCount(m_rowID + 1);
|
m_table->setRowCount(m_rowID + 1);
|
||||||
for(int j = 0; j < m_table->columnCount(); j++)
|
for(int j = 0; j < m_table->columnCount(); j++)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* item = new QTableWidgetItem();
|
QTableWidgetItem *item = new QTableWidgetItem();
|
||||||
m_table->setItem(m_rowID, j, item);
|
m_table->setItem(m_rowID, j, item);
|
||||||
m_table->scrollToBottom();
|
m_table->scrollToBottom();
|
||||||
}
|
}
|
||||||
|
@ -133,10 +138,10 @@ public:
|
||||||
{
|
{
|
||||||
m_table->removeRow(m_rowID);
|
m_table->removeRow(m_rowID);
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
QTableWidget* m_table;
|
|
||||||
int m_rowID;
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTableWidget *m_table;
|
||||||
|
int m_rowID;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CUndoWorksheetExtraction : public QUndoCommand
|
class CUndoWorksheetExtraction : public QUndoCommand
|
||||||
|
@ -153,7 +158,6 @@ public:
|
||||||
{
|
{
|
||||||
m_table->setItem(is.m_row, is.m_column, is.m_item);
|
m_table->setItem(is.m_row, is.m_column, is.m_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void undo()
|
void undo()
|
||||||
|
@ -163,12 +167,11 @@ public:
|
||||||
m_table->setItem(is.m_row, is.m_column, is.m_item);
|
m_table->setItem(is.m_row, is.m_column, is.m_item);
|
||||||
m_table->takeItem(is.m_row, is.m_column);
|
m_table->takeItem(is.m_row, is.m_column);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<CTableWidgetItemStore> m_items;
|
QList<CTableWidgetItemStore> m_items;
|
||||||
QTableWidget* m_table;
|
QTableWidget *m_table;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CUndoWorksheetDeleteCommand : public QUndoCommand
|
class CUndoWorksheetDeleteCommand : public QUndoCommand
|
||||||
|
@ -181,8 +184,8 @@ public:
|
||||||
{
|
{
|
||||||
for(int i = 0; i < m_table->columnCount(); i++)
|
for(int i = 0; i < m_table->columnCount(); i++)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* item = new QTableWidgetItem();
|
QTableWidgetItem *item = new QTableWidgetItem();
|
||||||
QTableWidgetItem* table_item = m_table->item(m_rowID, i);
|
QTableWidgetItem *table_item = m_table->item(m_rowID, i);
|
||||||
item->setText(table_item->text());
|
item->setText(table_item->text());
|
||||||
m_deletedItems.push_back(item);
|
m_deletedItems.push_back(item);
|
||||||
}
|
}
|
||||||
|
@ -203,8 +206,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QTableWidgetItem*> m_deletedItems;
|
QList<QTableWidgetItem *> m_deletedItems;
|
||||||
QTableWidget* m_table;
|
QTableWidget *m_table;
|
||||||
int m_rowID;
|
int m_rowID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -17,18 +17,14 @@
|
||||||
|
|
||||||
#include "extract_bot_names.h"
|
#include "extract_bot_names.h"
|
||||||
|
|
||||||
|
|
||||||
static bool RemoveOlds = false;
|
static bool RemoveOlds = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
TCreatureInfo *ExtractBotNames::getCreature(const std::string &sheetName)
|
TCreatureInfo *ExtractBotNames::getCreature(const std::string &sheetName)
|
||||||
{
|
{
|
||||||
CSheetId id(sheetName+".creature");
|
NLMISC::CSheetId id(sheetName+".creature");
|
||||||
|
|
||||||
if (Creatures.find(id) != Creatures.end())
|
if (Creatures.find(id) != Creatures.end())
|
||||||
return &(Creatures.find(id)->second);
|
return &(Creatures.find(id)->second);
|
||||||
|
@ -36,18 +32,17 @@ TCreatureInfo *ExtractBotNames::getCreature(const std::string &sheetName)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ExtractBotNames::cleanupName(const std::string &name)
|
std::string ExtractBotNames::cleanupName(const std::string &name)
|
||||||
{
|
{
|
||||||
string ret;
|
std::string ret;
|
||||||
|
|
||||||
for (uint i=0; i<name.size(); ++i)
|
for (size_t i = 0; i < name.size(); ++i)
|
||||||
{
|
{
|
||||||
if (name[i] != ' ')
|
if (name[i] != ' ')
|
||||||
ret += name[i];
|
ret += name[i];
|
||||||
else
|
else
|
||||||
ret += '_';
|
ret += '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,14 +50,13 @@ ucstring ExtractBotNames::cleanupUcName(const ucstring &name)
|
||||||
{
|
{
|
||||||
ucstring ret;
|
ucstring ret;
|
||||||
|
|
||||||
for (uint i=0; i<name.size(); ++i)
|
for (size_t i = 0; i < name.size(); ++i)
|
||||||
{
|
{
|
||||||
if (name[i] != ' ')
|
if (name[i] != ' ')
|
||||||
ret += name[i];
|
ret += name[i];
|
||||||
else
|
else
|
||||||
ret += '_';
|
ret += '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,34 +64,30 @@ ucstring ExtractBotNames::cleanupUcName(const ucstring &name)
|
||||||
/*
|
/*
|
||||||
Removes first and last '$'
|
Removes first and last '$'
|
||||||
*/
|
*/
|
||||||
ucstring ExtractBotNames::makeGroupName(const ucstring & translationName)
|
ucstring ExtractBotNames::makeGroupName(const ucstring &translationName)
|
||||||
{
|
{
|
||||||
ucstring ret = translationName;
|
ucstring ret = translationName;
|
||||||
if (ret.size() >= 2)
|
if (ret.size() >= 2)
|
||||||
{
|
{
|
||||||
if ( *ret.begin() == ucchar('$'))
|
if (*ret.begin() == ucchar('$'))
|
||||||
{
|
{
|
||||||
ret=ret.substr(1);
|
ret=ret.substr(1);
|
||||||
}
|
}
|
||||||
if ( *ret.rbegin() == ucchar('$'))
|
if (*ret.rbegin() == ucchar('$'))
|
||||||
{
|
{
|
||||||
ret = ret.substr(0, ret.size()-1);
|
ret = ret.substr(0, ret.size() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = cleanupUcName(ret);
|
ret = cleanupUcName(ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::set<std::string> ExtractBotNames::getGenericNames()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set<string> ExtractBotNames::getGenericNames()
|
|
||||||
{
|
{
|
||||||
return GenericNames;
|
return GenericNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
map<string, TEntryInfo> ExtractBotNames::getSimpleNames()
|
std::map<std::string, TEntryInfo> ExtractBotNames::getSimpleNames()
|
||||||
{
|
{
|
||||||
return SimpleNames;
|
return SimpleNames;
|
||||||
}
|
}
|
||||||
|
@ -112,34 +102,34 @@ void ExtractBotNames::cleanGenericNames()
|
||||||
GenericNames.clear();
|
GenericNames.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
string ExtractBotNames::removeAndStoreFunction(const std::string &fullName)
|
std::string ExtractBotNames::removeAndStoreFunction(const std::string &fullName)
|
||||||
{
|
{
|
||||||
string::size_type pos = fullName.find("$");
|
std::string::size_type pos = fullName.find("$");
|
||||||
if (pos == string::npos)
|
if (pos == std::string::npos)
|
||||||
|
{
|
||||||
return fullName;
|
return fullName;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// extract and store the function name
|
// extract and store the function name
|
||||||
string ret;
|
std::string ret;
|
||||||
|
|
||||||
ret = fullName.substr(0, pos);
|
ret = fullName.substr(0, pos);
|
||||||
string::size_type pos2 = fullName.find("$", pos+1);
|
std::string::size_type pos2 = fullName.find("$", pos+1);
|
||||||
|
|
||||||
string fct = fullName.substr(pos+1, pos2-(pos+1));
|
std::string fct = fullName.substr(pos + 1, pos2 - (pos + 1));
|
||||||
|
|
||||||
ret += fullName.substr(pos2+1);
|
ret += fullName.substr(pos2 + 1);
|
||||||
|
|
||||||
if (Functions.find(fct) == Functions.end())
|
if (Functions.find(fct) == Functions.end())
|
||||||
{
|
{
|
||||||
nldebug("Adding function '%s'", fct.c_str());
|
nldebug("Adding function '%s'", fct.c_str());
|
||||||
Functions.insert(fct);
|
Functions.insert(fct);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExtractBotNames::addGenericName(const std::string &name, const std::string &sheetName)
|
void ExtractBotNames::addGenericName(const std::string &name, const std::string &sheetName)
|
||||||
{
|
{
|
||||||
TCreatureInfo *c = getCreature(sheetName);
|
TCreatureInfo *c = getCreature(sheetName);
|
||||||
|
@ -185,75 +175,72 @@ void ExtractBotNames::addSimpleName(const std::string &name, const std::string &
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractBotNames::setRequiredSettings(list<string> filters, string level_design_path)
|
void ExtractBotNames::setRequiredSettings(std::list<std::string> filters, std::string level_design_path)
|
||||||
{
|
{
|
||||||
for (std::list<string>::iterator it = filters.begin(); it != filters.end(); ++it)
|
for (std::list<std::string>::iterator it = filters.begin(); it != filters.end(); ++it)
|
||||||
{
|
{
|
||||||
Filters.push_back(*it);
|
Filters.push_back(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// init the sheets
|
// init the sheets
|
||||||
CSheetId::init(false);
|
NLMISC::CSheetId::init(false);
|
||||||
const string PACKED_SHEETS_NAME = "bin/translation_tools_creature.packed_sheets";
|
const std::string PACKED_SHEETS_NAME = "bin/translation_tools_creature.packed_sheets";
|
||||||
loadForm("creature", PACKED_SHEETS_NAME, Creatures, false, false);
|
loadForm("creature", PACKED_SHEETS_NAME, Creatures, false, false);
|
||||||
|
|
||||||
if (Creatures.empty())
|
if (Creatures.empty())
|
||||||
{
|
{
|
||||||
loadForm("creature", PACKED_SHEETS_NAME, Creatures, true);
|
loadForm("creature", PACKED_SHEETS_NAME, Creatures, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtractBotNames::extractBotNamesFromPrimitives(CLigoConfig ligoConfig)
|
void ExtractBotNames::extractBotNamesFromPrimitives(NLLIGO::CLigoConfig ligoConfig)
|
||||||
{
|
{
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// ok, ready for the real work,
|
// ok, ready for the real work,
|
||||||
// first, read the primitives files and parse the primitives
|
// first, read the primitives files and parse the primitives
|
||||||
vector<string> files;
|
std::vector<std::string> files;
|
||||||
CPath::getFileList("primitive", files);
|
NLMISC::CPath::getFileList("primitive", files);
|
||||||
|
|
||||||
|
|
||||||
for (uint i=0; i<files.size(); ++i)
|
for (uint i=0; i<files.size(); ++i)
|
||||||
{
|
{
|
||||||
string pathName = files[i];
|
std::string pathName = files[i];
|
||||||
pathName = CPath::lookup(pathName);
|
pathName = NLMISC::CPath::lookup(pathName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// dnk-88: what is it?
|
||||||
// check filters
|
// check filters
|
||||||
uint j=0;
|
uint j = 0;
|
||||||
for (j=0; j<Filters.size(); ++j)
|
for (size_t j = 0; j < Filters.size(); ++j)
|
||||||
{
|
{
|
||||||
if (pathName.find(Filters[j]) != string::npos)
|
if (pathName.find(Filters[j]) != std::string::npos)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (j != Filters.size())
|
if (j != Filters.size())
|
||||||
// skip this file
|
// skip this file
|
||||||
continue;
|
continue;
|
||||||
|
*/
|
||||||
|
nlinfo("Loading file '%s'...", NLMISC::CFile::getFilename(pathName).c_str());
|
||||||
|
|
||||||
nlinfo("Loading file '%s'...", CFile::getFilename(pathName).c_str());
|
NLLIGO::CPrimitives primDoc;
|
||||||
|
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
|
||||||
CPrimitives primDoc;
|
|
||||||
CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
|
|
||||||
loadXmlPrimitiveFile(primDoc, pathName, ligoConfig);
|
loadXmlPrimitiveFile(primDoc, pathName, ligoConfig);
|
||||||
|
|
||||||
// now parse the file
|
// now parse the file
|
||||||
|
|
||||||
// look for group template
|
// look for group template
|
||||||
{
|
{
|
||||||
TPrimitiveClassPredicate pred("group_template_npc");
|
NLLIGO::TPrimitiveClassPredicate pred("group_template_npc");
|
||||||
TPrimitiveSet result;
|
NLLIGO::TPrimitiveSet result;
|
||||||
|
|
||||||
CPrimitiveSet<TPrimitiveClassPredicate> ps;
|
NLLIGO::CPrimitiveSet<NLLIGO::TPrimitiveClassPredicate> ps;
|
||||||
ps.buildSet(primDoc.RootNode, pred, result);
|
ps.buildSet(primDoc.RootNode, pred, result);
|
||||||
|
|
||||||
for (uint i=0; i<result.size(); ++i)
|
for (uint i = 0; i < result.size(); ++i)
|
||||||
{
|
{
|
||||||
string name;
|
std::string name;
|
||||||
string countStr;
|
std::string countStr;
|
||||||
string sheetStr;
|
std::string sheetStr;
|
||||||
result[i]->getPropertyByName("name", name);
|
result[i]->getPropertyByName("name", name);
|
||||||
result[i]->getPropertyByName("count", countStr);
|
result[i]->getPropertyByName("count", countStr);
|
||||||
result[i]->getPropertyByName("bot_sheet_look", sheetStr);
|
result[i]->getPropertyByName("bot_sheet_look", sheetStr);
|
||||||
|
@ -276,16 +263,16 @@ void ExtractBotNames::extractBotNamesFromPrimitives(CLigoConfig ligoConfig)
|
||||||
}
|
}
|
||||||
// look for bot template
|
// look for bot template
|
||||||
{
|
{
|
||||||
TPrimitiveClassPredicate pred("bot_template_npc");
|
NLLIGO::TPrimitiveClassPredicate pred("bot_template_npc");
|
||||||
TPrimitiveSet result;
|
NLLIGO::TPrimitiveSet result;
|
||||||
|
|
||||||
CPrimitiveSet<TPrimitiveClassPredicate> ps;
|
NLLIGO::CPrimitiveSet<NLLIGO::TPrimitiveClassPredicate> ps;
|
||||||
ps.buildSet(primDoc.RootNode, pred, result);
|
ps.buildSet(primDoc.RootNode, pred, result);
|
||||||
|
|
||||||
for (uint i=0; i<result.size(); ++i)
|
for (size_t i = 0; i < result.size(); ++i)
|
||||||
{
|
{
|
||||||
string name;
|
std::string name;
|
||||||
string sheetStr;
|
std::string sheetStr;
|
||||||
result[i]->getPropertyByName("name", name);
|
result[i]->getPropertyByName("name", name);
|
||||||
result[i]->getPropertyByName("sheet_look", sheetStr);
|
result[i]->getPropertyByName("sheet_look", sheetStr);
|
||||||
|
|
||||||
|
@ -307,17 +294,17 @@ void ExtractBotNames::extractBotNamesFromPrimitives(CLigoConfig ligoConfig)
|
||||||
}
|
}
|
||||||
// look for npc_group
|
// look for npc_group
|
||||||
{
|
{
|
||||||
TPrimitiveClassPredicate pred("npc_group");
|
NLLIGO::TPrimitiveClassPredicate pred("npc_group");
|
||||||
TPrimitiveSet result;
|
NLLIGO::TPrimitiveSet result;
|
||||||
|
|
||||||
CPrimitiveSet<TPrimitiveClassPredicate> ps;
|
NLLIGO::CPrimitiveSet<NLLIGO::TPrimitiveClassPredicate> ps;
|
||||||
ps.buildSet(primDoc.RootNode, pred, result);
|
ps.buildSet(primDoc.RootNode, pred, result);
|
||||||
|
|
||||||
for (uint i=0; i<result.size(); ++i)
|
for (size_t i = 0; i < result.size(); ++i)
|
||||||
{
|
{
|
||||||
string name;
|
std::string name;
|
||||||
string countStr;
|
std::string countStr;
|
||||||
string sheetStr;
|
std::string sheetStr;
|
||||||
result[i]->getPropertyByName("name", name);
|
result[i]->getPropertyByName("name", name);
|
||||||
result[i]->getPropertyByName("count", countStr);
|
result[i]->getPropertyByName("count", countStr);
|
||||||
result[i]->getPropertyByName("bot_sheet_client", sheetStr);
|
result[i]->getPropertyByName("bot_sheet_client", sheetStr);
|
||||||
|
@ -344,16 +331,16 @@ void ExtractBotNames::extractBotNamesFromPrimitives(CLigoConfig ligoConfig)
|
||||||
}
|
}
|
||||||
// look for bot
|
// look for bot
|
||||||
{
|
{
|
||||||
TPrimitiveClassPredicate pred("npc_bot");
|
NLLIGO::TPrimitiveClassPredicate pred("npc_bot");
|
||||||
TPrimitiveSet result;
|
NLLIGO::TPrimitiveSet result;
|
||||||
|
|
||||||
CPrimitiveSet<TPrimitiveClassPredicate> ps;
|
NLLIGO::CPrimitiveSet<NLLIGO::TPrimitiveClassPredicate> ps;
|
||||||
ps.buildSet(primDoc.RootNode, pred, result);
|
ps.buildSet(primDoc.RootNode, pred, result);
|
||||||
|
|
||||||
for (uint i=0; i<result.size(); ++i)
|
for (size_t i = 0; i < result.size(); ++i)
|
||||||
{
|
{
|
||||||
string name;
|
std::string name;
|
||||||
string sheetStr;
|
std::string sheetStr;
|
||||||
result[i]->getPropertyByName("name", name);
|
result[i]->getPropertyByName("name", name);
|
||||||
result[i]->getPropertyByName("sheet_client", sheetStr);
|
result[i]->getPropertyByName("sheet_client", sheetStr);
|
||||||
|
|
||||||
|
|
|
@ -30,22 +30,16 @@
|
||||||
#include "nel/ligo/primitive.h"
|
#include "nel/ligo/primitive.h"
|
||||||
#include "nel/ligo/primitive_utils.h"
|
#include "nel/ligo/primitive_utils.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace NLMISC;
|
|
||||||
using namespace NLLIGO;
|
|
||||||
using namespace STRING_MANAGER;
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
struct TCreatureInfo
|
struct TCreatureInfo
|
||||||
{
|
{
|
||||||
CSheetId SheetId;
|
NLMISC::CSheetId SheetId;
|
||||||
bool ForceSheetName;
|
bool ForceSheetName;
|
||||||
bool DisplayName;
|
bool DisplayName;
|
||||||
|
|
||||||
|
void readGeorges(const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId)
|
||||||
void readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId)
|
|
||||||
{
|
{
|
||||||
const NLGEORGES::UFormElm &item=form->getRootNode();
|
const NLGEORGES::UFormElm &item=form->getRootNode();
|
||||||
|
|
||||||
|
@ -61,7 +55,6 @@ struct TCreatureInfo
|
||||||
f.serial(DisplayName);
|
f.serial(DisplayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static uint getVersion ()
|
static uint getVersion ()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -70,42 +63,37 @@ struct TCreatureInfo
|
||||||
void removed()
|
void removed()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TEntryInfo
|
struct TEntryInfo
|
||||||
{
|
{
|
||||||
string SheetName;
|
std::string SheetName;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ExtractBotNames
|
struct ExtractBotNames
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
vector<string> Filters;
|
std::vector<std::string> Filters;
|
||||||
std::map<CSheetId, TCreatureInfo> Creatures;
|
std::map<NLMISC::CSheetId, TCreatureInfo> Creatures;
|
||||||
set<string> GenericNames;
|
std::set<std::string> GenericNames;
|
||||||
map<string, TEntryInfo> SimpleNames;
|
std::map<std::string, TEntryInfo> SimpleNames;
|
||||||
set<string> Functions;
|
std::set<std::string> Functions;
|
||||||
private:
|
private:
|
||||||
TCreatureInfo *getCreature(const std::string &sheetName);
|
TCreatureInfo *getCreature(const std::string &sheetName);
|
||||||
ucstring makeGroupName(const ucstring & translationName);
|
ucstring makeGroupName(const ucstring &translationName);
|
||||||
string removeAndStoreFunction(const std::string &fullName);
|
std::string removeAndStoreFunction(const std::string &fullName);
|
||||||
void addGenericName(const std::string &name, const std::string &sheetName);
|
void addGenericName(const std::string &name, const std::string &sheetName);
|
||||||
void addSimpleName(const std::string &name, const std::string &sheetName);
|
void addSimpleName(const std::string &name, const std::string &sheetName);
|
||||||
public:
|
public:
|
||||||
void extractBotNamesFromPrimitives(CLigoConfig ligoConfig);
|
void extractBotNamesFromPrimitives(NLLIGO::CLigoConfig ligoConfig);
|
||||||
void setRequiredSettings(list<string> filters, string level_design_path);
|
void setRequiredSettings(std::list<std::string> filters, std::string level_design_path);
|
||||||
set<string> getGenericNames();
|
std::set<std::string> getGenericNames();
|
||||||
map<string, TEntryInfo> getSimpleNames();
|
std::map<std::string, TEntryInfo> getSimpleNames();
|
||||||
string cleanupName(const std::string &name);
|
std::string cleanupName(const std::string &name);
|
||||||
ucstring cleanupUcName(const ucstring &name);
|
ucstring cleanupUcName(const ucstring &name);
|
||||||
void cleanSimpleNames();
|
void cleanSimpleNames();
|
||||||
void cleanGenericNames();
|
void cleanGenericNames();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* EXTRACT_BOT_NAMES_H */
|
#endif /* EXTRACT_BOT_NAMES_H */
|
||||||
|
|
||||||
|
|
|
@ -16,128 +16,125 @@
|
||||||
|
|
||||||
#include "extract_new_sheet_names.h"
|
#include "extract_new_sheet_names.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace NLMISC;
|
|
||||||
using namespace NLLIGO;
|
|
||||||
using namespace STRING_MANAGER;
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/*
|
/*
|
||||||
* Specialisation of IWordListBuilder to list sheets in a directory
|
* Specialisation of IWordListBuilder to list sheets in a directory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
bool CSheetWordListBuilder::buildWordList(std::vector<std::string> &allWords, std::string workSheetFileName)
|
||||||
bool CSheetWordListBuilder::buildWordList(std::vector<string> &allWords, string workSheetFileName)
|
{
|
||||||
{
|
SheetExt = NLMISC::toLower(SheetExt);
|
||||||
SheetExt= toLower(SheetExt);
|
|
||||||
// verify the directory is correct
|
// verify the directory is correct
|
||||||
if(!CFile::isDirectory(SheetPath))
|
if(!NLMISC::CFile::isDirectory(SheetPath))
|
||||||
{
|
{
|
||||||
nlwarning("Error: Directory '%s' not found. '%s' Aborted", SheetPath.c_str(), workSheetFileName.c_str());
|
nlwarning("Error: Directory '%s' not found. '%s' Aborted", SheetPath.c_str(), workSheetFileName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// list all files.
|
// list all files.
|
||||||
std::vector<string> allFiles;
|
std::vector<std::string> allFiles;
|
||||||
allFiles.reserve(100000);
|
allFiles.reserve(100000);
|
||||||
CPath::getPathContent(SheetPath, true, false, true, allFiles, NULL);
|
NLMISC::CPath::getPathContent(SheetPath, true, false, true, allFiles, NULL);
|
||||||
|
|
||||||
// Keep only the extension we want, and remove "_" (parent)
|
// Keep only the extension we want, and remove "_" (parent)
|
||||||
allWords.clear();
|
allWords.clear();
|
||||||
allWords.reserve(allFiles.size());
|
allWords.reserve(allFiles.size());
|
||||||
for(uint i=0;i<allFiles.size();i++)
|
for(size_t i = 0; i < allFiles.size(); i++)
|
||||||
{
|
{
|
||||||
string fileNameWithoutExt= CFile::getFilenameWithoutExtension(allFiles[i]);
|
std::string fileNameWithoutExt = NLMISC::CFile::getFilenameWithoutExtension(allFiles[i]);
|
||||||
string extension= toLower(CFile::getExtension(allFiles[i]));
|
std::string extension = NLMISC::toLower(NLMISC::CFile::getExtension(allFiles[i]));
|
||||||
|
|
||||||
// bad extension?
|
// bad extension?
|
||||||
if(extension!=SheetExt)
|
if(extension!=SheetExt)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// parent?
|
// parent?
|
||||||
if(fileNameWithoutExt.empty()||fileNameWithoutExt[0]=='_')
|
if(fileNameWithoutExt.empty() || fileNameWithoutExt[0] == '_')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ok, add
|
// ok, add
|
||||||
allWords.push_back(toLower(fileNameWithoutExt));
|
allWords.push_back(NLMISC::toLower(fileNameWithoutExt));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/*
|
/*
|
||||||
* Specialisation of IWordListBuilder to list new region/place name from .primitive
|
* Specialisation of IWordListBuilder to list new region/place name from .primitive
|
||||||
*/
|
*/
|
||||||
bool CRegionPrimWordListBuilder::buildWordList(std::vector<string> &allWords, string workSheetFileName)
|
bool CRegionPrimWordListBuilder::buildWordList(std::vector<std::string> &allWords, std::string workSheetFileName)
|
||||||
{
|
{
|
||||||
// verify the directory is correct
|
// verify the directory is correct
|
||||||
if(!CFile::isDirectory(PrimPath))
|
if(!NLMISC::CFile::isDirectory(PrimPath))
|
||||||
{
|
{
|
||||||
nlwarning("Error: Directory '%s' not found. '%s' Aborted", PrimPath.c_str(), workSheetFileName.c_str());
|
nlwarning("Error: Directory '%s' not found. '%s' Aborted", PrimPath.c_str(), workSheetFileName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// list all files.
|
// list all files.
|
||||||
std::vector<string> allFiles;
|
std::vector<std::string> allFiles;
|
||||||
allFiles.reserve(100000);
|
allFiles.reserve(100000);
|
||||||
CPath::getPathContent(PrimPath, true, false, true, allFiles, NULL);
|
NLMISC::CPath::getPathContent(PrimPath, true, false, true, allFiles, NULL);
|
||||||
|
|
||||||
// parse all primitive that match the filter
|
// parse all primitive that match the filter
|
||||||
allWords.clear();
|
allWords.clear();
|
||||||
allWords.reserve(100000);
|
allWords.reserve(100000);
|
||||||
// to avoid duplicate
|
// to avoid duplicate
|
||||||
set<string> allWordSet;
|
std::set<std::string> allWordSet;
|
||||||
for(uint i=0;i<allFiles.size();i++)
|
for(size_t i = 0; i < allFiles.size(); i++)
|
||||||
{
|
{
|
||||||
string fileName= CFile::getFilename(allFiles[i]);
|
std::string fileName = NLMISC::CFile::getFilename(allFiles[i]);
|
||||||
// filter don't match?
|
// filter don't match?
|
||||||
bool oneMatch= false;
|
bool oneMatch= false;
|
||||||
for(uint filter=0;filter<PrimFilter.size();filter++)
|
for(size_t filter = 0; filter < PrimFilter.size(); filter++)
|
||||||
{
|
{
|
||||||
if(testWildCard(fileName, PrimFilter[filter]))
|
if(NLMISC::testWildCard(fileName, PrimFilter[filter]))
|
||||||
oneMatch= true;
|
oneMatch= true;
|
||||||
}
|
}
|
||||||
if(!oneMatch)
|
if(!oneMatch)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ok, read the file
|
// ok, read the file
|
||||||
CPrimitives PrimDoc;
|
NLLIGO::CPrimitives PrimDoc;
|
||||||
CPrimitiveContext::instance().CurrentPrimitive = &PrimDoc;
|
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &PrimDoc;
|
||||||
if (!loadXmlPrimitiveFile(PrimDoc, allFiles[i], LigoConfig))
|
if (!NLLIGO::loadXmlPrimitiveFile(PrimDoc, allFiles[i], LigoConfig))
|
||||||
{
|
{
|
||||||
nlwarning("Error: cannot open file '%s'. '%s' Aborted", allFiles[i].c_str(), workSheetFileName.c_str());
|
nlwarning("Error: cannot open file '%s'. '%s' Aborted", allFiles[i].c_str(), workSheetFileName.c_str());
|
||||||
CPrimitiveContext::instance().CurrentPrimitive = NULL;
|
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CPrimitiveContext::instance().CurrentPrimitive = NULL;
|
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = NULL;
|
||||||
|
|
||||||
// For all primitives of interest
|
// For all primitives of interest
|
||||||
const char *listClass[]= {"continent", "region", "place", "stable",
|
const char *listClass[] = {"continent", "region", "place", "stable",
|
||||||
"teleport_destination", "room_template"};
|
"teleport_destination", "room_template"
|
||||||
const char *listProp[]= {"name", "name", "name", "name",
|
};
|
||||||
"place_name", "place_name"};
|
|
||||||
|
const char *listProp[] = {"name", "name", "name", "name",
|
||||||
|
"place_name", "place_name"
|
||||||
|
};
|
||||||
|
|
||||||
const uint numListClass= sizeof(listClass)/sizeof(listClass[0]);
|
const uint numListClass= sizeof(listClass)/sizeof(listClass[0]);
|
||||||
const uint numListProp= sizeof(listProp)/sizeof(listProp[0]);
|
const uint numListProp= sizeof(listProp)/sizeof(listProp[0]);
|
||||||
nlctassert(numListProp==numListClass);
|
nlctassert(numListProp == numListClass);
|
||||||
for(uint cid=0;cid<numListClass;cid++)
|
for(uint cid = 0; cid < numListClass; cid++)
|
||||||
{
|
{
|
||||||
// parse the whole hierarchy
|
// parse the whole hierarchy
|
||||||
TPrimitiveClassPredicate predCont(listClass[cid]);
|
NLLIGO::TPrimitiveClassPredicate predCont(listClass[cid]);
|
||||||
CPrimitiveSet<TPrimitiveClassPredicate> setPlace;
|
NLLIGO::CPrimitiveSet<NLLIGO::TPrimitiveClassPredicate> setPlace;
|
||||||
TPrimitiveSet placeRes;
|
NLLIGO::TPrimitiveSet placeRes;
|
||||||
setPlace.buildSet(PrimDoc.RootNode, predCont, placeRes);
|
setPlace.buildSet(PrimDoc.RootNode, predCont, placeRes);
|
||||||
|
|
||||||
// for all found
|
// for all found
|
||||||
for (uint placeId= 0; placeId < placeRes.size(); ++placeId)
|
for (size_t placeId = 0; placeId < placeRes.size(); ++placeId)
|
||||||
{
|
{
|
||||||
string primName;
|
std::string primName;
|
||||||
if(placeRes[placeId]->getPropertyByName(listProp[cid], primName) && !primName.empty())
|
if(placeRes[placeId]->getPropertyByName(listProp[cid], primName) && !primName.empty())
|
||||||
{
|
{
|
||||||
primName= toLower(primName);
|
primName = NLMISC::toLower(primName);
|
||||||
// avoid duplicate
|
// avoid duplicate
|
||||||
if(allWordSet.insert(primName).second)
|
if(allWordSet.insert(primName).second)
|
||||||
{
|
{
|
||||||
|
@ -147,8 +144,7 @@ bool CRegionPrimWordListBuilder::buildWordList(std::vector<string> &allWords, st
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,43 +30,34 @@
|
||||||
#include "nel/ligo/primitive.h"
|
#include "nel/ligo/primitive.h"
|
||||||
#include "nel/ligo/primitive_utils.h"
|
#include "nel/ligo/primitive_utils.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace NLMISC;
|
|
||||||
using namespace NLLIGO;
|
|
||||||
using namespace STRING_MANAGER;
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
/*
|
/*
|
||||||
* Interface to build the whole list of words (key id) for a specific worksheet
|
* Interface to build the whole list of words (key id) for a specific worksheet
|
||||||
*/
|
*/
|
||||||
struct IWordListBuilder
|
struct IWordListBuilder
|
||||||
{
|
{
|
||||||
virtual bool buildWordList(std::vector<string> &allWords, string workSheetFileName) =0;
|
virtual bool buildWordList(std::vector<std::string> &allWords, std::string workSheetFileName) =0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CSheetWordListBuilder : public IWordListBuilder
|
struct CSheetWordListBuilder : public IWordListBuilder
|
||||||
{
|
{
|
||||||
string SheetExt;
|
std::string SheetExt;
|
||||||
string SheetPath;
|
std::string SheetPath;
|
||||||
|
|
||||||
virtual bool buildWordList(std::vector<string> &allWords, string workSheetFileName);
|
virtual bool buildWordList(std::vector<std::string> &allWords, std::string workSheetFileName);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CRegionPrimWordListBuilder : public IWordListBuilder
|
struct CRegionPrimWordListBuilder : public IWordListBuilder
|
||||||
{
|
{
|
||||||
string PrimPath;
|
std::string PrimPath;
|
||||||
vector<string> PrimFilter;
|
std::vector<std::string> PrimFilter;
|
||||||
NLLIGO::CLigoConfig LigoConfig;
|
NLLIGO::CLigoConfig LigoConfig;
|
||||||
virtual bool buildWordList(std::vector<string> &allWords, string workSheetFileName);
|
virtual bool buildWordList(std::vector<std::string> &allWords, std::string workSheetFileName);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* EXTRACT_NEW_SHEET_NAMES_H */
|
#endif /* EXTRACT_NEW_SHEET_NAMES_H */
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,28 @@
|
||||||
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "ftp_selection.h"
|
#include "ftp_selection.h"
|
||||||
|
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtGui/QMessageBox>
|
||||||
#include <QtNetwork/QFtp>
|
#include <QtNetwork/QFtp>
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
CFtpSelection::CFtpSelection(QWidget *parent): QDialog(parent)
|
CFtpSelection::CFtpSelection(QWidget *parent): QDialog(parent)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
connect(_ui.connectButton, SIGNAL(clicked()), this, SLOT(ConnectButtonClicked()));
|
connect(_ui.connectButton, SIGNAL(clicked()), this, SLOT(ConnectButtonClicked()));
|
||||||
connect(_ui.doneButton, SIGNAL(clicked()), this, SLOT(DoneButtonClicked()));
|
connect(_ui.doneButton, SIGNAL(clicked()), this, SLOT(DoneButtonClicked()));
|
||||||
|
@ -14,7 +30,7 @@ namespace TranslationManager
|
||||||
connect(_ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(_ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
// file list
|
// file list
|
||||||
connect(_ui.fileList, SIGNAL(itemActivated(QTreeWidgetItem*,int)),this, SLOT(processItem(QTreeWidgetItem*,int)));
|
connect(_ui.fileList, SIGNAL(itemActivated(QTreeWidgetItem *,int)),this, SLOT(processItem(QTreeWidgetItem *,int)));
|
||||||
_ui.fileList->setEnabled(false);
|
_ui.fileList->setEnabled(false);
|
||||||
_ui.fileList->setRootIsDecorated(false);
|
_ui.fileList->setRootIsDecorated(false);
|
||||||
_ui.fileList->setHeaderLabels(QStringList() << tr("Name") << tr("Size") << tr("Owner") << tr("Group") << tr("Time"));
|
_ui.fileList->setHeaderLabels(QStringList() << tr("Name") << tr("Size") << tr("Owner") << tr("Group") << tr("Time"));
|
||||||
|
@ -25,22 +41,25 @@ namespace TranslationManager
|
||||||
_ui.doneButton->setEnabled(false);
|
_ui.doneButton->setEnabled(false);
|
||||||
|
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connection with the FTP Server. We retrieve the file list.
|
// Connection with the FTP Server. We retrieve the file list.
|
||||||
void CFtpSelection::ConnectButtonClicked()
|
void CFtpSelection::ConnectButtonClicked()
|
||||||
{
|
{
|
||||||
conn = new QFtp(this);
|
conn = new QFtp(this);
|
||||||
connect(conn, SIGNAL(commandFinished(int,bool)), this, SLOT(FtpCommandFinished(int,bool)));
|
connect(conn, SIGNAL(commandFinished(int,bool)), this, SLOT(FtpCommandFinished(int,bool)));
|
||||||
connect(conn, SIGNAL(listInfo(QUrlInfo)), this, SLOT(AddToList(QUrlInfo)));
|
connect(conn, SIGNAL(listInfo(QUrlInfo)), this, SLOT(AddToList(QUrlInfo)));
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
QUrl url(_ui.url->text());
|
QUrl url(_ui.url->text());
|
||||||
if (!url.isValid() || url.scheme().toLower() != QLatin1String("ftp")) {
|
if (!url.isValid() || url.scheme().toLower() != QLatin1String("ftp"))
|
||||||
|
{
|
||||||
conn->connectToHost(_ui.url->text(), 21);
|
conn->connectToHost(_ui.url->text(), 21);
|
||||||
conn->login();
|
conn->login();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
conn->connectToHost(url.host(), url.port(21));
|
conn->connectToHost(url.host(), url.port(21));
|
||||||
|
|
||||||
if (!url.userName().isEmpty())
|
if (!url.userName().isEmpty())
|
||||||
|
@ -50,14 +69,13 @@ namespace TranslationManager
|
||||||
if (!url.path().isEmpty())
|
if (!url.path().isEmpty())
|
||||||
conn->cd(url.path());
|
conn->cd(url.path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the user action.
|
// Get the user action.
|
||||||
void CFtpSelection::FtpCommandFinished(int, bool error)
|
void CFtpSelection::FtpCommandFinished(int, bool error)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
setCursor(Qt::ArrowCursor);
|
setCursor(Qt::ArrowCursor);
|
||||||
#endif
|
|
||||||
if (conn->currentCommand() == QFtp::ConnectToHost)
|
if (conn->currentCommand() == QFtp::ConnectToHost)
|
||||||
{
|
{
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -85,7 +103,9 @@ namespace TranslationManager
|
||||||
status = false;
|
status = false;
|
||||||
file->close();
|
file->close();
|
||||||
file->remove();
|
file->remove();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
file->close();
|
file->close();
|
||||||
status = true;
|
status = true;
|
||||||
}
|
}
|
||||||
|
@ -94,15 +114,16 @@ namespace TranslationManager
|
||||||
|
|
||||||
if (conn->currentCommand() == QFtp::List)
|
if (conn->currentCommand() == QFtp::List)
|
||||||
{
|
{
|
||||||
if (isDirectory.isEmpty()) {
|
if (isDirectory.isEmpty())
|
||||||
|
{
|
||||||
_ui.fileList->addTopLevelItem(new QTreeWidgetItem(QStringList() << tr("<empty>")));
|
_ui.fileList->addTopLevelItem(new QTreeWidgetItem(QStringList() << tr("<empty>")));
|
||||||
_ui.fileList->setEnabled(false);
|
_ui.fileList->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Make the file list with directories and files
|
// Make the file list with directories and files
|
||||||
void CFtpSelection::AddToList(const QUrlInfo &urlInfo)
|
void CFtpSelection::AddToList(const QUrlInfo &urlInfo)
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||||
item->setText(0, urlInfo.name());
|
item->setText(0, urlInfo.name());
|
||||||
item->setText(1, QString::number(urlInfo.size()));
|
item->setText(1, QString::number(urlInfo.size()));
|
||||||
|
@ -115,14 +136,15 @@ namespace TranslationManager
|
||||||
|
|
||||||
isDirectory[urlInfo.name()] = urlInfo.isDir();
|
isDirectory[urlInfo.name()] = urlInfo.isDir();
|
||||||
_ui.fileList->addTopLevelItem(item);
|
_ui.fileList->addTopLevelItem(item);
|
||||||
if (!_ui.fileList->currentItem()) {
|
if (!_ui.fileList->currentItem())
|
||||||
|
{
|
||||||
_ui.fileList->setCurrentItem(_ui.fileList->topLevelItem(0));
|
_ui.fileList->setCurrentItem(_ui.fileList->topLevelItem(0));
|
||||||
_ui.fileList->setEnabled(true);
|
_ui.fileList->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFtpSelection::processItem(QTreeWidgetItem* item, int)
|
void CFtpSelection::processItem(QTreeWidgetItem *item, int)
|
||||||
{
|
{
|
||||||
QString name = item->text(0);
|
QString name = item->text(0);
|
||||||
if (isDirectory.value(name))
|
if (isDirectory.value(name))
|
||||||
{
|
{
|
||||||
|
@ -132,38 +154,40 @@ namespace TranslationManager
|
||||||
currentPath += name;
|
currentPath += name;
|
||||||
conn->cd(name);
|
conn->cd(name);
|
||||||
conn->list();
|
conn->list();
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_ui.doneButton->setEnabled(true);
|
_ui.doneButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exit from a directory
|
// Exit from a directory
|
||||||
void CFtpSelection::cdToParent()
|
void CFtpSelection::cdToParent()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
_ui.fileList->clear();
|
_ui.fileList->clear();
|
||||||
isDirectory.clear();
|
isDirectory.clear();
|
||||||
currentPath = currentPath.left(currentPath.lastIndexOf('/'));
|
currentPath = currentPath.left(currentPath.lastIndexOf('/'));
|
||||||
if (currentPath.isEmpty()) {
|
if (currentPath.isEmpty())
|
||||||
|
{
|
||||||
_ui.cdToParrent->setEnabled(false);
|
_ui.cdToParrent->setEnabled(false);
|
||||||
conn->cd("/");
|
conn->cd("/");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
conn->cd(currentPath);
|
conn->cd(currentPath);
|
||||||
}
|
}
|
||||||
conn->list();
|
conn->list();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done action
|
// Done action
|
||||||
void CFtpSelection::DoneButtonClicked()
|
void CFtpSelection::DoneButtonClicked()
|
||||||
{
|
{
|
||||||
QString fileName = _ui.fileList->currentItem()->text(0);
|
QString fileName = _ui.fileList->currentItem()->text(0);
|
||||||
|
|
||||||
if (QFile::exists(fileName)) {
|
if (QFile::exists(fileName))
|
||||||
|
{
|
||||||
QMessageBox::information(this, tr("FTP"),
|
QMessageBox::information(this, tr("FTP"),
|
||||||
tr("There already exists a file called %1 in "
|
tr("There already exists a file called %1 in "
|
||||||
"the current directory.")
|
"the current directory.")
|
||||||
|
@ -172,10 +196,11 @@ namespace TranslationManager
|
||||||
}
|
}
|
||||||
|
|
||||||
file = new QFile(fileName);
|
file = new QFile(fileName);
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
if (!file->open(QIODevice::WriteOnly)) {
|
if (!file->open(QIODevice::WriteOnly))
|
||||||
|
{
|
||||||
QMessageBox::information(this, tr("FTP"),
|
QMessageBox::information(this, tr("FTP"),
|
||||||
tr("Unable to save the file %1: %2.")
|
tr("Unable to save the file %1: %2.")
|
||||||
.arg(fileName).arg(file->errorString()));
|
.arg(fileName).arg(file->errorString()));
|
||||||
|
@ -186,6 +211,6 @@ namespace TranslationManager
|
||||||
conn->get(_ui.fileList->currentItem()->text(0), file);
|
conn->get(_ui.fileList->currentItem()->text(0), file);
|
||||||
|
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#ifndef FTP_SELECTION_H
|
#ifndef FTP_SELECTION_H
|
||||||
#define FTP_SELECTION_H
|
#define FTP_SELECTION_H
|
||||||
|
|
||||||
|
#include "ui_ftp_selection.h"
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
|
@ -16,34 +18,33 @@
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtNetwork>
|
#include <QtNetwork>
|
||||||
|
|
||||||
#include "ui_ftp_selection.h"
|
namespace TranslationManager
|
||||||
|
{
|
||||||
|
|
||||||
using namespace std;
|
class CFtpSelection : public QDialog
|
||||||
|
{
|
||||||
namespace TranslationManager {
|
|
||||||
|
|
||||||
class CFtpSelection : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
|
||||||
Ui::FtpSelectionDialog _ui;
|
public:
|
||||||
QFtp *conn;
|
CFtpSelection(QWidget *parent = 0);
|
||||||
QHash<QString, bool> isDirectory;
|
~CFtpSelection() {}
|
||||||
QString currentPath;
|
bool status;
|
||||||
private Q_SLOTS:
|
QFile *file;
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
void cdToParent();
|
void cdToParent();
|
||||||
void processItem(QTreeWidgetItem*,int);
|
void processItem(QTreeWidgetItem *,int);
|
||||||
void ConnectButtonClicked();
|
void ConnectButtonClicked();
|
||||||
void DoneButtonClicked();
|
void DoneButtonClicked();
|
||||||
void FtpCommandFinished(int, bool error);
|
void FtpCommandFinished(int, bool error);
|
||||||
void AddToList(const QUrlInfo &urlInfo);
|
void AddToList(const QUrlInfo &urlInfo);
|
||||||
public:
|
|
||||||
bool status;
|
private:
|
||||||
QFile *file;
|
Ui::FtpSelectionDialog _ui;
|
||||||
CFtpSelection(QWidget* parent = 0);
|
QFtp *conn;
|
||||||
~CFtpSelection() {}
|
QHash<QString, bool> isDirectory;
|
||||||
};
|
QString currentPath;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FTP_SELECTION_H */
|
#endif /* FTP_SELECTION_H */
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,43 @@
|
||||||
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
#include <QtGui/qlistwidget.h>
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "source_selection.h"
|
#include "source_selection.h"
|
||||||
|
|
||||||
|
#include <QtGui/QListWidget>
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
CSourceDialog::CSourceDialog(QWidget *parent): QDialog(parent)
|
CSourceDialog::CSourceDialog(QWidget *parent): QDialog(parent)
|
||||||
{
|
{
|
||||||
_ui.setupUi(this);
|
_ui.setupUi(this);
|
||||||
// Set signal and slot for "OK Button"
|
|
||||||
connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked()));
|
connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked()));
|
||||||
// Set signal and slot for "Cancel Button"
|
|
||||||
connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
|
connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
|
||||||
_ui.sourceSelectionListWidget->setSortingEnabled(false);
|
_ui.sourceSelectionListWidget->setSortingEnabled(false);
|
||||||
connect(_ui.sourceSelectionListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
|
connect(_ui.sourceSelectionListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
|
||||||
this, SLOT(itemDoubleClicked(QListWidgetItem *)));
|
this, SLOT(itemDoubleClicked(QListWidgetItem *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert options in the source dialog. Options like: from FTP Server, from Local directory etc.
|
// Insert options in the source dialog. Options like: from FTP Server, from Local directory etc.
|
||||||
void CSourceDialog::setSourceOptions(map<QListWidgetItem*,int> options)
|
void CSourceDialog::setSourceOptions(std::map<QListWidgetItem *, int> &options)
|
||||||
{
|
{
|
||||||
map<QListWidgetItem*,int>::iterator it;
|
std::map<QListWidgetItem *,int>::iterator it;
|
||||||
|
|
||||||
for(it = options.begin(); it != options.end(); ++it)
|
for(it = options.begin(); it != options.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,16 +1,30 @@
|
||||||
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef SOURCE_SELECTION_H
|
#ifndef SOURCE_SELECTION_H
|
||||||
#define SOURCE_SELECTION_H
|
#define SOURCE_SELECTION_H
|
||||||
|
|
||||||
|
#include "ui_source_selection.h"
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtGui/QListWidgetItem>
|
#include <QtGui/QListWidgetItem>
|
||||||
#include "ui_source_selection.h"
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
using namespace std;
|
#include <map>
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
@ -18,16 +32,19 @@ namespace TranslationManager
|
||||||
class CSourceDialog : public QDialog
|
class CSourceDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
|
||||||
Ui::SourceSelectionDialog _ui;
|
public:
|
||||||
|
CSourceDialog(QWidget *parent = 0);
|
||||||
|
~CSourceDialog() {}
|
||||||
|
void setSourceOptions(std::map<QListWidgetItem *, int> &options);
|
||||||
|
QListWidgetItem *selected_item;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void OkButtonClicked();
|
void OkButtonClicked();
|
||||||
void itemDoubleClicked(QListWidgetItem *item);
|
void itemDoubleClicked(QListWidgetItem *item);
|
||||||
public:
|
|
||||||
CSourceDialog(QWidget *parent = 0);
|
private:
|
||||||
~CSourceDialog(){}
|
Ui::SourceSelectionDialog _ui;
|
||||||
void setSourceOptions(map<QListWidgetItem*, int> options);
|
|
||||||
QListWidgetItem *selected_item;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,38 @@
|
||||||
/*
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
* File: translation_manager_constants.h
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
* Author: cemycc
|
//
|
||||||
*
|
// This program is free software: you can redistribute it and/or modify
|
||||||
* Created on July 5, 2011, 9:15 PM
|
// it under the terms of the GNU Affero General Public License as
|
||||||
*/
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef TRANSLATION_MANAGER_CONSTANTS_H
|
#ifndef TRANSLATION_MANAGER_CONSTANTS_H
|
||||||
#define TRANSLATION_MANAGER_CONSTANTS_H
|
#define TRANSLATION_MANAGER_CONSTANTS_H
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
namespace Constants
|
namespace Constants
|
||||||
{
|
{
|
||||||
const int ED_SHEET = 1;
|
const int ED_SHEET = 1;
|
||||||
const int ED_PHRASE = 2;
|
const int ED_PHRASE = 2;
|
||||||
|
|
||||||
const char * const WK_BOTNAMES = "bot_names_wk.txt";
|
const char *const WK_BOTNAMES = "bot_names_wk.txt";
|
||||||
const char * const WK_ITEM = "item_words_wk.txt";
|
const char *const WK_ITEM = "item_words_wk.txt";
|
||||||
const char * const WK_CREATURE = "creature_words_wk.txt";
|
const char *const WK_CREATURE = "creature_words_wk.txt";
|
||||||
const char * const WK_SBRICK = "sbrick_words_wk.txt";
|
const char *const WK_SBRICK = "sbrick_words_wk.txt";
|
||||||
const char * const WK_SPHRASE = "sphrase_words_wk.txt";
|
const char *const WK_SPHRASE = "sphrase_words_wk.txt";
|
||||||
const char * const WK_PLACE = "place_words_wk.txt";
|
const char *const WK_PLACE = "place_words_wk.txt";
|
||||||
const char * const WK_CONTINENT = "place_words_wk.txt";
|
const char *const WK_CONTINENT = "place_words_wk.txt";
|
||||||
const char * const WK_STABLE = "place_words_wk.txt";
|
const char *const WK_STABLE = "place_words_wk.txt";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TRANSLATION_MANAGER_CONSTANTS_H */
|
#endif /* TRANSLATION_MANAGER_CONSTANTS_H */
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
// Copyright (C) 2010 Winch Gate Property Limited
|
|
||||||
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -25,22 +24,21 @@
|
||||||
#include <QtGui/QUndoStack>
|
#include <QtGui/QUndoStack>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
||||||
namespace TranslationManager {
|
namespace TranslationManager
|
||||||
|
{
|
||||||
|
|
||||||
|
class CEditor : public QMdiSubWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
class CEditor : public QMdiSubWindow {
|
|
||||||
Q_OBJECT
|
|
||||||
protected:
|
|
||||||
QUndoStack* current_stack;
|
|
||||||
QString current_file;
|
|
||||||
int editor_type;
|
|
||||||
public:
|
public:
|
||||||
CEditor(QMdiArea* parent) : QMdiSubWindow(parent) {}
|
CEditor(QMdiArea *parent) : QMdiSubWindow(parent) {}
|
||||||
CEditor() : QMdiSubWindow() {}
|
CEditor() : QMdiSubWindow() {}
|
||||||
virtual void open(QString filename) =0;
|
virtual void open(QString filename) =0;
|
||||||
virtual void save() =0;
|
virtual void save() =0;
|
||||||
virtual void saveAs(QString filename) =0;
|
virtual void saveAs(QString filename) =0;
|
||||||
virtual void activateWindow() =0;
|
virtual void activateWindow() =0;
|
||||||
public:
|
|
||||||
int eType()
|
int eType()
|
||||||
{
|
{
|
||||||
return editor_type;
|
return editor_type;
|
||||||
|
@ -49,7 +47,7 @@ public:
|
||||||
{
|
{
|
||||||
return current_file;
|
return current_file;
|
||||||
}
|
}
|
||||||
void setUndoStack(QUndoStack* stack)
|
void setUndoStack(QUndoStack *stack)
|
||||||
{
|
{
|
||||||
current_stack = stack;
|
current_stack = stack;
|
||||||
}
|
}
|
||||||
|
@ -62,10 +60,12 @@ public:
|
||||||
setWindowFilePath(current_file);
|
setWindowFilePath(current_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QUndoStack *current_stack;
|
||||||
|
QString current_file;
|
||||||
|
int editor_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* TRANSLATION_MANAGER_EDITOR_H */
|
#endif /* TRANSLATION_MANAGER_EDITOR_H */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
// Copyright (C) 2010 Winch Gate Property Limited
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
|
@ -16,32 +15,31 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Project system includes
|
// Plugin includes
|
||||||
|
#include "translation_manager_main_window.h"
|
||||||
|
#include "translation_manager_constants.h"
|
||||||
|
#include "ftp_selection.h"
|
||||||
|
|
||||||
|
// Core includes
|
||||||
#include "../core/icore.h"
|
#include "../core/icore.h"
|
||||||
#include "../core/core_constants.h"
|
#include "../core/core_constants.h"
|
||||||
#include "../core/menu_manager.h"
|
#include "../core/menu_manager.h"
|
||||||
#include "../../extension_system/iplugin_spec.h"
|
#include "../../extension_system/iplugin_spec.h"
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QtGui/QWidget>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtGui/QMessageBox>
|
#include <QtCore/QEvent>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtGui/QErrorMessage>
|
|
||||||
#include <QtCore/QSignalMapper>
|
#include <QtCore/QSignalMapper>
|
||||||
|
#include <QtCore/QResource>
|
||||||
|
#include <QtGui/QMessageBox>
|
||||||
|
#include <QtGui/QErrorMessage>
|
||||||
#include <QtGui/QTableWidget>
|
#include <QtGui/QTableWidget>
|
||||||
#include <QtGui/QTableWidgetItem>
|
#include <QtGui/QTableWidgetItem>
|
||||||
#include <QtGui/QMdiSubWindow>
|
#include <QtGui/QMdiSubWindow>
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
#include <QtCore/QResource>
|
|
||||||
#include <QtGui/QMenuBar>
|
#include <QtGui/QMenuBar>
|
||||||
#include <QtCore/QFileInfo>
|
|
||||||
#include <QtCore/QEvent>
|
|
||||||
#include <QtGui/QCloseEvent>
|
#include <QtGui/QCloseEvent>
|
||||||
// Plugin includes
|
|
||||||
#include "translation_manager_main_window.h"
|
|
||||||
#include "translation_manager_constants.h"
|
|
||||||
#include "ftp_selection.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
@ -53,7 +51,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||||
|
|
||||||
_ui.mdiArea->closeAllSubWindows();
|
_ui.mdiArea->closeAllSubWindows();
|
||||||
windowMapper = new QSignalMapper(this);
|
windowMapper = new QSignalMapper(this);
|
||||||
connect(windowMapper, SIGNAL(mapped(QWidget*)), this, SLOT(setActiveSubWindow(QWidget*)));
|
connect(windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(setActiveSubWindow(QWidget *)));
|
||||||
|
|
||||||
initialize_settings["georges"] = false;
|
initialize_settings["georges"] = false;
|
||||||
initialize_settings["ligo"] = false;
|
initialize_settings["ligo"] = false;
|
||||||
|
@ -83,45 +81,51 @@ void CMainWindow::createToolbar()
|
||||||
QMenu *wordsExtractionMenu = new QMenu("&Words extraction...");
|
QMenu *wordsExtractionMenu = new QMenu("&Words extraction...");
|
||||||
wordsExtractionMenu->setIcon(QIcon(Core::Constants::ICON_SETTINGS));
|
wordsExtractionMenu->setIcon(QIcon(Core::Constants::ICON_SETTINGS));
|
||||||
_ui.toolBar->addAction(wordsExtractionMenu->menuAction());
|
_ui.toolBar->addAction(wordsExtractionMenu->menuAction());
|
||||||
|
|
||||||
// extract bot names
|
// extract bot names
|
||||||
QAction *extractBotNamesAct = wordsExtractionMenu->addAction("&Extract bot names...");
|
QAction *extractBotNamesAct = wordsExtractionMenu->addAction("&Extract bot names...");
|
||||||
extractBotNamesAct->setStatusTip(tr("Extract bot names from primitives."));
|
extractBotNamesAct->setStatusTip(tr("Extract bot names from primitives."));
|
||||||
connect(extractBotNamesAct, SIGNAL(triggered()), this, SLOT(extractBotNames()));
|
connect(extractBotNamesAct, SIGNAL(triggered()), this, SLOT(extractBotNames()));
|
||||||
|
|
||||||
// Words extraction
|
// Words extraction
|
||||||
// -----------------------------
|
|
||||||
// signal mapper for extraction words
|
|
||||||
QSignalMapper *wordsExtractionMapper = new QSignalMapper(this);
|
QSignalMapper *wordsExtractionMapper = new QSignalMapper(this);
|
||||||
connect(wordsExtractionMapper, SIGNAL(mapped(QString)), this, SLOT(extractWords(QString)));
|
connect(wordsExtractionMapper, SIGNAL(mapped(QString)), this, SLOT(extractWords(QString)));
|
||||||
// extract item words
|
// extract item words
|
||||||
|
|
||||||
QAction *extractItemWordsAct = wordsExtractionMenu->addAction("&Extract item words...");
|
QAction *extractItemWordsAct = wordsExtractionMenu->addAction("&Extract item words...");
|
||||||
extractItemWordsAct->setStatusTip(tr("Extract item words"));
|
extractItemWordsAct->setStatusTip(tr("Extract item words"));
|
||||||
connect(extractItemWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
connect(extractItemWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
||||||
wordsExtractionMapper->setMapping(extractItemWordsAct, QString(Constants::WK_ITEM));
|
wordsExtractionMapper->setMapping(extractItemWordsAct, QString(Constants::WK_ITEM));
|
||||||
|
|
||||||
// extract creature words
|
// extract creature words
|
||||||
QAction *extractCreatureWordsAct = wordsExtractionMenu->addAction("&Extract creature words...");
|
QAction *extractCreatureWordsAct = wordsExtractionMenu->addAction(tr("&Extract creature words..."));
|
||||||
extractCreatureWordsAct->setStatusTip(tr("Extract creature words"));
|
extractCreatureWordsAct->setStatusTip(tr("Extract creature words"));
|
||||||
connect(extractCreatureWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
connect(extractCreatureWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
||||||
wordsExtractionMapper->setMapping(extractCreatureWordsAct, QString(Constants::WK_CREATURE));
|
wordsExtractionMapper->setMapping(extractCreatureWordsAct, QString(Constants::WK_CREATURE));
|
||||||
|
|
||||||
// extract sbrick words
|
// extract sbrick words
|
||||||
QAction *extractSbrickWordsAct = wordsExtractionMenu->addAction("&Extract sbrick words...");
|
QAction *extractSbrickWordsAct = wordsExtractionMenu->addAction("&Extract sbrick words...");
|
||||||
extractSbrickWordsAct->setStatusTip(tr("Extract sbrick words"));
|
extractSbrickWordsAct->setStatusTip(tr("Extract sbrick words"));
|
||||||
connect(extractSbrickWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
connect(extractSbrickWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
||||||
wordsExtractionMapper->setMapping(extractSbrickWordsAct, QString(Constants::WK_SBRICK));
|
wordsExtractionMapper->setMapping(extractSbrickWordsAct, QString(Constants::WK_SBRICK));
|
||||||
|
|
||||||
// extract sphrase words
|
// extract sphrase words
|
||||||
QAction *extractSphraseWordsAct = wordsExtractionMenu->addAction("&Extract sphrase words...");
|
QAction *extractSphraseWordsAct = wordsExtractionMenu->addAction("&Extract sphrase words...");
|
||||||
extractSphraseWordsAct->setStatusTip(tr("Extract sphrase words"));
|
extractSphraseWordsAct->setStatusTip(tr("Extract sphrase words"));
|
||||||
connect(extractSphraseWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
connect(extractSphraseWordsAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
||||||
wordsExtractionMapper->setMapping(extractSphraseWordsAct, QString(Constants::WK_SPHRASE));
|
wordsExtractionMapper->setMapping(extractSphraseWordsAct, QString(Constants::WK_SPHRASE));
|
||||||
|
|
||||||
// extract place and region names
|
// extract place and region names
|
||||||
QAction *extractPlaceNamesAct = wordsExtractionMenu->addAction("&Extract place names...");
|
QAction *extractPlaceNamesAct = wordsExtractionMenu->addAction("&Extract place names...");
|
||||||
extractPlaceNamesAct->setStatusTip(tr("Extract place names from primitives"));
|
extractPlaceNamesAct->setStatusTip(tr("Extract place names from primitives"));
|
||||||
connect(extractPlaceNamesAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
connect(extractPlaceNamesAct, SIGNAL(triggered()), wordsExtractionMapper, SLOT(map()));
|
||||||
wordsExtractionMapper->setMapping(extractPlaceNamesAct, QString(Constants::WK_PLACE));
|
wordsExtractionMapper->setMapping(extractPlaceNamesAct, QString(Constants::WK_PLACE));
|
||||||
|
|
||||||
// Merge options
|
// Merge options
|
||||||
// -----------------------------
|
|
||||||
QAction *mergeSingleFileAct = wordsExtractionMenu->addAction("&Merge worksheet file...");
|
QAction *mergeSingleFileAct = wordsExtractionMenu->addAction("&Merge worksheet file...");
|
||||||
mergeSingleFileAct->setStatusTip(tr("Merge worksheet file from local or remote directory"));
|
mergeSingleFileAct->setStatusTip(tr("Merge worksheet file from local or remote directory"));
|
||||||
connect(mergeSingleFileAct, SIGNAL(triggered()), this, SLOT(mergeSingleFile()));
|
connect(mergeSingleFileAct, SIGNAL(triggered()), this, SLOT(mergeSingleFile()));
|
||||||
|
|
||||||
// Windows menu
|
// Windows menu
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
Core::MenuManager *menuManager = core->menuManager();
|
Core::MenuManager *menuManager = core->menuManager();
|
||||||
|
@ -130,12 +134,11 @@ void CMainWindow::createToolbar()
|
||||||
connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowsList()));
|
connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(updateWindowsList()));
|
||||||
|
|
||||||
// Undo, Redo actions
|
// Undo, Redo actions
|
||||||
// -----------------------------
|
QAction *undoAction = menuManager->action(Core::Constants::UNDO);
|
||||||
QAction* undoAction = menuManager->action(Core::Constants::UNDO);
|
|
||||||
if (undoAction != 0)
|
if (undoAction != 0)
|
||||||
_ui.toolBar->addAction(undoAction);
|
_ui.toolBar->addAction(undoAction);
|
||||||
|
|
||||||
QAction* redoAction = menuManager->action(Core::Constants::REDO);
|
QAction *redoAction = menuManager->action(Core::Constants::REDO);
|
||||||
if (redoAction != 0)
|
if (redoAction != 0)
|
||||||
_ui.toolBar->addAction(redoAction);
|
_ui.toolBar->addAction(redoAction);
|
||||||
}
|
}
|
||||||
|
@ -152,19 +155,18 @@ void CMainWindow::updateToolbar(QMdiSubWindow *window)
|
||||||
QAction *deleteRowAct = new QAction(tr("Delete row"), this);
|
QAction *deleteRowAct = new QAction(tr("Delete row"), this);
|
||||||
connect(deleteRowAct, SIGNAL(triggered()), window, SLOT(deleteRow()));
|
connect(deleteRowAct, SIGNAL(triggered()), window, SLOT(deleteRow()));
|
||||||
windowMenu->addAction(deleteRowAct);
|
windowMenu->addAction(deleteRowAct);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the active subwindow
|
// Set the active subwindow
|
||||||
void CMainWindow::setActiveSubWindow(QWidget* window)
|
void CMainWindow::setActiveSubWindow(QWidget *window)
|
||||||
{
|
{
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
QMdiSubWindow *cwindow = qobject_cast<QMdiSubWindow *>(window);
|
QMdiSubWindow *mdiWindow = qobject_cast<QMdiSubWindow *>(window);
|
||||||
_ui.mdiArea->setActiveSubWindow(cwindow);
|
if (mdiWindow != 0)
|
||||||
|
_ui.mdiArea->setActiveSubWindow(mdiWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions for updating the windows list
|
// Functions for updating the windows list
|
||||||
|
@ -174,7 +176,7 @@ void CMainWindow::updateWindowsList()
|
||||||
{
|
{
|
||||||
windowMenu->clear();
|
windowMenu->clear();
|
||||||
QMdiSubWindow *current_window = _ui.mdiArea->activeSubWindow();
|
QMdiSubWindow *current_window = _ui.mdiArea->activeSubWindow();
|
||||||
QList<QMdiSubWindow*> subWindows = _ui.mdiArea->subWindowList();
|
QList<QMdiSubWindow *> subWindows = _ui.mdiArea->subWindowList();
|
||||||
|
|
||||||
updateToolbar(current_window);
|
updateToolbar(current_window);
|
||||||
|
|
||||||
|
@ -182,9 +184,12 @@ void CMainWindow::updateWindowsList()
|
||||||
{
|
{
|
||||||
QString window_file = QFileInfo(subWindows.at(i)->windowFilePath()).fileName();
|
QString window_file = QFileInfo(subWindows.at(i)->windowFilePath()).fileName();
|
||||||
QString action_text;
|
QString action_text;
|
||||||
if (i < 9) {
|
if (i < 9)
|
||||||
|
{
|
||||||
action_text = QString("&%1 %2").arg(i + 1).arg(window_file);
|
action_text = QString("&%1 %2").arg(i + 1).arg(window_file);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
action_text = QString("%1 %2").arg(i + 1).arg(window_file);
|
action_text = QString("%1 %2").arg(i + 1).arg(window_file);
|
||||||
}
|
}
|
||||||
QAction *action = new QAction(action_text, this);
|
QAction *action = new QAction(action_text, this);
|
||||||
|
@ -194,7 +199,9 @@ void CMainWindow::updateWindowsList()
|
||||||
windowMenu->addAction(action);
|
windowMenu->addAction(action);
|
||||||
windowMapper->setMapping(action, subWindows.at(i));
|
windowMapper->setMapping(action, subWindows.at(i));
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
windowMenu->clear();
|
windowMenu->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +213,7 @@ void CMainWindow::open()
|
||||||
settings->beginGroup("translationmanager");
|
settings->beginGroup("translationmanager");
|
||||||
QString lastOpenLocation = settings->value("lastOpenLocation").toString();
|
QString lastOpenLocation = settings->value("lastOpenLocation").toString();
|
||||||
QString file_name = QFileDialog::getOpenFileName(this, tr("Open translation file"), lastOpenLocation, tr("Translation files (*txt)"));
|
QString file_name = QFileDialog::getOpenFileName(this, tr("Open translation file"), lastOpenLocation, tr("Translation files (*txt)"));
|
||||||
QFileInfo* file_info = new QFileInfo(file_name);
|
QFileInfo *file_info = new QFileInfo(file_name);
|
||||||
settings->setValue("lastOpenLocation", file_info->absolutePath());
|
settings->setValue("lastOpenLocation", file_info->absolutePath());
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
|
||||||
|
@ -218,9 +225,8 @@ void CMainWindow::open()
|
||||||
editor->activateWindow();
|
editor->activateWindow();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
// sheet editor
|
// sheet editor
|
||||||
if(isWorksheetEditor(file_name))
|
if(isWorksheetEditor(file_name))
|
||||||
{
|
{
|
||||||
|
@ -237,17 +243,14 @@ void CMainWindow::open()
|
||||||
new_window->open(file_name);
|
new_window->open(file_name);
|
||||||
new_window->activateWindow();
|
new_window->activateWindow();
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open a work file. You can set the directory for work file in the settings dialog
|
// Open a work file. You can set the directory for work file in the settings dialog
|
||||||
void CMainWindow::openWorkFile(QString file)
|
void CMainWindow::openWorkFile(QString file)
|
||||||
{
|
{
|
||||||
QFileInfo* file_path = new QFileInfo(QString("%1/%2").arg(work_path).arg(file));
|
QFileInfo *file_path = new QFileInfo(QString("%1/%2").arg(work_path).arg(file));
|
||||||
if(file_path->exists())
|
if(file_path->exists())
|
||||||
{
|
{
|
||||||
if(isWorksheetEditor(file_path->filePath()))
|
if(isWorksheetEditor(file_path->filePath()))
|
||||||
|
@ -256,31 +259,26 @@ void CMainWindow::openWorkFile(QString file)
|
||||||
new_window->open(file_path->filePath());
|
new_window->open(file_path->filePath());
|
||||||
new_window->activateWindow();
|
new_window->activateWindow();
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(QString("The %1 file don't exists.").arg(file_path->fileName()));
|
error.showMessage(tr("The %1 file don't exists.").arg(file_path->fileName()));
|
||||||
error.exec();
|
error.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save signal
|
|
||||||
void CMainWindow::save()
|
void CMainWindow::save()
|
||||||
{
|
{
|
||||||
if(_ui.mdiArea->subWindowList().size() > 0)
|
if(_ui.mdiArea->subWindowList().size() > 0)
|
||||||
{
|
{
|
||||||
CEditor* current_window = qobject_cast<CEditor*>(_ui.mdiArea->currentSubWindow());
|
CEditor *current_window = qobject_cast<CEditor *>(_ui.mdiArea->currentSubWindow());
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
current_window->save();
|
current_window->save();
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save as signal
|
|
||||||
void CMainWindow::saveAs()
|
void CMainWindow::saveAs()
|
||||||
{
|
{
|
||||||
QString file_name;
|
QString file_name;
|
||||||
|
@ -288,17 +286,12 @@ void CMainWindow::saveAs()
|
||||||
{
|
{
|
||||||
file_name = QFileDialog::getSaveFileName(this);
|
file_name = QFileDialog::getSaveFileName(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_name.isEmpty())
|
if (!file_name.isEmpty())
|
||||||
{
|
{
|
||||||
CEditor* current_window = qobject_cast<CEditor*>(_ui.mdiArea->currentSubWindow());
|
CEditor *current_window = qobject_cast<CEditor *>(_ui.mdiArea->currentSubWindow());
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
current_window->saveAs(file_name);
|
current_window->saveAs(file_name);
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,8 +300,8 @@ void CMainWindow::initializeSettings(bool georges = false)
|
||||||
{
|
{
|
||||||
if(georges == true && initialize_settings["georges"] == false)
|
if(georges == true && initialize_settings["georges"] == false)
|
||||||
{
|
{
|
||||||
CPath::addSearchPath(level_design_path.toStdString() + "/DFN", true, false);
|
NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/DFN", true, false);
|
||||||
CPath::addSearchPath(level_design_path.toStdString() + "/Game_elem/Creature", true, false);
|
NLMISC::CPath::addSearchPath(level_design_path.toStdString() + "/Game_elem/Creature", true, false);
|
||||||
initialize_settings["georges"] = true;
|
initialize_settings["georges"] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +322,6 @@ void CMainWindow::initializeSettings(bool georges = false)
|
||||||
nlerror("Can't found path to world_editor_classes.xml");
|
nlerror("Can't found path to world_editor_classes.xml");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extracting words
|
// Extracting words
|
||||||
|
@ -337,19 +329,22 @@ void CMainWindow::extractWords(QString typeq)
|
||||||
{
|
{
|
||||||
if(verifySettings() == true)
|
if(verifySettings() == true)
|
||||||
{
|
{
|
||||||
CEditorWorksheet* editor_window = getEditorByWorksheetType(typeq);
|
CEditorWorksheet *editor_window = getEditorByWorksheetType(typeq);
|
||||||
if(editor_window != NULL)
|
if(editor_window != NULL)
|
||||||
{
|
{
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
QString file_path = editor_window->windowFilePath();
|
QString file_path = editor_window->windowFilePath();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
openWorkFile(typeq);
|
openWorkFile(typeq);
|
||||||
editor_window = getEditorByWorksheetType(typeq);
|
editor_window = getEditorByWorksheetType(typeq);
|
||||||
if(editor_window != NULL)
|
if(editor_window != NULL)
|
||||||
{
|
{
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
QString file_path = editor_window->windowFilePath();
|
QString file_path = editor_window->windowFilePath();
|
||||||
} else return;
|
}
|
||||||
|
else return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString column_name;
|
QString column_name;
|
||||||
|
@ -358,48 +353,54 @@ void CMainWindow::extractWords(QString typeq)
|
||||||
// Primitives extraction
|
// Primitives extraction
|
||||||
CRegionPrimWordListBuilder builderP;
|
CRegionPrimWordListBuilder builderP;
|
||||||
bool isSheet = false;
|
bool isSheet = false;
|
||||||
if(typeq.toAscii() == Constants::WK_ITEM) {
|
if(typeq.toAscii() == Constants::WK_ITEM)
|
||||||
|
{
|
||||||
column_name = "item ID";
|
column_name = "item ID";
|
||||||
builderS.SheetExt = "sitem";
|
builderS.SheetExt = "sitem";
|
||||||
builderS.SheetPath = level_design_path.append("/game_element/sitem").toStdString();
|
builderS.SheetPath = level_design_path.append("/game_element/sitem").toStdString();
|
||||||
isSheet = true;
|
isSheet = true;
|
||||||
} else if(typeq.toAscii() == Constants::WK_CREATURE) {
|
}
|
||||||
|
else if(typeq.toAscii() == Constants::WK_CREATURE)
|
||||||
|
{
|
||||||
column_name = "creature ID";
|
column_name = "creature ID";
|
||||||
builderS.SheetExt = "creature";
|
builderS.SheetExt = "creature";
|
||||||
builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toStdString();
|
builderS.SheetPath = level_design_path.append("/Game_elem/Creature/fauna").toStdString();
|
||||||
isSheet = true;
|
isSheet = true;
|
||||||
} else if(typeq.toAscii() == Constants::WK_SBRICK) {
|
}
|
||||||
|
else if(typeq.toAscii() == Constants::WK_SBRICK)
|
||||||
|
{
|
||||||
column_name = "sbrick ID";
|
column_name = "sbrick ID";
|
||||||
builderS.SheetExt = "sbrick";
|
builderS.SheetExt = "sbrick";
|
||||||
builderS.SheetPath = level_design_path.append("/game_element/sbrick").toStdString();
|
builderS.SheetPath = level_design_path.append("/game_element/sbrick").toStdString();
|
||||||
isSheet = true;
|
isSheet = true;
|
||||||
} else if(typeq.toAscii() == Constants::WK_SPHRASE) {
|
}
|
||||||
|
else if(typeq.toAscii() == Constants::WK_SPHRASE)
|
||||||
|
{
|
||||||
column_name = "sphrase ID";
|
column_name = "sphrase ID";
|
||||||
builderS.SheetExt = "sphrase";
|
builderS.SheetExt = "sphrase";
|
||||||
builderS.SheetPath = level_design_path.append("/game_element/sphrase").toStdString();
|
builderS.SheetPath = level_design_path.append("/game_element/sphrase").toStdString();
|
||||||
isSheet = true;
|
isSheet = true;
|
||||||
} else if(typeq.toAscii() == Constants::WK_PLACE) {
|
}
|
||||||
|
else if(typeq.toAscii() == Constants::WK_PLACE)
|
||||||
|
{
|
||||||
column_name = "placeId";
|
column_name = "placeId";
|
||||||
builderP.PrimPath = primitives_path.toStdString();
|
builderP.PrimPath = primitives_path.toStdString();
|
||||||
builderP.PrimFilter.push_back("region_*.primitive");
|
builderP.PrimFilter.push_back("region_*.primitive");
|
||||||
builderP.PrimFilter.push_back("indoors_*.primitive");
|
builderP.PrimFilter.push_back("indoors_*.primitive");
|
||||||
isSheet = false;
|
isSheet = false;
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
if(isSheet)
|
if(isSheet)
|
||||||
{
|
{
|
||||||
editor_window->extractWords(editor_window->windowFilePath(), column_name, builderS);
|
editor_window->extractWords(editor_window->windowFilePath(), column_name, builderS);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
initializeSettings(false);
|
initializeSettings(false);
|
||||||
editor_window->extractWords(editor_window->windowFilePath(), column_name, builderP);
|
editor_window->extractWords(editor_window->windowFilePath(), column_name, builderP);
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract bot names from primitives
|
// Extract bot names from primitives
|
||||||
|
@ -407,44 +408,44 @@ void CMainWindow::extractBotNames()
|
||||||
{
|
{
|
||||||
if(verifySettings() == true)
|
if(verifySettings() == true)
|
||||||
{
|
{
|
||||||
CEditorWorksheet* editor_window = getEditorByWorksheetType(NULL);
|
CEditorWorksheet *editor_window = getEditorByWorksheetType(NULL);
|
||||||
if(editor_window != NULL)
|
if(editor_window != NULL)
|
||||||
{
|
{
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
QString file_path = editor_window->windowFilePath();
|
QString file_path = editor_window->windowFilePath();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
openWorkFile(Constants::WK_BOTNAMES);
|
openWorkFile(Constants::WK_BOTNAMES);
|
||||||
editor_window = getEditorByWorksheetType(NULL);
|
editor_window = getEditorByWorksheetType(NULL);
|
||||||
if(editor_window != NULL)
|
if(editor_window != NULL)
|
||||||
{
|
{
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
QString file_path = editor_window->windowFilePath();
|
QString file_path = editor_window->windowFilePath();
|
||||||
} else return;
|
|
||||||
}
|
}
|
||||||
#ifndef QT_NO_CURSOR
|
else return;
|
||||||
|
}
|
||||||
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
#endif
|
|
||||||
initializeSettings(true);
|
initializeSettings(true);
|
||||||
editor_window->extractBotNames(convertQStringList(filters), level_design_path.toStdString(), ligoConfig);
|
editor_window->extractBotNames(convertQStringList(filters), level_design_path.toStdString(), ligoConfig);
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge the content for 2 worksheet files
|
// Merge the content for 2 worksheet files
|
||||||
void CMainWindow::mergeSingleFile()
|
void CMainWindow::mergeSingleFile()
|
||||||
{
|
{
|
||||||
CEditor* editor_window = qobject_cast<CEditor*>(_ui.mdiArea->currentSubWindow());
|
CEditor *editor_window = qobject_cast<CEditor *>(_ui.mdiArea->currentSubWindow());
|
||||||
CSourceDialog *dialog = new CSourceDialog(this);
|
CSourceDialog *dialog = new CSourceDialog(this);
|
||||||
CFtpSelection* ftp_dialog;
|
CFtpSelection *ftp_dialog;
|
||||||
map<QListWidgetItem*, int> methods;
|
map<QListWidgetItem *, int> methods;
|
||||||
QString file_name;
|
QString file_name;
|
||||||
|
|
||||||
if (_ui.mdiArea->subWindowList().size() == 0)
|
if (_ui.mdiArea->subWindowList().size() == 0)
|
||||||
{
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(QString("Open a work file in editor for merge operation."));
|
error.showMessage(tr("Open a work file in editor for merge operation."));
|
||||||
error.exec();
|
error.exec();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -452,16 +453,16 @@ void CMainWindow::mergeSingleFile()
|
||||||
if(editor_window->eType() != Constants::ED_SHEET) // Sheet Editor
|
if(editor_window->eType() != Constants::ED_SHEET) // Sheet Editor
|
||||||
{
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(QString("Please open or activate the window with a sheet file."));
|
error.showMessage(tr("Please open or activate the window with a sheet file."));
|
||||||
error.exec();
|
error.exec();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create items
|
// create items
|
||||||
QListWidgetItem* local_item = new QListWidgetItem();
|
QListWidgetItem *local_item = new QListWidgetItem();
|
||||||
local_item->setText("Local directory");
|
local_item->setText("Local directory");
|
||||||
methods[local_item] = 0;
|
methods[local_item] = 0;
|
||||||
QListWidgetItem* ftp_item = new QListWidgetItem();
|
QListWidgetItem *ftp_item = new QListWidgetItem();
|
||||||
ftp_item->setText("From a FTP server");
|
ftp_item->setText("From a FTP server");
|
||||||
methods[ftp_item] = 1;
|
methods[ftp_item] = 1;
|
||||||
|
|
||||||
|
@ -475,7 +476,7 @@ void CMainWindow::mergeSingleFile()
|
||||||
}
|
}
|
||||||
else if(dialog->selected_item == ftp_item) // Ftp directory
|
else if(dialog->selected_item == ftp_item) // Ftp directory
|
||||||
{
|
{
|
||||||
CFtpSelection* ftp_dialog = new CFtpSelection(this);
|
CFtpSelection *ftp_dialog = new CFtpSelection(this);
|
||||||
ftp_dialog->show();
|
ftp_dialog->show();
|
||||||
|
|
||||||
if(ftp_dialog->exec() && ftp_dialog->status == true)
|
if(ftp_dialog->exec() && ftp_dialog->status == true)
|
||||||
|
@ -491,26 +492,30 @@ void CMainWindow::mergeSingleFile()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
editor_window->activateWindow();
|
editor_window->activateWindow();
|
||||||
CEditorWorksheet* current_window = qobject_cast<CEditorWorksheet*>(editor_window);
|
CEditorWorksheet *current_window = qobject_cast<CEditorWorksheet *>(editor_window);
|
||||||
if(current_window->windowFilePath() == file_name)
|
if(current_window->windowFilePath() == file_name)
|
||||||
return;
|
return;
|
||||||
if(current_window->compareWorksheetFile(file_name))
|
if(current_window->compareWorksheetFile(file_name))
|
||||||
{
|
{
|
||||||
current_window->mergeWorksheetFile(file_name);
|
current_window->mergeWorksheetFile(file_name);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(tr("The file: %1 has different columns from the current file in editor.").arg(file_name));
|
error.showMessage(tr("The file: %1 has different columns from the current file in editor.").arg(file_name));
|
||||||
error.exec();
|
error.exec();
|
||||||
}
|
}
|
||||||
if(dialog->selected_item == ftp_item)
|
if(dialog->selected_item == ftp_item)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
// TODO: uninit ftp_dialog?????
|
||||||
if(!ftp_dialog->file->remove())
|
if(!ftp_dialog->file->remove())
|
||||||
{
|
{
|
||||||
QErrorMessage error;
|
QErrorMessage error;
|
||||||
error.showMessage(tr("Please remove the file from ftp server manually. The file is located on the same directory with OVQT application."));
|
error.showMessage(tr("Please remove the file from ftp server manually. The file is located on the same directory with OVQT application."));
|
||||||
error.exec();
|
error.exec();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,9 +549,7 @@ bool CMainWindow::verifySettings()
|
||||||
error_settings.exec();
|
error_settings.exec();
|
||||||
count_errors = true;
|
count_errors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !count_errors;
|
return !count_errors;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCoreListener::closeMainWindow() const
|
bool CCoreListener::closeMainWindow() const
|
||||||
|
@ -554,12 +557,13 @@ bool CCoreListener::closeMainWindow() const
|
||||||
bool okToClose = true;
|
bool okToClose = true;
|
||||||
Q_FOREACH(QMdiSubWindow *subWindow, m_MainWindow->_ui.mdiArea->subWindowList())
|
Q_FOREACH(QMdiSubWindow *subWindow, m_MainWindow->_ui.mdiArea->subWindowList())
|
||||||
{
|
{
|
||||||
CEditor *currentEditor = qobject_cast<CEditor*>(subWindow);
|
CEditor *currentEditor = qobject_cast<CEditor *>(subWindow);
|
||||||
if(subWindow->isWindowModified())
|
if(subWindow->isWindowModified())
|
||||||
{
|
{
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
|
msgBox.setIcon(QMessageBox::Question);
|
||||||
msgBox.setText(tr("The document has been modified ( %1 ).").arg(currentEditor->windowFilePath()));
|
msgBox.setText(tr("The document has been modified ( %1 ).").arg(currentEditor->windowFilePath()));
|
||||||
msgBox.setInformativeText("Do you want to save your changes?");
|
msgBox.setInformativeText(tr("Do you want to save your changes?"));
|
||||||
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||||
msgBox.setDefaultButton(QMessageBox::Save);
|
msgBox.setDefaultButton(QMessageBox::Save);
|
||||||
int ret = msgBox.exec();
|
int ret = msgBox.exec();
|
||||||
|
@ -594,16 +598,19 @@ CEditorWorksheet *CMainWindow::getEditorByWorksheetType(const QString &type)
|
||||||
{
|
{
|
||||||
Q_FOREACH(QMdiSubWindow *subWindow, _ui.mdiArea->subWindowList())
|
Q_FOREACH(QMdiSubWindow *subWindow, _ui.mdiArea->subWindowList())
|
||||||
{
|
{
|
||||||
CEditor *currentEditor = qobject_cast<CEditor*>(subWindow);
|
CEditor *currentEditor = qobject_cast<CEditor *>(subWindow);
|
||||||
if(currentEditor->eType() == Constants::ED_SHEET)
|
if(currentEditor->eType() == Constants::ED_SHEET)
|
||||||
{
|
{
|
||||||
CEditorWorksheet *editor = qobject_cast<CEditorWorksheet *>(currentEditor);
|
CEditorWorksheet *editor = qobject_cast<CEditorWorksheet *>(currentEditor);
|
||||||
if(type != NULL) {
|
if(type != NULL)
|
||||||
|
{
|
||||||
if(editor->isSheetTable(type))
|
if(editor->isSheetTable(type))
|
||||||
{
|
{
|
||||||
return editor;
|
return editor;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(editor->isBotNamesTable())
|
if(editor->isBotNamesTable())
|
||||||
{
|
{
|
||||||
return editor;
|
return editor;
|
||||||
|
@ -614,8 +621,7 @@ CEditorWorksheet *CMainWindow::getEditorByWorksheetType(const QString &type)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::list<std::string> CMainWindow::convertQStringList(QStringList listq)
|
||||||
list<string> CMainWindow::convertQStringList(QStringList listq)
|
|
||||||
{
|
{
|
||||||
std::list<std::string> stdlist;
|
std::list<std::string> stdlist;
|
||||||
|
|
||||||
|
@ -623,7 +629,6 @@ list<string> CMainWindow::convertQStringList(QStringList listq)
|
||||||
{
|
{
|
||||||
stdlist.push_back(text.toStdString());
|
stdlist.push_back(text.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return stdlist;
|
return stdlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,19 +640,13 @@ bool CMainWindow::isWorksheetEditor(QString filename)
|
||||||
if(wk_file.ColCount > 1)
|
if(wk_file.ColCount > 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMainWindow::isPhraseEditor(QString filename)
|
bool CMainWindow::isPhraseEditor(QString filename)
|
||||||
{
|
{
|
||||||
vector<STRING_MANAGER::TPhrase> phrases;
|
vector<STRING_MANAGER::TPhrase> phrases;
|
||||||
if(readPhraseFile(filename.toStdString(), phrases, false))
|
return readPhraseFile(filename.toStdString(), phrases, false);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace TranslationManager */
|
} /* namespace TranslationManager */
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
// Copyright (C) 2010 Winch Gate Property Limited
|
|
||||||
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -15,20 +14,19 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
#ifndef MAIN_WINDOW_H
|
#ifndef MAIN_WINDOW_H
|
||||||
#define MAIN_WINDOW_H
|
#define MAIN_WINDOW_H
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "ui_translation_manager_main_window.h"
|
||||||
|
#include "translation_manager_editor.h"
|
||||||
|
#include "source_selection.h"
|
||||||
|
#include "editor_worksheet.h"
|
||||||
|
#include "editor_phrase.h"
|
||||||
|
|
||||||
// Project system includes
|
// Project system includes
|
||||||
#include "../core/icore_listener.h"
|
#include "../core/icore_listener.h"
|
||||||
|
|
||||||
// Nel includes
|
|
||||||
#include "nel/misc/types_nl.h"
|
|
||||||
#include "nel/misc/sheet_id.h"
|
|
||||||
#include "nel/misc/path.h"
|
|
||||||
#include "nel/misc/diff_tool.h"
|
|
||||||
#include "nel/ligo/ligo_config.h"
|
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtGui/QUndoStack>
|
#include <QtGui/QUndoStack>
|
||||||
|
@ -39,16 +37,15 @@
|
||||||
#include <QtCore/QSignalMapper>
|
#include <QtCore/QSignalMapper>
|
||||||
#include <QtGui/QDialog>
|
#include <QtGui/QDialog>
|
||||||
|
|
||||||
// Plugin includes
|
// STL includes
|
||||||
#include "translation_manager_editor.h"
|
|
||||||
#include "source_selection.h"
|
|
||||||
#include "ui_translation_manager_main_window.h"
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include "editor_worksheet.h"
|
|
||||||
#include "editor_phrase.h"
|
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
|
// Nel includes
|
||||||
|
#include "nel/misc/types_nl.h"
|
||||||
|
#include "nel/misc/sheet_id.h"
|
||||||
|
#include "nel/misc/path.h"
|
||||||
|
#include "nel/misc/diff_tool.h"
|
||||||
|
#include "nel/ligo/ligo_config.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -58,12 +55,15 @@ namespace TranslationManager
|
||||||
class CMainWindow : public QMainWindow
|
class CMainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMainWindow(QWidget *parent = 0);
|
CMainWindow(QWidget *parent = 0);
|
||||||
virtual ~CMainWindow() {}
|
virtual ~CMainWindow() {}
|
||||||
QUndoStack *m_undoStack;
|
QUndoStack *m_undoStack;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Ui::CMainWindow _ui;
|
Ui::CMainWindow _ui;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// actions
|
// actions
|
||||||
QAction *openAct;
|
QAction *openAct;
|
||||||
|
@ -80,6 +80,7 @@ private:
|
||||||
QString translation_path;
|
QString translation_path;
|
||||||
QString work_path;
|
QString work_path;
|
||||||
NLLIGO::CLigoConfig ligoConfig;
|
NLLIGO::CLigoConfig ligoConfig;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void extractBotNames();
|
void extractBotNames();
|
||||||
void extractWords(QString typeq);
|
void extractWords(QString typeq);
|
||||||
|
@ -89,6 +90,7 @@ private Q_SLOTS:
|
||||||
void setActiveSubWindow(QWidget *window);
|
void setActiveSubWindow(QWidget *window);
|
||||||
void updateWindowsList();
|
void updateWindowsList();
|
||||||
void mergeSingleFile();
|
void mergeSingleFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void openWorkFile(QString file);
|
void openWorkFile(QString file);
|
||||||
void updateToolbar(QMdiSubWindow *window);
|
void updateToolbar(QMdiSubWindow *window);
|
||||||
|
@ -97,22 +99,20 @@ private:
|
||||||
void createMenus();
|
void createMenus();
|
||||||
void createToolbar();
|
void createToolbar();
|
||||||
void initializeSettings(bool georges);
|
void initializeSettings(bool georges);
|
||||||
list<string> convertQStringList(QStringList listq);
|
std::list<std::string> convertQStringList(QStringList listq);
|
||||||
CEditor* getEditorByWindowFilePath(const QString &fileName);
|
CEditor *getEditorByWindowFilePath(const QString &fileName);
|
||||||
// Worksheet specific functions
|
// Worksheet specific functions
|
||||||
CEditorWorksheet* getEditorByWorksheetType(const QString &type);
|
CEditorWorksheet *getEditorByWorksheetType(const QString &type);
|
||||||
bool isWorksheetEditor(QString filename);
|
bool isWorksheetEditor(QString filename);
|
||||||
bool isPhraseEditor(QString filename);
|
bool isPhraseEditor(QString filename);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CCoreListener : public Core::ICoreListener
|
class CCoreListener : public Core::ICoreListener
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CCoreListener(CMainWindow* mainWindow, QObject *parent = 0): ICoreListener(parent)
|
CCoreListener(CMainWindow *mainWindow, QObject *parent = 0): ICoreListener(parent)
|
||||||
{
|
{
|
||||||
m_MainWindow = mainWindow;
|
m_MainWindow = mainWindow;
|
||||||
}
|
}
|
||||||
|
@ -124,10 +124,6 @@ public:
|
||||||
CMainWindow *m_MainWindow;
|
CMainWindow *m_MainWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace TranslationManager
|
} // namespace TranslationManager
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // SIMPLE_VIEWER_H
|
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
#include "translation_manager_plugin.h"
|
#include "translation_manager_plugin.h"
|
||||||
#include "translation_manager_settings_page.h"
|
#include "translation_manager_settings_page.h"
|
||||||
#include "translation_manager_main_window.h"
|
#include "translation_manager_main_window.h"
|
||||||
// Project system includes
|
|
||||||
|
// Core includes
|
||||||
#include "../core/icore.h"
|
#include "../core/icore.h"
|
||||||
#include "../core/core_constants.h"
|
#include "../core/core_constants.h"
|
||||||
#include "../core/menu_manager.h"
|
#include "../core/menu_manager.h"
|
||||||
|
@ -65,11 +66,8 @@ bool TranslationManagerPlugin::initialize(ExtensionSystem::IPluginManager *plugi
|
||||||
|
|
||||||
void TranslationManagerPlugin::extensionsInitialized()
|
void TranslationManagerPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TranslationManagerPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
void TranslationManagerPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
||||||
{
|
{
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
|
@ -86,23 +84,6 @@ void TranslationManagerPlugin::addAutoReleasedObject(QObject *obj)
|
||||||
_autoReleaseObjects.prepend(obj);
|
_autoReleaseObjects.prepend(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* TranslationManagerPlugin::objectByName(const QString &name) const
|
|
||||||
{
|
|
||||||
Q_FOREACH (QObject *qobj, _plugMan->allObjects())
|
|
||||||
if (qobj->objectName() == name)
|
|
||||||
return qobj;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExtensionSystem::IPluginSpec *TranslationManagerPlugin::pluginByName(const QString &name) const
|
|
||||||
{
|
|
||||||
Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins())
|
|
||||||
if (spec->name() == name)
|
|
||||||
return spec;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(TranslationManager::TranslationManagerPlugin)
|
Q_EXPORT_PLUGIN(TranslationManager::TranslationManagerPlugin)
|
|
@ -45,7 +45,7 @@ class IPluginSpec;
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
class CTranslationManagerContext;
|
class CTranslationManagerContext;
|
||||||
|
|
||||||
class TranslationManagerPlugin : public QObject, public ExtensionSystem::IPlugin
|
class TranslationManagerPlugin : public QObject, public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
|
@ -58,12 +58,8 @@ public:
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
|
|
||||||
void setNelContext(NLMISC::INelContext *nelContext);
|
void setNelContext(NLMISC::INelContext *nelContext);
|
||||||
|
|
||||||
void addAutoReleasedObject(QObject *obj);
|
void addAutoReleasedObject(QObject *obj);
|
||||||
|
|
||||||
QObject *objectByName(const QString &name) const;
|
|
||||||
ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NLMISC::CLibraryContext *_LibContext;
|
NLMISC::CLibraryContext *_LibContext;
|
||||||
|
|
||||||
|
@ -75,8 +71,9 @@ private:
|
||||||
class CTranslationManagerContext: public Core::IContext
|
class CTranslationManagerContext: public Core::IContext
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTranslationManagerContext(CMainWindow* mainWindow, QObject *parent = 0): IContext(parent)
|
CTranslationManagerContext(CMainWindow *mainWindow, QObject *parent = 0): IContext(parent)
|
||||||
{
|
{
|
||||||
m_MainWindow = mainWindow;
|
m_MainWindow = mainWindow;
|
||||||
}
|
}
|
||||||
|
@ -109,9 +106,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
CMainWindow *m_MainWindow;
|
CMainWindow *m_MainWindow;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Plugin
|
}
|
||||||
|
|
||||||
#endif // TRANSLATION_MANAGER_PLUGIN_H
|
#endif // TRANSLATION_MANAGER_PLUGIN_H
|
|
@ -1,5 +1,4 @@
|
||||||
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
|
||||||
// Copyright (C) 2010 Winch Gate Property Limited
|
|
||||||
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -17,17 +16,15 @@
|
||||||
|
|
||||||
#include "translation_manager_settings_page.h"
|
#include "translation_manager_settings_page.h"
|
||||||
|
|
||||||
|
// Core includes
|
||||||
|
#include "../core/icore.h"
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtGui/QWidget>
|
#include <QtGui/QWidget>
|
||||||
#include <QtGui/QFileDialog>
|
#include <QtGui/QFileDialog>
|
||||||
#include <QtGui/QListWidgetItem>
|
#include <QtGui/QListWidgetItem>
|
||||||
|
|
||||||
// NeL includes
|
|
||||||
|
|
||||||
// Project includes
|
|
||||||
#include "../core/icore.h"
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -203,5 +200,4 @@ void CTranslationManagerSettingsPage::writeSettings()
|
||||||
settings->sync();
|
settings->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
} /* namespace Plugin */
|
|
|
@ -24,13 +24,9 @@
|
||||||
|
|
||||||
#include "ui_translation_manager_settings_page.h"
|
#include "ui_translation_manager_settings_page.h"
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace TranslationManager
|
namespace TranslationManager
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
@class CTranslationManagerSettingsPage
|
|
||||||
*/
|
|
||||||
class CTranslationManagerSettingsPage : public Core::IOptionsPage
|
class CTranslationManagerSettingsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -61,6 +57,6 @@ private:
|
||||||
void readSettings();
|
void readSettings();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Plugin
|
}
|
||||||
|
|
||||||
#endif // TRANSLATION_MANAGER_SETTINGS_H
|
#endif // TRANSLATION_MANAGER_SETTINGS_H
|
|
@ -6,34 +6,21 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>533</width>
|
<width>589</width>
|
||||||
<height>478</height>
|
<height>490</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>531</width>
|
|
||||||
<height>421</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Translation Manager Plugin</string>
|
<string>Translation Manager Plugin</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<property name="geometry">
|
<item row="0" column="0">
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>30</y>
|
|
||||||
<width>521</width>
|
|
||||||
<height>232</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
|
@ -118,45 +105,8 @@
|
||||||
<widget class="QListWidget" name="lang_list"/>
|
<widget class="QListWidget" name="lang_list"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>340</y>
|
|
||||||
<width>521</width>
|
|
||||||
<height>60</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>Translation directory</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLineEdit" name="translation_edit"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QToolButton" name="translation_add">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>270</y>
|
|
||||||
<width>521</width>
|
|
||||||
<height>60</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
|
@ -176,8 +126,32 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Translation directory</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLineEdit" name="translation_edit"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QToolButton" name="translation_add">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../core/core.qrc"/>
|
<include location="../core/core.qrc"/>
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include "zone_painter_model.h"
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
|
||||||
|
namespace Plugin
|
||||||
|
{
|
||||||
|
|
||||||
|
CZonePainterModel::CZonePainterModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CZonePainterModel::~CZonePainterModel()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace Plugin */
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#ifndef ZONE_PAINTER_MODEL_H
|
||||||
|
#define ZONE_PAINTER_MODEL_H
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
#include <nel/misc/rgba.h>
|
||||||
|
#include <nel/misc/event_emitter.h>
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
|
||||||
|
namespace Plugin
|
||||||
|
{
|
||||||
|
|
||||||
|
class CZonePainterModel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CZonePainterModel();
|
||||||
|
virtual ~CZonePainterModel();
|
||||||
|
|
||||||
|
}; /* class CZonePainterModel */
|
||||||
|
|
||||||
|
} /* namespace Plugin */
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ZONE_PAINTER_MODEL_H
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QtGui/QMenu>
|
#include <QtGui/QMenu>
|
||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
#include <QtGui/QMenuBar>
|
#include <QtGui/QMenuBar>
|
||||||
|
#include <QtGui/QFileDialog>
|
||||||
|
|
||||||
namespace Plugin
|
namespace Plugin
|
||||||
{
|
{
|
||||||
|
@ -39,6 +40,7 @@ bool ZonePainterPlugin::initialize(ExtensionSystem::IPluginManager *pluginManage
|
||||||
addAutoReleasedObject(new CZonePainterSettingsPage(this));
|
addAutoReleasedObject(new CZonePainterSettingsPage(this));
|
||||||
addAutoReleasedObject(new CZonePainterContext(this));
|
addAutoReleasedObject(new CZonePainterContext(this));
|
||||||
//addAutoReleasedObject(new CCoreListener(this));
|
//addAutoReleasedObject(new CCoreListener(this));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +48,26 @@ void ZonePainterPlugin::extensionsInitialized()
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
Core::MenuManager *menuManager = core->menuManager();
|
Core::MenuManager *menuManager = core->menuManager();
|
||||||
|
QAction *loadZoneAction = new QAction("Load Zone", this);
|
||||||
|
QAction *saveZoneAction = new QAction("Save Zone", this);
|
||||||
|
|
||||||
|
QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS);
|
||||||
|
QMenu *zoneMenu = toolsMenu->addMenu("Zone Painter");
|
||||||
|
zoneMenu->addAction(loadZoneAction);
|
||||||
|
connect(loadZoneAction, SIGNAL(triggered()), this, SLOT(clickLoadZoneAction()));
|
||||||
|
zoneMenu->addAction(saveZoneAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****** SLOTS ******/
|
||||||
|
void ZonePainterPlugin::clickLoadZoneAction() {
|
||||||
|
QString zoneFile = QFileDialog::getOpenFileName(NULL, tr("Open Zone File"), ".", tr("Zone Files (*.zone);;"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZonePainterPlugin::clickSaveZoneAction() {
|
||||||
|
|
||||||
|
}
|
||||||
|
/****** END SLOTS ******/
|
||||||
|
|
||||||
void ZonePainterPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
void ZonePainterPlugin::setNelContext(NLMISC::INelContext *nelContext)
|
||||||
{
|
{
|
||||||
#ifdef NL_OS_WINDOWS
|
#ifdef NL_OS_WINDOWS
|
||||||
|
|
|
@ -56,12 +56,17 @@ public:
|
||||||
|
|
||||||
void addAutoReleasedObject(QObject *obj);
|
void addAutoReleasedObject(QObject *obj);
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void clickLoadZoneAction();
|
||||||
|
void clickSaveZoneAction();
|
||||||
protected:
|
protected:
|
||||||
NLMISC::CLibraryContext *m_LibContext;
|
NLMISC::CLibraryContext *m_LibContext;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExtensionSystem::IPluginManager *m_plugMan;
|
ExtensionSystem::IPluginManager *m_plugMan;
|
||||||
QList<QObject *> m_autoReleaseObjects;
|
QList<QObject *> m_autoReleaseObjects;
|
||||||
|
|
||||||
|
NL3D::CLandscapeModel *m_Landscape;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CZonePainterContext: public Core::IContext
|
class CZonePainterContext: public Core::IContext
|
||||||
|
|
|
@ -57,7 +57,7 @@ printLog(log, "")
|
||||||
Psftp = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, UploadPsftpTool)
|
Psftp = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, UploadPsftpTool)
|
||||||
printLog(log, "PSFTP " + Psftp)
|
printLog(log, "PSFTP " + Psftp)
|
||||||
|
|
||||||
def downloadVersionTag(server, user, dir):
|
def downloadVersionTag(server, user, sshkey, dir):
|
||||||
if os.path.isfile("upload.tag"):
|
if os.path.isfile("upload.tag"):
|
||||||
os.remove("upload.tag")
|
os.remove("upload.tag")
|
||||||
if os.path.isfile("upload.batch"):
|
if os.path.isfile("upload.batch"):
|
||||||
|
@ -67,7 +67,7 @@ def downloadVersionTag(server, user, dir):
|
||||||
ub.write("get upload.tag upload.tag\n")
|
ub.write("get upload.tag upload.tag\n")
|
||||||
ub.write("quit\n")
|
ub.write("quit\n")
|
||||||
ub.close()
|
ub.close()
|
||||||
subprocess.call([ Psftp, "-b", "upload.batch", user + "@" + server ])
|
subprocess.call([ Psftp, "-b", "upload.batch", "-i", sshkey, user + "@" + server ])
|
||||||
os.remove("upload.batch")
|
os.remove("upload.batch")
|
||||||
if os.path.isfile("upload.tag"):
|
if os.path.isfile("upload.tag"):
|
||||||
ft = open("upload.tag")
|
ft = open("upload.tag")
|
||||||
|
@ -122,8 +122,8 @@ def listDirectoryUpload(ft, ub, udb, dir):
|
||||||
printLog(log, "listDirectoryUpload: file not dir or file?!" + fileFull)
|
printLog(log, "listDirectoryUpload: file not dir or file?!" + fileFull)
|
||||||
return nft
|
return nft
|
||||||
|
|
||||||
def uploadSftp(server, user, dir_to, dir_from, addcmd):
|
def uploadSftp(server, user, sshkey, dir_to, dir_from, addcmd):
|
||||||
ft = downloadVersionTag(server, user, dir_to)
|
ft = downloadVersionTag(server, user, sshkey, dir_to)
|
||||||
if isDirectoryNeeded(ft, dir_from):
|
if isDirectoryNeeded(ft, dir_from):
|
||||||
if os.path.isfile("upload_dir.batch"):
|
if os.path.isfile("upload_dir.batch"):
|
||||||
os.remove("upload_dir.batch")
|
os.remove("upload_dir.batch")
|
||||||
|
@ -146,8 +146,8 @@ def uploadSftp(server, user, dir_to, dir_from, addcmd):
|
||||||
ub.close()
|
ub.close()
|
||||||
udb.write("quit\n")
|
udb.write("quit\n")
|
||||||
udb.close()
|
udb.close()
|
||||||
subprocess.call([ Psftp, "-be", "-b", "upload_dir.batch", user + "@" + server ])
|
subprocess.call([ Psftp, "-be", "-b", "upload_dir.batch", "-i", sshkey, user + "@" + server ])
|
||||||
subprocess.call([ Psftp, "-b", "upload.batch", user + "@" + server ])
|
subprocess.call([ Psftp, "-b", "upload.batch", "-i", sshkey, user + "@" + server ])
|
||||||
os.remove("upload_dir.batch")
|
os.remove("upload_dir.batch")
|
||||||
os.remove("upload.batch")
|
os.remove("upload.batch")
|
||||||
os.remove("upload.tag")
|
os.remove("upload.tag")
|
||||||
|
@ -156,19 +156,23 @@ def uploadSftp(server, user, dir_to, dir_from, addcmd):
|
||||||
|
|
||||||
printLog(log, ">>> Upload patch <<<")
|
printLog(log, ">>> Upload patch <<<")
|
||||||
for target in UploadPatch:
|
for target in UploadPatch:
|
||||||
uploadSftp(target[0], target[1], target[3], ClientPatchDirectory + "/patch", [ ])
|
uploadSftp(target[0], target[1], target[2], target[3], ClientPatchDirectory + "/patch", [ ])
|
||||||
|
|
||||||
printLog(log, ">>> Upload data_shard <<<")
|
printLog(log, ">>> Upload data_shard <<<")
|
||||||
for target in UploadShard:
|
for target in UploadShard:
|
||||||
uploadSftp(target[0], target[1], target[3], DataShardDirectory, [ "rm *.packed_sheets", "rm primitive_cache/*.binprim" ])
|
uploadSftp(target[0], target[1], target[2], target[3], DataShardDirectory, [ "rm *.packed_sheets", "rm primitive_cache/*.binprim" ])
|
||||||
|
|
||||||
printLog(log, ">>> Upload data_common <<<")
|
printLog(log, ">>> Upload data_common <<<")
|
||||||
for target in UploadCommon:
|
for target in UploadCommon:
|
||||||
uploadSftp(target[0], target[1], target[3], DataCommonDirectory, [ ])
|
uploadSftp(target[0], target[1], target[2], target[3], DataCommonDirectory, [ ])
|
||||||
|
|
||||||
printLog(log, ">>> Upload data_leveldesign <<<")
|
printLog(log, ">>> Upload data_leveldesign/leveldesign <<<")
|
||||||
for target in UploadLeveldesign:
|
for target in UploadLeveldesign:
|
||||||
uploadSftp(target[0], target[1], target[3], LeveldesignDirectory, [ ])
|
uploadSftp(target[0], target[1], target[2], target[3], LeveldesignDirectory, [ ])
|
||||||
|
|
||||||
|
printLog(log, ">>> Upload data_leveldesign/primitives <<<")
|
||||||
|
for target in UploadPrimitives:
|
||||||
|
uploadSftp(target[0], target[1], target[2], target[3], PrimitivesDirectory, [ ])
|
||||||
|
|
||||||
log.close()
|
log.close()
|
||||||
if os.path.isfile("8_upload.log"):
|
if os.path.isfile("8_upload.log"):
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
|
ADD_SUBDIRECTORY(build_samplebank)
|
||||||
|
ADD_SUBDIRECTORY(build_sound)
|
||||||
|
ADD_SUBDIRECTORY(build_soundbank)
|
||||||
|
|
||||||
|
# Deprecated tool - no longer useful, valid or buildable.
|
||||||
|
#ADD_SUBDIRECTORY(source_sounds_builder)
|
||||||
|
|
13
code/nel/tools/sound/build_samplebank/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FILE(GLOB SRC *.cpp *.h)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(build_samplebank ${SRC})
|
||||||
|
|
||||||
|
ADD_DEFINITIONS( ${LIBXML2_DEFINITIONS})
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(build_samplebank nelmisc nelsound)
|
||||||
|
NL_DEFAULT_PROPS(build_samplebank "NeL, Tools, Sound: build_samplebank")
|
||||||
|
NL_ADD_RUNTIME_FLAGS(build_samplebank)
|
||||||
|
|
||||||
|
INSTALL(TARGETS build_samplebank RUNTIME DESTINATION bin COMPONENT toolssound)
|
13
code/nel/tools/sound/build_sound/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FILE(GLOB SRC *.cpp *.h)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(build_sound ${SRC})
|
||||||
|
|
||||||
|
ADD_DEFINITIONS( ${LIBXML2_DEFINITIONS})
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(build_sound nelmisc nelsound)
|
||||||
|
NL_DEFAULT_PROPS(build_sound "NeL, Tools, Sound: build_sound")
|
||||||
|
NL_ADD_RUNTIME_FLAGS(build_sound)
|
||||||
|
|
||||||
|
INSTALL(TARGETS build_sound RUNTIME DESTINATION bin COMPONENT toolssound)
|
13
code/nel/tools/sound/build_soundbank/CMakeLists.txt
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FILE(GLOB SRC *.cpp *.h)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(build_soundbank ${SRC})
|
||||||
|
|
||||||
|
ADD_DEFINITIONS( ${LIBXML2_DEFINITIONS})
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(build_soundbank nelmisc nelsound)
|
||||||
|
NL_DEFAULT_PROPS(build_soundbank "NeL, Tools, Sound: build_soundbank")
|
||||||
|
NL_ADD_RUNTIME_FLAGS(build_soundbank)
|
||||||
|
|
||||||
|
INSTALL(TARGETS build_soundbank RUNTIME DESTINATION bin COMPONENT toolssound)
|
|
@ -80,6 +80,9 @@ XMLOutGameInterfaceFiles = {
|
||||||
"out_v2_keys.xml",
|
"out_v2_keys.xml",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TexturesInterface = "texture_interfaces_v3";
|
||||||
|
TexturesInterfaceDXTC = "texture_interfaces_dxtc";
|
||||||
|
|
||||||
|
|
||||||
// The ligo primitive class file
|
// The ligo primitive class file
|
||||||
LigoPrimitiveClass = "world_editor_classes.xml";
|
LigoPrimitiveClass = "world_editor_classes.xml";
|
||||||
|
@ -351,8 +354,8 @@ SystemInfoColors =
|
||||||
|
|
||||||
// NEW System Info Categories
|
// NEW System Info Categories
|
||||||
"SYS", "255 255 255 255 normal", // Default system messages
|
"SYS", "255 255 255 255 normal", // Default system messages
|
||||||
"BC", "255 255 255 255 center", // Broadcast messages
|
"BC", "255 255 255 255 centeraround", // Broadcast messages
|
||||||
"TAGBC", "255 255 255 255 center", // Taged broadcast messages : color should remain white as some word are tagged
|
"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged
|
||||||
"XP", "255 255 64 255 over", // XP Gain
|
"XP", "255 255 64 255 over", // XP Gain
|
||||||
"SP", "255 255 64 255 over", // SP Gain
|
"SP", "255 255 64 255 over", // SP Gain
|
||||||
"TTL", "255 255 64 255 over", // Title
|
"TTL", "255 255 64 255 over", // Title
|
||||||
|
@ -440,6 +443,7 @@ R2EDReloadFiles = {
|
||||||
XMLInterfaceFiles = {
|
XMLInterfaceFiles = {
|
||||||
"config.xml",
|
"config.xml",
|
||||||
"widgets.xml",
|
"widgets.xml",
|
||||||
|
"webig_widgets.xml",
|
||||||
"player.xml",
|
"player.xml",
|
||||||
"inventory.xml",
|
"inventory.xml",
|
||||||
"interaction.xml",
|
"interaction.xml",
|
||||||
|
@ -556,6 +560,15 @@ HelpPages =
|
||||||
"de=http://forums.ryzom.com/forum/showthread.php?t=29131"
|
"de=http://forums.ryzom.com/forum/showthread.php?t=29131"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
WebIgMainDomain = "atys.ryzom.com";
|
||||||
|
|
||||||
|
WebIgTrustedDomains =
|
||||||
|
{
|
||||||
|
"atys.ryzom.com"
|
||||||
|
};
|
||||||
|
|
||||||
|
PatchletUrl = "http://atys.ryzom.com/start/app_patchlet.php?patch=preload";
|
||||||
|
|
||||||
SelectedSlot = 0;
|
SelectedSlot = 0;
|
||||||
|
|
||||||
BuildName = "RELEASE_HEAD";
|
BuildName = "RELEASE_HEAD";
|
||||||
|
|
|
@ -80,6 +80,9 @@ XMLOutGameInterfaceFiles = {
|
||||||
"out_v2_keys.xml",
|
"out_v2_keys.xml",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TexturesInterface = "texture_interfaces_v3";
|
||||||
|
TexturesInterfaceDXTC = "texture_interfaces_dxtc";
|
||||||
|
|
||||||
|
|
||||||
// The ligo primitive class file
|
// The ligo primitive class file
|
||||||
LigoPrimitiveClass = "world_editor_classes.xml";
|
LigoPrimitiveClass = "world_editor_classes.xml";
|
||||||
|
@ -352,8 +355,8 @@ SystemInfoColors =
|
||||||
|
|
||||||
// NEW System Info Categories
|
// NEW System Info Categories
|
||||||
"SYS", "255 255 255 255 normal", // Default system messages
|
"SYS", "255 255 255 255 normal", // Default system messages
|
||||||
"BC", "255 255 255 255 center", // Broadcast messages
|
"BC", "255 255 255 255 centeraround", // Broadcast messages
|
||||||
"TAGBC", "255 255 255 255 center", // Taged broadcast messages : color should remain white as some word are tagged
|
"TAGBC", "255 255 255 255 centeraround", // Taged broadcast messages : color should remain white as some word are tagged
|
||||||
"XP", "255 255 64 255 over", // XP Gain
|
"XP", "255 255 64 255 over", // XP Gain
|
||||||
"SP", "255 255 64 255 over", // SP Gain
|
"SP", "255 255 64 255 over", // SP Gain
|
||||||
"TTL", "255 255 64 255 over", // Title
|
"TTL", "255 255 64 255 over", // Title
|
||||||
|
@ -441,6 +444,7 @@ R2EDReloadFiles = {
|
||||||
XMLInterfaceFiles = {
|
XMLInterfaceFiles = {
|
||||||
"config.xml",
|
"config.xml",
|
||||||
"widgets.xml",
|
"widgets.xml",
|
||||||
|
"webig_widgets.xml",
|
||||||
"player.xml",
|
"player.xml",
|
||||||
"inventory.xml",
|
"inventory.xml",
|
||||||
"interaction.xml",
|
"interaction.xml",
|
||||||
|
@ -557,6 +561,15 @@ HelpPages =
|
||||||
"de=http://forums.ryzom.com/forum/showthread.php?t=29131"
|
"de=http://forums.ryzom.com/forum/showthread.php?t=29131"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
WebIgMainDomain = "atys.ryzom.com";
|
||||||
|
|
||||||
|
WebIgTrustedDomains =
|
||||||
|
{
|
||||||
|
"atys.ryzom.com"
|
||||||
|
};
|
||||||
|
|
||||||
|
PatchletUrl = "http://atys.ryzom.com/start/app_patchlet.php?patch=preload";
|
||||||
|
|
||||||
SelectedSlot = 0;
|
SelectedSlot = 0;
|
||||||
|
|
||||||
BuildName = "RELEASE_HEAD";
|
BuildName = "RELEASE_HEAD";
|
||||||
|
|
Before Width: | Height: | Size: 4 MiB After Width: | Height: | Size: 4 MiB |
|
@ -78,9 +78,18 @@
|
||||||
<command name="guildinvite" action="command" params="a guildInvite $" />
|
<command name="guildinvite" action="command" params="a guildInvite $" />
|
||||||
<command name="invite" action="command" params="a teamInvite $" />
|
<command name="invite" action="command" params="a teamInvite $" />
|
||||||
|
|
||||||
<command name="channel" action="command" params="a connectUserChannel +" />
|
<command name="channel" action="command" params='a connectUserChannel "$"' />
|
||||||
|
<command name="channel" action="command" params='a connectUserChannel "$" +' />
|
||||||
|
|
||||||
|
<command name="leaguekick" action="command" params="a leagueKick $" />
|
||||||
|
<command name="leaguequit" action="command" params="a setLeague" />
|
||||||
|
<command name="leagueinvite" action="command" params="a leagueInvite $" />
|
||||||
|
<command name="league" action="command" params='a setLeague "$"' />
|
||||||
|
|
||||||
|
<command name="resetname" action="command" params="a resetName"/>
|
||||||
|
|
||||||
<!-- WebIG -->
|
<!-- WebIG -->
|
||||||
<command name="go" action="browse" params="name=ui:interface:webig:content:html|url=home"/>
|
<command name="go" action="browse" params="name=ui:interface:webig:content:html|url=home"/>
|
||||||
|
<command name="webdev" action="browse" params="name=ui:interface:webig:content:html|url=http://localhost/index.html"/>
|
||||||
|
|
||||||
</interface_config>
|
</interface_config>
|
||||||
|
|
|
@ -258,6 +258,9 @@
|
||||||
<variable entry="UI:SAVE:INSCENE:USER:TITLE"
|
<variable entry="UI:SAVE:INSCENE:USER:TITLE"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="false" />
|
value="false" />
|
||||||
|
<variable entry="UI:SAVE:INSCENE:USER:RPTAGS"
|
||||||
|
type="bool"
|
||||||
|
value="false" />
|
||||||
<variable entry="UI:SAVE:INSCENE:USER:GUILD_NAME"
|
<variable entry="UI:SAVE:INSCENE:USER:GUILD_NAME"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="false" />
|
value="false" />
|
||||||
|
@ -291,6 +294,9 @@
|
||||||
<variable entry="UI:SAVE:INSCENE:FRIEND:TITLE"
|
<variable entry="UI:SAVE:INSCENE:FRIEND:TITLE"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="true" />
|
value="true" />
|
||||||
|
<variable entry="UI:SAVE:INSCENE:FRIEND:RPTAGS"
|
||||||
|
type="bool"
|
||||||
|
value="true" />
|
||||||
<variable entry="UI:SAVE:INSCENE:FRIEND:GUILD_NAME"
|
<variable entry="UI:SAVE:INSCENE:FRIEND:GUILD_NAME"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="true" />
|
value="true" />
|
||||||
|
@ -327,6 +333,9 @@
|
||||||
<variable entry="UI:SAVE:INSCENE:ENEMY:TITLE"
|
<variable entry="UI:SAVE:INSCENE:ENEMY:TITLE"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="true" />
|
value="true" />
|
||||||
|
<variable entry="UI:SAVE:INSCENE:ENEMY:RPTAGS"
|
||||||
|
type="bool"
|
||||||
|
value="true" />
|
||||||
<variable entry="UI:SAVE:INSCENE:ENEMY:GUILD_NAME"
|
<variable entry="UI:SAVE:INSCENE:ENEMY:GUILD_NAME"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="true" />
|
value="true" />
|
||||||
|
@ -2797,6 +2806,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:GUILD_LIST:SORT_ORDER"
|
<variable entry="UI:SAVE:GUILD_LIST:SORT_ORDER"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
<variable entry="UI:SAVE:CHATLOG_STATE"
|
||||||
|
type="sint32"
|
||||||
|
value="0" />
|
||||||
<!-- Auto Convert ACT_TSTART end TEND from server to smoothServerTick -->
|
<!-- Auto Convert ACT_TSTART end TEND from server to smoothServerTick -->
|
||||||
<link expr="@SERVER:USER:ACT_TSTART"
|
<link expr="@SERVER:USER:ACT_TSTART"
|
||||||
action="set"
|
action="set"
|
||||||
|
@ -2963,7 +2975,28 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:CHAT:COLORS:TELL"
|
<variable entry="UI:SAVE:CHAT:COLORS:TELL"
|
||||||
type="rgba"
|
type="rgba"
|
||||||
value="170 170 170 255" />
|
value="170 170 170 255" />
|
||||||
<variable entry="UI:SAVE:CHAT:COLORS:DYN"
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:0"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:1"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:2"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:3"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:4"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:5"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:6"
|
||||||
|
type="rgba"
|
||||||
|
value="162 255 173 255" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:COLORS:DYN:7"
|
||||||
type="rgba"
|
type="rgba"
|
||||||
value="162 255 173 255" />
|
value="162 255 173 255" />
|
||||||
<variable entry="UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
<variable entry="UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
||||||
|
@ -2975,6 +3008,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
<variable entry="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="false" />
|
value="false" />
|
||||||
|
<variable entry="UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB"
|
||||||
|
type="bool"
|
||||||
|
value="true" />
|
||||||
<!-- ***************************** -->
|
<!-- ***************************** -->
|
||||||
<!-- * SYSTEM INFO COLORS * -->
|
<!-- * SYSTEM INFO COLORS * -->
|
||||||
<!-- ***************************** -->
|
<!-- ***************************** -->
|
||||||
|
@ -3045,6 +3081,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_BAG:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_BAG:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_BAG:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_PA0:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_PA0:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
@ -3066,6 +3105,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_PA0:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_PA0:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_PA0:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_PA1:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_PA1:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
@ -3087,6 +3129,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_PA1:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_PA1:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_PA1:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_PA2:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_PA2:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
@ -3108,6 +3153,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_PA2:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_PA2:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_PA2:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_PA3:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_PA3:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
@ -3129,6 +3177,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_PA3:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_PA3:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_PA3:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_GUILD:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_GUILD:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
@ -3151,6 +3202,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_GUILD:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_GUILD:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_GUILD:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<variable entry="UI:SAVE:INV_ROOM:SORT_TYPE"
|
<variable entry="UI:SAVE:INV_ROOM:SORT_TYPE"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
@ -3173,6 +3227,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:SAVE:INV_ROOM:FILTER_MISSMP"
|
<variable entry="UI:SAVE:INV_ROOM:FILTER_MISSMP"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
value="1" />
|
value="1" />
|
||||||
|
<variable entry="UI:SAVE:INV_ROOM:FILTER_TP"
|
||||||
|
type="sint32"
|
||||||
|
value="1" />
|
||||||
<!-- List Menu 1 -->
|
<!-- List Menu 1 -->
|
||||||
<variable entry="UI:VARIABLES:ISACTIVE:SETS"
|
<variable entry="UI:VARIABLES:ISACTIVE:SETS"
|
||||||
type="sint32"
|
type="sint32"
|
||||||
|
@ -3809,4 +3866,10 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
||||||
<variable entry="UI:TEMP:R2_DRAW_ARRAY"
|
<variable entry="UI:TEMP:R2_DRAW_ARRAY"
|
||||||
type="bool"
|
type="bool"
|
||||||
value="0" />
|
value="0" />
|
||||||
|
<variable entry="UI:TEMP:DEFAULT_WEB_RETRY_TIMEOUT"
|
||||||
|
type="sint32"
|
||||||
|
value="2" />
|
||||||
|
<variable entry="UI:SAVE:WEBIG_RETRY_DELAY"
|
||||||
|
type="sint32"
|
||||||
|
value="2" />
|
||||||
</interface_config>
|
</interface_config>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<variable entry="UI:VARIABLES:ENCY:REWARDBRICK:SHEET" type="sint32" value="0" />
|
<variable entry="UI:VARIABLES:ENCY:REWARDBRICK:SHEET" type="sint32" value="0" />
|
||||||
<variable entry="UI:VARIABLES:ENCY:ALBUMBRICK:SHEET" type="sint32" value="0" />
|
<variable entry="UI:VARIABLES:ENCY:ALBUMBRICK:SHEET" type="sint32" value="0" />
|
||||||
|
|
||||||
<style style="ency_title" type="text" color="255 255 255 255" fontsize="14" shadow="true" case_mode="%case_first_string_letter_up"/>
|
<style style="ency_title" type="text" color="255 255 255 255" fontsize="14" shadow="true" case_mode="%case_normal"/>
|
||||||
<style style="ency_title2" type="text" color="255 255 255 192" fontsize="12" shadow="true" />
|
<style style="ency_title2" type="text" color="255 255 255 192" fontsize="12" shadow="true" />
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1615,19 +1615,82 @@
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
<instance template="tgcw_color"
|
<instance template="tgcw_color"
|
||||||
id="cc_dyn"
|
id="cc_dyn0"
|
||||||
text="uiDynColor"
|
text="uiDynColor0"
|
||||||
title="uiCCDDyn"
|
title="uiCCDDyn0"
|
||||||
tooltip="uittChooseDynColor"
|
tooltip="uittChooseDynColor0"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
posparent="cc_shout"
|
posparent="cc_shout"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn1"
|
||||||
|
text="uiDynColor1"
|
||||||
|
title="uiCCDDyn1"
|
||||||
|
tooltip="uittChooseDynColor1"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn0"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn2"
|
||||||
|
text="uiDynColor2"
|
||||||
|
title="uiCCDDyn2"
|
||||||
|
tooltip="uittChooseDynColor2"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn1"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn3"
|
||||||
|
text="uiDynColor3"
|
||||||
|
title="uiCCDDyn3"
|
||||||
|
tooltip="uittChooseDynColor3"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn2"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn4"
|
||||||
|
text="uiDynColor4"
|
||||||
|
title="uiCCDDyn4"
|
||||||
|
tooltip="uittChooseDynColor4"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn3"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn5"
|
||||||
|
text="uiDynColor5"
|
||||||
|
title="uiCCDDyn5"
|
||||||
|
tooltip="uittChooseDynColor5"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn4"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn6"
|
||||||
|
text="uiDynColor6"
|
||||||
|
title="uiCCDDyn6"
|
||||||
|
tooltip="uittChooseDynColor6"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn5"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
|
<instance template="tgcw_color"
|
||||||
|
id="cc_dyn7"
|
||||||
|
text="uiDynColor7"
|
||||||
|
title="uiCCDDyn7"
|
||||||
|
tooltip="uittChooseDynColor7"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="cc_dyn6"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
id="enter_dontquit_cb"
|
id="enter_dontquit_cb"
|
||||||
text="uiEnterDontQuitCB"
|
text="uiEnterDontQuitCB"
|
||||||
tooltip="uittChatEnter"
|
tooltip="uittChatEnter"
|
||||||
posparent="cc_dyn"
|
posparent="cc_dyn7"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
x="0"
|
x="0"
|
||||||
y="-8" />
|
y="-8" />
|
||||||
|
@ -1647,11 +1710,19 @@
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
x="0"
|
x="0"
|
||||||
y="-8" />
|
y="-8" />
|
||||||
|
<instance template="tgcw_checkbox"
|
||||||
|
id="show_online_offline_notifications_cb"
|
||||||
|
text="uiShowOnlineOfflineNotifications"
|
||||||
|
tooltip="uittShowOnlineOfflineNotifications"
|
||||||
|
posparent="show_dyn_channel_name_in_chat_cb"
|
||||||
|
posref="BL TL"
|
||||||
|
x="0"
|
||||||
|
y="-8" />
|
||||||
<instance template="tgcw_scrollbarint"
|
<instance template="tgcw_scrollbarint"
|
||||||
id="font_size"
|
id="font_size"
|
||||||
text="uiFontSize"
|
text="uiFontSize"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
posparent="show_dyn_channel_name_in_chat_cb"
|
posparent="show_online_offline_notifications_cb"
|
||||||
x="0"
|
x="0"
|
||||||
y="-8" />
|
y="-8" />
|
||||||
<link expr="@UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
<link expr="@UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
||||||
|
@ -1660,6 +1731,8 @@
|
||||||
target="show_times_in_chat_cb:c:pushed" />
|
target="show_times_in_chat_cb:c:pushed" />
|
||||||
<link expr="@UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
<link expr="@UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||||
target="show_dyn_channel_name_in_chat_cb:c:pushed" />
|
target="show_dyn_channel_name_in_chat_cb:c:pushed" />
|
||||||
|
<link expr="@UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB"
|
||||||
|
target="show_online_offline_notifications_cb:c:pushed" />
|
||||||
</group>
|
</group>
|
||||||
<ctrl style="skin_scroll"
|
<ctrl style="skin_scroll"
|
||||||
id="sb_chat_colors"
|
id="sb_chat_colors"
|
||||||
|
@ -1886,12 +1959,20 @@
|
||||||
posparent="is_user_name"
|
posparent="is_user_name"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
|
<instance template="tgcw_checkbox"
|
||||||
|
id="is_user_rptags"
|
||||||
|
text="uiRpTags"
|
||||||
|
tooltip="uittRpTags"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="is_user_title"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
id="is_user_guild_name"
|
id="is_user_guild_name"
|
||||||
text="uigcGuildName"
|
text="uigcGuildName"
|
||||||
tooltip="uittGuildName"
|
tooltip="uittGuildName"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
posparent="is_user_title"
|
posparent="is_user_rptags"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
|
@ -1995,12 +2076,20 @@
|
||||||
posparent="is_friend_name"
|
posparent="is_friend_name"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
|
<instance template="tgcw_checkbox"
|
||||||
|
id="is_friend_rptags"
|
||||||
|
text="uiRpTags"
|
||||||
|
tooltip="uittRpTags"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="is_friend_title"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
id="is_friend_guild_name"
|
id="is_friend_guild_name"
|
||||||
text="uigcGuildName"
|
text="uigcGuildName"
|
||||||
tooltip="uittGuildName"
|
tooltip="uittGuildName"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
posparent="is_friend_title"
|
posparent="is_friend_rptags"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
|
@ -2112,12 +2201,20 @@
|
||||||
posparent="is_enemy_name"
|
posparent="is_enemy_name"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
|
<instance template="tgcw_checkbox"
|
||||||
|
id="is_enemy_rptags"
|
||||||
|
text="uiRpTags"
|
||||||
|
tooltip="uittRpTags"
|
||||||
|
posref="BL TL"
|
||||||
|
posparent="is_enemy_title"
|
||||||
|
x="0"
|
||||||
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
id="is_enemy_guild_name"
|
id="is_enemy_guild_name"
|
||||||
text="uigcGuildName"
|
text="uigcGuildName"
|
||||||
tooltip="uittGuildName"
|
tooltip="uittGuildName"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
posparent="is_enemy_title"
|
posparent="is_enemy_rptags"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4" />
|
y="-4" />
|
||||||
<instance template="tgcw_checkbox"
|
<instance template="tgcw_checkbox"
|
||||||
|
@ -3095,10 +3192,45 @@
|
||||||
widget="colbut"
|
widget="colbut"
|
||||||
link="UI:SAVE:CHAT:COLORS:SHOUT"
|
link="UI:SAVE:CHAT:COLORS:SHOUT"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
<param ui="chat_colors:cc_dyn:c"
|
<param ui="chat_colors:cc_dyn0:c"
|
||||||
type="db"
|
type="db"
|
||||||
widget="colbut"
|
widget="colbut"
|
||||||
link="UI:SAVE:CHAT:COLORS:DYN"
|
link="UI:SAVE:CHAT:COLORS:DYN:0"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn1:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:1"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn2:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:2"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn3:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:3"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn4:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:4"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn5:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:5"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn6:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:6"
|
||||||
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:cc_dyn7:c"
|
||||||
|
type="db"
|
||||||
|
widget="colbut"
|
||||||
|
link="UI:SAVE:CHAT:COLORS:DYN:7"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
<!--
|
<!--
|
||||||
<param ui="chat_colors:cc_shout:c" type="db" widget="colbut" link="UI:SAVE:CHAT:COLORS:SHOUT" realtime="true" />
|
<param ui="chat_colors:cc_shout:c" type="db" widget="colbut" link="UI:SAVE:CHAT:COLORS:SHOUT" realtime="true" />
|
||||||
|
@ -3120,6 +3252,11 @@
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
link="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
link="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
|
<param ui="chat_colors:show_online_offline_notifications_cb:c"
|
||||||
|
type="db"
|
||||||
|
widget="boolbut"
|
||||||
|
link="UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB"
|
||||||
|
realtime="true" />
|
||||||
<param ui="chat_colors:font_size:c"
|
<param ui="chat_colors:font_size:c"
|
||||||
type="db"
|
type="db"
|
||||||
widget="sbint"
|
widget="sbint"
|
||||||
|
@ -3222,6 +3359,11 @@
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
link="UI:SAVE:INSCENE:USER:TITLE"
|
link="UI:SAVE:INSCENE:USER:TITLE"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
|
<param ui="in_scene_user:is_user_rptags:c"
|
||||||
|
type="db"
|
||||||
|
widget="boolbut"
|
||||||
|
link="UI:SAVE:INSCENE:USER:RPTAGS"
|
||||||
|
realtime="true" />
|
||||||
<param ui="in_scene_user:is_user_guild_name:c"
|
<param ui="in_scene_user:is_user_guild_name:c"
|
||||||
type="db"
|
type="db"
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
|
@ -3272,6 +3414,11 @@
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
link="UI:SAVE:INSCENE:FRIEND:TITLE"
|
link="UI:SAVE:INSCENE:FRIEND:TITLE"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
|
<param ui="in_scene_friend:is_friend_rptags:c"
|
||||||
|
type="db"
|
||||||
|
widget="boolbut"
|
||||||
|
link="UI:SAVE:INSCENE:FRIEND:RPTAGS"
|
||||||
|
realtime="true" />
|
||||||
<param ui="in_scene_friend:is_friend_guild_name:c"
|
<param ui="in_scene_friend:is_friend_guild_name:c"
|
||||||
type="db"
|
type="db"
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
|
@ -3327,6 +3474,11 @@
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
link="UI:SAVE:INSCENE:ENEMY:TITLE"
|
link="UI:SAVE:INSCENE:ENEMY:TITLE"
|
||||||
realtime="true" />
|
realtime="true" />
|
||||||
|
<param ui="in_scene_enemy:is_enemy_rptags:c"
|
||||||
|
type="db"
|
||||||
|
widget="boolbut"
|
||||||
|
link="UI:SAVE:INSCENE:ENEMY:RPTAGS"
|
||||||
|
realtime="true" />
|
||||||
<param ui="in_scene_enemy:is_enemy_guild_name:c"
|
<param ui="in_scene_enemy:is_enemy_guild_name:c"
|
||||||
type="db"
|
type="db"
|
||||||
widget="boolbut"
|
widget="boolbut"
|
||||||
|
|
|
@ -463,27 +463,7 @@
|
||||||
<!-- ***************** -->
|
<!-- ***************** -->
|
||||||
<!-- * GUILD FORUM * -->
|
<!-- * GUILD FORUM * -->
|
||||||
<!-- ***************** -->
|
<!-- ***************** -->
|
||||||
<proc id="guild_forum_proc_active">
|
|
||||||
<action handler="set"
|
|
||||||
params="dblink=UI:VARIABLES:ISACTIVE:GUILD_FORUM|value=1" />
|
|
||||||
<action handler="set"
|
|
||||||
cond="not(%is_guild_present)"
|
|
||||||
params="target='ui:interface:guild_forum:active'|value=0" />
|
|
||||||
<action handler="browse"
|
|
||||||
params="name=ui:interface:guild_forum:content:html|url=home|show=0" />
|
|
||||||
</proc>
|
|
||||||
<proc id="guild_forum_proc_deactive">
|
|
||||||
<action handler="set"
|
|
||||||
params="dblink=UI:VARIABLES:ISACTIVE:GUILD_FORUM|value=0" />
|
|
||||||
</proc>
|
|
||||||
<group type="menu"
|
|
||||||
id="guild_forum_menu"
|
|
||||||
extends="base_menu_with_color">
|
|
||||||
<action id="home"
|
|
||||||
name="uiHOME"
|
|
||||||
handler="browse"
|
|
||||||
params="name=ui:interface:guild_forum:content:html|url=home" />
|
|
||||||
</group>
|
|
||||||
<group type="container"
|
<group type="container"
|
||||||
id="guild_forum"
|
id="guild_forum"
|
||||||
w="480"
|
w="480"
|
||||||
|
@ -531,7 +511,7 @@
|
||||||
w="0"
|
w="0"
|
||||||
h="0"
|
h="0"
|
||||||
posref="TL TL">
|
posref="TL TL">
|
||||||
<group type="forum_html"
|
<group type="html"
|
||||||
id="html"
|
id="html"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
url="home"
|
url="home"
|
||||||
|
@ -828,24 +808,7 @@
|
||||||
<!-- ************** -->
|
<!-- ************** -->
|
||||||
<!-- * MAIL BOX * -->
|
<!-- * MAIL BOX * -->
|
||||||
<!-- ************** -->
|
<!-- ************** -->
|
||||||
<proc id="mailbox_proc_active">
|
|
||||||
<action handler="set"
|
|
||||||
params="dblink=UI:VARIABLES:ISACTIVE:MAILBOX|value=1" />
|
|
||||||
<action handler="browse"
|
|
||||||
params="name=ui:interface:mailbox:content:html|url=home|show=0" />
|
|
||||||
</proc>
|
|
||||||
<proc id="mailbox_proc_deactive">
|
|
||||||
<action handler="set"
|
|
||||||
params="dblink=UI:VARIABLES:ISACTIVE:MAILBOX|value=0" />
|
|
||||||
</proc>
|
|
||||||
<group type="menu"
|
|
||||||
id="mailbox_menu"
|
|
||||||
extends="base_menu_with_color">
|
|
||||||
<action id="home"
|
|
||||||
name="uiHOME"
|
|
||||||
handler="browse"
|
|
||||||
params="name=ui:interface:mailbox:content:html|url=home" />
|
|
||||||
</group>
|
|
||||||
<group type="container"
|
<group type="container"
|
||||||
id="mailbox"
|
id="mailbox"
|
||||||
w="480"
|
w="480"
|
||||||
|
@ -892,7 +855,7 @@
|
||||||
w="0"
|
w="0"
|
||||||
h="0"
|
h="0"
|
||||||
posref="TL TL">
|
posref="TL TL">
|
||||||
<group type="mail_html"
|
<group type="html"
|
||||||
id="html"
|
id="html"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
url="home"
|
url="home"
|
||||||
|
@ -976,8 +939,6 @@
|
||||||
<proc id="webig_proc_active">
|
<proc id="webig_proc_active">
|
||||||
<action handler="set"
|
<action handler="set"
|
||||||
params="dblink=UI:VARIABLES:ISACTIVE:WEBIG|value=1" />
|
params="dblink=UI:VARIABLES:ISACTIVE:WEBIG|value=1" />
|
||||||
<action handler="browse"
|
|
||||||
params="name=ui:interface:webig:content:html|url=home" />
|
|
||||||
</proc>
|
</proc>
|
||||||
<proc id="webig_proc_deactive">
|
<proc id="webig_proc_deactive">
|
||||||
<action handler="set"
|
<action handler="set"
|
||||||
|
@ -1088,7 +1049,7 @@
|
||||||
<group type="webig_html"
|
<group type="webig_html"
|
||||||
id="html"
|
id="html"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
url="http://atys.ryzom.com/start/index.php"
|
url=""
|
||||||
home="http://atys.ryzom.com/start/index.php"
|
home="http://atys.ryzom.com/start/index.php"
|
||||||
sizeref="wh"
|
sizeref="wh"
|
||||||
x="0"
|
x="0"
|
||||||
|
@ -1254,8 +1215,8 @@
|
||||||
<group type="webig_html"
|
<group type="webig_html"
|
||||||
id="html"
|
id="html"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
url="http://atys.ryzom.com/start/app_ig_start.php"
|
url=""
|
||||||
home="http://atys.ryzom.com/start/app_ig_start.php"
|
home="http://atys.ryzom.com/start/init_ig.php"
|
||||||
sizeref="wh"
|
sizeref="wh"
|
||||||
x="0"
|
x="0"
|
||||||
y="0"
|
y="0"
|
||||||
|
|
|
@ -283,17 +283,14 @@ function game:onDrawNpcWebPage()
|
||||||
local utf8Url = ucUrl:toUtf8()
|
local utf8Url = ucUrl:toUtf8()
|
||||||
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
||||||
if isRing then
|
if isRing then
|
||||||
-- when in ring mode, add the parameters ourselves. 60 sec timeout because of zope...
|
|
||||||
-- browseNpcWebPage(uiStr, utf8Url .. game.RingAccessPointFilter:getURLParameters(), false, 60)
|
|
||||||
-- Use new window after revamp
|
|
||||||
--RingAccessPoint:getWindow().active = 1
|
|
||||||
--RingAccessPoint:getWindow():center()
|
|
||||||
--RingAccessPoint:getWindow():blink(1)
|
|
||||||
--RingAccessPoint:show()
|
|
||||||
getUI("ui:interface:npc_web_browser").active = false
|
getUI("ui:interface:npc_web_browser").active = false
|
||||||
runAH(nil, "context_ring_sessions", "")
|
runAH(nil, "context_ring_sessions", "")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
local hideWindow = string.find(utf8Url, "_hideWindow=1") ~= nil
|
||||||
|
if hideWindow then
|
||||||
|
getUI("ui:interface:npc_web_browser").active = false
|
||||||
|
end
|
||||||
self.NpcWebPage.BrowseDone= true;
|
self.NpcWebPage.BrowseDone= true;
|
||||||
browseNpcWebPage(uiStr, utf8Url, true, 10); -- 'true' is for 'add parameters' here. 10 is standard timeout
|
browseNpcWebPage(uiStr, utf8Url, true, 10); -- 'true' is for 'add parameters' here. 10 is standard timeout
|
||||||
end
|
end
|
||||||
|
@ -302,9 +299,9 @@ function game:onDrawNpcWebPage()
|
||||||
-- if this is a ring window, then only the refresh button to access to filter will be available
|
-- if this is a ring window, then only the refresh button to access to filter will be available
|
||||||
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
||||||
local browser = getUI("ui:interface:npc_web_browser")
|
local browser = getUI("ui:interface:npc_web_browser")
|
||||||
browser:find("browse_redo").active = not isRing
|
browser:find("browse_redo").active = true
|
||||||
browser:find("browse_undo").active = not isRing
|
browser:find("browse_undo").active = true
|
||||||
browser:find("browse_refresh").active = isRing
|
browser:find("browse_refresh").active = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -978,6 +975,7 @@ function RingPlayerInfo:tooltipRRPs(dbBase, ttFormat)
|
||||||
setContextHelpText(fmt);
|
setContextHelpText(fmt);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------
|
||||||
--
|
--
|
||||||
function RingPlayerInfo:tooltipRingRating(level, progress, ttFormat)
|
function RingPlayerInfo:tooltipRingRating(level, progress, ttFormat)
|
||||||
|
@ -1012,6 +1010,27 @@ function RingPlayerInfo:getLevelRatingAndImprovementRate(val)
|
||||||
return level, progress
|
return level, progress
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
function game:updateOrganization(path, uiOrgText, uiStatusText, uiPointsText)
|
||||||
|
|
||||||
|
local org = getDbProp(path.."1:VALUE")
|
||||||
|
getUICaller()[uiOrgText].uc_hardtext = i18n.get('uiOrganization_' .. org)
|
||||||
|
|
||||||
|
local status = getDbProp(path.."2:VALUE")
|
||||||
|
getUICaller()[uiStatusText].uc_hardtext= status
|
||||||
|
|
||||||
|
local points = getDbProp(path.."3:VALUE")
|
||||||
|
getUICaller()[uiPointsText].uc_hardtext= points
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------------------------
|
||||||
|
function game:organizationTooltip()
|
||||||
|
-- set the tooltip in InterfaceManager
|
||||||
|
setContextHelpText( i18n.get('uittOrganization') );
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------
|
||||||
function game:popMissionList()
|
function game:popMissionList()
|
||||||
|
@ -1393,6 +1412,8 @@ end
|
||||||
function game:onMainLoopBegin()
|
function game:onMainLoopBegin()
|
||||||
game.InGameDbInitialized = false
|
game.InGameDbInitialized = false
|
||||||
game.PrevSessionMission = getDbProp("UI:VARIABLES:MISSION_SELECTED_PREV_SESSION")
|
game.PrevSessionMission = getDbProp("UI:VARIABLES:MISSION_SELECTED_PREV_SESSION")
|
||||||
|
|
||||||
|
debugInfo("onMainLoopBegin()")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -1408,6 +1429,29 @@ function game:onInGameDbInitialized()
|
||||||
if game.PrevSessionMission ~= -1 then
|
if game.PrevSessionMission ~= -1 then
|
||||||
self:setCurrentMission(game.PrevSessionMission)
|
self:setCurrentMission(game.PrevSessionMission)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
game:setInfoPlayerCharacterRace()
|
||||||
|
end
|
||||||
|
|
||||||
|
function game:onWebIgReady()
|
||||||
|
-- Call init webig
|
||||||
|
getUI("ui:interface:web_transactions:content:html"):browse("home")
|
||||||
|
getUI("ui:interface:webig:content:html"):browse("home")
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
-- handler called by C++ at the start of a far TP (log to char selection or far tp)
|
||||||
|
function game:onFarTpStart()
|
||||||
|
debugInfo("game:onFarTpStart()")
|
||||||
|
--game:deinitWebIgApps()
|
||||||
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
-- handler called by C++ after characer reselection or the end of a far TP
|
||||||
|
function game:onFarTpEnd()
|
||||||
|
debugInfo("game:onFarTpEnd()")
|
||||||
|
--game:preInitWebIgApps()
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1415,8 +1459,8 @@ end
|
||||||
function game:onMainLoopEnd()
|
function game:onMainLoopEnd()
|
||||||
game.InGameDbInitialized = false
|
game.InGameDbInitialized = false
|
||||||
game:updateMissionJournalFixedEntry()
|
game:updateMissionJournalFixedEntry()
|
||||||
end
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------
|
||||||
-- ring journal on / off
|
-- ring journal on / off
|
||||||
|
@ -1471,6 +1515,11 @@ function game:onNewMissionStepAdded(stepIndex)
|
||||||
local missionWnd = getMissionWindow()
|
local missionWnd = getMissionWindow()
|
||||||
local missionIndex = getDbProp("UI:SAVE:MISSION_SELECTED")
|
local missionIndex = getDbProp("UI:SAVE:MISSION_SELECTED")
|
||||||
local dbPath
|
local dbPath
|
||||||
|
|
||||||
|
if missionIndex < 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- debugInfo("New Step")
|
-- debugInfo("New Step")
|
||||||
if missionIndex < 15 then
|
if missionIndex < 15 then
|
||||||
dbPath = "SERVER:MISSIONS:" .. tostring(missionIndex) .. ":GOALS:" .. tostring(stepIndex) .. ":TEXT"
|
dbPath = "SERVER:MISSIONS:" .. tostring(missionIndex) .. ":GOALS:" .. tostring(stepIndex) .. ":TEXT"
|
||||||
|
@ -1651,3 +1700,64 @@ function game:getRPJobs()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------------------
|
||||||
|
function game:setInfoPlayerCharacterRace()
|
||||||
|
getUI("ui:interface:info_player_skills:content:basics_skills:character_race_name").uc_hardtext = i18n.get("io"..getUserRace())
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------------------------------------------------------------
|
||||||
|
-- game.preInitTimer = 0
|
||||||
|
-- function game:preInitWebIgAppsLoop()
|
||||||
|
-- if game.preInitTimer == nil then game.preInitTimer = 0 end
|
||||||
|
|
||||||
|
-- game.preInitTimer = game.preInitTimer - 1
|
||||||
|
-- if (not game.preWebIgAppsInitialized) and game.preInitTimer < 0 then
|
||||||
|
-- debugInfo("initWebIgAppsLoop(): calling app_ig_preinit.php")
|
||||||
|
-- getUI("ui:interface:web_transactions:content:html"):browse("http://atys.ryzom.com/start/app_ig_preinit.php")
|
||||||
|
-- game.preInitTimer = getDbProp("UI:SAVE:WEBIG_RETRY_DELAY")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- if game.preWebIgAppsInitialized then
|
||||||
|
-- debugInfo("preInitWebIgAppsLoop(): Calling removeOnDbChange()")
|
||||||
|
-- removeOnDbChange(getUI("ui:interface"), "@UI:VARIABLES:CURRENT_SERVER_TICK")
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- --------------------------------------------------------------------------------------------------------------
|
||||||
|
-- function game:preInitWebIgApps()
|
||||||
|
-- debugInfo("game:preInitWebIgApps()")
|
||||||
|
-- addOnDbChange(getUI("ui:interface"), "@UI:VARIABLES:CURRENT_SERVER_TICK", "game:preInitWebIgAppsLoop()")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- --------------------------------------------------------------------------------------------------------------
|
||||||
|
-- game.postInitTimer = 0
|
||||||
|
-- function game:postInitWebIgAppsLoop()
|
||||||
|
-- if game.postInitTimer == nil then game.postInitTimer = 0 end
|
||||||
|
|
||||||
|
-- game.postInitTimer = game.postInitTimer - 1
|
||||||
|
-- if game.postInitTimer < 0 then
|
||||||
|
-- debugInfo("initWebIgAppsLoop(): calling app_ig_postinit.php")
|
||||||
|
-- getUI("ui:interface:web_transactions:content:html"):browse("http://atys.ryzom.com/start/app_ig_postinit.php")
|
||||||
|
-- game.postInitTimer = getDbProp("UI:SAVE:WEBIG_RETRY_DELAY")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- if game.postWebIgAppsInitialized then
|
||||||
|
-- debugInfo("postInitWebIgAppsLoop(): Calling removeOnDbChange()")
|
||||||
|
-- removeOnDbChange(getUI("ui:interface:milko_pad"), "@UI:VARIABLES:CURRENT_SERVER_TICK")
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- --------------------------------------------------------------------------------------------------------------
|
||||||
|
-- function game:postInitWebIgApps()
|
||||||
|
-- debugInfo("game:postInitWebIgApps()")
|
||||||
|
-- addOnDbChange(getUI("ui:interface:milko_pad"), "@UI:VARIABLES:CURRENT_SERVER_TICK", "game:postInitWebIgAppsLoop()")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- --------------------------------------------------------------------------------------------------------------
|
||||||
|
-- function game:deinitWebIgApps()
|
||||||
|
-- debugInfo("game:deinitWebIgApps()")
|
||||||
|
-- game.preWebIgAppsInitialized = nil
|
||||||
|
-- game.postWebIgAppsInitialized = nil
|
||||||
|
-- titleSetted = nil
|
||||||
|
-- end
|
||||||
|
|
|
@ -676,54 +676,32 @@
|
||||||
y="0"
|
y="0"
|
||||||
h="0"
|
h="0"
|
||||||
posref="TL TL">
|
posref="TL TL">
|
||||||
<group id="title"
|
|
||||||
posref="TL TL"
|
|
||||||
sizeref="w"
|
|
||||||
w="-1"
|
|
||||||
h="24"
|
|
||||||
y="-22">
|
|
||||||
<view type="text"
|
<view type="text"
|
||||||
id="player_title_txt"
|
id="character_race_title"
|
||||||
|
posparent="basics_skills"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
x="0"
|
x="0"
|
||||||
y="-4"
|
y="-24"
|
||||||
hardtext="uiPlayerTitle"
|
hardtext="uiRaceBold"
|
||||||
shadow="true"
|
shadow="true"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
global_color="false"
|
global_color="false"
|
||||||
fontsize="12" />
|
fontsize="12" />
|
||||||
<group type="combo_box"
|
<view type="text"
|
||||||
id="player_title"
|
id="character_race_name"
|
||||||
w="300"
|
posparent="character_race_title"
|
||||||
h="20"
|
|
||||||
value="UI:TITLE"
|
|
||||||
posparent="player_title_txt"
|
|
||||||
posref="TR TL"
|
posref="TR TL"
|
||||||
x="4"
|
shadow="true"
|
||||||
y="4"
|
color="255 200 55 255"
|
||||||
on_select_start="title_combobox_button">
|
global_color="false"
|
||||||
<instance template="combo_box_def1" />
|
x="2"
|
||||||
</group>
|
fontsize="12"
|
||||||
<instance template="text_tt"
|
hardtext="" />
|
||||||
posparent="player_title"
|
|
||||||
tooltip="uittIdentityTitle" />
|
|
||||||
<link expr="@UI:TITLE"
|
|
||||||
action="title_combobox_changed" />
|
|
||||||
</group>
|
|
||||||
<ctrl style="text_button_16"
|
|
||||||
id="inf"
|
|
||||||
posref="TR TR"
|
|
||||||
y="-24"
|
|
||||||
wmargin="8"
|
|
||||||
hardtext="uiInfo"
|
|
||||||
tooltip="uittIdentityInfo"
|
|
||||||
onclick_l="open_title_help"
|
|
||||||
params_l="from=user" />
|
|
||||||
<group id="guild"
|
<group id="guild"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
sizeref="w"
|
sizeref="w"
|
||||||
h="14"
|
h="14"
|
||||||
y="-52">
|
y="-48">
|
||||||
<view type="text"
|
<view type="text"
|
||||||
id="guild_title"
|
id="guild_title"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
|
@ -1231,23 +1209,23 @@
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
y="0"
|
y="0"
|
||||||
val="%player_protect_cold" />
|
val="%player_protect_cold" />
|
||||||
<instance template="tipc_magic_protect"
|
|
||||||
id="Fire"
|
|
||||||
posparent="Cold"
|
|
||||||
posref="BL TL"
|
|
||||||
y="0"
|
|
||||||
val="%player_protect_fire" />
|
|
||||||
<instance template="tipc_magic_protect"
|
<instance template="tipc_magic_protect"
|
||||||
id="Rot"
|
id="Rot"
|
||||||
posparent="Fire"
|
posparent="Cold"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
y="0"
|
y="0"
|
||||||
val="%player_protect_rot" />
|
val="%player_protect_rot" />
|
||||||
<instance template="tipc_magic_protect"
|
<instance template="tipc_magic_protect"
|
||||||
id="Shockwave"
|
id="Fire"
|
||||||
posparent="Rot"
|
posparent="Rot"
|
||||||
posref="BL TL"
|
posref="BL TL"
|
||||||
y="0"
|
y="0"
|
||||||
|
val="%player_protect_fire" />
|
||||||
|
<instance template="tipc_magic_protect"
|
||||||
|
id="Shockwave"
|
||||||
|
posparent="Fire"
|
||||||
|
posref="BL TL"
|
||||||
|
y="0"
|
||||||
val="%player_protect_shockwave" />
|
val="%player_protect_shockwave" />
|
||||||
<instance template="tipc_magic_protect"
|
<instance template="tipc_magic_protect"
|
||||||
id="Poison"
|
id="Poison"
|
||||||
|
@ -1420,9 +1398,60 @@
|
||||||
fontsize="12" />
|
fontsize="12" />
|
||||||
<instance template="faction_points_widget"
|
<instance template="faction_points_widget"
|
||||||
id="fp"
|
id="fp"
|
||||||
|
posparent="ecosystem_points"
|
||||||
|
posref="BL TL"
|
||||||
|
x="0"
|
||||||
|
y="-10" />
|
||||||
|
<group id="pvp_points"
|
||||||
|
posparent="fp"
|
||||||
|
posref="BL TL"
|
||||||
|
sizeref="wh"
|
||||||
|
w="-1"
|
||||||
|
h="40"
|
||||||
|
y="-10">
|
||||||
|
<view type="text"
|
||||||
|
id="pvppoints_t"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
x="0"
|
x="0"
|
||||||
y="-150" />
|
y="0"
|
||||||
|
hardtext="uiPvpPoints"
|
||||||
|
shadow="true"
|
||||||
|
color="255 255 255 255"
|
||||||
|
global_color="false"
|
||||||
|
fontsize="12" />
|
||||||
|
<group id="black"
|
||||||
|
posref="TL TL"
|
||||||
|
x="0"
|
||||||
|
sizeref="w"
|
||||||
|
y="-14"
|
||||||
|
w="0"
|
||||||
|
h="26"
|
||||||
|
inherit_gc_alpha="true">
|
||||||
|
<view type="text"
|
||||||
|
id="total"
|
||||||
|
posref="ML ML"
|
||||||
|
x="8"
|
||||||
|
y="0"
|
||||||
|
hardtext="uiPvpTotal"
|
||||||
|
shadow="true"
|
||||||
|
color="255 255 255 255"
|
||||||
|
global_color="true"
|
||||||
|
fontsize="12" />
|
||||||
|
<view type="text_number"
|
||||||
|
id="val"
|
||||||
|
posref="MR MR"
|
||||||
|
x="-8"
|
||||||
|
y="0"
|
||||||
|
color="255 255 255 255"
|
||||||
|
global_color="true"
|
||||||
|
fontsize="12"
|
||||||
|
value="SERVER:USER:RRPS_LEVELS0:VALUE"
|
||||||
|
shadow="true" />
|
||||||
|
</group>
|
||||||
|
<instance template="inner_thin_border"
|
||||||
|
posparent="black"
|
||||||
|
inherit_gc_alpha="true" />
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group h="0" id="rpjobs" posref="TL TL" sizeref="wh" w="0" y="0">
|
<group h="0" id="rpjobs" posref="TL TL" sizeref="wh" w="0" y="0">
|
||||||
<ctrl style="text_button_header"
|
<ctrl style="text_button_header"
|
||||||
|
@ -1514,11 +1543,57 @@
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group h="0" id="webinfos" posref="TL TL" sizeref="wh" w="0" y="0">
|
<group h="0" id="webinfos" posref="TL TL" sizeref="wh" w="0" y="0">
|
||||||
|
<group id="title"
|
||||||
|
posref="TL TL"
|
||||||
|
sizeref="w"
|
||||||
|
active="true"
|
||||||
|
w="-1"
|
||||||
|
h="24"
|
||||||
|
y="-8">
|
||||||
|
<view type="text"
|
||||||
|
id="player_title_txt"
|
||||||
|
posref="TL TL"
|
||||||
|
x="8"
|
||||||
|
y="-4"
|
||||||
|
hardtext="uiPlayerTitle"
|
||||||
|
shadow="true"
|
||||||
|
color="255 255 255 255"
|
||||||
|
global_color="false"
|
||||||
|
fontsize="12" />
|
||||||
|
<group type="combo_box"
|
||||||
|
id="player_title"
|
||||||
|
w="300"
|
||||||
|
h="20"
|
||||||
|
value="UI:TITLE"
|
||||||
|
posparent="player_title_txt"
|
||||||
|
posref="TR TL"
|
||||||
|
x="4"
|
||||||
|
y="4"
|
||||||
|
on_select_start="title_combobox_button">
|
||||||
|
<instance template="combo_box_def1" />
|
||||||
|
</group>
|
||||||
|
<instance template="text_tt"
|
||||||
|
posparent="player_title"
|
||||||
|
tooltip="uittIdentityTitle" />
|
||||||
|
<link expr="@UI:TITLE"
|
||||||
|
action="title_combobox_changed" />
|
||||||
|
</group>
|
||||||
|
<ctrl style="text_button_16"
|
||||||
|
id="inf"
|
||||||
|
posref="TR TR"
|
||||||
|
active="true"
|
||||||
|
y="-9"
|
||||||
|
wmargin="8"
|
||||||
|
hardtext="uiInfo"
|
||||||
|
tooltip="uittIdentityInfo"
|
||||||
|
onclick_l="open_title_help"
|
||||||
|
params_l="from=user" />
|
||||||
<ctrl style="text_button_header"
|
<ctrl style="text_button_header"
|
||||||
button_type="push_button"
|
button_type="push_button"
|
||||||
id="browse_home"
|
id="browse_home"
|
||||||
posref="TR TR"
|
posref="BR TR"
|
||||||
x="-1"
|
posparent="title"
|
||||||
|
x="0"
|
||||||
y="-2"
|
y="-2"
|
||||||
hardtext="uiBrowseRefresh"
|
hardtext="uiBrowseRefresh"
|
||||||
tooltip="uittBrowseRefresh"
|
tooltip="uittBrowseRefresh"
|
||||||
|
@ -1533,7 +1608,7 @@
|
||||||
title_prefix=""
|
title_prefix=""
|
||||||
sizeref="wh"
|
sizeref="wh"
|
||||||
x="0"
|
x="0"
|
||||||
y="-8"
|
y="-42"
|
||||||
w="0"
|
w="0"
|
||||||
h="0"
|
h="0"
|
||||||
background_color="0 0 0 255"
|
background_color="0 0 0 255"
|
||||||
|
@ -1905,7 +1980,7 @@
|
||||||
<group id="content"
|
<group id="content"
|
||||||
x="0"
|
x="0"
|
||||||
y="0"
|
y="0"
|
||||||
h="272"
|
h="300"
|
||||||
posref="TL TL">
|
posref="TL TL">
|
||||||
<group id="you"
|
<group id="you"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
|
@ -2004,7 +2079,7 @@
|
||||||
id="kami"
|
id="kami"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
x="4"
|
x="4"
|
||||||
y="-180"
|
y="-160"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
shadow="true"
|
shadow="true"
|
||||||
|
@ -2013,7 +2088,7 @@
|
||||||
id="karavan"
|
id="karavan"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
x="4"
|
x="4"
|
||||||
y="-210"
|
y="-190"
|
||||||
color="255 255 255 255"
|
color="255 255 255 255"
|
||||||
fontsize="10"
|
fontsize="10"
|
||||||
shadow="true"
|
shadow="true"
|
||||||
|
@ -2021,7 +2096,7 @@
|
||||||
<group id="cult_allegiance_group"
|
<group id="cult_allegiance_group"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
x="4"
|
x="4"
|
||||||
y="-240"
|
y="-220"
|
||||||
child_resize_h="true"
|
child_resize_h="true"
|
||||||
child_resize_w="true">
|
child_resize_w="true">
|
||||||
<view type="text"
|
<view type="text"
|
||||||
|
@ -2090,6 +2165,87 @@
|
||||||
id="fb5"
|
id="fb5"
|
||||||
x="100"
|
x="100"
|
||||||
path="SERVER:FAME:PLAYER5" />
|
path="SERVER:FAME:PLAYER5" />
|
||||||
|
<view type="text"
|
||||||
|
id="organization_text"
|
||||||
|
posref="TL TL"
|
||||||
|
x="0"
|
||||||
|
y="-245"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="true"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="uiOrganization" />
|
||||||
|
<group id="organization"
|
||||||
|
posref="TL TL"
|
||||||
|
x="2"
|
||||||
|
y="-260"
|
||||||
|
h="34"
|
||||||
|
w="-4"
|
||||||
|
sizeref="w" >
|
||||||
|
<view type="text"
|
||||||
|
id="name"
|
||||||
|
posref="TL TL"
|
||||||
|
x="2"
|
||||||
|
y="-5"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="false"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="" />
|
||||||
|
<view type="text"
|
||||||
|
id="text_points"
|
||||||
|
posref="BL BL"
|
||||||
|
x="4"
|
||||||
|
y="2"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="true"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="uiPoints" />
|
||||||
|
<view type="text"
|
||||||
|
id="points"
|
||||||
|
posparent="text_points"
|
||||||
|
posref="MR ML"
|
||||||
|
x="4"
|
||||||
|
y="0"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="false"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="0" />
|
||||||
|
<view type="text"
|
||||||
|
id="status"
|
||||||
|
posref="BR BR"
|
||||||
|
x="-4"
|
||||||
|
y="2"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="false"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="0" />
|
||||||
|
<view type="text"
|
||||||
|
id="text_status"
|
||||||
|
posparent="status"
|
||||||
|
posref="ML MR"
|
||||||
|
x="-4"
|
||||||
|
y="0"
|
||||||
|
color="255 255 255 255"
|
||||||
|
fontsize="10"
|
||||||
|
global_color="true"
|
||||||
|
shadow="true"
|
||||||
|
hardtext="uiSkillJobLVL" />
|
||||||
|
<link expr="@SERVER:USER:RRPS_LEVELS1"
|
||||||
|
action="lua:game:updateOrganization('SERVER:USER:RRPS_LEVELS', 'name', 'status', 'points')" />
|
||||||
|
<link expr="@SERVER:USER:RRPS_LEVELS2"
|
||||||
|
action="lua:game:updateOrganization('SERVER:USER:RRPS_LEVELS', 'name', 'status', 'points')" />
|
||||||
|
<link expr="@SERVER:USER:RRPS_LEVELS3"
|
||||||
|
action="lua:game:updateOrganization('SERVER:USER:RRPS_LEVELS', 'name', 'status', 'points')" />
|
||||||
|
<instance template="text_tt"
|
||||||
|
posparent="parent"
|
||||||
|
on_tooltip="lua:game:organizationTooltip()" />
|
||||||
|
<instance template="inner_thin_border"
|
||||||
|
inherit_gc_alpha="true" />
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group id="guild"
|
<group id="guild"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
|
|
|
@ -301,7 +301,6 @@
|
||||||
<view type="bitmap"
|
<view type="bitmap"
|
||||||
id="tag_1"
|
id="tag_1"
|
||||||
posref="TL TL"
|
posref="TL TL"
|
||||||
posparent="pvp_tags"
|
|
||||||
x="2"
|
x="2"
|
||||||
y="0"
|
y="0"
|
||||||
texture="alpha_10.tga"
|
texture="alpha_10.tga"
|
||||||
|
@ -2116,7 +2115,14 @@
|
||||||
name="uimDismiss"
|
name="uimDismiss"
|
||||||
handler="dismiss_member"
|
handler="dismiss_member"
|
||||||
params="" />
|
params="" />
|
||||||
<!-- <action id="successor" name="uimSetSuccesor" handler="set_successor" params=""/>-->
|
<action id="leader"
|
||||||
|
name="uimSetTeamLeader"
|
||||||
|
handler="set_team_leader"
|
||||||
|
params=""/>
|
||||||
|
<action id="successor"
|
||||||
|
name="uimSetSuccesor"
|
||||||
|
handler="set_successor"
|
||||||
|
params=""/>
|
||||||
<!-- <action id="emote" name="uimEmotes" hanlder="" params="">
|
<!-- <action id="emote" name="uimEmotes" hanlder="" params="">
|
||||||
<action id="emote1" name="uimEmote1" handler="emote" params="emote_id=0"/>
|
<action id="emote1" name="uimEmote1" handler="emote" params="emote_id=0"/>
|
||||||
<action id="emote2" name="uimEmote2" handler="emote" params="emote_id=1"/>
|
<action id="emote2" name="uimEmote2" handler="emote" params="emote_id=1"/>
|
||||||
|
@ -2147,6 +2153,10 @@
|
||||||
<!-- links to enable leader options -->
|
<!-- links to enable leader options -->
|
||||||
<link expr="eq(band(@SERVER:GROUP:LEADER_INDEX, 15), 15)"
|
<link expr="eq(band(@SERVER:GROUP:LEADER_INDEX, 15), 15)"
|
||||||
target="ui:interface:team_member_menu:dismiss:active" />
|
target="ui:interface:team_member_menu:dismiss:active" />
|
||||||
|
<link expr="eq(band(@SERVER:GROUP:LEADER_INDEX, 15), 15)"
|
||||||
|
target="ui:interface:team_member_menu:leader:active" />
|
||||||
|
<link expr="eq(band(@SERVER:GROUP:LEADER_INDEX, 15), 15)"
|
||||||
|
target="ui:interface:team_member_menu:successor:active" />
|
||||||
<!-- menu on the chat of the team for the leader -->
|
<!-- menu on the chat of the team for the leader -->
|
||||||
<group type="menu"
|
<group type="menu"
|
||||||
id="team_chat_leader_menu"
|
id="team_chat_leader_menu"
|
||||||
|
@ -2481,21 +2491,13 @@
|
||||||
<view type="text"
|
<view type="text"
|
||||||
id="text"
|
id="text"
|
||||||
posref="TM TM"
|
posref="TM TM"
|
||||||
color="233 197 42 255"
|
color="42 197 233 255"
|
||||||
x="10"
|
x="10"
|
||||||
y="-10"
|
y="-10"
|
||||||
fontsize="14"
|
fontsize="12"
|
||||||
global_color="false"
|
global_color="false"
|
||||||
shadow="true"
|
shadow="true"
|
||||||
hardtext="uiJoinDuelProposal" />
|
hardtext="uiJoinLeagueProposal" />
|
||||||
<view type="bitmap"
|
|
||||||
id="warning"
|
|
||||||
posparent="text"
|
|
||||||
posref="ML MR"
|
|
||||||
y="4"
|
|
||||||
x="-4"
|
|
||||||
global_color="false"
|
|
||||||
texture="w_warning.tga" />
|
|
||||||
<group id="content"
|
<group id="content"
|
||||||
child_resize_h="true"
|
child_resize_h="true"
|
||||||
child_resize_hmargin="10">
|
child_resize_hmargin="10">
|
||||||
|
|
|
@ -206,6 +206,7 @@ SYNTAXE:
|
||||||
positive="true"
|
positive="true"
|
||||||
suffix=""
|
suffix=""
|
||||||
prefix=""
|
prefix=""
|
||||||
|
format="false" // make the number thousands formatted
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -676,8 +676,7 @@
|
||||||
<!-- Simple Message Box with just a OK button -->
|
<!-- Simple Message Box with just a OK button -->
|
||||||
<group type="modal" id="message_box" exit_click_out="true" posparent="char3d" posref="MM MM" w="250" child_resize_h="true" child_resize_hmargin="100"
|
<group type="modal" id="message_box" exit_click_out="true" posparent="char3d" posref="MM MM" w="250" child_resize_h="true" child_resize_hmargin="100"
|
||||||
on_enter="leave_modal" mouse_pos="false" escapable="false"
|
on_enter="leave_modal" mouse_pos="false" escapable="false"
|
||||||
display="false"
|
display="false">
|
||||||
>
|
|
||||||
<instance template="outgame_popup" id="back" posref="TL TL" />
|
<instance template="outgame_popup" id="back" posref="TL TL" />
|
||||||
|
|
||||||
<view type="text" id="text" posref="TL TL" line_maxw="234" x="8" y="-56" w="0" h="0" color="255 255 255 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
|
<view type="text" id="text" posref="TL TL" line_maxw="234" x="8" y="-56" w="0" h="0" color="255 255 255 255" fontsize="12" shadow="true" multi_line="true" multi_line_space="0" case_mode="%case_first_sentence_letter_up"/>
|
||||||
|
@ -687,15 +686,9 @@
|
||||||
onclick_l="leave_modal" />
|
onclick_l="leave_modal" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
<group id="webstart" posref="MM MM" w="800" h="600" active="true" >
|
||||||
|
<group id="content" x="0" y="0" w="800" h="600" posref="MM MM" >
|
||||||
|
<group id="webstart_html" type="html" posref="MM MM"
|
||||||
|
|
||||||
|
|
||||||
<!-- Web box
|
|
||||||
<group id="webstart" posref="BR BR" w="200" h="200" active="true" >
|
|
||||||
<group id="content" x="0" y="0" w="200" h="200" posref="TL TL" >
|
|
||||||
<group type="html" id="webstart_html" posref="TL TL"
|
|
||||||
url=""
|
url=""
|
||||||
title_prefix="uiQuickhelpTitle"
|
title_prefix="uiQuickhelpTitle"
|
||||||
sizeref="wh" x="0" y="0" w="-40" h="-40"
|
sizeref="wh" x="0" y="0" w="-40" h="-40"
|
||||||
|
@ -739,7 +732,6 @@
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
-->
|
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
|