Merge: Default to build pipeline branch.

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
commit 17f0f1fa43

@ -14,17 +14,22 @@ FIND_PATH(DXSDK_DIR
"Include/dxsdkver.h"
PATHS
"$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)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
PATHS
"${DXSDK_LIBRARY_DIR}"
"$ENV{DXSDK_DIR}"
"$ENV{DXSDK_DIR}/Lib"
"$ENV{DXSDK_DIR}/Lib/x86"
)
"${DXSDK_LIBRARY_DIR}"
)
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
IF(DXSDK_DIR)

@ -37,7 +37,9 @@ ENDMACRO(NL_TARGET_DRIVER)
# Argument:
###
MACRO(NL_DEFAULT_PROPS name label)
SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
IF(NOT MSVC10)
SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
ENDIF(NOT MSVC10)
GET_TARGET_PROPERTY(type ${name} TYPE)
IF(${type} STREQUAL 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 "Debug")
# Determine target CPU
# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
IF(NOT CMAKE_SIZEOF_VOID_P)
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
SET(HOST_CPU ${CMAKE_SYSTEM_PROCESSOR})
# Using 32 or 64 bits libraries
# Determine target CPU
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)
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
# Using 32 or 64 bits libraries
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(TARGET_CPU "x86_64")
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(TARGET_CPU "x86")
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ENDIF(HOST_CPU MATCHES "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(TARGET_CPU STREQUAL "x86_64")
SET(TARGET_X64 1)
SET(PLATFORM_CFLAGS "-DHAVE_X86_64")
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ARCH "x86_64")
SET(TARGET_X64 1)
ADD_DEFINITIONS(-DHAVE_X86_64)
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(ARCH "x86")
ADD_DEFINITIONS(-DHAVE_X86)
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
# ADD_DEFINITIONS(-DHAVE_IA64)
# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
SET(PLATFORM_CFLAGS "-DHAVE_X86")
ENDIF(TARGET_CPU STREQUAL "x86_64")
IF(WIN32)
# 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)
# /Ox is working with VC++ 2010, but custom optimizations don't exist
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_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
ELSE(WIN32)
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")
ELSE(MSVC)
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)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
@ -382,12 +432,12 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
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)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
ENDIF(WIN32)
ENDIF(MSVC)
ENDMACRO(NL_SETUP_BUILD)
MACRO(NL_SETUP_BUILD_FLAGS)
@ -451,7 +501,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
ELSE(WIN32)
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
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.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
ENDIF(NOT NL_LIB_PREFIX)
@ -460,7 +514,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
ELSE(WIN32)
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
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.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
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
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).
/// The program will be launched in the current directory

@ -146,6 +146,8 @@ public:
TAdditionalInfoCb EntityInfoCallback;
static void removeShardFromName(ucstring& name);
private:
// get all eid for a user using the user name or the user id
void getByUser (uint32 uid, std::vector<NLMISC::CEntityId> &res);

@ -49,7 +49,7 @@ public:
* \param server
*/
virtual void submitEvents(CEventServer & server, bool allWindows) = 0;
/**
* Instruct the event emitter to send CGDMouseMove instead of CEventMouseMove.
*

@ -75,7 +75,7 @@ public:
enum TProp {
PropUInt8, PropUInt16, PropUInt32, PropUInt64,
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 };
@ -160,6 +160,7 @@ public:
case PropString: nlassert(sizeof(T) == sizeof (std::string)); break;
// case PropEntityId: nlassert(sizeof(T) == sizeof (NLMISC::CEntityId)); 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);
}

@ -1228,7 +1228,7 @@ bool CDriverD3D::init (uint windowIcon, emptyProc exitFunc)
ExitFunc = exitFunc;
createCursors();
// Register a window class
WNDCLASSW wc;

@ -138,7 +138,7 @@ void CDriverGL::setLightInternal(uint8 num, const CLight& light)
}
else
{
// Deactivate spot properties
// Disable spot properties
#ifdef USE_OPENGLES
glLightf (lightNum, GL_SPOT_CUTOFF, 180.f);
glLightf (lightNum, GL_SPOT_EXPONENT, 0.f);

@ -978,7 +978,7 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb)
// Check type
nlassert (vb.Type[CVertexBuffer::Normal]==CVertexBuffer::Float3);
_DriverGLStates.enableNormalArray(true);
nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Normal]);
nglArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Normal]);
}
else
{

@ -58,7 +58,7 @@ bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow syst
CNELU::Driver = NULL;
// Init driver.
#if defined(NL_OS_WINDOWS)
#ifdef NL_OS_WINDOWS
if (direct3d)
{
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");
return false;
}
if (!CNELU::Driver->init())
{
nlwarning ("CNELU::initDriver: init() failed");

@ -30,6 +30,7 @@
#include "nel/misc/command.h"
#include "nel/misc/path.h"
#include "nel/misc/i18n.h"
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

@ -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
void cbInvalidEntityNamesFilename(const std::string &invalidEntityNamesFilename)
{

@ -178,7 +178,7 @@ static const CStringConversion<TKey>::CPair stringTable [] =
{ "KeyZOOM", KeyZOOM },
{ "KeyNONAME", KeyNONAME },
{ "KeyPA1", KeyPA1 },
{ "KeyOEM_CLEAR", KeyOEM_CLEAR },
{ "KeyOEM_CLEAR", KeyOEM_CLEAR }
};

@ -643,6 +643,8 @@ bool CRGBA::convertToHLS(float &h, float &l, float &s) const
{
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)
{
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
h = (g - b) / diff;
}
#else
else
{
h = 4.f + (r - g) / diff;
}
#endif
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)
_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
if (wParam < KeyCount)
server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));

@ -77,7 +77,7 @@ string typeToString (CTransportClass::TProp type)
string conv[] = {
"PropUInt8", "PropUInt16", "PropUInt32", "PropUInt64",
"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" };
if (type > CTransportClass::PropUKN)
@ -352,6 +352,7 @@ void CTransportClass::init ()
// nlassert (PropDataSetRow < PropUKN); DummyProp[PropDataSetRow] = new CTransportClass::CRegisteredProp<TDataSetRow>;
// nlassert (PropEntityId < PropUKN); DummyProp[PropEntityId] = new CTransportClass::CRegisteredProp<CEntityId>;
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)
CUnifiedNetwork::getInstance()->setServiceUpCallback("*", cbTCUpService, NULL, false);

@ -354,8 +354,8 @@ SystemInfoColors =
// NEW System Info Categories
"SYS", "255 255 255 255 normal", // Default system messages
"BC", "255 255 255 255 center", // Broadcast messages
"TAGBC", "255 255 255 255 center", // Taged broadcast messages : color should remain white as some word are tagged
"BC", "255 255 255 255 centeraround", // Broadcast messages
"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
"SP", "255 255 64 255 over", // SP Gain
"TTL", "255 255 64 255 over", // Title
@ -443,23 +443,24 @@ R2EDReloadFiles = {
XMLInterfaceFiles = {
"config.xml",
"widgets.xml",
"webig_widgets.xml",
"player.xml",
"inventory.xml",
"interaction.xml",
"phrase.xml",
"phrase.xml",
"harvest.xml",
"macros.xml",
"info_player.xml",
"outpost.xml",
"guild.xml",
"taskbar.xml",
"game_config.xml",
"game_config.xml",
"game_context_menu.xml",
"player_trade.xml",
"bot_chat_v4.xml",
"compass.xml",
"map.xml",
"hierarchy.xml",
"hierarchy.xml",
"reset.xml",
"actions.xml",
"help.xml",
@ -559,6 +560,15 @@ HelpPages =
"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;
BuildName = "RELEASE_HEAD";

@ -80,6 +80,9 @@ XMLOutGameInterfaceFiles = {
"out_v2_keys.xml",
};
TexturesInterface = "texture_interfaces_v3";
TexturesInterfaceDXTC = "texture_interfaces_dxtc";
// The ligo primitive class file
LigoPrimitiveClass = "world_editor_classes.xml";
@ -352,8 +355,8 @@ SystemInfoColors =
// NEW System Info Categories
"SYS", "255 255 255 255 normal", // Default system messages
"BC", "255 255 255 255 center", // Broadcast messages
"TAGBC", "255 255 255 255 center", // Taged broadcast messages : color should remain white as some word are tagged
"BC", "255 255 255 255 centeraround", // Broadcast messages
"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
"SP", "255 255 64 255 over", // SP Gain
"TTL", "255 255 64 255 over", // Title
@ -441,23 +444,24 @@ R2EDReloadFiles = {
XMLInterfaceFiles = {
"config.xml",
"widgets.xml",
"webig_widgets.xml",
"player.xml",
"inventory.xml",
"interaction.xml",
"phrase.xml",
"phrase.xml",
"harvest.xml",
"macros.xml",
"info_player.xml",
"outpost.xml",
"guild.xml",
"taskbar.xml",
"game_config.xml",
"game_config.xml",
"game_context_menu.xml",
"player_trade.xml",
"bot_chat_v4.xml",
"compass.xml",
"map.xml",
"hierarchy.xml",
"hierarchy.xml",
"reset.xml",
"actions.xml",
"help.xml",
@ -557,6 +561,15 @@ HelpPages =
"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;
BuildName = "RELEASE_HEAD";

@ -78,9 +78,18 @@
<command name="guildinvite" action="command" params="a guildInvite $" />
<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 -->
<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>

@ -258,6 +258,9 @@
<variable entry="UI:SAVE:INSCENE:USER:TITLE"
type="bool"
value="false" />
<variable entry="UI:SAVE:INSCENE:USER:RPTAGS"
type="bool"
value="false" />
<variable entry="UI:SAVE:INSCENE:USER:GUILD_NAME"
type="bool"
value="false" />
@ -291,6 +294,9 @@
<variable entry="UI:SAVE:INSCENE:FRIEND:TITLE"
type="bool"
value="true" />
<variable entry="UI:SAVE:INSCENE:FRIEND:RPTAGS"
type="bool"
value="true" />
<variable entry="UI:SAVE:INSCENE:FRIEND:GUILD_NAME"
type="bool"
value="true" />
@ -327,6 +333,9 @@
<variable entry="UI:SAVE:INSCENE:ENEMY:TITLE"
type="bool"
value="true" />
<variable entry="UI:SAVE:INSCENE:ENEMY:RPTAGS"
type="bool"
value="true" />
<variable entry="UI:SAVE:INSCENE:ENEMY:GUILD_NAME"
type="bool"
value="true" />
@ -2797,6 +2806,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:GUILD_LIST:SORT_ORDER"
type="sint32"
value="0" />
<variable entry="UI:SAVE:CHATLOG_STATE"
type="sint32"
value="0" />
<!-- Auto Convert ACT_TSTART end TEND from server to smoothServerTick -->
<link expr="@SERVER:USER:ACT_TSTART"
action="set"
@ -2963,7 +2975,28 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:CHAT:COLORS:TELL"
type="rgba"
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"
value="162 255 173 255" />
<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"
type="bool"
value="false" />
<variable entry="UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB"
type="bool"
value="true" />
<!-- ***************************** -->
<!-- * SYSTEM INFO COLORS * -->
<!-- ***************************** -->
@ -3045,6 +3081,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_BAG:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_BAG:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA0:SORT_TYPE"
type="sint32"
value="0" />
@ -3066,6 +3105,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_PA0:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA0:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA1:SORT_TYPE"
type="sint32"
value="0" />
@ -3087,6 +3129,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_PA1:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA1:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA2:SORT_TYPE"
type="sint32"
value="0" />
@ -3108,6 +3153,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_PA2:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA2:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA3:SORT_TYPE"
type="sint32"
value="0" />
@ -3129,6 +3177,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_PA3:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_PA3:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_GUILD:SORT_TYPE"
type="sint32"
value="1" />
@ -3151,6 +3202,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_GUILD:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_GUILD:FILTER_TP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_ROOM:SORT_TYPE"
type="sint32"
value="1" />
@ -3173,6 +3227,9 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:SAVE:INV_ROOM:FILTER_MISSMP"
type="sint32"
value="1" />
<variable entry="UI:SAVE:INV_ROOM:FILTER_TP"
type="sint32"
value="1" />
<!-- List Menu 1 -->
<variable entry="UI:VARIABLES:ISACTIVE:SETS"
type="sint32"
@ -3809,4 +3866,10 @@ This MUST follow the Enum MISSION_DESC::TIconId
<variable entry="UI:TEMP:R2_DRAW_ARRAY"
type="bool"
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>

@ -11,7 +11,7 @@
<variable entry="UI:VARIABLES:ENCY:REWARDBRICK: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" />

@ -1615,19 +1615,82 @@
x="0"
y="-4" />
<instance template="tgcw_color"
id="cc_dyn"
text="uiDynColor"
title="uiCCDDyn"
tooltip="uittChooseDynColor"
id="cc_dyn0"
text="uiDynColor0"
title="uiCCDDyn0"
tooltip="uittChooseDynColor0"
posref="BL TL"
posparent="cc_shout"
x="0"
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"
id="enter_dontquit_cb"
text="uiEnterDontQuitCB"
tooltip="uittChatEnter"
posparent="cc_dyn"
posparent="cc_dyn7"
posref="BL TL"
x="0"
y="-8" />
@ -1647,11 +1710,19 @@
posref="BL TL"
x="0"
y="-8" />
<instance template="tgcw_scrollbarint"
<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"
id="font_size"
text="uiFontSize"
posref="BL TL"
posparent="show_dyn_channel_name_in_chat_cb"
posparent="show_online_offline_notifications_cb"
x="0"
y="-8" />
<link expr="@UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
@ -1660,7 +1731,9 @@
target="show_times_in_chat_cb:c:pushed" />
<link expr="@UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
target="show_dyn_channel_name_in_chat_cb:c:pushed" />
</group>
<link expr="@UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB"
target="show_online_offline_notifications_cb:c:pushed" />
</group>
<ctrl style="skin_scroll"
id="sb_chat_colors"
align="T"
@ -1886,12 +1959,20 @@
posparent="is_user_name"
x="0"
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"
id="is_user_guild_name"
text="uigcGuildName"
tooltip="uittGuildName"
posref="BL TL"
posparent="is_user_title"
posparent="is_user_rptags"
x="0"
y="-4" />
<instance template="tgcw_checkbox"
@ -1995,12 +2076,20 @@
posparent="is_friend_name"
x="0"
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"
id="is_friend_guild_name"
text="uigcGuildName"
tooltip="uittGuildName"
posref="BL TL"
posparent="is_friend_title"
posparent="is_friend_rptags"
x="0"
y="-4" />
<instance template="tgcw_checkbox"
@ -2112,12 +2201,20 @@
posparent="is_enemy_name"
x="0"
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"
id="is_enemy_guild_name"
text="uigcGuildName"
tooltip="uittGuildName"
posref="BL TL"
posparent="is_enemy_title"
posparent="is_enemy_rptags"
x="0"
y="-4" />
<instance template="tgcw_checkbox"
@ -3095,10 +3192,45 @@
widget="colbut"
link="UI:SAVE:CHAT:COLORS:SHOUT"
realtime="true" />
<param ui="chat_colors:cc_dyn:c"
<param ui="chat_colors:cc_dyn0:c"
type="db"
widget="colbut"
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"
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" />
<!--
<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"
link="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
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"
type="db"
widget="sbint"
@ -3222,6 +3359,11 @@
widget="boolbut"
link="UI:SAVE:INSCENE:USER:TITLE"
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"
type="db"
widget="boolbut"
@ -3272,6 +3414,11 @@
widget="boolbut"
link="UI:SAVE:INSCENE:FRIEND:TITLE"
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"
type="db"
widget="boolbut"
@ -3327,6 +3474,11 @@
widget="boolbut"
link="UI:SAVE:INSCENE:ENEMY:TITLE"
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"
type="db"
widget="boolbut"

@ -463,27 +463,7 @@
<!-- ***************** -->
<!-- * 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"
id="guild_forum"
w="480"
@ -531,7 +511,7 @@
w="0"
h="0"
posref="TL TL">
<group type="forum_html"
<group type="html"
id="html"
posref="TL TL"
url="home"
@ -828,24 +808,7 @@
<!-- ************** -->
<!-- * 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"
id="mailbox"
w="480"
@ -892,7 +855,7 @@
w="0"
h="0"
posref="TL TL">
<group type="mail_html"
<group type="html"
id="html"
posref="TL TL"
url="home"
@ -976,8 +939,6 @@
<proc id="webig_proc_active">
<action handler="set"
params="dblink=UI:VARIABLES:ISACTIVE:WEBIG|value=1" />
<action handler="browse"
params="name=ui:interface:webig:content:html|url=home" />
</proc>
<proc id="webig_proc_deactive">
<action handler="set"
@ -1088,7 +1049,7 @@
<group type="webig_html"
id="html"
posref="TL TL"
url="http://atys.ryzom.com/start/index.php"
url=""
home="http://atys.ryzom.com/start/index.php"
sizeref="wh"
x="0"
@ -1254,8 +1215,8 @@
<group type="webig_html"
id="html"
posref="TL TL"
url="http://atys.ryzom.com/start/app_ig_start.php"
home="http://atys.ryzom.com/start/app_ig_start.php"
url=""
home="http://atys.ryzom.com/start/init_ig.php"
sizeref="wh"
x="0"
y="0"

@ -283,17 +283,14 @@ function game:onDrawNpcWebPage()
local utf8Url = ucUrl:toUtf8()
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
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
runAH(nil, "context_ring_sessions", "")
return
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;
browseNpcWebPage(uiStr, utf8Url, true, 10); -- 'true' is for 'add parameters' here. 10 is standard timeout
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
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
local browser = getUI("ui:interface:npc_web_browser")
browser:find("browse_redo").active = not isRing
browser:find("browse_undo").active = not isRing
browser:find("browse_refresh").active = isRing
browser:find("browse_redo").active = true
browser:find("browse_undo").active = true
browser:find("browse_refresh").active = true
end
end
end
@ -978,6 +975,7 @@ function RingPlayerInfo:tooltipRRPs(dbBase, ttFormat)
setContextHelpText(fmt);
end
--------------------------------------------------------------------------------------------------------------
--
function RingPlayerInfo:tooltipRingRating(level, progress, ttFormat)
@ -1012,6 +1010,27 @@ function RingPlayerInfo:getLevelRatingAndImprovementRate(val)
return level, progress
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()
@ -1392,7 +1411,9 @@ end
-- handler called by C++ to tell that the main loop is about to begin
function game:onMainLoopBegin()
game.InGameDbInitialized = false
game.PrevSessionMission = getDbProp("UI:VARIABLES:MISSION_SELECTED_PREV_SESSION")
game.PrevSessionMission = getDbProp("UI:VARIABLES:MISSION_SELECTED_PREV_SESSION")
debugInfo("onMainLoopBegin()")
end
@ -1408,6 +1429,29 @@ function game:onInGameDbInitialized()
if game.PrevSessionMission ~= -1 then
self:setCurrentMission(game.PrevSessionMission)
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
--------------------------------------------------------------------------------------------------------------
@ -1415,8 +1459,8 @@ end
function game:onMainLoopEnd()
game.InGameDbInitialized = false
game:updateMissionJournalFixedEntry()
end
end
--------------------------------------------------------------------------------------------------------------
-- ring journal on / off
@ -1471,6 +1515,11 @@ function game:onNewMissionStepAdded(stepIndex)
local missionWnd = getMissionWindow()
local missionIndex = getDbProp("UI:SAVE:MISSION_SELECTED")
local dbPath
if missionIndex < 0 then
return
end
-- debugInfo("New Step")
if missionIndex < 15 then
dbPath = "SERVER:MISSIONS:" .. tostring(missionIndex) .. ":GOALS:" .. tostring(stepIndex) .. ":TEXT"
@ -1651,3 +1700,64 @@ function game:getRPJobs()
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"
h="0"
posref="TL TL">
<group id="title"
posref="TL TL"
sizeref="w"
w="-1"
h="24"
y="-22">
<view type="text"
id="player_title_txt"
posref="TL TL"
x="0"
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"
y="-24"
wmargin="8"
hardtext="uiInfo"
tooltip="uittIdentityInfo"
onclick_l="open_title_help"
params_l="from=user" />
<view type="text"
id="character_race_title"
posparent="basics_skills"
posref="TL TL"
x="0"
y="-24"
hardtext="uiRaceBold"
shadow="true"
color="255 255 255 255"
global_color="false"
fontsize="12" />
<view type="text"
id="character_race_name"
posparent="character_race_title"
posref="TR TL"
shadow="true"
color="255 200 55 255"
global_color="false"
x="2"
fontsize="12"
hardtext="" />
<group id="guild"
posref="TL TL"
sizeref="w"
h="14"
y="-52">
y="-48">
<view type="text"
id="guild_title"
posref="TL TL"
@ -1232,20 +1210,20 @@
y="0"
val="%player_protect_cold" />
<instance template="tipc_magic_protect"
id="Fire"
id="Rot"
posparent="Cold"
posref="BL TL"
y="0"
val="%player_protect_fire" />
val="%player_protect_rot" />
<instance template="tipc_magic_protect"
id="Rot"
posparent="Fire"
id="Fire"
posparent="Rot"
posref="BL TL"
y="0"
val="%player_protect_rot" />
val="%player_protect_fire" />
<instance template="tipc_magic_protect"
id="Shockwave"
posparent="Rot"
posparent="Fire"
posref="BL TL"
y="0"
val="%player_protect_shockwave" />
@ -1420,9 +1398,60 @@
fontsize="12" />
<instance template="faction_points_widget"
id="fp"
posref="TL TL"
posparent="ecosystem_points"
posref="BL TL"
x="0"
y="-150" />
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"
x="0"
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 h="0" id="rpjobs" posref="TL TL" sizeref="wh" w="0" y="0">
<ctrl style="text_button_header"
@ -1514,11 +1543,57 @@
</group>
</group>
<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"
button_type="push_button"
id="browse_home"
posref="TR TR"
x="-1"
posref="BR TR"
posparent="title"
x="0"
y="-2"
hardtext="uiBrowseRefresh"
tooltip="uittBrowseRefresh"
@ -1533,7 +1608,7 @@
title_prefix=""
sizeref="wh"
x="0"
y="-8"
y="-42"
w="0"
h="0"
background_color="0 0 0 255"
@ -1905,7 +1980,7 @@
<group id="content"
x="0"
y="0"
h="272"
h="300"
posref="TL TL">
<group id="you"
posref="TL TL"
@ -2004,7 +2079,7 @@
id="kami"
posref="TL TL"
x="4"
y="-180"
y="-160"
color="255 255 255 255"
fontsize="10"
shadow="true"
@ -2013,7 +2088,7 @@
id="karavan"
posref="TL TL"
x="4"
y="-210"
y="-190"
color="255 255 255 255"
fontsize="10"
shadow="true"
@ -2021,7 +2096,7 @@
<group id="cult_allegiance_group"
posref="TL TL"
x="4"
y="-240"
y="-220"
child_resize_h="true"
child_resize_w="true">
<view type="text"
@ -2090,6 +2165,87 @@
id="fb5"
x="100"
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 id="guild"
posref="TL TL"

@ -301,7 +301,6 @@
<view type="bitmap"
id="tag_1"
posref="TL TL"
posparent="pvp_tags"
x="2"
y="0"
texture="alpha_10.tga"
@ -2116,7 +2115,14 @@
name="uimDismiss"
handler="dismiss_member"
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="emote1" name="uimEmote1" handler="emote" params="emote_id=0"/>
<action id="emote2" name="uimEmote2" handler="emote" params="emote_id=1"/>
@ -2147,6 +2153,10 @@
<!-- links to enable leader options -->
<link expr="eq(band(@SERVER:GROUP:LEADER_INDEX, 15), 15)"
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 -->
<group type="menu"
id="team_chat_leader_menu"
@ -2481,21 +2491,13 @@
<view type="text"
id="text"
posref="TM TM"
color="233 197 42 255"
color="42 197 233 255"
x="10"
y="-10"
fontsize="14"
fontsize="12"
global_color="false"
shadow="true"
hardtext="uiJoinDuelProposal" />
<view type="bitmap"
id="warning"
posparent="text"
posref="ML MR"
y="4"
x="-4"
global_color="false"
texture="w_warning.tga" />
hardtext="uiJoinLeagueProposal" />
<group id="content"
child_resize_h="true"
child_resize_hmargin="10">

@ -206,6 +206,7 @@ SYNTAXE:
positive="true"
suffix=""
prefix=""
format="false" // make the number thousands formatted
/>

@ -676,8 +676,7 @@
<!-- 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"
on_enter="leave_modal" mouse_pos="false" escapable="false"
display="false"
>
display="false">
<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"/>
@ -687,15 +686,9 @@
onclick_l="leave_modal" />
</group>
<!-- 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"
<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"
url=""
title_prefix="uiQuickhelpTitle"
sizeref="wh" x="0" y="0" w="-40" h="-40"
@ -739,7 +732,6 @@
</group>
</group>
</group>
-->
</group>

@ -195,4 +195,4 @@
>
</group>
</interface_config>
</interface_config>

@ -1,5 +1,12 @@
-- In this file we define functions that serves for player windows
function getDbPropU(dbEntry)
value = getDbProp(dbEntry)
if (value < 0) then
value = 4294967296+value
end
return value
end
------------------------------------------------------------------------------------------------------------
-- create the game namespace without reseting if already created in an other file.
@ -109,9 +116,9 @@ end
------------------------------------------------------------------------------------------------------------
-- Update player pvp tag
function game:pvpTagUpdateDisplay()
local currentServerTick = getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local currentServerTick = getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local uiPlayer= getUI('ui:interface:player:header_opened');
-- get the current state
@ -222,9 +229,9 @@ function game:updatePvpTag()
setDbProp('UI:TEMP:PVP_FACTION:TAG_PVP', booleanToNumber(pvpServerTag));
-- launch timer DB if necessary
local currentServerTick = getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local currentServerTick = getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
if(pvpServerTagTimer > currentServerTick) or (pvpServerFlagTimer > currentServerTick) then
local ui = getUI('ui:interface:player');
@ -252,9 +259,9 @@ function game:updatePvpTimer()
self:pvpTagUpdateDisplay();
-- try to stop
local currentServerTick = getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local currentServerTick = getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local pvpServerFlagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
-- Manage Tag Timer display
if(pvpServerTagTimer <= currentServerTick) then
@ -299,8 +306,8 @@ function game:playerTTPvp()
-- Flag mode?
if(buttonMode==2) then
local pvpServerFlagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local currentServerTick = getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerFlagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:FLAG_PVP_TIME_LEFT');
local currentServerTick = getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local tempsString = game:formatTime( pvpServerFlagTimer - currentServerTick );
text = i18n.get('uittPvPModeFlag');
text = findReplaceAll(text, '%temps', tempsString);
@ -320,8 +327,8 @@ function game:playerTTPvp()
end
-- timer
if(buttonTimer) then
local pvpServerTagTimer = getDbProp('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local currentServerTick = getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local pvpServerTagTimer = getDbPropU('SERVER:CHARACTER_INFO:PVP_FACTION_TAG:ACTIVATION_TIME');
local currentServerTick = getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local tempsString = game:formatTime( pvpServerTagTimer - currentServerTick );
local timeFmt= i18n.get('uittPvPTagTimer');
timeFmt= findReplaceAll(timeFmt, '%temps', tempsString);
@ -402,7 +409,7 @@ function game:outpostUpdatePVPTimer(textSlot, ui)
-- Get the timer of interest (priority to player leaving the zone)
local endTimer= 0;
local endOfPvpTimer= getDbProp('SERVER:CHARACTER_INFO:PVP_OUTPOST:FLAG_PVP_TIME_END');
local endOfPvpTimer= getDbPropU('SERVER:CHARACTER_INFO:PVP_OUTPOST:FLAG_PVP_TIME_END');
if( endOfPvpTimer>0 ) then
endTimer= endOfPvpTimer;
else
@ -415,7 +422,7 @@ function game:outpostUpdatePVPTimer(textSlot, ui)
-- Use a text with a timer?
if( endTimer>0 ) then
-- compute the time that lefts in sec (suppose a smooth server tick is 1 ms)
local curTick= getDbProp('UI:VARIABLES:CURRENT_SERVER_TICK');
local curTick= getDbPropU('UI:VARIABLES:CURRENT_SERVER_TICK');
local timeSec= (endTimer- curTick)/10;
-- replace in str
local text= "@{FF6F}" .. runFct('secondsToTimeStringShort', timeSec);
@ -619,8 +626,8 @@ function game:updatePlayerBonusMalus()
local pvpOutpostEndOfRound= 0;
if(pvpOutpostPresent~=0) then
local pvpOutpostLevel= 0;
pvpOutpostEndOfPVPFlag= getDbProp('SERVER:CHARACTER_INFO:PVP_OUTPOST:FLAG_PVP_TIME_END');
pvpOutpostEndOfRound= getDbProp('SERVER:CHARACTER_INFO:PVP_OUTPOST:ROUND_END_DATE');
pvpOutpostEndOfPVPFlag= getDbPropU('SERVER:CHARACTER_INFO:PVP_OUTPOST:FLAG_PVP_TIME_END');
pvpOutpostEndOfRound= getDbPropU('SERVER:CHARACTER_INFO:PVP_OUTPOST:ROUND_END_DATE');
-- set a level only if we have some round, and if the out timer is not set
if(pvpOutpostEndOfRound~=0 and pvpOutpostEndOfPVPFlag==0) then
pvpOutpostLevel= 1 + getDbProp('SERVER:CHARACTER_INFO:PVP_OUTPOST:ROUND_LVL_CUR');

@ -417,7 +417,7 @@
tx_over="W_button_24_over.tga"
w="24"
h="24"
scale="true"
scale="false"
global_color_normal="false"
global_color_over="false"
global_color_pushed="false"
@ -488,15 +488,15 @@
<!-- PVP Tag Button -->
<instance template="t_pvp_tag_button"
id="pvp_tag_button_0"
tx="pvp_green.tga"
tx="no_pvp.tga"
mode="0" />
<instance template="t_pvp_tag_button"
id="pvp_tag_button_1"
tx="pvp_orange.tga"
tx="pvp_tag.tga"
mode="1" />
<instance template="t_pvp_tag_button"
id="pvp_tag_button_2"
tx="pvp_red.tga"
tx="pvp_flag.tga"
mode="2" />
<!-- PVP Tag special overed pushed icon. pushed == over rotated !!. (NB: Ugly to save icon space) -->
<view type="bitmap"
@ -1104,7 +1104,9 @@
global_color_over="true"
header_color="UI:SAVE:WIN:COLORS:ANI"
title_delta_max_w="-150"
title_over_extend_view_text="true">
title_over_extend_view_text="true"
on_tooltip="userpa_name_tooltip"
on_tooltip_params="#index">
<group id="header_closed"
h="12"
posref="TL TL"></group>
@ -1461,4 +1463,4 @@
<tree node="userpa3" />
<tree node="userpa4" />
</tree>
</interface_config>
</interface_config>

@ -318,21 +318,53 @@
<group type="container" id="accept_trade_invitation" w="260" h="512" resizer="false" pop_max_h="512"
active="false" savable="false" openable="false" opened="true" movable="true"
on_close_button="proc" on_close_button_params="player_decline_invitation" title_opened="uiTradeInvitation" >
<group id="content" child_resize_h="true" child_resize_hmargin="10" >
<group id="inside" sizeref="w" posref="TL TL" y="-4" child_resize_h="true" child_resize_hmargin="6">
<view type="text_id" id="invite_phrase" posref="MM MM" x="0" y="0" color="255 255 255 255" fontsize="12" shadow="true"
multi_line="true" multi_line_space="0" line_maxw="250" />
<group type="container"
id="accept_trade_invitation"
w="260"
h="512"
resizer="false"
pop_max_h="512"
active="false"
savable="false"
openable="false"
opened="true"
movable="true"
on_close_button="proc"
on_close_button_params="player_decline_invitation"
title_opened="uiTradeInvitation" >
<group id="content"
child_resize_h="true"
child_resize_hmargin="10" >
<group id="inside"
sizeref="w"
posref="TL TL"
y="-4"
child_resize_h="true"
child_resize_hmargin="6">
<view type="text_id"
id="invite_phrase"
posref="MM MM"
x="0"
y="0"
color="255 255 255 255"
fontsize="12"
shadow="true"
multi_line="true"
multi_line_space="0"
line_maxw="250" />
</group>
<instance template="button_ok_cancel" posparent="inside" posref="BR TR" x="-4" y="-4"
ok_text="uiAccept" cancel_text="uiDecline"
onclick_ok="proc" onclick_ok_param="player_accept_invitation"
onclick_cancel="proc" onclick_cancel_param="player_decline_invitation" />
<instance template="button_ok_cancel"
posparent="inside"
posref="BR TR"
x="-4"
y="-4"
ok_text="uiAccept"
cancel_text="uiDecline"
onclick_ok="proc"
onclick_ok_param="player_accept_invitation"
onclick_cancel="proc"
onclick_cancel_param="player_decline_invitation" />
</group>
</group>

@ -261,6 +261,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_BAG:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_BAG:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_BAG:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_BAG:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA0:SORT_TYPE|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA0:ICON_LIST|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA0:FILTER_ARMOR|value=1" />
@ -275,6 +276,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_PA1:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA1:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA1:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA1:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:SORT_TYPE|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:ICON_LIST|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:FILTER_ARMOR|value=1" />
@ -282,6 +284,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_PA2:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA2:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:SORT_TYPE|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:ICON_LIST|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:FILTER_ARMOR|value=1" />
@ -289,6 +292,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_PA3:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_PA3:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:SORT_TYPE|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:ICON_LIST|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:FILTER_ARMOR|value=1" />
@ -296,6 +300,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_GUILD:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:SORT_TYPE|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:ICON_LIST|value=0" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:FILTER_ARMOR|value=1" />
@ -303,6 +308,7 @@
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:FILTER_TOOL|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:FILTER_MP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:FILTER_MISSMP|value=1" />
<action handler="set" params="dblink=UI:SAVE:INV_ROOM:FILTER_TP|value=1" />
<action handler="set" params="dblink=UI:SAVE:ISDETACHED:MAIN_CHAT|value=0" />
<action handler="set" params="dblink=UI:SAVE:ISDETACHED:GUILD_CHAT|value=0" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

@ -243,7 +243,7 @@
<view type="bitmap"
id="win_top"
posref="TL TL"
y="-10"
y="-15"
texture="Infos_top.tga"
global_color="true" />
<view type="bitmap"
@ -265,7 +265,7 @@
id="win_jauge_mid"
posref="TL ML"
x="0"
y="1"
y="-2"
posparent="win_bot"
scale="true"
w="128"
@ -288,7 +288,7 @@
id="info0"
posref="TL TL"
x="0"
y="-3"
y="-10"
fontsize="14"
shadow="true"
hardtext=""
@ -298,7 +298,7 @@
id="info1"
posref="TL TL"
x="0"
y="-17"
y="-28"
fontsize="12"
shadow="true"
hardtext=""
@ -308,7 +308,7 @@
id="info2"
posref="TL TL"
x="0"
y="-32"
y="-40"
fontsize="10"
shadow="true"
hardtext=""
@ -350,7 +350,59 @@
y=""
texture="target_mission.tga"
global_color="false" />
<view type="bitmap"
<view type="bitmap"
id="rp_logo_1"
posref="BR BL"
x="4"
y="0"
slot="false"
posparent="info0"
color="255 255 255 255"
render_layer="1"
texture=""
w="24"
h="24"
global_color="false" />
<view type="bitmap"
id="rp_logo_2"
posref="BR BL"
x="32"
y="0"
slot="false"
posparent="info0"
color="255 255 255 255"
render_layer="1"
texture=""
w="24"
h="24"
global_color="false" />
<view type="bitmap"
id="rp_logo_3"
posref="TR TL"
x="60"
y="0"
slot="false"
posparent="info0"
color="255 255 255 255"
render_layer="1"
texture=""
w="24"
h="24"
global_color="false" />
<view type="bitmap"
id="rp_logo_4"
posref="TR TL"
x="88"
y="0"
slot="false"
posparent="info0"
color="255 255 255 255"
render_layer="1"
texture=""
w="24"
h="24"
global_color="false" />
<view type="bitmap"
id="bar0"
posref="TL TL"
posparent="win_jauge_top"
@ -415,14 +467,14 @@
<ctrl type="sheet"
id="guild_logo"
posref="ML MR"
x="-8"
x="-4"
slot="false"
posparent="right"
nature="guild_flag"
value="UI:TEMP:GUILD_SHEET"
dragable="false"
color="255 255 255 255" />
<view type="bitmap"
<view type="bitmap"
id="npc_mission_logo"
posref="TL TR"
x="-8"
@ -459,7 +511,7 @@
child_resize_h="true"
child_resize_wmargin="4" >
<view type="bitmap"
id="pvp_faction_civ_logo"
id="pvp_faction_logo"
posref="TL TL"
texture="mp_pearl.tga"
x="2"
@ -467,9 +519,10 @@
h="24"
global_color="false" />
<view type="bitmap"
id="pvp_faction_cult_logo"
id="pvp_safe_logo"
active="false"
posref="TR TL"
posparent="pvp_faction_civ_logo"
posparent="pvp_faction_logo"
texture="mp_pearl.tga"
x="2"
w="24"
@ -499,7 +552,7 @@
x="2"
w="24"
h="24"
texture="ICO_Multi_Fight.tga"
texture="pvp_duel.tga"
global_color="false" />
</group>
</group>
@ -1736,7 +1789,11 @@
<action id="xp_catalyser_use"
name="uimXpCatalyserUse"
handler="xp_catalyser_use" />
<separator />
<action id="item_text_display"
name="uiOpen"
handler="item_text_display"
params="ui:interface:edit_custom" />
<separator />
<!-- Move to an Animal -->
<action id="move"
name="uimMoveTo">
@ -1781,14 +1838,13 @@
<action id="infos"
name="uimBoldInfo"
handler="open_item_help" />
<action id="lockunlock"
name="uimLockItem"
handler="lock_inv_item" />
<action id="item_text_edition"
name="uimItemTextEdit"
handler="item_text_edition"
params="ui:interface:edit_custom" />
<action id="item_text_display"
name="uimItemTextDisplay"
handler="item_text_display"
params="ui:interface:edit_custom" />
</group>
<!-- MAX_INVENTORY_ANIMAL -->
<link expr="switch(@%pa_beast0:TYPE, 'uimMtPaMount0', 'uimMtPaMount0', 'uimMtPaPacker0', 'uimMtPaDemon0')"
@ -1802,7 +1858,8 @@
<!-- item menu when we are in self -->
<group type="menu"
id="item_menu_in_self"
extends="base_menu">
extends="base_menu"
on_active="item_menu_base_check" >
<!--<action id="drop" name="uimDrop" handler="proc" params="drop_item_proc"/>-->
<action id="destroy"
name="uimDestroy"
@ -1812,11 +1869,15 @@
name="uimBoldInfo"
handler="open_item_help"
params="" />
<action id="lockunlock"
name="uimLockItem"
handler="lock_inv_item" />
</group>
<!-- item menu default -->
<group type="menu"
id="item_menu"
extends="base_menu">
extends="base_menu"
on_active="item_menu_base_check" >
<!--<action id="drop" name="uimDrop" handler="proc" params="drop_item_proc"/>-->
<action id="destroy"
name="uimDestroy"
@ -1830,6 +1891,9 @@
name="uimBoldInfo"
handler="open_item_help"
params="" />
<action id="lockunlock"
name="uimLockItem"
handler="lock_inv_item" />
</group>
<define id="item_modal_menu"
value="ui:interface:item_menu" />
@ -1959,7 +2023,8 @@
fontsize="10"
value="#value"
global_color="false"
positive="true" />
positive="true"
format="true" />
<view type="text"
id="bad_price"
posparent="box1"
@ -2070,6 +2135,7 @@
global_color="false" />
</group>
</template>
<!-- ********************* -->
<!-- * FACTION POINTS * -->
<!-- ********************* -->
@ -6245,6 +6311,8 @@
<!-- onClickR on a filter -->
<proc id="pinv_item_filter">
<!-- Reset all filter first -->
<action handler="set"
params="dblink=UI:SAVE:@0:FILTER_TP|value=0" />
<action handler="set"
params="dblink=UI:SAVE:@0:FILTER_MISSMP|value=0" />
<action handler="set"
@ -6370,6 +6438,7 @@
filter_tool="UI:SAVE:#inv_type:FILTER_TOOL"
filter_mp="UI:SAVE:#inv_type:FILTER_MP"
filter_missmp="UI:SAVE:#inv_type:FILTER_MISSMP"
filter_tp="UI:SAVE:#inv_type:FILTER_TP"
wspace="2"
hspace="2"
startitem="0"
@ -6426,6 +6495,7 @@
filter_tool="UI:SAVE:#inv_type:FILTER_TOOL"
filter_mp="UI:SAVE:#inv_type:FILTER_MP"
filter_missmp="UI:SAVE:#inv_type:FILTER_MISSMP"
filter_tp="UI:SAVE:#inv_type:FILTER_TP"
hspace="2"
xitem="2"
yitem="-2"
@ -6480,17 +6550,26 @@
<link expr="eq(@UI:SAVE:#inv_type:ICON_LIST, 0)"
target="bag_list:active,sep2:active" />
<instance template="tinv_item_list_filter"
id="filter_missmp"
id="filter_tp"
x="-35"
y="1"
posref="BR BR"
inv_type="#inv_type"
dblink="UI:SAVE:#inv_type:FILTER_TP"
texture="filter_tp.tga"
tooltip="uittFilterTP" />
<instance template="tinv_item_list_filter"
id="filter_missmp"
x="-60"
y="1"
posref="BR BR"
inv_type="#inv_type"
dblink="UI:SAVE:#inv_type:FILTER_MISSMP"
texture="filter_mission.tga"
tooltip="uittFilterMissMP" />
<instance template="tinv_item_list_filter"
id="filter_mp"
x="-60"
x="-85"
y="1"
posref="BR BR"
inv_type="#inv_type"
@ -6499,7 +6578,7 @@
tooltip="uittFilterMP" />
<instance template="tinv_item_list_filter"
id="filter_tool"
x="-85"
x="-110"
y="1"
posref="BR BR"
inv_type="#inv_type"
@ -6508,7 +6587,7 @@
tooltip="uittFilterTool" />
<instance template="tinv_item_list_filter"
id="filter_weapon"
x="-110"
x="-135"
y="1"
posref="BR BR"
inv_type="#inv_type"
@ -6517,7 +6596,7 @@
tooltip="uittFilterWeapon" />
<instance template="tinv_item_list_filter"
id="filter_armor"
x="-135"
x="-160"
y="1"
posref="BR BR"
inv_type="#inv_type"

@ -628,7 +628,7 @@ void CCDBNodeBranch::display (const std::string &prefix)
}
}
void CCDBNodeBranch::removeNode (CTextId& id)
void CCDBNodeBranch::removeNode (const CTextId& id)
{
// Look for the node
CCDBNodeBranch *pNode = dynamic_cast<CCDBNodeBranch*>(getNode(id,false));

@ -165,7 +165,7 @@ public:
virtual void display (const std::string &prefix);
void removeNode (CTextId& id);
void removeNode (const CTextId& id);
/**
* add an observer to a property

@ -358,17 +358,8 @@ CCharacterCL::CCharacterCL()
_EventFactionId = 0;
_PvpMode = PVP_MODE::None;
_PvpClan = PVP_CLAN::None;
for (uint8 i = 0; i < PVP_CLAN::NbClans; i++)
{
_PvpAllies[i] = false;
_PvpEnemies[i] = false;
}
_ClanCivMaxFame = PVP_CLAN::None;
_ClanCultMaxFame = PVP_CLAN::None;
_LeagueId = 0;
_OutpostId = 0;
_OutpostSide = OUTPOSTENUMS::UnknownPVPSide;
@ -1842,9 +1833,30 @@ void CCharacterCL::updateVisualPropertyGuildNameID(const NLMISC::TGameCycle &/*
//-----------------------------------------------
void CCharacterCL::updateVisualPropertyEventFactionID(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop)
{
_EventFactionId = uint32(prop);
// ODD Hack by Ulukyn
//_EventFactionId = uint32(prop);
_PvpMode = uint32(prop);
buildInSceneInterface();
if (isUser())
{
uint i;
uint numEntity = (uint)EntitiesMngr.entities().size();
for (i=0; i<numEntity; i++)
{
CEntityCL *entity = EntitiesMngr.entity(i);
if (entity)
{
CCharacterCL *character = dynamic_cast<CCharacterCL*>(entity);
if (character)
{
if( character->getPvpMode() != 0 && !character->isUser())
character->buildInSceneInterface ();
}
}
}
}
} // updateVisualPropertyEventFactionID //
//-----------------------------------------------
@ -1853,8 +1865,8 @@ void CCharacterCL::updateVisualPropertyEventFactionID(const NLMISC::TGameCycle &
//-----------------------------------------------
void CCharacterCL::updateVisualPropertyPvpMode(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop)
{
_PvpMode = (uint8)prop;
buildInSceneInterface();
//_PvpMode = uint32(prop);
//buildInSceneInterface();
} // updateVisualPropertyPvpMode //
@ -1864,18 +1876,26 @@ void CCharacterCL::updateVisualPropertyPvpMode(const NLMISC::TGameCycle &/* game
//-----------------------------------------------
void CCharacterCL::updateVisualPropertyPvpClan(const NLMISC::TGameCycle &/* gameCycle */, const sint64 &prop)
{
// get fames signs from prop
for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++)
_LeagueId = uint32(prop);
if (isUser())
{
_PvpAllies[fameIdx] = (prop & (SINT64_CONSTANT(1) << (2*fameIdx))) != 0;
_PvpEnemies[fameIdx] = (prop & (SINT64_CONSTANT(1) << (2*fameIdx+1))) != 0;
uint i;
uint numEntity = (uint)EntitiesMngr.entities().size();
for (i=0; i<numEntity; i++)
{
CEntityCL *entity = EntitiesMngr.entity(i);
if (entity)
{
CCharacterCL *character = dynamic_cast<CCharacterCL*>(entity);
if (character)
{
if( character->getPvpMode() != 0 && !character->isUser())
character->buildInSceneInterface ();
}
}
}
}
_ClanCivMaxFame = PVP_CLAN::TPVPClan((prop & (0x03 << 2*7)) >> 2*7);
_ClanCultMaxFame = PVP_CLAN::TPVPClan(4 + ((prop & (0x03 << 2*8)) >> 2*8));
buildInSceneInterface();
} // updateVisualPropertyPvpClan //
//-----------------------------------------------
@ -4522,10 +4542,6 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
else
deltaHPColor = ClientCfg.SystemInfoParams["dg"].Color;
}
else
{
deltaHPColor = CRGBA(127,127,127);
}
}
else
{
@ -10252,7 +10268,7 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
if( args.size() == 0 )
{
uint8 pvpMode = playerTarget->getPvpMode();
uint16 pvpMode = playerTarget->getPvpMode();
string str;
if( pvpMode&PVP_MODE::PvpDuel )
str+="duel ";
@ -10270,6 +10286,10 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
str+="faction ";
if( pvpMode&PVP_MODE::PvpFactionFlagged)
str+="faction_flagged ";
if( pvpMode&PVP_MODE::PvpZoneSafe)
str+="in_safe_zone ";
if( pvpMode&PVP_MODE::PvpSafe)
str+="safe ";
IM->displaySystemInfo(ucstring(str));
nlinfo("<pvpMode> %s",str.c_str());
}
@ -10280,14 +10300,14 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
fromString(args[1], state);
if( state )
{
uint8 currentPVPMode = playerTarget->getPvpMode();
uint16 currentPVPMode = playerTarget->getPvpMode();
currentPVPMode |= pvpMode;
playerTarget->setPvpMode(currentPVPMode);
IM->displaySystemInfo(toString("<pvpMode> adding pvp mode %s",args[0].c_str()));
}
else
{
uint8 currentPVPMode = playerTarget->getPvpMode();
uint16 currentPVPMode = playerTarget->getPvpMode();
currentPVPMode &= ~pvpMode;
playerTarget->setPvpMode(currentPVPMode);
IM->displaySystemInfo(toString("<pvpMode> removing pvp mode %s",args[0].c_str()));
@ -10297,7 +10317,7 @@ NLMISC_COMMAND(pvpMode, "modify pvp mode", "[<pvp mode> <state>]")
return true;
}
/*
NLMISC_COMMAND(pvpClan, "modify pvp clan", "<pvp clan>")
{
if (args.size() != 1) return false;
@ -10319,13 +10339,13 @@ NLMISC_COMMAND(pvpClan, "modify pvp clan", "<pvp clan>")
if (!playerTarget)
return false;
PVP_CLAN::TPVPClan clan = PVP_CLAN::fromString(args[0]);
playerTarget->setPvpClan(clan);
// PVP_CLAN::TPVPClan clan = PVP_CLAN::fromString(args[0]);
// playerTarget->setPvpClan(clan);
playerTarget->buildInSceneInterface();
return true;
}
*/
#endif // !FINAL_VERSION
#include "r2/editor.h"

@ -84,7 +84,7 @@ public:
enum { MaxNumAura = 2 };
enum TAtkHeight
{
AtkUnknownHeight = 0,
AtkUnkownHeight = 0,
AtkLow,
AtkMiddle,
AtkHigh
@ -368,48 +368,10 @@ public:
virtual uint64 getGuildSymbol () const { return _GuildSymbol; }
virtual uint32 getEventFactionID() const { return _EventFactionId; }
virtual uint8 getPvpMode() const { return _PvpMode; }
void setPvpMode(uint8 mode) { _PvpMode=mode; }
virtual PVP_CLAN::TPVPClan getPvpClan() const { return _PvpClan; }
void setPvpClan(PVP_CLAN::TPVPClan clan) { _PvpClan=clan; }
virtual PVP_CLAN::TPVPClan getClanCivMaxFame() const { return _ClanCivMaxFame; }
void setClanCivMaxFame(PVP_CLAN::TPVPClan clan) { _ClanCivMaxFame=clan; }
virtual PVP_CLAN::TPVPClan getClanCultMaxFame() const { return _ClanCultMaxFame; }
void setClanCultMaxFame(PVP_CLAN::TPVPClan clan) { _ClanCultMaxFame=clan; }
virtual bool isPvpAlly(uint8 faction) const { if (faction < PVP_CLAN::NbClans) return _PvpAllies[faction]; else return false; }
virtual bool isPvpEnnemy(uint8 faction) const { if (faction < PVP_CLAN::NbClans) return _PvpEnemies[faction]; else return false; }
virtual bool isPvpMarauder() const
{
for (uint8 i = 0; i < 4; i++)
if (!_PvpEnemies[i])
return false;
return true;
}
virtual bool isPvpTrytonist() const
{
if (_PvpEnemies[4] && _PvpEnemies[6])
return true;
return false;
}
virtual bool isPvpPrimas() const
{
if (_PvpAllies[4] && _PvpAllies[6])
return true;
return false;
}
virtual bool isPvpRanger() const
{
for (uint8 i = 0; i < 4; i++)
if (!_PvpAllies[i])
return false;
return true;
}
virtual uint16 getPvpMode() const { return _PvpMode; }
void setPvpMode(uint16 mode) { _PvpMode=mode; }
virtual uint32 getLeagueID() const { return _LeagueId; }
void setLeagueID(uint32 league) { _LeagueId=league; }
virtual uint16 getOutpostId() const { return _OutpostId; }
virtual OUTPOSTENUMS::TPVPSide getOutpostSide() const { return _OutpostSide; }
@ -727,12 +689,9 @@ protected:
uint32 _GuildNameId;
uint64 _GuildSymbol;
uint32 _EventFactionId;
uint8 _PvpMode;
uint16 _PvpMode;
PVP_CLAN::TPVPClan _PvpClan;
PVP_CLAN::TPVPClan _ClanCivMaxFame;
PVP_CLAN::TPVPClan _ClanCultMaxFame;
bool _PvpAllies[PVP_CLAN::NbClans];
bool _PvpEnemies[PVP_CLAN::NbClans];
uint32 _LeagueId;
uint16 _OutpostId;
OUTPOSTENUMS::TPVPSide _OutpostSide;

@ -422,15 +422,12 @@ int main(int argc, char **argv)
string sCmdLine = cmdline;
#if FINAL_VERSION
if (sCmdLine.find("/multi") == string::npos) // If '/multi' not found
{
HANDLE mutex = CreateMutex (NULL, false, "RyzomClient");
if (mutex && GetLastError() == ERROR_ALREADY_EXISTS)
{
delete appContext;
return 0;
}
}
//if (sCmdLine.find("/multi") == string::npos) // If '/multi' not found
//{
// HANDLE mutex = CreateMutex (NULL, false, "RyzomClient");
// if (mutex && GetLastError() == ERROR_ALREADY_EXISTS)
// exit (0);
//}
initCrashReport ();
#endif // FINAL_VERSION

@ -424,6 +424,7 @@ CClientConfig::CClientConfig()
PatchWanted = false;
#endif
PatchUrl = "";
PatchletUrl = "";
PatchVersion = "";
PatchServer = "";
@ -433,6 +434,7 @@ CClientConfig::CClientConfig()
RingReleaseNotePath = "http://"+WebIgMainDomain+"/releasenotes_ring/index.php";
ReleaseNotePath = "http://"+WebIgMainDomain+"/releasenotes/index.php";
///////////////
// ANIMATION //
// With a bigger angle, rotation is animated.
@ -1044,9 +1046,13 @@ void CClientConfig::setValues()
READ_STRING_DEV(ReleaseNotePath)
READ_STRING_FV(PatchServer)
/////////////////////////
// NEW PATCHLET SYSTEM //
READ_STRING_FV(PatchletUrl)
////////////////////////
// WEBIG //
READ_STRING_DEV(WebIgMainDomain);
READ_STRING_FV(WebIgMainDomain);
READ_STRINGVECTOR_FV(WebIgTrustedDomains);
///////////////

@ -286,17 +286,17 @@ struct CClientConfig
// NEW PATCHING SYSTEM //
bool PatchWanted;
std::string PatchUrl;
std::string PatchletUrl;
std::string PatchVersion;
std::string PatchServer;
std::string RingReleaseNotePath;
std::string ReleaseNotePath;
////////////////////////
// WEBIG //
std::string WebIgMainDomain;
std::vector<string> WebIgTrustedDomains;
///////////////
// ANIMATION //
// With a bigger angle, rotation is animated.

@ -963,16 +963,10 @@ void CClientChatManager::buildTellSentence(const ucstring &sender, const ucstrin
else
{
// Does the char have a CSR title?
if (CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender))) csr = ucstring("(CSR) ");
csr = CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender)) ? ucstring("(CSR) ") : ucstring("");
}
ucstring cur_time;
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
{
cur_time = CInterfaceManager::getTimestampHuman();
}
result = cur_time + csr + name + ucstring(" ") + CI18N::get("tellsYou") + ucstring(": ") + msg;
result = csr + name + ucstring(" ") + CI18N::get("tellsYou") + ucstring(": ") + msg;
}
}
@ -1002,23 +996,18 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde
if (!catStr.empty())
cat = string("&")+catStr+"&";
// Format the sentence with the provided sender name
ucstring senderName = CEntityCL::removeTitleAndShardFromName(sender);
// Add time if not a &bbl&
ucstring cur_time;
if (cat.toString() != "&bbl&")
if ( ! cat.empty())
{
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
{
cur_time = CInterfaceManager::getTimestampHuman();
}
result = msg;
return;
}
// Format the sentence with the provided sender name
ucstring senderName = CEntityCL::removeTitleAndShardFromName(sender);
ucstring csr;
// Does the char have a CSR title?
if (CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender))) csr = ucstring("(CSR) ");
csr = CHARACTER_TITLE::isCsrTitle(CEntityCL::getTitleFromName(sender)) ? ucstring("(CSR) ") : ucstring("");
if (UserEntity && senderName == UserEntity->getDisplayName())
{
@ -1026,10 +1015,10 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde
switch(type)
{
case CChatGroup::shout:
result = cat + cur_time + csr + CI18N::get("youShout") + ucstring(": ") + finalMsg;
result = cat + csr + CI18N::get("youShout") + ucstring(": ") + finalMsg;
break;
default:
result = cat + cur_time + csr + CI18N::get("youSay") + ucstring(": ") + finalMsg;
result = cat + csr + CI18N::get("youSay") + ucstring(": ") + finalMsg;
break;
}
}
@ -1048,10 +1037,10 @@ void CClientChatManager::buildChatSentence(TDataSetIndex /* compressedSenderInde
switch(type)
{
case CChatGroup::shout:
result = cat + cur_time + csr + senderName + ucstring(" ") + CI18N::get("heShout") + ucstring(": ") + finalMsg;
result = cat + csr + senderName + ucstring(" ") + CI18N::get("heShout") + ucstring(": ") + finalMsg;
break;
default:
result = cat + cur_time + csr + senderName + ucstring(" ") + CI18N::get("heSays") + ucstring(": ") + finalMsg;
result = cat + csr + senderName + ucstring(" ") + CI18N::get("heSays") + ucstring(": ") + finalMsg;
break;
}
}
@ -1185,21 +1174,15 @@ class CHandlerTell : public IActionHandler
ucstring finalMsg;
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, false);
ucstring cur_time;
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
cur_time = CInterfaceManager::getTimestampHuman();
ucstring csr;
if (CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw())) csr += ucstring("(CSR) ");
finalMsg += cur_time + csr + CI18N::get("youTell") + ": ";
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), finalMsg, true);
finalMsg += message;
// display msg with good color
// TDataSetIndex dsi; // not used ....
PeopleInterraction.ChatInput.Tell.displayTellMessage(/*dsi, */finalMsg, receiver, prop.getRGBA());
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
@ -1351,8 +1334,18 @@ class CHandlerTalk : public IActionHandler
{
string str = text.toUtf8();
string cmdWithArgs = str.substr(1);
/* In the chat context, only ' ' is a possible separator */
// Get the command name from the string, can contain spaces
string cmd = cmdWithArgs.substr(0, cmdWithArgs.find(' '));
if (cmdWithArgs.find('"') == 0)
{
string::size_type pos = cmdWithArgs.find('"', 1);
if (string::npos != pos)
{
cmd = cmdWithArgs.substr(1, pos - 1);
}
}
if ( NLMISC::ICommand::exists( cmd ) )
{
NLMISC::ICommand::execute( cmdWithArgs, g_log );

@ -192,7 +192,7 @@ NLMISC_COMMAND(where, "Ask information on the position", "")
return false;
}
NLMISC_COMMAND(who, "Display all players currently in game","[<options (GM)>]")
NLMISC_COMMAND(who, "Display all players currently in region","[<options (GM, channel name)>]")
{
// Check parameters.
if(args.size() > 1)
@ -1177,7 +1177,7 @@ NLMISC_COMMAND(db, "Modify Database","<Property> <Value>")
if(node)
node->setValue64(value);
else
pIM->displaySystemInfo(toString("DB %s don't exist.", args[0].c_str()));
pIM->displaySystemInfo(toString("DB '%s' does not exist.", args[0].c_str()));
#else
pIM->displaySystemInfo(ucstring("Can't write to DB when in Final Version."));
#endif
@ -1193,7 +1193,7 @@ NLMISC_COMMAND(db, "Modify Database","<Property> <Value>")
nlinfo("%s", str.c_str());
}
else
pIM->displaySystemInfo(toString("DB %s don't exist.", args[0].c_str()));
pIM->displaySystemInfo(toString("DB '%s' does not exist.", args[0].c_str()));
return true;
}
else
@ -1295,6 +1295,24 @@ NLMISC_COMMAND(setItemName, "set name of items, sbrick, etc..","<sheet_id> <name
}
NLMISC_COMMAND(setMissingDynstringText, "set text of missing dynamic string"," <name> <text>")
{
if (args.size() < 2) return false;
ucstring name;
name.fromUtf8(args[0]);
ucstring text;
text.fromUtf8(args[1]);
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
if (pSMC)
pSMC->replaceDynString(name, text);
else
return false;
return true;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@ -5243,7 +5261,7 @@ bool CUserCommand::execute(const std::string &/* rawCommandString */, const std:
{
if ((uint)index >= args.size())
{
// Not enough argument
// Not enough arguments
pIM->displaySystemInfo (ucstring(CommandName+" : ")+CI18N::get ("uiCommandWrongArgumentCount"));
return false;
}
@ -5253,11 +5271,18 @@ bool CUserCommand::execute(const std::string &/* rawCommandString */, const std:
finalArgs += /*ucstring(*/args[index++]/*).toUtf8()*/;
else
{
finalArgs += /*ucstring(*/args[index++]/*).toUtf8()*/;
while (index<args.size())
{
finalArgs += " ";
finalArgs += /*ucstring(*/args[index++]/*).toUtf8()*/;
finalArgs += (index > 0) ? " " : "";
// If arg contains spaces then put it in quotes
if (string::npos != args[index].find(" "))
{
finalArgs += "\"" + args[index++] + "\"";
}
else
{
finalArgs += args[index++];
}
}
}
}

@ -244,20 +244,20 @@ class CAHOnReloadTestPage: public IActionHandler
REGISTER_ACTION_HANDLER (CAHOnReloadTestPage, "on_reload_test_page");
//void initWebBrowser()
//{
// CInterfaceManager *pIM = CInterfaceManager::getInstance();
// pIM->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_WEBSTART);
//
// // start the browser
// CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(pIM->getElementFromId(GROUP_BROWSER));
//
// if (pGH)
// {
// pGH->setActive(true);
// pGH->browse(MainPageURL.c_str());
// }
//}
void initWebBrowser()
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
//pIM->getDbProp("UI:VARIABLES:SCREEN")->setValue32(UI_VARIABLES_SCREEN_WEBSTART);
// start the browser
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(pIM->getElementFromId(GROUP_BROWSER));
if (pGH)
{
pGH->setActive(true);
pGH->browse(ClientCfg.PatchletUrl.c_str());
}
}
// ------------------------------------------------------------------------------------------------
@ -392,9 +392,6 @@ bool connection (const string &cookie, const string &fsaddr)
pIM->getDbProp ("UI:CURRENT_SCREEN")->setValue32(ClientCfg.Local ? 6 : -1); // TMP TMP
CCDBNodeBranch::flushObserversCalls();
// Init web box
//initWebBrowser();
// Active inputs
Actions.enable(true);
EditActions.enable(true);
@ -422,6 +419,10 @@ bool connection (const string &cookie, const string &fsaddr)
nlinfo ("PROFILE: %d seconds for connection", (uint32)(ryzomGetLocalTime ()-connStart)/1000);
// Init web box
nlinfo("ok");
initWebBrowser();
// TMP TMP
if (ClientCfg.Local)
{

@ -484,6 +484,9 @@ void checkUnderCursor()
if(ContextCur.context("ATTACK"))
return;
}
if(testMissionOption(0))
return;
}
// Dead
else

@ -115,7 +115,7 @@ NLMISC::CRGBA CEntityCL::_UserPackAnimalColor;
NLMISC::CRGBA CEntityCL::_PvpEnemyColor;
NLMISC::CRGBA CEntityCL::_PvpNeutralColor;
NLMISC::CRGBA CEntityCL::_PvpAllyInTeamColor;
NLMISC::CRGBA CEntityCL::_PvpAllyInGuildColor;
NLMISC::CRGBA CEntityCL::_PvpAllyInLeagueColor;
NLMISC::CRGBA CEntityCL::_PvpAllyColor;
NLMISC::CRGBA CEntityCL::_GMTitleColor[CHARACTER_TITLE::EndGmTitle - CHARACTER_TITLE::BeginGmTitle + 1];
uint8 CEntityCL::_InvalidGMTitleCode = 0xFF;
@ -2295,6 +2295,7 @@ void CEntityCL::onStringAvailable(uint /* stringId */, const ucstring &value)
womenTitle = true;
}
const ucstring replacement(STRING_MANAGER::CStringManagerClient::getTitleLocalizedName(_TitleRaw,womenTitle));
_Tags = STRING_MANAGER::CStringManagerClient::getTitleInfos(_TitleRaw,womenTitle);
if (!replacement.empty() || !ClientCfg.DebugStringManager)
{
// build the final name
@ -2436,7 +2437,6 @@ public:
CEntityCL::_PvpEnemyColor = pIM->getDbProp("UI:SAVE:ENTITY:COLORS:PVPENEMY")->getValueRGBA();
CEntityCL::_PvpAllyColor = pIM->getDbProp("UI:SAVE:ENTITY:COLORS:PVPALLY")->getValueRGBA();
CEntityCL::_PvpAllyInTeamColor = pIM->getDbProp("UI:SAVE:ENTITY:COLORS:PVPALLYINTEAM")->getValueRGBA();
CEntityCL::_PvpAllyInGuildColor = pIM->getDbProp("UI:SAVE:ENTITY:COLORS:PVPALLYINGUILD")->getValueRGBA();
CEntityCL::_PvpNeutralColor = pIM->getDbProp("UI:SAVE:ENTITY:COLORS:PVPNEUTRAL")->getValueRGBA();
// don't save these colors in .icfg because players can't change them
@ -2463,7 +2463,7 @@ bool CEntityCL::isTarget () const
//-----------------------------------------------
bool CEntityCL::isInGuild () const
bool CEntityCL::isInSameGuild () const
{
if (Type != Player && Type != User)
return false;
@ -2477,6 +2477,33 @@ bool CEntityCL::isInGuild () const
//-----------------------------------------------
bool CEntityCL::oneInLeague () const
{
if (Type != Player && Type != User)
return false;
const uint32 leagueID = getLeagueID();
if ((UserEntity && (UserEntity->getLeagueID() != 0)) || leagueID != 0)
return true;
return false;
}
//-----------------------------------------------
bool CEntityCL::isInSameLeague () const
{
if (Type != Player && Type != User)
return false;
const uint32 leagueID = getLeagueID();
if ((leagueID != 0) && UserEntity && (leagueID == UserEntity->getLeagueID()))
return true;
return false;
}
//-----------------------------------------------
NLMISC::CRGBA CEntityCL::getColor () const
{
// target
@ -2511,46 +2538,43 @@ NLMISC::CRGBA CEntityCL::getColor () const
{
if (isEnemy())
{
if (getPvpMode()&PVP_MODE::PvpFactionFlagged || getPvpMode()&PVP_MODE::PvpChallenge)
return _PvpEnemyColor;
else
if (getPvpMode()&PVP_MODE::PvpFaction)
return CRGBA(min(255, _PvpEnemyColor.R+150), min(255, _PvpEnemyColor.G+150), min(255, _PvpEnemyColor.B+150),_PvpEnemyColor.A);
else
return _PvpEnemyColor;
}
}
// neutral pvp
if (isNeutralPVP())
{
if (isInTeam())
return _PvpAllyInTeamColor;
if (isInGuild())
return _PvpAllyInGuildColor;
return _PvpNeutralColor;
}
// ally
if (isAlly())
{
if (getPvpMode() & PVP_MODE::PvpFactionFlagged)
{
if (isInTeam())
return _PvpAllyInTeamColor;
if(isInGuild())
return _PvpAllyInGuildColor;
return _PvpAllyColor;
if(isInSameLeague())
return CRGBA(max(0, _PvpAllyColor.R-100), max(0, _PvpAllyColor.G-100), max(0, _PvpAllyColor.B-100),_PvpAllyColor.A);
return CRGBA(max(0, _PvpAllyInTeamColor.R-100), max(0, _PvpAllyInTeamColor.G-100), max(0, _PvpAllyInTeamColor.B-100),_PvpAllyInTeamColor.A);
}
else
{
if (isInTeam())
return CRGBA(min(255, _PvpAllyInTeamColor.R+150), min(255, _PvpAllyInTeamColor.G+150), min(255, _PvpAllyInTeamColor.B+150),_PvpAllyInTeamColor.A);
if(isInGuild())
return CRGBA(min(255, _PvpAllyInGuildColor.R+150), min(255, _PvpAllyInGuildColor.G+150), min(255, _PvpAllyInGuildColor.B+150),_PvpAllyInGuildColor.A);
return CRGBA(min(255, _PvpAllyColor.R+150), min(255, _PvpAllyColor.G+150), min(255, _PvpAllyColor.B+150),_PvpAllyColor.A);
if(isInSameLeague())
return _PvpAllyColor;
return _PvpAllyInTeamColor;
}
}
// neutral pvp
if (isNeutralPVP())
return _PvpNeutralColor;
// neutral
if (isInTeam())
return _GroupColor;
if (isInGuild())
// neutral
if (isInSameLeague())
return CRGBA(min(255, _GroupColor.R+50), min(255, _GroupColor.G+50), min(255, _GroupColor.B+50),_GroupColor.A);
if (isInSameGuild())
return _GuildColor;
}
return _EntitiesColor[Type];

@ -686,7 +686,7 @@ public:
virtual bool isNeutralPVP() const { return false; }
/// Return true if this player has the viewing properties of a friend (inscene bars...)
virtual bool isViewedAsFriend() const { return isNeutral() || isFriend() || isInTeam() || isInGuild(); }
virtual bool isViewedAsFriend() const { return isNeutral() || isFriend() || isInTeam() || isInSameGuild() || isInSameLeague(); }
/// Return the People for the entity (unknown by default)
virtual EGSPD::CPeople::TPeople people() const;
@ -733,7 +733,13 @@ public:
bool isInTeam () const { return _IsInTeam; }
// Return true if this entity is in the user guild
bool isInGuild () const;
bool isInSameGuild () const;
// Return true if this entity is in the user league
bool isInSameLeague () const;
// Return true if this entity or the user is in a league
bool oneInLeague () const;
// Return true if this entity is a Mount owned by the User
bool isUserMount () const {return _IsUserMount;}
@ -746,8 +752,9 @@ public:
virtual uint64 getGuildSymbol () const { return 0; }
virtual uint32 getEventFactionID() const { return 0; }
virtual uint8 getPvpMode() const { return PVP_MODE::None; }
virtual uint16 getPvpMode() const { return PVP_MODE::None; }
virtual PVP_CLAN::TPVPClan getPvpClan() const { return PVP_CLAN::None; }
virtual uint32 getLeagueID() const { return 0; }
virtual uint16 getOutpostId() const { return 0; }
virtual OUTPOSTENUMS::TPVPSide getOutpostSide() const { return OUTPOSTENUMS::UnknownPVPSide; }
@ -760,6 +767,16 @@ public:
return _Title;
}
/// Return the entity tags
const ucstring &getTag(uint8 id) const
{
if (_Tags.size() > id) {
return _Tags[id];
}
static ucstring empty;
return empty;
}
/// Return the raw unparsed entity title
const ucstring getTitleRaw() const
{
@ -910,6 +927,8 @@ protected:
ucstring _EntityName;
// Current entity title
ucstring _Title;
// Current entity tags
std::vector<ucstring> _Tags;
// Current entity title string id
std::string _TitleRaw;
// Current permanent content symbol for the entity
@ -1006,7 +1025,7 @@ protected:
static NLMISC::CRGBA _PvpEnemyColor;
static NLMISC::CRGBA _PvpNeutralColor;
static NLMISC::CRGBA _PvpAllyInTeamColor;
static NLMISC::CRGBA _PvpAllyInGuildColor;
static NLMISC::CRGBA _PvpAllyInLeagueColor;
static NLMISC::CRGBA _PvpAllyColor;
// colors for GM players
static NLMISC::CRGBA _GMTitleColor[CHARACTER_TITLE::EndGmTitle - CHARACTER_TITLE::BeginGmTitle + 1];

@ -57,6 +57,9 @@
#include "sbrick_manager.h"
#include "sphrase_manager.h"
#include "action_handler_help.h"
#include "nel/misc/i18n.h"
#include "nel/misc/algo.h"
#include "nel/net/email.h"
#include "game_share/mission_desc.h"
#include "game_share/inventories.h"
#include "game_share/visual_slot_manager.h"
@ -378,7 +381,7 @@ CInterfaceGroup *CInterfaceHelp::activateNextWindow(CDBCtrlSheet *elt, sint forc
setup.setupDefaultIDs();
setup.SrcSheet = elt;
setup.HelpWindow = group;
setupCreatorName(setup);
//setupCreatorName(setup);
// Hide elements by defaults
resetSheetHelp(setup);
@ -2064,6 +2067,12 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS)
strFindReplace(itemText, "%r2_comment_text", toString(itemInfo.R2ItemComment));
}
break;
case ITEMFAMILY::PET_ANIMAL_TICKET:
{
string nr = (itemInfo.PetNumber > 0) ? toString(itemInfo.PetNumber) : "(slot)" + toString(item->getIndexInDB());
strFindReplace(itemText, "%petnumber", nr);
}
break;
default:
{
strFindReplace(itemText, "%no_rent", pIS->IsItemNoRent ? CI18N::get("uihelpItemNoRent") : string(""));
@ -2745,8 +2754,15 @@ void setupCreatorName(CSheetHelpSetup &setup)
CViewText *vthd = dynamic_cast<CViewText*>(setup.HelpWindow->getView("creator_header"));
if (vtid != NULL)
{
// if not an item, disable the view
if(!setup.SrcSheet || setup.SrcSheet->getType()!=CCtrlSheetInfo::SheetType_Item )
bool bIsRM = false;
if (setup.SrcSheet)
{
const CItemSheet *pIS= dynamic_cast<const CItemSheet*>(SheetMngr.get(CSheetId(setup.SrcSheet->getSheetId())));
bIsRM = (pIS && pIS->Family == ITEMFAMILY::RAW_MATERIAL);
}
// if a RM or not an item, disable the view
if(!setup.SrcSheet || bIsRM || setup.SrcSheet->getType()!=CCtrlSheetInfo::SheetType_Item )
{
// important else a brick could display a creator name....
vtid->setActive(false);
@ -3569,6 +3585,31 @@ public:
};
REGISTER_ACTION_HANDLER( CHandlerAuraModifierTooltip, "aura_modifier_tooltip");
// ***************************************************************************
class CHandlerUserPaToolTip : public IActionHandler
{
public:
virtual void execute(CCtrlBase *pCaller, const string &Params)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
uint8 index;
fromString(Params, index);
--index; // Param is 1-based so subtract 1
if (index < 0 || index >= MAX_INVENTORY_ANIMAL)
{
return;
}
ucstring txt;
CCDBNodeLeaf *node = pIM->getDbProp(toString("SERVER:PACK_ANIMAL:BEAST%d:NAME", index));
if (node && CStringManagerClient::instance()->getDynString(node->getValue32(), txt))
{
pIM->setContextHelpText(CEntityCL::removeTitleFromName(txt));
}
}
};
REGISTER_ACTION_HANDLER( CHandlerUserPaToolTip, "userpa_name_tooltip");
// ***************************************************************************
class CHandlerAnimalDeadPopupTooltip : public IActionHandler
@ -3922,7 +3963,7 @@ public:
#ifdef NL_OS_WINDOWS
if (Driver)
{
HWND wnd = Driver->getDisplay();
HWND wnd = (HWND) Driver->getDisplay();
ShowWindow(wnd, SW_MINIMIZE);
}
#endif

@ -64,6 +64,15 @@ void refreshItemHelp(CSheetHelpSetup &setup);
// refresh help for a mission
void refreshMissionHelp(CSheetHelpSetup &setup, const CPrerequisitInfos &infos);
class CPetAnimalItemInfoWaiter : public IItemInfoWaiter
{
void infoReceived()
{
//ItemSheet
//ItemSlotId
CClientItemInfo info = getInventory().getItemInfo(ItemSlotId);
}
};
// ***************************************************************************

@ -31,9 +31,11 @@
#include "../net_manager.h"
#include "group_menu.h"
#include "../global.h"
#include "group_html.h"
//
#include "game_share/inventories.h"
#include "game_share/bot_chat_types.h"
#include "macrocmd_manager.h"
#include "inventory_manager.h"
@ -43,6 +45,7 @@
#include "view_bitmap.h"
extern CSheetManager SheetMngr;
extern NLMISC::CLog g_log;
using namespace std;
using namespace NLMISC;
@ -80,8 +83,6 @@ void CInterfaceItemEdition::setCurrWindow(CDBCtrlSheet* ctrlSheet, const std::st
_CurrWindow.IsInEditionMode = isInEditionMode;
_CurrWindow.begin();
}
}
// ********************************************************************************************
@ -153,13 +154,26 @@ void CInterfaceItemEdition::CItemEditionWindow::infoReceived()
if (itemInfo.CustomText.empty())
display->setTextFormatTaged(ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id)));
else
display->setTextFormatTaged(itemInfo.CustomText);
{
ucstring text = itemInfo.CustomText;
string::size_type delimiter = text.find(' ');
if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(pIM->getElementFromId("ui:interface:web_transactions:content:html"));
if (pGH)
pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str());
if (delimiter == string::npos)
group->setActive(false);
else
text = text.substr(delimiter, text.size()-delimiter);
}
display->setTextFormatTaged(text);
}
}
}
}
}
}
@ -278,7 +292,21 @@ void CInterfaceItemEdition::CItemEditionWindow::begin()
if (itemInfo.CustomText.empty())
display->setTextFormatTaged(ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(pIS->Id)));
else
display->setTextFormatTaged(itemInfo.CustomText);
{
ucstring text = itemInfo.CustomText;
string::size_type delimiter = text.find(' ');
if(text.size() > 3 && text[0]=='@' && text[1]=='W' && text[2]=='E' && text[3]=='B')
{
CGroupHTML *pGH = dynamic_cast<CGroupHTML*>(pIM->getElementFromId("ui:interface:web_transactions:content:html"));
if (pGH)
pGH->browse(ucstring(text.substr(4, delimiter-4)).toString().c_str());
if (delimiter == string::npos)
group->setActive(false);
else
text = text.substr(delimiter, text.size()-delimiter);
}
display->setTextFormatTaged(text);
}
}
else
{
@ -287,7 +315,6 @@ void CInterfaceItemEdition::CItemEditionWindow::begin()
}
}
}
}
}
}
@ -366,7 +393,6 @@ void CInterfaceItemEdition::CItemEditionWindow::validate()
text = editBoxLarge->getInputString();
}
if (textValid)
{
CBitMemStream out;
@ -972,6 +998,12 @@ bool checkCanExchangeItem(CDBCtrlSheet *pCSSrc)
bDropOrSell = pIS->canExchangeOrGive(PlayerTrade.BotChatGiftContext);
}
// Locked by owner; cannot trade
if (pCSSrc->getLockedByOwner())
{
return false;
}
// Special case if this is an animal ticket
if ((pIS != NULL) && (pIS->Family == ITEMFAMILY::PET_ANIMAL_TICKET))
{
@ -1209,6 +1241,13 @@ class CHandlerDestroyItem : public IActionHandler
nlwarning("<CHandlerDestroyItem::execute> no caller sheet found");
return;
}
// Don't destroy locked items
if (item->getLockedByOwner())
{
return;
}
// if the item is currently selected, removes the selection
if (item == CDBCtrlSheet::getCurrSelection())
{
@ -1712,11 +1751,15 @@ class CHandlerItemMenuCheck : public IActionHandler
CViewTextMenu *pXpCatalyserUse = dynamic_cast<CViewTextMenu*>(pMenu->getView("xp_catalyser_use"));
CViewTextMenu *pDrop = dynamic_cast<CViewTextMenu*>(pMenu->getView("drop"));
CViewTextMenu *pDestroy = dynamic_cast<CViewTextMenu*>(pMenu->getView("destroy"));
CViewTextMenu *pLockUnlock = dynamic_cast<CViewTextMenu*>(pMenu->getView("lockunlock"));
CViewTextMenu *pMoveSubMenu = dynamic_cast<CViewTextMenu*>(pMenu->getView("move"));
CViewTextMenu *pMoveToBag = dynamic_cast<CViewTextMenu*>(pMenu->getView("bag"));
CViewTextMenu *pMoveToGuild = dynamic_cast<CViewTextMenu*>(pMenu->getView("guild"));
CViewTextMenu *pMoveToRoom = dynamic_cast<CViewTextMenu*>(pMenu->getView("room"));
CViewTextMenu *pMoveToPa[MAX_INVENTORY_ANIMAL];
bool bIsLockedByOwner = pCS->getLockedByOwner();
for(i=0;i<MAX_INVENTORY_ANIMAL;i++)
{
pMoveToPa[i]= dynamic_cast<CViewTextMenu*>(pMenu->getView(toString("pa%d", i)));
@ -1735,24 +1778,27 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pXpCatalyserUse) pXpCatalyserUse->setActive(false);
if(pItemTextDisplay) pItemTextDisplay->setActive(false);
if(pItemTextEdition) pItemTextEdition->setActive(false);
if(pLockUnlock) pLockUnlock->setActive(true);
const CItemSheet *pIS = pCS->asItemSheet();
if (invId != INVENTORIES::guild)
if (pIS != NULL)
{
if (pCrisEnchant && pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL)
if (pCrisEnchant && pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL && !bIsLockedByOwner)
pCrisEnchant->setActive(true);
if (pCrisReload && pIS->Family == ITEMFAMILY::ITEM_SAP_RECHARGE)
if (pCrisReload && pIS->Family == ITEMFAMILY::ITEM_SAP_RECHARGE && !bIsLockedByOwner)
pCrisReload->setActive(true);
// teleport can be used only from bag (NB: should not exist in mektoub....)
if (pTeleportUse && pIS->Family == ITEMFAMILY::TELEPORT && pCS->getInventoryIndex()==INVENTORIES::bag)
if (pTeleportUse && pIS->Family == ITEMFAMILY::TELEPORT && pCS->getInventoryIndex()==INVENTORIES::bag && !bIsLockedByOwner)
{
pTeleportUse->setActive(true);
}
if (pItemConsume && pIS->IsConsumable == true && pCS->getInventoryIndex()==INVENTORIES::bag)
if (pItemConsume && pIS->IsConsumable == true && pCS->getInventoryIndex()==INVENTORIES::bag && !bIsLockedByOwner)
{
pItemConsume->setActive(true);
}
if (pXpCatalyserUse && pIS->Family == ITEMFAMILY::XP_CATALYSER && pCS->getInventoryIndex()==INVENTORIES::bag)
if (pXpCatalyserUse && pIS->Family == ITEMFAMILY::XP_CATALYSER && pCS->getInventoryIndex()==INVENTORIES::bag && !bIsLockedByOwner)
{
pXpCatalyserUse->setActive(true);
}
@ -1815,9 +1861,10 @@ class CHandlerItemMenuCheck : public IActionHandler
for(i=0;i<MAX_INVENTORY_ANIMAL;i++)
if(pMoveToPa[i]) pMoveToPa[i]->setActive(false);
// additionnaly, cannot drop/destroy an animal item.
// additionnaly, cannot drop/destroy/lock an animal item.
if(pDrop) pDrop->setActive(false);
if(pDestroy) pDestroy->setActive(false);
if(pLockUnlock) pLockUnlock->setActive(false);
}
else
{
@ -1845,6 +1892,7 @@ class CHandlerItemMenuCheck : public IActionHandler
// std case: can drop / destroy
if(pDrop) pDrop->setActive(invId!=INVENTORIES::guild);
if(pDestroy) pDestroy->setActive(invId!=INVENTORIES::guild);
if(pLockUnlock) pLockUnlock->setActive(invId!=INVENTORIES::guild);
}
// hide the move entry completely?
@ -1899,6 +1947,29 @@ class CHandlerItemMenuCheck : public IActionHandler
pItemTextDisplay->setGrayed(pIM->getDbProp("UI:VARIABLES:ISACTIVE:PHRASE_EDIT_CUSTOM")->getValueBool());
}
if (pCS->getGrayed())
{
if (pEquip) pEquip->setActive(false);
if (pDestroy) pDestroy->setActive(false);
if (pLockUnlock) pLockUnlock->setActive(false);
if (pMoveSubMenu) pMoveSubMenu->setActive(false);
}
if (bIsLockedByOwner)
{
if (pLockUnlock) pLockUnlock->setHardText("uimUnlockItem");
// Cannot drop/destroy if locked by owner
if (pDrop) pDrop->setActive(false);
if (pDestroy) pDestroy->setActive(false);
}
else
{
if (pLockUnlock) pLockUnlock->setHardText("uimLockItem");
}
// Only show lock menu item if inventory contains the info
if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock());
// **** Gray Entries
// If ourselves are not available, then gray all
@ -1911,6 +1982,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pXpCatalyserUse) pXpCatalyserUse->setGrayed(true);
if(pDrop) pDrop->setGrayed(true);
if(pDestroy) pDestroy->setGrayed(true);
if(pLockUnlock) pLockUnlock->setGrayed(true);
if(pMoveSubMenu) pMoveSubMenu->setGrayed(true);
if(pMoveToBag) pMoveToBag->setGrayed(true);
for(i=0;i<MAX_INVENTORY_ANIMAL;i++)
@ -1929,6 +2001,7 @@ class CHandlerItemMenuCheck : public IActionHandler
if(pXpCatalyserUse) pXpCatalyserUse->setGrayed(false);
if(pDrop) pDrop->setGrayed(false);
if(pDestroy) pDestroy->setGrayed(false);
if(pLockUnlock) pLockUnlock->setGrayed(false);
if(pMoveSubMenu) pMoveSubMenu->setGrayed(false);
// check each inventory dest if available
@ -1956,6 +2029,45 @@ class CHandlerItemMenuDeactivate : public IActionHandler
};
REGISTER_ACTION_HANDLER( CHandlerItemMenuDeactivate, "item_menu_deactivate" );
// ***************************************************************************
class CHandlerItemMenuBaseCheck : public IActionHandler
{
void execute (CCtrlBase *pCaller, const std::string &/* sParams */)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
// Get the ctrl sheet that launched this menu
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(pIM->getCtrlLaunchingModal());
if (pCS == NULL) return;
INVENTORIES::TInventory invId= (INVENTORIES::TInventory)pCS->getInventoryIndex();
// Get the menu launched
CInterfaceGroup *pMenu= dynamic_cast<CInterfaceGroup*>(pCaller);
if(!pMenu) return;
// Get all needed text entries
CViewTextMenu *pDestroy = dynamic_cast<CViewTextMenu*>(pMenu->getView("destroy"));
CViewTextMenu *pLockUnlock = dynamic_cast<CViewTextMenu*>(pMenu->getView("lockunlock"));
if (pCS->getLockedByOwner())
{
pLockUnlock->setHardText("uimUnlockItem");
// Cannot destroy if locked by owner
if (pDestroy) pDestroy->setActive(false);
}
else
{
pLockUnlock->setHardText("uimLockItem");
if (pDestroy) pDestroy->setActive(true);
}
}
};
REGISTER_ACTION_HANDLER( CHandlerItemMenuBaseCheck, "item_menu_base_check" );
// ***************************************************************************
static void sendMsgUseItem(uint16 slot)
{

@ -33,7 +33,7 @@
#include "group_editbox.h"
#include "dbview_bar.h"
#include "skill_manager.h"
#include "game_share/bot_chat_types.h"
using namespace std;
using namespace NLMISC;
@ -69,7 +69,9 @@ const std::string FaberPhraseItemResultGroup= FaberPhraseWindow + ":header_opene
// ***************************************************************************
CActionPhraseFaber::CActionPhraseFaber()
{
_InventoryMirror.resize(INVENTORIES::NUM_INVENTORY * MAX_PLAYER_INV_ENTRIES);
uint size = MAX_PLAYER_INV_ENTRIES + (MAX_ANIMALINV_ENTRIES * MAX_INVENTORY_ANIMAL) +
MAX_GUILDINV_ENTRIES + MAX_ROOMINV_ENTRIES;
_InventoryMirror.resize(size);
_InventoryObsSetup= false;
_ExecuteFromItemPlanBrick= NULL;
}
@ -275,25 +277,64 @@ void CActionPhraseFaber::fillFaberPlanSelection(const std::string &brickDB, ui
}
// ***************************************************************************
CItemImage *CActionPhraseFaber::getInvMirrorItemImage(uint slotIndex)
CItemImage *CActionPhraseFaber::getInvMirrorItemImage(uint slotIndex, uint& invId, uint& indexInInv)
{
uint invId= slotIndex/MAX_PLAYER_INV_ENTRIES;
uint indexInInv= slotIndex%MAX_PLAYER_INV_ENTRIES;
if (slotIndex < MAX_PLAYER_INV_ENTRIES)
{
invId = INVENTORIES::bag;
indexInInv = slotIndex;
return &getInventory().getBagItem(slotIndex);
}
slotIndex -= MAX_PLAYER_INV_ENTRIES;
if (slotIndex < (MAX_ANIMALINV_ENTRIES * MAX_INVENTORY_ANIMAL))
{
uint animal = slotIndex / MAX_ANIMALINV_ENTRIES;
uint index = slotIndex % MAX_ANIMALINV_ENTRIES;
invId = INVENTORIES::pet_animal + animal;
indexInInv = index;
return &getInventory().getPAItem(animal, index);
}
slotIndex -= (MAX_ANIMALINV_ENTRIES * MAX_INVENTORY_ANIMAL);
if (slotIndex < MAX_GUILDINV_ENTRIES)
{
if (getInventory().isInventoryAvailable(INVENTORIES::guild))
{
CInterfaceManager *im = CInterfaceManager::getInstance();
CCDBNodeBranch *itemBranch = im->getDbBranch(SERVER_INVENTORY ":GUILD:" + toString(slotIndex));
static CItemImage image;
image.build(itemBranch);
invId = INVENTORIES::guild;
indexInInv = slotIndex;
return &image;
}
return NULL;
}
slotIndex -= MAX_GUILDINV_ENTRIES;
// get the item image from bag, steed, pack animal...
if(invId==INVENTORIES::bag && indexInInv<MAX_BAGINV_ENTRIES)
return &getInventory().getBagItem(indexInInv);
else if(invId>=INVENTORIES::pet_animal && invId<INVENTORIES::pet_animal+MAX_INVENTORY_ANIMAL && indexInInv<MAX_ANIMALINV_ENTRIES)
return &getInventory().getPAItem(invId-INVENTORIES::pet_animal, indexInInv);
if (slotIndex < MAX_ROOMINV_ENTRIES)
{
if (getInventory().isInventoryAvailable(INVENTORIES::player_room))
{
CInterfaceManager *im = CInterfaceManager::getInstance();
CCDBNodeBranch *itemBranch = im->getDbBranch(SERVER_INVENTORY ":ROOM:" + toString(slotIndex));
static CItemImage image;
image.build(itemBranch);
invId = INVENTORIES::player_room;
indexInInv = slotIndex;
return &image;
}
return NULL;
}
return NULL;
}
// ***************************************************************************
bool CActionPhraseFaber::isMpAvailable(CItemSheet *mpSheet, uint slotIndex) const
bool CActionPhraseFaber::isMpAvailable(CItemSheet *mpSheet, uint invId, uint slotIndex) const
{
uint invId= slotIndex / MAX_PLAYER_INV_ENTRIES;
return mpSheet && mpSheet->Family==ITEMFAMILY::RAW_MATERIAL && getInventory().isInventoryAvailable((INVENTORIES::TInventory)invId);
}
@ -396,14 +437,14 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick
_InventoryMirror[i].reset();
}
uint invId = 0;
uint indexInInv = 0;
// Run all the inventories.
for(i=0;i<_InventoryMirror.size();i++)
{
uint invId= i/MAX_PLAYER_INV_ENTRIES;
uint indexInInv= i%MAX_PLAYER_INV_ENTRIES;
CItemImage *itemImage= getInvMirrorItemImage(i);
// item found?
CItemImage *itemImage= getInvMirrorItemImage(i, invId, indexInInv);
bool bLockedByOwner = itemImage && itemImage->getLockedByOwner();
// item found and not locked?
if(itemImage)
{
// setup the origin
@ -413,7 +454,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick
// The item must be a mp
CSheetId sheetId= CSheetId(itemImage->getSheetID());
CItemSheet *mpSheet= dynamic_cast<CItemSheet*>(SheetMngr.get(sheetId));
if( isMpAvailable(mpSheet, i) )
if( isMpAvailable(mpSheet, invId, i) && !bLockedByOwner)
{
_InventoryMirror[i].Sheet= sheetId;
_InventoryMirror[i].Quality= itemImage->getQuality();
@ -422,6 +463,7 @@ void CActionPhraseFaber::validateFaberPlanSelection(CSBrickSheet *itemPlanBrick
_InventoryMirror[i].Weight= itemImage->getWeight();
// Bkup original quantity from inventory
_InventoryMirror[i].OriginalQuantity= _InventoryMirror[i].Quantity;
_InventoryMirror[i].LockedByOwner= bLockedByOwner;
}
}
}
@ -1311,17 +1353,22 @@ void CActionPhraseFaber::onInventoryChange()
return;
// Run all the Bag
uint invId = 0;
uint indexInInv = 0;
for(i=0;i<_InventoryMirror.size();i++)
{
CItemImage *itemImage= getInvMirrorItemImage(i);
CItemImage *itemImage= getInvMirrorItemImage(i, invId, indexInInv);
if(itemImage)
{
CSheetId sheetId= CSheetId(itemImage->getSheetID());
CItemSheet *mpSheet= dynamic_cast<CItemSheet*>(SheetMngr.get(sheetId));
CItem newInvItem;
// The item must be a mp, and the item must be available
if( isMpAvailable(mpSheet, i) )
bool bLockedByOwner = itemImage->getLockedByOwner();
// The item must be a mp, and the item must be available and unlocked
if( isMpAvailable(mpSheet, invId, i) && !bLockedByOwner)
{
newInvItem.Sheet= sheetId;
newInvItem.Quality= itemImage->getQuality();
@ -1329,12 +1376,13 @@ void CActionPhraseFaber::onInventoryChange()
newInvItem.UserColor= itemImage->getUserColor();
newInvItem.Weight= itemImage->getWeight();
newInvItem.OriginalQuantity= newInvItem.Quantity;
newInvItem.LockedByOwner = bLockedByOwner;
}
/* There is 4 cases:
/* There is 5 cases:
- no changes => no op.
- new Mp on a empty or non Mp slot. Easy, just add.
- old Mp removed (not same sheetId/quality/userColor)
- new/unlocked Mp on a empty or non Mp slot. Easy, just add.
- old Mp removed (not same sheetId/quality/userColor/locked)
- old Mp with quantity changed to be greater
- old Mp with quantity changed to be smaller
*/
@ -1348,8 +1396,8 @@ void CActionPhraseFaber::onInventoryChange()
// If the item was not a mp
if(_InventoryMirror[i].Sheet==CSheetId::Unknown)
{
// if now it is, easy, just add
if(newInvItem.Sheet!=CSheetId::Unknown)
// if now it is, easy, just add if not locked
if(newInvItem.Sheet!=CSheetId::Unknown && !newInvItem.LockedByOwner)
curInvItem= newInvItem;
}
// else must test change or remove
@ -1358,7 +1406,8 @@ void CActionPhraseFaber::onInventoryChange()
bool sameMp;
sameMp= curInvItem.Sheet == newInvItem.Sheet &&
curInvItem.Quality == newInvItem.Quality &&
curInvItem.UserColor == newInvItem.UserColor ;
curInvItem.UserColor == newInvItem.UserColor &&
curInvItem.LockedByOwner == newInvItem.LockedByOwner;
// if the Mp was deleted from this slot, delete it from all faber execution
if(!sameMp)

@ -92,6 +92,7 @@ private:
uint Selected;
// This is the original quantity in inventory
sint32 OriginalQuantity;
bool LockedByOwner;
CItem() : Sheet(0)
{
@ -233,8 +234,8 @@ private:
void removeMpSlotThatUseInvSlot(uint invSlot, uint quantityToRemove);
// from an index in _InventoryMirror, get the ItemImage
CItemImage *getInvMirrorItemImage(uint slotIndex);
bool isMpAvailable(CItemSheet *mpSheet, uint slotIndex) const;
CItemImage *getInvMirrorItemImage(uint slotIndex, uint& invId, uint& indexInInv);
bool isMpAvailable(CItemSheet *mpSheet, uint invId, uint slotIndex) const;
void updateItemResult();
};

@ -48,6 +48,7 @@
#include "../sheet_manager.h"
#include "../user_entity.h"
#include "view_bitmap.h"
#include "nel/misc/common.h"
using namespace std::rel_ops;
@ -996,7 +997,7 @@ void CBotChatPageTrade::startSellDialog(CDBCtrlSheet *sheet, CCtrlBase * /* pCal
CCtrlTextButton *confirmButton = dynamic_cast<CCtrlTextButton*>(ig->getCtrl("ok"));
if (confirmButton)
{
confirmButton->setActive( true );
confirmButton->setActive( sheet->getLockedByOwner() );
confirmButton->setText(CI18N::get("uiSellImmediately"));
confirmButton->setDefaultContextHelp(CI18N::get("uittDirectSellButton"));
}
@ -1538,10 +1539,12 @@ void CBotChatPageTrade::setupResellGroup(bool sellMode, uint defaultQuantity, CI
CViewText *vt= dynamic_cast<CViewText*>(cantResellGroup->getView("reason"));
if(vt)
{
if(resaleFlag==BOTCHATTYPE::ResaleKOBroken)
if(resaleFlag == BOTCHATTYPE::ResaleKOBroken)
vt->setHardText("uiCantResaleCauseDamaged");
else
else if (resaleFlag == BOTCHATTYPE::ResaleKONoTimeLeft)
vt->setHardText("uiCantResaleCauseTooLate");
else
vt->setHardText("uiCantResaleLockedByOwner");
}
}
// else setup "can_resell:choose_resell group"
@ -2575,9 +2578,9 @@ static DECLARE_INTERFACE_USER_FCT(getPriceWithFame)
if(value==-1)
result.setUCString(CI18N::get("uiBadPrice"));
else if(value==valueFame)
result.setUCString(toString(value));
result.setUCString(NLMISC::formatThousands(toString(value)));
else
result.setUCString(toString("%d (%d)", valueFame, value));
result.setUCString(NLMISC::formatThousands(toString(valueFame)) + " (" + NLMISC::formatThousands(toString(value)) + ")");
return true;
}
@ -2592,8 +2595,8 @@ static DECLARE_INTERFACE_USER_FCT(getBonusOnResale)
sint valueHigh= (sint)args[0].getInteger();
sint valueLow= (sint)args[1].getInteger();
sint diff = valueHigh - valueLow;
result.setUCString(toString("+%d", diff));
sint diff = valueHigh - valueLow;
result.setUCString("+" + NLMISC::formatThousands(toString(diff)));
return true;
}

@ -378,7 +378,7 @@ void CChatTargetFilter::setTargetGroup(CChatGroup::TGroupType groupType, uint32
const bool guildActive = pIM->getDbProp("SERVER:GUILD:NAME")->getValueBool();
switch(groupType)
{
case CChatGroup::dyn_chat: entry+="DYN"; break;
case CChatGroup::dyn_chat: entry+="DYN:" + NLMISC::toString(dynamicChannelDbIndex); break;
case CChatGroup::say: entry+="SAY"; break;
case CChatGroup::shout: entry+="SHOUT"; break;
case CChatGroup::team: if(!teamActive) return; entry+="GROUP"; break;

@ -148,18 +148,43 @@ CViewBase *CChatTextManager::createMsgText(const ucstring &cstMsg, NLMISC::CRGBA
vt->setMultiLineSpace(getTextMultiLineSpace());
vt->setModulateGlobalColor(false);
ucstring cur_time;
static CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (node)
{
if (node->getValueBool())
{
cur_time = CInterfaceManager::getTimestampHuman();
}
}
// if text contain any color code, set the text formated and white,
// otherwise, set text normal and apply global color
if (msg.find(ucstring("@{")) != ucstring::npos)
size_t codePos = msg.find(ucstring("@{"));
if (codePos != ucstring::npos)
{
// Prepend the current time (do it after the color if the color at first position.
if (codePos == 0)
{
codePos = msg.find(ucstring("}"));
msg = msg.substr(0, codePos + 1) + cur_time + msg.substr(codePos + 1, msg.length() - codePos);
}
else
{
msg = cur_time + msg;
}
vt->setTextFormatTaged(msg);
vt->setColor(NLMISC::CRGBA::White);
}
else
{
msg = cur_time + msg;
vt->setText(msg);
vt->setColor(col);
}
if (!commandGroup)
{
return vt;

@ -472,15 +472,9 @@ void CChatWindow::displayLocalPlayerTell(const ucstring &receiver, const ucstrin
CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:SPEAKER"," ");
encodeColorTag(prop.getRGBA(), finalMsg, false);
ucstring cur_time;
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
{
cur_time = CInterfaceManager::getTimestampHuman();
}
ucstring csr;
if (CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw())) csr += ucstring("(CSR) ");
finalMsg += cur_time + csr + CI18N::get("youTell") + ": ";
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
finalMsg += csr + CI18N::get("youTell") + ": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
encodeColorTag(prop.getRGBA(), finalMsg, true);
finalMsg += msg;
@ -1294,8 +1288,18 @@ public:
CChatWindow::_ChatWindowLaunchingCommand = chat;
string str = text.toUtf8();
string cmdWithArgs = str.substr(1);
/* In the chat context, only ' ' is a possible separator */
// Get the command name from the string, can contain spaces
string cmd = cmdWithArgs.substr(0, cmdWithArgs.find(' '));
if (cmdWithArgs.find('"') == 0)
{
string::size_type pos = cmdWithArgs.find('"', 1);
if (string::npos != pos)
{
cmd = cmdWithArgs.substr(1, pos - 1);
}
}
if ( NLMISC::ICommand::exists( cmd ) )
{
NLMISC::ICommand::execute( cmdWithArgs, g_log );
@ -1314,7 +1318,7 @@ public:
}
}
// Clear input string
pEB->setInputString (string(""));
pEB->setInputString (ucstring(""));
CGroupContainer *gc = pEB->getEnclosingContainer();
if (gc)
{

@ -115,6 +115,7 @@ public:
// @{
// Event part
void setActionOnLeftClick (const std::string &actionHandlerName) { _AHOnLeftClickString = actionHandlerName; _AHOnLeftClick = getAH(actionHandlerName, _AHLeftClickParams); }
void setActionOnLeftClickParams(const std::string &params) { _AHOnLeftClickStringParams = params; }
void setActionOnRightClick (const std::string &actionHandlerName) { _AHOnRightClick = getAH(actionHandlerName, _AHRightClickParams); }
void setActionOnClockTick (const std::string &ahName) { _AHOnClockTick = getAH(ahName, _AHClockTickParams); }
void setParamsOnLeftClick (const std::string &paramsHandlerName) { _AHLeftClickParams = paramsHandlerName; }
@ -204,6 +205,7 @@ protected:
IActionHandler *_AHOnOver;
CStringShared _AHOverParams;
std::string _AHOnLeftClickString;
std::string _AHOnLeftClickStringParams;
IActionHandler *_AHOnLeftClick;
CStringShared _AHLeftClickParams;
IActionHandler *_AHOnLeftDblClick;

@ -338,7 +338,14 @@ bool CCtrlButton::getMouseOverShape(string &texName, uint8 &rot, CRGBA &col)
{
if (_AHOnLeftClickString == "browse")
{
texName = "curs_pick.tga";
if (!_AHOnLeftClickStringParams.empty())
{
texName = "@curs_pick.tga@"+_AHOnLeftClickStringParams;
}
else
{
texName = "curs_pick.tga";
}
rot= 0;
col = CRGBA::White;
return true;

@ -45,6 +45,7 @@
#include "../client_sheets/sphrase_sheet.h"
#include "game_share/xml_auto_ptr.h"
#include "lua_ihm.h"
#include "game_share/bot_chat_types.h"
#include "../r2/editor.h"
@ -123,6 +124,14 @@ ucstring CControlSheetTooltipInfoWaiter::infoValidated(CDBCtrlSheet* ctrlSheet,
return help;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls)
{
CLuaIHM::pushUIOnStack(ls, dynamic_cast<CInterfaceElement *>(_LastDraggedSheet));
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaGetHpBuff(CLuaState &ls)
{
@ -179,6 +188,62 @@ int CDBCtrlSheet::luaGetName(CLuaState &ls)
return 1;
}
// **********************************************************************************************************
class LuaInfoWaiter : public IItemInfoWaiter
{
public:
volatile bool done;
public:
virtual void infoReceived();
};
void LuaInfoWaiter::infoReceived()
{
getInventory().removeItemInfoWaiter(this);
this->done = true;
}
static LuaInfoWaiter luaInfoWaiter;
// ***************************************************************************
int CDBCtrlSheet::luaGetCreatorName(CLuaState &ls)
{
uint32 itemSlotId = getInventory().getItemSlotId(this);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
ucstring creatorName;
STRING_MANAGER::CStringManagerClient::instance()->getString(itemInfo.CreatorName, creatorName);
CLuaIHM::push(ls, creatorName);
return 1;
}
// ***************************************************************************
int CDBCtrlSheet::luaWaitInfo(CLuaState &ls)
{
static bool sent = false;
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
uint32 itemSlotId= getInventory().getItemSlotId(ctrlSheet);
CClientItemInfo itemInfo = getInventory().getItemInfo(itemSlotId);
if (sent || itemInfo.versionInfo != 0)
{
ls.push((bool)(luaInfoWaiter.done));
if (luaInfoWaiter.done)
sent = false;
return luaInfoWaiter.done ? 1 : 0;
}
else
{
luaInfoWaiter.ItemSlotId = itemSlotId;
luaInfoWaiter.ItemSheet = this->getSheetId();
luaInfoWaiter.done = false;
getInventory().addItemInfoWaiter(&luaInfoWaiter);
sent = true;
}
return 0;
}
// ***************************************************************************
int CDBCtrlSheet::luaBuildCrystallizedSpellListBrick(CLuaState &ls)
@ -1797,8 +1862,16 @@ void CDBCtrlSheet::draw()
string params = string("src=") + pCSSrc->getId();
if (!_AHCanDropParams.empty())
{
string sTmp = _AHCanDropParams;
params = sTmp + "|" + params;
if (getAHName(_AHOnCanDrop) == "lua")
{
params = _AHCanDropParams;
strFindReplace(params, "%src", pCSSrc->getId());
}
else
{
string sTmp = _AHCanDropParams;
params = sTmp + "|" + params;
}
}
pIM->runActionHandler (_AHOnCanDrop, this, params);
}
@ -2138,6 +2211,12 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
// if a raw material for example, must add special icon text.
displayCharBitmaps(_RenderLayer+2, x, y, curSheetColor);
// Add the lock overlay if needed
if (getLockedByOwner())
{
rVR.draw11RotFlipBitmap (_RenderLayer+1, x - 2, y + 8, 0, false, rVR.getSystemTextureId(CViewRenderer::ItemLockedByOwnerTexture), curSheetColor);
}
}
break;
// Action
@ -2600,8 +2679,16 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
string params = string("src=") + _Id;
if (!pCSdest->_AHCanDropParams.empty())
{
string sTmp = pCSdest->_AHCanDropParams;
params = sTmp + "|" + params;
if (getAHName(pCSdest->_AHOnCanDrop) == "lua")
{
params = pCSdest->_AHCanDropParams;
strFindReplace(params, "%src", _Id);
}
else
{
string sTmp = pCSdest->_AHCanDropParams;
params = sTmp + "|" + params;
}
}
pIM->runActionHandler (pCSdest->_AHOnCanDrop, pCSdest, params);
@ -2612,8 +2699,16 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
string params = string("src=") + _Id;
if (!pCSdest->_AHDropParams.empty())
{
string sTmp = pCSdest->_AHDropParams;
params = sTmp + "|" + params; // must copy 'drop' params at start because it could be the name of a procedure
if (getAHName(pCSdest->_AHOnDrop) == "lua")
{
params = pCSdest->_AHDropParams;
strFindReplace(params, "%src", _Id);
}
else
{
string sTmp = pCSdest->_AHDropParams;
params = sTmp + "|" + params;// must copy 'drop' params at start because it could be the name of a procedure
}
}
// call action
pIM->runActionHandler (pCSdest->_AHOnDrop, pCSdest, params);
@ -2649,8 +2744,16 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
string params = string("src=") + _Id;
if (!pList->getCtrlSheetInfo()._AHCanDropParams.empty())
{
string sTmp = pList->getCtrlSheetInfo()._AHCanDropParams;
params = sTmp + "|" + params;
if (getAHName(pList->getCtrlSheetInfo()._AHOnCanDrop) == "lua")
{
params = pList->getCtrlSheetInfo()._AHCanDropParams;
strFindReplace(params, "%src", _Id);
}
else
{
string sTmp = pList->getCtrlSheetInfo()._AHCanDropParams;
params = sTmp + "|" + params;
}
}
pIM->runActionHandler (pList->getCtrlSheetInfo()._AHOnCanDrop, pList, params);
@ -2661,8 +2764,16 @@ bool CDBCtrlSheet::handleEvent (const CEventDescriptor &event)
string params = string("src=") + _Id;
if (!pList->getCtrlSheetInfo()._AHDropParams.empty())
{
string sTmp = pList->getCtrlSheetInfo()._AHDropParams;
params = sTmp + "|" + params; // must copy 'drop' params at start because it could be the name of a procedure
if (getAHName(pList->getCtrlSheetInfo()._AHOnDrop) == "lua")
{
params = pList->getCtrlSheetInfo()._AHDropParams;
strFindReplace(params, "%src", _Id);
}
else
{
string sTmp = pList->getCtrlSheetInfo()._AHDropParams;
params = sTmp + "|" + params; // must copy 'drop' params at start because it could be the name of a procedure
}
}
// call action
pIM->runActionHandler (pList->getCtrlSheetInfo()._AHOnDrop, pList, params);
@ -2975,9 +3086,32 @@ void CDBCtrlSheet::getContextHelp(ucstring &help) const
}
else if(getType() == CCtrlSheetInfo::SheetType_Item)
{
const CItemSheet *item = asItemSheet();
if (item)
help = getItemActualName();
const CItemSheet *item= asItemSheet();
if(item)
{
if (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL || item->Family == ITEMFAMILY::JEWELRY || item->Family == ITEMFAMILY::ARMOR)
{
string luaMethodName = ( (item->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ? "updateCrystallizedSpellTooltip" : "updateBuffItemTooltip");
CDBCtrlSheet *ctrlSheet = const_cast<CDBCtrlSheet*>(this);
if ( ! getInventory().isItemInfoUpToDate(getInventory().getItemSlotId(ctrlSheet)))
{
// Prepare the waiter
ControlSheetTooltipUpdater.ItemSheet= ctrlSheet->getSheetId();
ControlSheetTooltipUpdater.LuaMethodName = luaMethodName;
ControlSheetTooltipUpdater.ItemSlotId= getInventory().getItemSlotId(ctrlSheet);
ControlSheetTooltipUpdater.CtrlSheet = ctrlSheet;
// Add the waiter
getInventory().addItemInfoWaiter(&ControlSheetTooltipUpdater);
}
help = ControlSheetTooltipUpdater.infoValidated(ctrlSheet, luaMethodName);
}
else
help= getItemActualName();
}
else
help= _ContextHelp;
}
@ -3936,6 +4070,17 @@ void CDBCtrlSheet::setItemResaleFlag(sint32 rf)
node->setValue32(rf);
}
// ***************************************************************************
bool CDBCtrlSheet::getLockedByOwner() const
{
return (getItemResaleFlag() == BOTCHATTYPE::ResaleKOLockedByOwner);
}
// ***************************************************************************
bool CDBCtrlSheet::canOwnerLock() const
{
return (NULL != getItemResaleFlagPtr());
}
// ***************************************************************************
sint32 CDBCtrlSheet::getItemSellerType() const

@ -194,16 +194,20 @@ public:
void setActionOnLeftClick (const std::string &ActionHandlerName) { _AHOnLeftClick = getAH(ActionHandlerName, _AHLeftClickParams); }
void setActionOnRightClick (const std::string &ActionHandlerName) { _AHOnRightClick = getAH(ActionHandlerName, _AHRightClickParams); }
void setActionOnDrop (const std::string &ActionHandlerName) { _AHOnDrop = getAH(ActionHandlerName, _AHDropParams); }
void setActionOnCanDrop (const std::string &ActionHandlerName) { _AHOnCanDrop = getAH(ActionHandlerName, _AHCanDropParams); }
void setParamsOnLeftClick (const std::string &ParamsHandlerName) { _AHLeftClickParams = ParamsHandlerName; }
void setParamsOnRightClick (const std::string &ParamsHandlerName) { _AHRightClickParams = ParamsHandlerName; }
void setParamsOnDrop (const std::string &ParamsHandlerName) { _AHDropParams = ParamsHandlerName; }
void setParamsOnCanDrop (const std::string &ParamsHandlerName) { _AHCanDropParams = ParamsHandlerName; }
const std::string &getActionOnLeftClick () const { return getAHName(_AHOnLeftClick); }
const std::string &getActionOnRightClick () const { return getAHName(_AHOnRightClick); }
const std::string &getActionOnDrop () const { return getAHName(_AHOnDrop); }
const std::string &getActionOnCanDrop () const { return getAHName(_AHOnCanDrop); }
const std::string &getParamsOnLeftClick () const { return _AHLeftClickParams; }
const std::string &getParamsOnRightClick () const { return _AHRightClickParams; }
const std::string &getParamsOnDrop () const { return _AHDropParams; }
const std::string &getParamsOnCanDrop () const { return _AHCanDropParams; }
void setListMenuLeft (const std::string &cm) { CCtrlSheetInfo::setListMenuLeft(cm); }
void setListMenuRight (const std::string &cm) { CCtrlSheetInfo::setListMenuRight(cm); }
@ -215,6 +219,7 @@ public:
void setCanDrop (bool cd) { _CanDrop = cd; }
bool getCanDrop () const { return _CanDrop; }
bool isDragable() { return _Dragable; }
void setDragable(bool dragable) { _Dragable = dragable; }
bool isDraging() { return _Draging; }
sint32 getDeltaDragX() {return _DeltaDragX;}
sint32 getDeltaDragY() {return _DeltaDragY;}
@ -265,19 +270,35 @@ public:
REFLECT_SINT32("back", getGuildBack, setGuildBack);
REFLECT_SINT32("symbol", getGuildSymbol, setGuildSymbol);
REFLECT_BOOL("invert_symbol", getInvertGuildSymbol, setInvertGuildSymbol);
REFLECT_BOOL("dragable", isDragable, setDragable);
REFLECT_BOOL("can_drop", getCanDrop, setCanDrop);
REFLECT_STRING ("left_click", getActionOnLeftClick, setActionOnLeftClick);
REFLECT_STRING ("right_click", getActionOnRightClick, setActionOnRightClick);
REFLECT_STRING ("left_click_params", getParamsOnLeftClick, setParamsOnLeftClick);
REFLECT_STRING ("right_click_params", getParamsOnRightClick, setParamsOnRightClick);
REFLECT_STRING ("on_drop", getActionOnDrop, setActionOnDrop);
REFLECT_STRING ("on_drop_params", getParamsOnDrop, setParamsOnDrop);
REFLECT_STRING ("on_can_drop", getActionOnCanDrop, setActionOnCanDrop);
REFLECT_STRING ("on_can_drop_params", getParamsOnCanDrop, setParamsOnCanDrop);
REFLECT_LUA_METHOD("getDraggedSheet", luaGetDraggedSheet)
REFLECT_LUA_METHOD("getHpBuff", luaGetHpBuff)
REFLECT_LUA_METHOD("getSapBuff", luaGetSapBuff)
REFLECT_LUA_METHOD("getFocusBuff", luaGetFocusBuff)
REFLECT_LUA_METHOD("getStaBuff", luaGetStaBuff)
REFLECT_LUA_METHOD("getName", luaGetName)
REFLECT_LUA_METHOD("getCreatorName", luaGetCreatorName)
REFLECT_LUA_METHOD("waitInfo", luaWaitInfo)
REFLECT_LUA_METHOD("buildCrystallizedSpellListBrick", luaBuildCrystallizedSpellListBrick)
REFLECT_EXPORT_END
int luaGetDraggedSheet(CLuaState &ls);
int luaGetHpBuff(CLuaState &ls);
int luaGetSapBuff(CLuaState &ls);
int luaGetFocusBuff(CLuaState &ls);
int luaGetStaBuff(CLuaState &ls);
int luaGetName(CLuaState &ls);
int luaGetCreatorName(CLuaState &ls);
int luaWaitInfo(CLuaState &ls);
int luaBuildCrystallizedSpellListBrick(CLuaState &ls);
// hardcode creation. User must setup other CtrlBase value (parent etc...)
@ -355,9 +376,9 @@ public:
/// Special ContextHelp for ctrl sheet.
virtual void getContextHelp(ucstring &help) const;
/// Special ContextHelp for ctrl sheet.
virtual void getContextHelpToolTip(ucstring &help) const;
/** true if an item of another ctrlSheet can be dropped on this slot.
* also return true if src is 0, or if _ItemSlot==UNDEFINED
*/
@ -494,6 +515,12 @@ public:
// set item RESALE_FLAG
void setItemResaleFlag(sint32 rf);
// get item locked by owner
bool getLockedByOwner() const;
// true if the inventory supports owner locking
bool canOwnerLock() const;
// get item SELLER_TYPE. 0 if no DB
sint32 getItemSellerType() const;
CCDBNodeLeaf *getItemSellerTypePtr() const;

@ -30,6 +30,7 @@
#include "game_share/pvp_clan.h"
#include "../string_manager_client.h"
#include "../entity_cl.h"
#include "nel/misc/common.h"
using namespace NLMISC;
@ -264,7 +265,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
{
STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance();
text += string("\n") + pSMC->getOutpostBuildingLocalizedDescription(CSheetId(Ctrl->getSheetId()));
text += "\n" + CI18N::get("uiBotChatPrice") + toString(pOBS->CostDapper);
text += "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pOBS->CostDapper));
text += CI18N::get("uiBotChatTime") + toString(pOBS->CostTime/60) + CI18N::get("uiBotChatTimeMinute");
if ((pOBS->CostTime % 60) != 0)
text += toString(pOBS->CostTime%60) + CI18N::get("uiBotChatTimeSecond");
@ -341,7 +342,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if (pIS && pIS->Family == ITEMFAMILY::GUILD_OPTION)
{
text+= "\n" + CI18N::get("uiBotChatSkillPointCost") + toString(pIS->GuildOption.XPCost);
text+= "\n" + CI18N::get("uiBotChatPrice") + toString(pIS->GuildOption.MoneyCost);
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(pIS->GuildOption.MoneyCost));
guildOption= true;
}
}
@ -376,10 +377,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
if (LastPrice > 0)
{
if(displayMulPrice)
text+= "\n" + CI18N::get("uiBotChatPrice") + toString(sint32(LastPrice * priceFactor)) + " ("
+ toString( sint32(factor) * sint32(LastPrice * priceFactor) ) + ")";
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString(sint32(LastPrice * priceFactor))) + " ("
+ NLMISC::formatThousands(toString( sint32(factor) * sint32(LastPrice * priceFactor) )) + ")";
else
text+= "\n" + CI18N::get("uiBotChatPrice") + toString( sint32(factor * LastPrice * priceFactor) );
text+= "\n" + CI18N::get("uiBotChatPrice") + NLMISC::formatThousands(toString( sint32(factor * LastPrice * priceFactor) ));
}
if ((LastFactionPointPrice != 0) && (LastFactionType >= PVP_CLAN::BeginClans) && (LastFactionType <= PVP_CLAN::EndClans))
@ -390,7 +391,7 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
text+= "\n";
text+= CI18N::get("uiBotChatFactionType") + PVP_CLAN::toString((PVP_CLAN::TPVPClan)LastFactionType)
+ CI18N::get("uiBotChatFactionPointPrice") + toString(LastFactionPointPrice);
+ CI18N::get("uiBotChatFactionPointPrice") + NLMISC::formatThousands(toString(LastFactionPointPrice));
}
// some additional info for resale
@ -402,10 +403,10 @@ void CDBGroupListSheetTrade::CSheetChildTrade::updateViewText(CDBGroupListSheetT
{
// append price
if(pIS && pIS->Stackable>1 && zeFather->getMultiplyPriceByQuantityFlag())
text+= CI18N::get("uiBotChatRetirePrice") + toString(LastPriceRetire) + " ("
+ toString(factor * LastPriceRetire) + ")";
text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(LastPriceRetire)) + " ("
+ NLMISC::formatThousands(toString(factor * LastPriceRetire)) + ")";
else
text+= CI18N::get("uiBotChatRetirePrice") + toString(factor * LastPriceRetire);
text+= CI18N::get("uiBotChatRetirePrice") + NLMISC::formatThousands(toString(factor * LastPriceRetire));
// set resale time left
ucstring fmt= CI18N::get("uiBotChatResaleTimeLeft");
strFindReplace(fmt, "%d", toString(LastResaleTimeLeft/RYZOM_DAY_IN_HOUR));
@ -482,6 +483,12 @@ bool CDBGroupListSheetTrade::CSheetChildTrade::isSheetValid(CDBGroupListSheetTex
return false;
}
// Locked by owner; cannot trade
if (Ctrl->getLockedByOwner())
{
return false;
}
// Check seller type?
TSellerTypeFilter stf= father->getSellerTypeFilter();
if( stf != None)

@ -21,6 +21,7 @@
#include "dbview_number.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/common.h"
using namespace std;
using namespace NL3D;
@ -102,30 +103,6 @@ bool CDBViewNumber::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup)
return true;
}
// ***************************************************************************
// Helper function
ucstring formatThousands(const ucstring& s, const ucstring& separator)
{
int j;
int k;
int topI = s.length() - 1;
if (topI < 4) return s;
ucstring ns;
do
{
for (j = topI, k = 0; j >= 0 && k < 3; --j, ++k )
{
ns = s[j] + ns; // new char is added to front of ns
if( j > 0 && k == 2) ns = separator + ns; // j > 0 means still more digits
}
topI -= 3;
} while(topI >= 0);
return ns;
}
// ***************************************************************************
void CDBViewNumber::checkCoords()
{
@ -134,8 +111,7 @@ void CDBViewNumber::checkCoords()
if (_Cache != val)
{
_Cache= val;
static ucstring separator = NLMISC::CI18N::get("uiThousandsSeparator");
ucstring value = _Format ? formatThousands(toString(val), separator) : toString(val);
ucstring value = _Format ? NLMISC::formatThousands(toString(val)) : toString(val);
if (_Positive) setText(val >= 0 ? ( ucstring(_Prefix) + value + ucstring(_Suffix) ) : ucstring("?"));
else setText( ucstring(_Prefix) + value + ucstring(_Suffix) );
}

@ -587,6 +587,12 @@ bool CGroupCompasMenu::parse(xmlNodePtr cur, CInterfaceGroup *parent /*=NULL*/)
return true;
}
// Helper for sorting landmarks
static inline bool UserLandMarksSortPredicate(const CUserLandMark& lm1, const CUserLandMark& lm2)
{
return toLower(lm1.Title) < toLower(lm2.Title);
}
// ***************************************************************************
// Called when we activate the compass menu
void CGroupCompasMenu::setActive (bool state)
@ -803,6 +809,10 @@ void CGroupCompasMenu::setActive (bool state)
}
// User landmarks
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() );
// Sort the landmarks
std::sort(currCont->UserLandMarks.begin(), currCont->UserLandMarks.end(), UserLandMarksSortPredicate);
for(k = 0; k < nbUserLandMarks; ++k)
{
if (currCont->UserLandMarks[k].Type < CUserLandMark::UserLandMarkTypeCount)

@ -34,6 +34,7 @@ extern "C"
#include "view_link.h"
#include "ctrl_scroll.h"
#include "ctrl_button.h"
#include "dbctrl_sheet.h"
#include "ctrl_text_button.h"
#include "action_handler.h"
#include "group_paragraph.h"
@ -63,13 +64,55 @@ using namespace NLMISC;
CGroupHTML *CGroupHTML::_ConnectingLock = NULL;
extern CActionsContext ActionsContext;
// Check if domain is on TrustedDomain
bool CGroupHTML::isTrustedDomain(const string &domain) {
// Check if domain is on TrustedDomain
bool CGroupHTML::isTrustedDomain(const string &domain)
{
vector<string>::iterator it;
it = find (ClientCfg.WebIgTrustedDomains.begin(), ClientCfg.WebIgTrustedDomains.end(), domain);
return it != ClientCfg.WebIgTrustedDomains.end();
}
void CGroupHTML::setImage(CViewBase * view, const string &file)
{
CCtrlButton *btn = dynamic_cast<CCtrlButton*>(view);
if(btn)
{
btn->setTexture (file);
btn->setTexturePushed(file);
btn->invalidateCoords();
btn->invalidateContent();
btn->resetInvalidCoords();
btn->updateCoords();
paragraphChange();
}
else
{
CViewBitmap *btm = dynamic_cast<CViewBitmap*>(view);
if(btm)
{
btm->setTexture (file);
btm->invalidateCoords();
btm->invalidateContent();
btm->resetInvalidCoords();
btm->updateCoords();
paragraphChange();
}
else
{
CGroupCell *btgc = dynamic_cast<CGroupCell*>(view);
if(btgc)
{
btgc->setTexture (file);
btgc->invalidateCoords();
btgc->invalidateContent();
btgc->resetInvalidCoords();
btgc->updateCoords();
paragraphChange();
}
}
}
}
// Get an url and return the local filename with the path where the url image should be
string CGroupHTML::localImageName(const string &url)
{
@ -99,30 +142,38 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img)
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
string dest = localImageName(url)+".tmp";
string dest = localImageName(url);
string tmpdest = localImageName(url)+".tmp";
#ifdef LOG_DL
nlwarning("add to download '%s' dest '%s' img %p", url.c_str(), dest.c_str(), img);
#endif
// create the local file
if (NLMISC::CFile::fileExists(dest))
// erase the tmp file if exists
if (NLMISC::CFile::fileExists(tmpdest))
NLMISC::CFile::deleteFile(tmpdest);
if (!NLMISC::CFile::fileExists(dest))
{
CFile::setRWAccess(dest);
NLMISC::CFile::deleteFile(dest);
FILE *fp = fopen (tmpdest.c_str(), "wb");
if (fp == NULL)
{
nlwarning("Can't open file '%s' for writing: code=%d '%s'", tmpdest.c_str (), errno, strerror(errno));
return;
}
curl_easy_setopt(curl, CURLOPT_FILE, fp);
curl_multi_add_handle(MultiCurl, curl);
Curls.push_back(CDataDownload(curl, url, fp, ImgType, img, "", ""));
#ifdef LOG_DL
nlwarning("adding handle %x, %d curls", curl, Curls.size());
#endif
RunningCurls++;
}
FILE *fp = fopen (dest.c_str(), "wb");
if (fp == NULL)
else
{
nlwarning("Can't open file '%s' for writing: code=%d '%s'", dest.c_str (), errno, strerror(errno));
return;
setImage(img, dest);
}
curl_easy_setopt(curl, CURLOPT_FILE, fp);
curl_multi_add_handle(MultiCurl, curl);
Curls.push_back(CDataDownload(curl, url, fp, ImgType, img, "", ""));
#ifdef LOG_DL
nlwarning("adding handle %x, %d curls", curl, Curls.size());
#endif
RunningCurls++;
}
void CGroupHTML::initImageDownload()
@ -297,41 +348,11 @@ void CGroupHTML::checkDownloads()
for(uint i = 0; i < it->imgs.size(); i++)
{
// don't display image that are not power of 2
uint32 w, h;
CBitmap::loadSize (file, w, h);
if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures()))
file.clear();
CCtrlButton *btn = dynamic_cast<CCtrlButton*>(it->imgs[i]);
if(btn)
{
#ifdef LOG_DL
nlwarning("refresh new downloading image %d button %p", i, it->imgs[i]);
#endif
btn->setTexture (file);
btn->setTexturePushed(file);
btn->invalidateCoords();
btn->invalidateContent();
btn->resetInvalidCoords();
btn->updateCoords();
paragraphChange();
}
else
{
CViewBitmap *btm = dynamic_cast<CViewBitmap*>(it->imgs[i]);
if(btm)
{
#ifdef LOG_DL
nlwarning("refresh new downloading image %d image %p", i, it->imgs[i]);
#endif
btm->setTexture (file);
btm->invalidateCoords();
btm->invalidateContent();
btm->resetInvalidCoords();
btm->updateCoords();
paragraphChange();
}
}
//uint32 w, h;
//CBitmap::loadSize (file, w, h);
//if (w == 0 || h == 0 || ((!NLMISC::isPowerOf2(w) || !NLMISC::isPowerOf2(h)) && !NL3D::CTextureFile::supportNonPowerOfTwoTextures()))
// file.clear();
setImage(it->imgs[i], file);
}
}
}
@ -446,6 +467,28 @@ void CGroupHTML::beginBuild ()
}
TStyle CGroupHTML::parseStyle (const string &str_styles)
{
TStyle styles;
vector<string> elements;
NLMISC::splitString(str_styles, ";", elements);
for(uint i = 0; i < elements.size(); ++i)
{
vector<string> style;
NLMISC::splitString(elements[i], ":", style);
if (style.size() >= 2)
{
string fullstyle = style[1];
for (uint j=2; j < style.size(); j++)
fullstyle += ":"+style[j];
styles[trim(style[0])] = fullstyle;
}
}
return styles;
}
// ***************************************************************************
void CGroupHTML::addText (const char * buf, int len)
@ -556,9 +599,31 @@ void CGroupHTML::addLink (uint element_number, uint /* attribute_number */, HTCh
_Link.push_back("");
}
}
for(uint8 i = MY_HTML_A_ACCESSKEY; i < MY_HTML_A_Z_ACTION_SHORTCUT; i++)
{
if (present[i] && value[i])
{
string title = value[i];
// nlinfo("key %d = %s", i, title.c_str());
}
}
//nlinfo("key of TITLE is : %d", MY_HTML_A_Z_ACTION_PARAMS);
if (present[MY_HTML_A_Z_ACTION_PARAMS] && value[MY_HTML_A_Z_ACTION_PARAMS])
{
string title = value[MY_HTML_A_Z_ACTION_PARAMS];
_LinkTitle.push_back(title);
}
else
_LinkTitle.push_back("");
}
else
{
_Link.push_back("");
_LinkTitle.push_back("");
}
}
}
}
@ -626,7 +691,6 @@ static const char *scanColorComponent(const char *src, uint8 &intensity)
return src;
}
class CNameToCol
{
public:
@ -831,6 +895,11 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
_GlobalColor.push_back(LinkColorGlobalColor);
_A.push_back(true);
if (present[MY_HTML_A_TITLE] && value[MY_HTML_A_TITLE])
_LinkTitle.push_back(value[MY_HTML_A_TITLE]);
if (present[MY_HTML_A_CLASS] && value[MY_HTML_A_CLASS])
_LinkClass.push_back(value[MY_HTML_A_CLASS]);
// Quick help
if (_TrustedDomain && present[MY_HTML_A_Z_ACTION_SHORTCUT] && value[MY_HTML_A_Z_ACTION_SHORTCUT])
{
@ -856,15 +925,87 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
}
}
}
break;
case HTML_DIV:
{
if (present[MY_HTML_DIV_NAME] && value[MY_HTML_DIV_NAME])
{
_DivName = value[MY_HTML_DIV_NAME];
string instClass;
if (present[MY_HTML_DIV_CLASS] && value[MY_HTML_DIV_CLASS])
instClass = value[MY_HTML_DIV_CLASS];
// use generic template system
if (_TrustedDomain && !instClass.empty() && instClass == "ryzom-ui-grouptemplate")
{
string id;
if (present[MY_HTML_DIV_ID] && value[MY_HTML_DIV_ID])
id = value[MY_HTML_DIV_ID];
string style;
if (present[MY_HTML_DIV_STYLE] && value[MY_HTML_DIV_STYLE])
style = value[MY_HTML_DIV_STYLE];
typedef pair<string, string> TTmplParam;
vector<TTmplParam> tmplParams;
string templateName;
if (!style.empty())
{
TStyle styles = parseStyle(style);
TStyle::iterator it;
for (it=styles.begin(); it != styles.end(); it++)
{
if ((*it).first == "template")
templateName = (*it).second;
else
tmplParams.push_back(TTmplParam((*it).first, (*it).second));
}
}
if (!templateName.empty())
{
string parentId;
bool haveParentDiv = getDiv() != NULL;
if (haveParentDiv)
parentId = getDiv()->getId();
else
parentId = _Paragraph->getId();
CInterfaceManager *im = CInterfaceManager::getInstance();
CInterfaceGroup *inst = im->createGroupInstance(templateName, parentId+":"+id, tmplParams);
if (inst)
{
inst->setId(parentId+":"+id);
inst->updateCoords();
if (haveParentDiv)
{
inst->setParent(getDiv());
inst->setParentSize(getDiv());
inst->setParentPos(getDiv());
inst->setPosRef(Hotspot_TL);
inst->setParentPosRef(Hotspot_TL);
getDiv()->addGroup(inst);
}
else
{
if (!_Paragraph)
{
newParagraph (0);
paragraphChange ();
}
getParagraph()->addChild(inst);
paragraphChange();
}
_Divs.push_back(inst);
}
}
}
}
break;
case HTML_FONT:
{
bool found = false;
@ -898,11 +1039,42 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
addString(ucstring ("\n"));
break;
case HTML_BODY:
if (present[HTML_BODY_BGCOLOR] && value[HTML_BODY_BGCOLOR])
{
// Get the color
CRGBA bgColor = getColor (value[HTML_BODY_BGCOLOR]);
setBackgroundColor (bgColor);
if (present[HTML_BODY_BGCOLOR] && value[HTML_BODY_BGCOLOR])
{
CRGBA bgColor = getColor (value[HTML_BODY_BGCOLOR]);
setBackgroundColor (bgColor);
}
string style;
if (present[HTML_BODY_STYLE] && value[HTML_BODY_STYLE])
style = value[HTML_BODY_STYLE];
if (!style.empty())
{
TStyle styles = parseStyle(style);
TStyle::iterator it;
it = styles.find("background-repeat");
bool repeat = (it != styles.end() && it->second == "1");
// Webig only
it = styles.find("background-scale");
bool scale = (it != styles.end() && it->second == "1");
it = styles.find("background-image");
if (it != styles.end())
{
string image = it->second;
string::size_type texExt = strlwr(image).find("url(");
// Url image
if (texExt != string::npos)
// Remove url()
image = image.substr(4, image.size()-5);
setBackground (image, scale, repeat);
}
}
}
break;
case HTML_FORM:
@ -1000,7 +1172,24 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
}
else
{
addImage (value[MY_HTML_IMG_SRC], globalColor);
// Get the option to reload (class==reload)
bool reloadImg = false;
string style;
if (present[MY_HTML_IMG_STYLE] && value[MY_HTML_IMG_STYLE])
style = value[MY_HTML_IMG_STYLE];
if (!style.empty())
{
TStyle styles = parseStyle(style);
TStyle::iterator it;
it = styles.find("reload");
if (it != styles.end() && (*it).second == "1")
reloadImg = true;
}
addImage (value[MY_HTML_IMG_SRC], globalColor, reloadImg);
}
}
}
@ -1312,8 +1501,43 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
if (!_Cells.empty())
{
_Cells.back() = new CGroupCell(CViewBase::TCtorParam());
string style;
if (present[MY_HTML_TD_STYLE] && value[MY_HTML_TD_STYLE])
style = value[MY_HTML_TD_STYLE];
// Set the cell parameters
if (!style.empty())
{
TStyle styles = parseStyle(style);
TStyle::iterator it;
it = styles.find("background-repeat");
_Cells.back()->setTextureTile(it != styles.end());
// Webig only
it = styles.find("background-scale");
_Cells.back()->setTextureScale(it != styles.end());
it = styles.find("background-image");
if (it != styles.end())
{
nlinfo("found background-image %s", it->second.c_str());
string image = (*it).second;
string::size_type texExt = strlwr(image).find("url(");
// Url image
if (texExt != string::npos)
{
// Remove url()
image = image.substr(4, image.size()-5);
addImageDownload(image, _Cells.back());
// Image in BNP
}
else
{
_Cells.back()->setTexture(image);
}
}
}
_Cells.back()->BgColor = _CellParams.back().BgColor;
_Cells.back()->Align = _CellParams.back().Align;
_Cells.back()->VAlign = _CellParams.back().VAlign;
@ -1435,6 +1659,8 @@ void CGroupHTML::endElement (uint element_number)
popIfNotEmpty (_GlobalColor);
popIfNotEmpty (_A);
popIfNotEmpty (_Link);
popIfNotEmpty (_LinkTitle);
popIfNotEmpty (_LinkClass);
break;
case HTML_H1:
case HTML_H2:
@ -1452,6 +1678,7 @@ void CGroupHTML::endElement (uint element_number)
break;
case HTML_DIV:
_DivName = "";
popIfNotEmpty (_Divs);
break;
case HTML_TABLE:
@ -1551,7 +1778,7 @@ void CGroupHTML::endElement (uint element_number)
if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript, _ObjectMD5Sum))
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->executeLuaScript(_ObjectScript, true);
pIM->executeLuaScript("\nlocal __ALLREADYDL__=true\n"+_ObjectScript, true);
}
_ObjectScript = "";
}
@ -1586,6 +1813,7 @@ void CGroupHTML::endUnparsedElement(const char *buffer, int length)
_ParsingLua = false;
// execute the embeded lua script
CInterfaceManager *pIM = CInterfaceManager::getInstance();
_LuaScript = "\nlocal __CURRENT_WINDOW__=\""+this->_Id+"\" \n"+_LuaScript;
pIM->executeLuaScript(_LuaScript, true);
}
}
@ -2211,40 +2439,77 @@ void CGroupHTML::addString(const ucstring &str)
// Not added ?
if (!added)
{
CViewLink *newLink = new CViewLink(CViewBase::TCtorParam());
if (getA())
if (getA() && string(getLinkClass()) == "ryzom-ui-button")
{
newLink->Link = getLink();
if (!newLink->Link.empty())
string buttonTemplate = DefaultButtonGroup;
// Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name"
string param = "name=" + this->_Id + "|url=" + getLink();
CInterfaceManager *im = CInterfaceManager::getInstance();
typedef pair<string, string> TTmplParam;
vector<TTmplParam> tmplParams;
tmplParams.push_back(TTmplParam("id", ""));
tmplParams.push_back(TTmplParam("onclick", "browse"));
tmplParams.push_back(TTmplParam("onclick_param", param));
tmplParams.push_back(TTmplParam("active", "true"));
CInterfaceGroup *buttonGroup = im->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams);
if (buttonGroup)
{
newLink->setHTMLView (this);
newLink->setUnderlined (true);
// Add the ctrl button
CCtrlTextButton *ctrlButton = dynamic_cast<CCtrlTextButton*>(buttonGroup->getCtrl("button"));
if (!ctrlButton) ctrlButton = dynamic_cast<CCtrlTextButton*>(buttonGroup->getCtrl("b"));
if (ctrlButton)
{
ctrlButton->setModulateGlobalColorAll (false);
// Translate the tooltip
ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(getLinkTitle()));
ctrlButton->setText(tmpStr);
}
getParagraph()->addChild (buttonGroup);
paragraphChange ();
}
}
newLink->setText(tmpStr);
newLink->setColor(getTextColor());
newLink->setFontSize(getFontSize());
newLink->setMultiLineSpace((uint)((float)getFontSize()*LineSpaceFontFactor));
newLink->setMultiLine(true);
newLink->setModulateGlobalColor(getGlobalColor());
// newLink->setLineAtBottom (true);
if (getA() && !newLink->Link.empty())
{
getParagraph()->addChildLink(newLink);
}
else
{
getParagraph()->addChild(newLink);
CViewLink *newLink = new CViewLink(CViewBase::TCtorParam());
if (getA())
{
newLink->Link = getLink();
newLink->LinkTitle = getLinkTitle();
if (!newLink->Link.empty())
{
newLink->setHTMLView (this);
newLink->setUnderlined (true);
}
}
newLink->setText(tmpStr);
newLink->setColor(getTextColor());
newLink->setFontSize(getFontSize());
newLink->setMultiLineSpace((uint)((float)getFontSize()*LineSpaceFontFactor));
newLink->setMultiLine(true);
newLink->setModulateGlobalColor(getGlobalColor());
// newLink->setLineAtBottom (true);
if (getA() && !newLink->Link.empty())
{
getParagraph()->addChildLink(newLink);
}
else
{
getParagraph()->addChild(newLink);
}
paragraphChange ();
}
paragraphChange ();
}
}
}
// ***************************************************************************
void CGroupHTML::addImage(const char *img, bool globalColor)
void CGroupHTML::addImage(const char *img, bool globalColor, bool reloadImg)
{
// In a paragraph ?
if (_Paragraph)
@ -2268,6 +2533,7 @@ void CGroupHTML::addImage(const char *img, bool globalColor)
newImage->Link = getLink();
newImage->setHTMLView (this);
}*/
newImage->setRenderLayer(getRenderLayer()+1);
newImage->setTexture (finalUrl);
newImage->setModulateGlobalColor(globalColor);
@ -2284,7 +2550,7 @@ void CGroupHTML::addImage(const char *img, bool globalColor)
// 2/ if it doesn't work, try to load the image in cache
//
image = localImageName(img);
if (lookupLocalFile (finalUrl, image.c_str(), false))
if (!reloadImg && lookupLocalFile (finalUrl, image.c_str(), false))
{
// No more text in this text view
_CurrentViewLink = NULL;
@ -2314,7 +2580,9 @@ void CGroupHTML::addImage(const char *img, bool globalColor)
else*/
getParagraph()->addChild(newImage);
paragraphChange ();
} else {
}
else
{
//
// 3/ if it doesn't work, display a placeholder and ask to dl the image into the cache
@ -2527,6 +2795,9 @@ CCtrlButton *CGroupHTML::addButton(CCtrlButton::EType type, const std::string &/
ctrlButton->setInstantContextHelp(true);
ctrlButton->setToolTipParent(TTMouse);
ctrlButton->setToolTipParentPosRef(Hotspot_TTAuto);
ctrlButton->setToolTipPosRef(Hotspot_TTAuto);
ctrlButton->setActionOnLeftClickParams(tooltip);
}
getParagraph()->addChild (ctrlButton);
@ -2556,6 +2827,7 @@ void CGroupHTML::clearContext()
_UL.clear();
_A.clear();
_Link.clear();
_LinkTitle.clear();
_Tables.clear();
_Cells.clear();
_TR.clear();
@ -2632,6 +2904,9 @@ CInterfaceGroup *CGroupHTML::getCurrentGroup()
void CGroupHTML::addGroup (CInterfaceGroup *group, uint beginSpace)
{
if (!group)
return;
// Remove previous paragraph if empty
if (_Paragraph && (_Paragraph->getNumChildren() == 0))
{
@ -2796,7 +3071,30 @@ void CGroupHTML::setBackgroundColor (const CRGBA &bgcolor)
{
// Change the background color
bitmap->setColor (bgcolor);
bitmap->setModulateGlobalColor(true);
bitmap->setModulateGlobalColor(false);
}
}
}
// ***************************************************************************
void CGroupHTML::setBackground (const string &bgtex, bool scale, bool tile)
{
// Should have a child named bg
CViewBase *view = getView (DefaultBackgroundBitmapView);
if (view)
{
CViewBitmap *bitmap = dynamic_cast<CViewBitmap*> (view);
if (bitmap)
{
bitmap->setParentPosRef(Hotspot_TL);
bitmap->setPosRef(Hotspot_TL);
bitmap->setX(0);
bitmap->setY(0);
bitmap->setRenderLayer(-2);
bitmap->setScale(scale);
bitmap->setTile(tile);
addImageDownload(bgtex, view);
}
}
}
@ -2897,9 +3195,6 @@ void CGroupHTML::handle ()
_Browsing = true;
updateRefreshButton();
// Add custom get params
addHTTPGetParams (finalUrl);
// Save new url
_URL = finalUrl;
@ -2910,6 +3205,10 @@ void CGroupHTML::handle ()
initLibWWW();
_TrustedDomain = isTrustedDomain(setCurrentDomain(finalUrl));
// Add custom get params
addHTTPGetParams (finalUrl, _TrustedDomain);
// Get the final URL
C3WSmartPtr uri = HTParse(finalUrl.c_str(), NULL, PARSE_ALL);
@ -3030,7 +3329,7 @@ void CGroupHTML::handle ()
HTParseFormInput(formfields, (_PostFormSubmitButton + "_y=0").c_str());
// Add custom params
addHTTPPostParams (formfields);
addHTTPPostParams(formfields, _TrustedDomain);
// Reset the title
if(_TitlePrefix.empty())
@ -3146,13 +3445,13 @@ void CGroupHTML::endBuild ()
// ***************************************************************************
void CGroupHTML::addHTTPGetParams (string &/* url */)
void CGroupHTML::addHTTPGetParams (string &/* url */, bool /*trustedDomain*/)
{
}
// ***************************************************************************
void CGroupHTML::addHTTPPostParams (HTAssocList * /* formfields */)
void CGroupHTML::addHTTPPostParams (HTAssocList * /* formfields */, bool /*trustedDomain*/)
{
}
@ -3401,7 +3700,7 @@ int CGroupHTML::luaRefresh(CLuaState &ls)
// ***************************************************************************
int CGroupHTML::luaRemoveContent(CLuaState &ls)
{
const char *funcName = "refresh";
const char *funcName = "removeContent";
CLuaIHM::checkArgCount(ls, funcName, 0);
removeContent();
return 0;

@ -30,6 +30,8 @@
#include "ctrl_button.h"
#include "group_table.h"
typedef std::map<std::string, std::string> TStyle;
extern "C"
{
#include "WWWInit.h"
@ -147,6 +149,7 @@ public:
std::string DefaultCheckBoxBitmapPushed;
std::string DefaultCheckBoxBitmapOver;
std::string DefaultBackgroundBitmapView;
std::string CurrentLinkTitle;
// Browser home
std::string Home;
@ -216,10 +219,10 @@ protected :
virtual void endUnparsedElement(const char *buffer, int length);
// Add GET params to the url
virtual void addHTTPGetParams (std::string &url);
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
// Add POST params to the libwww list
virtual void addHTTPPostParams (HTAssocList *formfields);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
// the current request is terminated
virtual void requestTerminated(HTRequest *request);
@ -227,6 +230,9 @@ protected :
// Get Home URL
virtual std::string home();
// Parse style html tag
TStyle parseStyle(const std::string &str_styles);
// Handle some work at each pass
virtual void handle ();
@ -251,7 +257,7 @@ protected :
void addString(const ucstring &str);
// Add an image in the current paragraph
void addImage(const char *image, bool globalColor);
void addImage(const char *image, bool globalColor, bool reloadImg=false);
// Add a text area in the current paragraph
CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content);
@ -266,6 +272,9 @@ protected :
// Set the background color
void setBackgroundColor (const NLMISC::CRGBA &bgcolor);
// Set the background
void setBackground (const std::string &bgtex, bool scale, bool tile);
// Force the current string to be in a single string
void flushString();
@ -281,7 +290,7 @@ protected :
// Current URL
std::string _URL;
// Current DOMAIN
// Current DOMAIN
bool _TrustedDomain;
// Title prefix
@ -397,6 +406,30 @@ protected :
return _Link.back().c_str();
}
std::vector<std::string> _LinkTitle;
inline const char *getLinkTitle() const
{
if (_LinkTitle.empty())
return "";
return _LinkTitle.back().c_str();
}
std::vector<std::string> _LinkClass;
inline const char *getLinkClass() const
{
if (_LinkClass.empty())
return "";
return _LinkClass.back().c_str();
}
// Divs (i.e. interface group)
std::vector<class CInterfaceGroup*> _Divs;
inline CInterfaceGroup *getDiv() const
{
if (_Divs.empty())
return NULL;
return _Divs.back();
}
// Tables
std::vector<class CGroupTable*> _Tables;
inline CGroupTable *getTable() const
@ -475,6 +508,7 @@ protected :
NoWrap = false;
}
NLMISC::CRGBA BgColor;
std::string Style;
CGroupCell::TAlign Align;
CGroupCell::TVAlign VAlign;
sint32 LeftMargin;
@ -582,9 +616,9 @@ private:
void checkImageDownload();
void addImageDownload(const std::string &url, CViewBase *img);
std::string localImageName(const std::string &url);
bool isTrustedDomain(const std::string &domain);
bool isTrustedDomain(const std::string &domain);
void setImage(CViewBase *view, const std::string &file);
// BnpDownload system
void initBnpDownload();

@ -24,6 +24,7 @@
#include "group_html_cs.h"
#include "game_share/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "interface_manager.h"
// used for login cookie to be sent to the web server
#include "../net_manager.h"
@ -49,7 +50,7 @@ CGroupHTMLCS::~CGroupHTMLCS()
// ***************************************************************************
void CGroupHTMLCS::addHTTPGetParams (string &url)
void CGroupHTMLCS::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{
url += ((url.find('?') != string::npos) ? "&" : "?");
@ -69,7 +70,7 @@ void CGroupHTMLCS::addHTTPGetParams (string &url)
// ***************************************************************************
void CGroupHTMLCS::addHTTPPostParams (HTAssocList *formfields)
void CGroupHTMLCS::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
{
std::vector<CParameter> parameters;
getParameters (parameters, false);
@ -120,6 +121,15 @@ void CGroupHTMLCS::getParameters (std::vector<CParameter> &parameters, bool enco
string s = getDebugInformation();
s += getSystemInformation();
static bool webIgReady = false;
if (!webIgReady) // Webig is ready when getParameters of CGroupHTMLCS is called
{
webIgReady = true;
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->executeLuaScript("game:onWebIgReady()");
}
// For each line
string::size_type startOfLine = 0;
string::size_type endOfLine;

@ -39,8 +39,8 @@ public:
~CGroupHTMLCS();
// From CGroupHTML
virtual void addHTTPGetParams (std::string &url);
virtual void addHTTPPostParams (HTAssocList *formfields);
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
virtual std::string home();
private:

@ -51,9 +51,9 @@ CGroupHTMLForum::~CGroupHTMLForum()
// ***************************************************************************
void CGroupHTMLForum::addHTTPGetParams (string &url)
void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{
ucstring user_name = UserEntity->getDisplayName ();
ucstring user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name.toUtf8();
@ -83,9 +83,9 @@ void CGroupHTMLForum::addHTTPGetParams (string &url)
// ***************************************************************************
void CGroupHTMLForum::addHTTPPostParams (HTAssocList *formfields)
void CGroupHTMLForum::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
{
ucstring user_name = UserEntity->getDisplayName ();
ucstring user_name = UserEntity->getLoginName ();
const SGuild &guild = CGuildManager::getInstance()->getGuild();
string gname = guild.Name.toUtf8();
@ -115,12 +115,13 @@ string CGroupHTMLForum::home ()
void CGroupHTMLForum::handle ()
{
// Do nothing if WebServer is not initialized
/* // Do nothing if WebServer is not initialized
if (!WebServer.empty())
{
Home = WebServer+"forum.php";
CGroupHTML::handle ();
}
*/
}
// ***************************************************************************

@ -39,8 +39,8 @@ public:
~CGroupHTMLForum();
// From CGroupHTML
virtual void addHTTPGetParams (std::string &url);
virtual void addHTTPPostParams (HTAssocList *formfields);
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
virtual std::string home();
virtual void handle ();

@ -50,9 +50,9 @@ CGroupHTMLMail::~CGroupHTMLMail()
// ***************************************************************************
void CGroupHTMLMail::addHTTPGetParams (string &url)
void CGroupHTMLMail::addHTTPGetParams (string &url, bool /*trustedDomain*/)
{
ucstring user_name = UserEntity->getDisplayName ();
ucstring user_name = UserEntity->getLoginName ();
url += ((url.find('?') != string::npos) ? "&" : "?") +
string("shard=") + toString(CharacterHomeSessionId) +
string("&user_login=") + user_name.toString() +
@ -62,9 +62,9 @@ void CGroupHTMLMail::addHTTPGetParams (string &url)
// ***************************************************************************
void CGroupHTMLMail::addHTTPPostParams (HTAssocList *formfields)
void CGroupHTMLMail::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
{
ucstring user_name = UserEntity->getDisplayName ();
ucstring user_name = UserEntity->getLoginName ();
HTParseFormInput(formfields, ("shard="+toString(CharacterHomeSessionId)).c_str());
HTParseFormInput(formfields, ("user_login="+user_name.toString()).c_str());
HTParseFormInput(formfields, ("session_cookie="+NetMngr.getLoginCookie().toString()).c_str());
@ -85,11 +85,12 @@ string CGroupHTMLMail::home ()
void CGroupHTMLMail::handle ()
{
// Do nothing if WebServer is not initialized
if (!WebServer.empty())
/* if (!WebServer.empty())
{
Home = WebServer+"mailbox.php";
CGroupHTML::handle ();
}
*/
}
// ***************************************************************************

@ -39,8 +39,8 @@ public:
~CGroupHTMLMail();
// From CGroupHTML
virtual void addHTTPGetParams (std::string &url);
virtual void addHTTPPostParams (HTAssocList *formfields);
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
virtual std::string home();
virtual void handle ();

@ -20,6 +20,7 @@
#include "game_share/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "../user_entity.h"
#include "../entities.h"
#include "interface_manager.h"
// used for login cookie to be sent to the web server
@ -55,7 +56,7 @@ static string getWebAuthKey()
// authkey = <sharid><name><cid><cookie>
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
string rawKey = toString(CharacterHomeSessionId) +
UserEntity->getDisplayName().toString() +
UserEntity->getLoginName().toString() +
toString(cid) +
NetMngr.getLoginCookie().toString();
string key = getMD5((const uint8*)rawKey.c_str(), (uint32)rawKey.size()).toString();
@ -64,18 +65,72 @@ static string getWebAuthKey()
return key;
}
void addWebIGParams (string &url)
void addWebIGParams (string &url, bool trustedDomain)
{
if(!UserEntity || !NetMngr.getLoginCookie().isValid()) return;
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
url += ((url.find('?') != string::npos) ? "&" : "?") +
string("shardid=") + toString(CharacterHomeSessionId) +
string("&name=") + UserEntity->getDisplayName().toUtf8() +
string("&cid=") + toString(cid) +
string("&authkey=") + getWebAuthKey() +
string("&ig=1") +
string("&lang=") + CI18N::getCurrentLanguageCode();
string("&name=") + UserEntity->getLoginName().toUtf8() +
string("&lang=") + CI18N::getCurrentLanguageCode() +
string("&datasetid=") + toString(UserEntity->dataSetId()) +
string("&ig=1");
if (trustedDomain)
{
url += string("&cid=") + toString(cid) +
string("&authkey=") + getWebAuthKey();
if (url.find('$') != string::npos)
{
strFindReplace(url, "$gender$", GSGENDER::toString(UserEntity->getGender()));
strFindReplace(url, "$displayName$", UserEntity->getDisplayName().toString());
strFindReplace(url, "$posx$", toString(UserEntity->pos().x));
strFindReplace(url, "$posy$", toString(UserEntity->pos().y));
strFindReplace(url, "$posz$", toString(UserEntity->pos().z));
strFindReplace(url, "$post$", toString(atan2(UserEntity->front().y, UserEntity->front().x)));
// Target fields
const char *dbPath = "UI:VARIABLES:TARGET:SLOT";
CInterfaceManager *im = CInterfaceManager::getInstance();
CCDBNodeLeaf *node = im->getDbProp(dbPath, false);
if (node && (uint8)node->getValue32() != (uint8) CLFECOMMON::INVALID_SLOT)
{
CEntityCL *target = EntitiesMngr.entity((uint) node->getValue32());
if (target)
{
strFindReplace(url, "$tdatasetid$", toString(target->dataSetId()));
strFindReplace(url, "$tdisplayName$", target->getDisplayName().toString());
strFindReplace(url, "$tposx$", toString(target->pos().x));
strFindReplace(url, "$tposy$", toString(target->pos().y));
strFindReplace(url, "$tposz$", toString(target->pos().z));
strFindReplace(url, "$tpost$", toString(atan2(target->front().y, target->front().x)));
strFindReplace(url, "$tsheet$", target->sheetId().toString());
string type;
if (target->isFauna())
type = "fauna";
else if (target->isNPC())
type = "npc";
else if (target->isPlayer())
type = "player";
else if (target->isUser())
type = "user";
strFindReplace(url, "$ttype$", target->sheetId().toString());
}
else
{
strFindReplace(url, "$tdatasetid$", "");
strFindReplace(url, "$tdisplayName$", "");
strFindReplace(url, "$tposx$", "");
strFindReplace(url, "$tposy$", "");
strFindReplace(url, "$tposz$", "");
strFindReplace(url, "$tpost$", "");
strFindReplace(url, "$tsheet$", "");
strFindReplace(url, "$ttype$", "");
}
}
}
}
}
// ***************************************************************************
@ -204,7 +259,7 @@ struct CWebigNotificationThread : public NLMISC::IRunnable
while (true)
{
string url = "http://"+ClientCfg.WebIgMainDomain+"/start/index.php?app=notif&rnd="+randomString();
addWebIGParams(url);
addWebIGParams(url, true);
get(url);
nlSleep(10*60*1000);
}
@ -231,53 +286,100 @@ void startWebigNotificationThread()
// ***************************************************************************
NLMISC_REGISTER_OBJECT(CViewBase, CGroupHTMLWebIG, std::string, "webig_html");
NLMISC_REGISTER_OBJECT(CViewBase, CGroupHTMLAuth, std::string, "auth_html");
CGroupHTMLWebIG::CGroupHTMLWebIG(const TCtorParam &param)
CGroupHTMLAuth::CGroupHTMLAuth(const TCtorParam &param)
: CGroupHTML(param)
{
startWebigNotificationThread();
}
// ***************************************************************************
CGroupHTMLWebIG::~CGroupHTMLWebIG()
CGroupHTMLAuth::~CGroupHTMLAuth()
{
}
void CGroupHTMLWebIG::addHTTPGetParams (string &url)
void CGroupHTMLAuth::addHTTPGetParams (string &url, bool trustedDomain)
{
addWebIGParams(url);
addWebIGParams(url, trustedDomain);
}
// ***************************************************************************
void CGroupHTMLWebIG::addHTTPPostParams (HTAssocList *formfields)
void CGroupHTMLAuth::addHTTPPostParams (HTAssocList *formfields, bool trustedDomain)
{
if(!UserEntity) return;
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
HTParseFormInput(formfields, ("shardid="+toString(CharacterHomeSessionId)).c_str());
HTParseFormInput(formfields, ("name="+UserEntity->getDisplayName().toUtf8()).c_str());
HTParseFormInput(formfields, ("cid="+toString(cid)).c_str());
HTParseFormInput(formfields, ("authkey="+getWebAuthKey()).c_str());
HTParseFormInput(formfields, "ig=1");
HTParseFormInput(formfields, ("name="+UserEntity->getLoginName().toUtf8()).c_str());
HTParseFormInput(formfields, ("lang="+CI18N::getCurrentLanguageCode()).c_str());
HTParseFormInput(formfields, "ig=1");
if (trustedDomain)
{
HTParseFormInput(formfields, ("cid="+toString(cid)).c_str());
HTParseFormInput(formfields, ("authkey="+getWebAuthKey()).c_str());
}
}
// ***************************************************************************
string CGroupHTMLWebIG::home ()
string CGroupHTMLAuth::home ()
{
return Home;
}
// ***************************************************************************
void CGroupHTMLWebIG::handle ()
void CGroupHTMLAuth::handle ()
{
// Home = "http://atys.ryzom.com/start/index.php";
CGroupHTML::handle ();
}
// ***************************************************************************
// ***************************************************************************
// ***************************************************************************
NLMISC_REGISTER_OBJECT(CViewBase, CGroupHTMLWebIG, std::string, "webig_html");
CGroupHTMLWebIG::CGroupHTMLWebIG(const TCtorParam &param)
: CGroupHTMLAuth(param)
{
startWebigNotificationThread();
}
// ***************************************************************************
CGroupHTMLWebIG::~CGroupHTMLWebIG()
{
}
// ***************************************************************************
void CGroupHTMLWebIG::addHTTPGetParams (string &url, bool trustedDomain)
{
CGroupHTMLAuth::addHTTPGetParams(url, trustedDomain);
}
// ***************************************************************************
void CGroupHTMLWebIG::addHTTPPostParams (HTAssocList *formfields, bool trustedDomain)
{
CGroupHTMLAuth::addHTTPPostParams(formfields, trustedDomain);
}
// ***************************************************************************
string CGroupHTMLWebIG::home ()
{
return Home;
}
// ***************************************************************************
void CGroupHTMLWebIG::handle ()
{
CGroupHTMLAuth::handle ();
}

@ -20,10 +20,32 @@
#include "nel/misc/types_nl.h"
#include "group_html.h"
/**
* Auth HTML group
*/
class CGroupHTMLAuth : public CGroupHTML
{
public:
// Constructor
CGroupHTMLAuth(const TCtorParam &param);
~CGroupHTMLAuth();
// From CGroupHTML
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
virtual std::string home();
virtual void handle ();
private:
};
/**
* WebIG HTML group
*/
class CGroupHTMLWebIG : public CGroupHTML
class CGroupHTMLWebIG : public CGroupHTMLAuth
{
public:
@ -31,9 +53,9 @@ public:
CGroupHTMLWebIG(const TCtorParam &param);
~CGroupHTMLWebIG();
// From CGroupHTML
virtual void addHTTPGetParams (std::string &url);
virtual void addHTTPPostParams (HTAssocList *formfields);
/// From CGroupHTMLAuth
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
virtual std::string home();
virtual void handle ();

@ -973,6 +973,132 @@ void CGroupInSceneBubbleManager::dynChatOpen (uint32 nBotUID, uint32 nBotName, c
UserEntity->interlocutor( pChar->slot() );
}
// ***************************************************************************
void CGroupInSceneBubbleManager::webIgChatOpen (uint32 nBotUID, string text, const vector<string> &strs, const vector<string> &links)
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
// If the character doesn't exist in view field -> do not display the bubble
CEntityCL *pEntity = EntitiesMngr.getEntityByCompressedIndex(nBotUID);
CCharacterCL *pChar = dynamic_cast<CCharacterCL*>(pEntity);
if (pChar == NULL)
{
nlwarning("character probably too far");
return;
}
// Look if we get a bubble with this nBotUID ?
uint32 pos, j;
for (pos = 0; pos < _DynBubbles.size(); ++pos)
{
if (_DynBubbles[pos].BotUID == nBotUID)
break;
}
// If the bubble doesn't exist -> create
CGroupInSceneBubble *bubble = NULL;
string id;
if (pos == _DynBubbles.size())
{
uint32 i = 0;
while (getDynBubble(i) != NULL) i++;
id = "in_scene_webig_bubble_" + toString(i);
// Create the instance
std::vector<std::pair<std::string,std::string> > templateParams;
templateParams.push_back (std::pair<std::string,std::string>("id", id));
CInterfaceGroup *group = pIM->createGroupInstance ("webig_3dbulle_L", "ui:interface", templateParams);
if (group == NULL)
{
nlwarning("cannot create webig_3dbulle_L");
return;
}
// Link to the interface
pIM->addWindowToMasterGroup("ui:interface", group);
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(pIM->getElementFromId("ui:interface"));
group->setParent(pRoot);
if (pRoot)
pRoot->addGroup (group);
group->setActive(false);
bubble = dynamic_cast<CGroupInSceneBubble*>(group);
if (bubble == NULL)
{
nlwarning("cannot cast to CGroupInSceneBubble");
return;
}
CDynBubble dynBubble;
dynBubble.BotName = 0;
dynBubble.BotUID = nBotUID;
dynBubble.Bubble = bubble;
_DynBubbles.push_back(dynBubble);
}
else
{
bubble = _DynBubbles[pos].Bubble;
// Remove from group to delete if in the same frame
for (j=0; j<_GroupToDelete.size(); j++)
if (_GroupToDelete[j] == bubble)
{
_GroupToDelete.erase(_GroupToDelete.begin()+j);
break;
}
}
// Update the bubble's texts
ucstring ucText;
ucText.fromUtf8(text);
bubble->setText(ucText);
id = bubble->getId() + ":header_opened:window:";
CViewText *pVT;
CCtrlLink *pCL;
_DynBubbles[pos].DescWaiting = 0;
for (j = 0; j < 8; ++j)
{
pVT = dynamic_cast<CViewText*>(bubble->getElement(id+"opt"+toString(j)));
if (pVT != NULL)
{
pVT->setActive(false);
pVT->setText(ucstring(""));
}
pCL = dynamic_cast<CCtrlLink*>(bubble->getElement(id+"optb"+toString(j)));
if (pCL != NULL) pCL->setActive(false);
}
for (j = 0; j < strs.size(); ++j)
{
string fullid = id+"opt"+toString(j);
pVT = dynamic_cast<CViewText*>(bubble->getElement(id+"opt"+toString(j)));
if (pVT != NULL)
{
pVT->setActive(true);
ucstring optionText;
optionText.fromUtf8(strs[j]);
pVT->setText(optionText);
pCL = dynamic_cast<CCtrlLink*>(bubble->getElement(id+"optb"+toString(j)));
if (pCL != NULL)
{
pCL->setActionOnLeftClick("browse");
pCL->setParamsOnLeftClick("name=ui:interface:web_transactions:content:html|show=0|url="+links[j]);
//pCL->setActionOnLeftClickParams("name=ui:interface:web_transactions:content:html|url="+links[j]);
pCL->setActive(true);
}
}
}
// Link bubble to the character
pChar->setBubble(bubble);
// Make the npc face the character
UserEntity->interlocutor( pChar->slot() );
}
uint32 CGroupInSceneBubbleManager::CDynBubble::getOptionStringId(uint option)
{
if (!Bubble) return 0;

@ -64,6 +64,9 @@ public:
// Open a Dynamic Chat
void dynChatOpen (uint32 nBotUID, uint32 nBotName, const std::vector<uint32> &DynStrs);
// Open a Dynamic Chat from webig
void webIgChatOpen (uint32 nBotUID, std::string sBotName, const std::vector<std::string> &strs, const std::vector<std::string> &links);
// Close a Dynamic Chat
void dynChatClose (uint32 nBotUID);

@ -97,7 +97,7 @@ CRGBA CGroupInSceneUserInfo::BarColorHPNegative = CRGBA(127, 32, 0);
#define nlfsinfo2 if ( _Entity->isForageSource() ) nlinfo
CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (CEntityCL *entity)
{
// Get the interface manager
CInterfaceManager *pIM = CInterfaceManager::getInstance();
@ -129,6 +129,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
bool forageSourceBarDisplayed= false;
bool needPvPLogo= false;
bool permanentContent = false;
bool rpTags = false;
bool displayMissionIcons = pIM->getDbProp("UI:SAVE:INSCENE:FRIEND:MISSION_ICON")->getValueBool();
// Names
@ -136,6 +137,12 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
ucstring theTribeName;
ucstring entityName = entity->getDisplayName();
ucstring entityTitle = entity->getTitle();
ucstring entityTag1 = entity->getTag(1);
ucstring entityTag2 = entity->getTag(2);
ucstring entityTag3 = entity->getTag(3);
ucstring entityTag4 = entity->getTag(4);
string entityPermanentContent = entity->getPermanentStatutIcon();
// Active fields and bars
@ -160,6 +167,8 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
}
else if(npcFriendAndNeutral)
{
string dbEntry;
getBarSettings( pIM, user, entity->isPlayer(), _friend, dbEntry, bars );
// For RoleMasters, merchants etc... must display name and function, and nothing else
for(uint i=0;i<NumBars;i++)
bars[i]= false;
@ -168,6 +177,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
title= true;
guildName= false;
templateName = "in_scene_user_info";
rpTags = (!entityTag1.empty() || !entityTag2.empty() || !entityTag3.empty() || !entityTag4.empty() ) && pIM->getDbProp(dbEntry+"RPTAGS")->getValueBool();
}
else
{
@ -176,6 +186,7 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
getBarSettings( pIM, user, entity->isPlayer(), _friend, dbEntry, bars );
name = !entityName.empty() && pIM->getDbProp(dbEntry+"NAME")->getValueBool();
title = !entityTitle.empty() && pIM->getDbProp(dbEntry+"TITLE")->getValueBool();
rpTags = (!entityTag1.empty() || !entityTag2.empty() || !entityTag3.empty() || !entityTag4.empty() ) && pIM->getDbProp(dbEntry+"RPTAGS")->getValueBool();
// if name is empty but not title, title is displayed as name
if (!title && entityName.empty() && !entityTitle.empty() && pIM->getDbProp(dbEntry+"NAME")->getValueBool())
title = true;
@ -369,6 +380,26 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
else
stringSpace += textH;
if (rpTags)
{
CPlayerCL * pPlayer = dynamic_cast<CPlayerCL*>(entity);
CViewBitmap *bitmap;
if (pPlayer == NULL || (pPlayer != NULL && pPlayer->getPvpMode() & PVP_MODE::PvpFaction))
{
bitmap = dynamic_cast<CViewBitmap*>(leftGroup->getView ("rp_logo_1"));
if (bitmap)
bitmap->setTexture(entityTag1.toString());
bitmap = dynamic_cast<CViewBitmap*>(leftGroup->getView ("rp_logo_2"));
if (bitmap)
bitmap->setTexture(entityTag2.toString());
}
bitmap = dynamic_cast<CViewBitmap*>(leftGroup->getView ("rp_logo_3"));
if (bitmap)
bitmap->setTexture(entityTag3.toString());
bitmap = dynamic_cast<CViewBitmap*>(leftGroup->getView ("rp_logo_4"));
if (bitmap)
bitmap->setTexture(entityTag4.toString());
}
// Get the permanent content bitmap
if(permanentContent)
@ -539,162 +570,96 @@ CGroupInSceneUserInfo *CGroupInSceneUserInfo::build (class CEntityCL *entity)
info->_MissionTarget = bitmap;
}
CViewBase * pvpCivLogo = info->getView ("pvp_faction_civ_logo");
CViewBase * pvpCultLogo = info->getView ("pvp_faction_cult_logo");
CViewBase * pvpFactionLogo = info->getView ("pvp_faction_logo");
CViewBase * pvpOutpostLogo = info->getView ("pvp_outpost_logo");
CViewBase * pvpDuelLogo = info->getView ("pvp_duel_logo");
CPlayerCL * pPlayer = dynamic_cast<CPlayerCL*>(entity);
if (pPlayer == NULL)
needPvPLogo = false;
// set or inactive pvp logos
bool needCivPvpLogo = needPvPLogo;
bool needCultPvpLogo = needPvPLogo;
if (pPlayer != NULL && needPvPLogo && pvpCivLogo && pvpCultLogo)
if (pPlayer != NULL && needPvPLogo)
{
uint8 civToDisplay = (uint8)(pPlayer->getClanCivMaxFame() & 0xFF);
uint8 cultToDisplay = (uint8)(pPlayer->getClanCultMaxFame() & 0xFF);
if (!entity->isUser())
if (pvpFactionLogo)
{
bool civEnnemies = false;
for (uint8 i = 0; i < 4; i++)
pvpFactionLogo->setActive(true);
CViewBitmap * pvpFactionBitmap = dynamic_cast<CViewBitmap *>(pvpFactionLogo);
if( pvpFactionBitmap )
{
if ( (pPlayer->isPvpAlly(i) && UserEntity->isPvpEnnemy(i)) ||
(pPlayer->isPvpEnnemy(i) && UserEntity->isPvpAlly(i)) )
if (user)
{
civEnnemies = true;
if ( civToDisplay == i)
break;
else
civToDisplay = i;
}
if (!civEnnemies)
{
if ( (pPlayer->isPvpAlly(i) && UserEntity->isPvpAlly(i)) ||
(pPlayer->isPvpEnnemy(i) && UserEntity->isPvpEnnemy(i)) )
if (pPlayer->getPvpMode() & PVP_MODE::PvpChallenge)
{
if ( civToDisplay == i)
break;
pvpFactionBitmap->setTexture("ico_curse.tga");
}
else if (pPlayer->getPvpMode() & PVP_MODE::PvpFaction)
{
if (pPlayer->getPvpMode() & PVP_MODE::PvpZoneSafe)
pvpFactionBitmap->setTexture("pvp_neutral.tga");
else
civToDisplay = i;
pvpFactionBitmap->setTexture("pvp_enemy_tag.tga");
}
else if (pPlayer->getPvpMode() & PVP_MODE::PvpFactionFlagged)
{
if (pPlayer->getPvpMode() & PVP_MODE::PvpSafe)
pvpFactionBitmap->setTexture("pvp_neutral.tga");
else
pvpFactionBitmap->setTexture("pvp_enemy_flag.tga");
}
}
}
for (uint8 i = 4; i < 7; i++)
{
if ( (pPlayer->isPvpAlly(i) && UserEntity->isPvpEnnemy(i)) ||
(pPlayer->isPvpEnnemy(i) && UserEntity->isPvpAlly(i)) )
{
if ( cultToDisplay == i)
break;
else
cultToDisplay = i;
}
if ( (pPlayer->isPvpAlly(i) && UserEntity->isPvpAlly(i)) ||
(pPlayer->isPvpEnnemy(i) && UserEntity->isPvpEnnemy(i)) )
{
if ( cultToDisplay == i)
break;
else
cultToDisplay = i;
}
}
}
if ((pPlayer->getPvpMode() & PVP_MODE::PvpFaction) || (pPlayer->getPvpMode() & PVP_MODE::PvpFactionFlagged))
{
CViewBitmap * pvpCivLogoBmp = dynamic_cast<CViewBitmap *>(pvpCivLogo);
if( pvpCivLogoBmp )
{
if (pPlayer->isPvpAlly(civToDisplay))
{
if (pPlayer->isPvpRanger())
pvpCivLogoBmp->setTexture("pvp_ally_ranger.tga");
else
pvpCivLogoBmp->setTexture("pvp_ally_"+toString(civToDisplay)+".tga");
}
else if (pPlayer->isPvpEnnemy(civToDisplay))
{
if (pPlayer->isPvpMarauder())
pvpCivLogoBmp->setTexture("pvp_enemy_marauder.tga");
else
pvpCivLogoBmp->setTexture("pvp_enemy_"+toString(civToDisplay)+".tga");
pvpFactionLogo->setActive(false);
}
else
{
needCivPvpLogo = false;
}
}
CViewBitmap * pvpCultLogoBmp = dynamic_cast<CViewBitmap *>(pvpCultLogo);
if( pvpCultLogoBmp )
{
if (pPlayer->isPvpAlly(cultToDisplay))
{
if (pPlayer->isPvpPrimas())
pvpCultLogoBmp->setTexture("pvp_ally_primas.tga");
if (pPlayer->getPvpMode() & PVP_MODE::PvpChallenge)
pvpFactionBitmap->setTexture("ico_curse.tga");
else if (pPlayer->isNeutralPVP())
pvpFactionBitmap->setTexture("pvp_neutral.tga");
else if (pPlayer->isAlly() && (pPlayer->getPvpMode() & PVP_MODE::PvpFactionFlagged))
pvpFactionBitmap->setTexture("pvp_ally_flag.tga");
else if (pPlayer->isAlly() && (pPlayer->getPvpMode() & PVP_MODE::PvpFaction))
pvpFactionBitmap->setTexture("pvp_ally_tag.tga");
else if (pPlayer->isEnemy() && (pPlayer->getPvpMode() & PVP_MODE::PvpFactionFlagged))
pvpFactionBitmap->setTexture("pvp_enemy_flag.tga");
else if (pPlayer->isEnemy() && (pPlayer->getPvpMode() & PVP_MODE::PvpFaction))
pvpFactionBitmap->setTexture("pvp_enemy_tag.tga");
else if (pPlayer->getPvpMode() & PVP_MODE::PvpFactionFlagged)
pvpFactionBitmap->setTexture("pvp_enemy_flag.tga");
else if (pPlayer->getPvpMode() & PVP_MODE::PvpFaction)
pvpFactionBitmap->setTexture("pvp_enemy_tag.tga");
else
pvpCultLogoBmp->setTexture("pvp_ally_"+toString(cultToDisplay)+".tga");
}
else if (pPlayer->isPvpEnnemy(cultToDisplay))
{
if (pPlayer->isPvpTrytonist())
pvpCultLogoBmp->setTexture("pvp_enemy_trytonist.tga");
else
pvpCultLogoBmp->setTexture("pvp_enemy_"+toString(cultToDisplay)+".tga");
}
else
{
needCultPvpLogo = false;
pvpFactionLogo->setActive(false);
}
}
}
else
{
needCivPvpLogo = false;
needCultPvpLogo = false;
}
CViewBase * pvpOutpostLogo = info->getView ("pvp_outpost_logo");
if (pvpOutpostLogo)
{
if( pPlayer->getOutpostId() == 0 )
{
if( pPlayer->getOutpostId() != 0 )
pvpOutpostLogo->setActive(true);
else
pvpOutpostLogo->setActive(false);
}
}
CViewBase * pvpDuelLogo = info->getView ("pvp_duel_logo");
if (pvpDuelLogo)
{
if( !(pPlayer->getPvpMode()&PVP_MODE::PvpDuel || pPlayer->getPvpMode()&PVP_MODE::PvpChallenge) )
{
if( pPlayer->getPvpMode()&PVP_MODE::PvpDuel )
pvpDuelLogo->setActive(true);
else
pvpDuelLogo->setActive(false);
}
}
}
else
{
CViewBase * pvpOutpostLogo = info->getView ("pvp_outpost_logo");
if (pvpFactionLogo)
pvpFactionLogo->setActive(false);
if (pvpOutpostLogo)
pvpOutpostLogo->setActive(false);
CViewBase * pvpDuelLogo = info->getView ("pvp_duel_logo");
if (pvpDuelLogo)
pvpDuelLogo->setActive(false);
pvpDuelLogo->setActive(false);
}
if (pvpCivLogo)
pvpCivLogo->setActive(needCivPvpLogo);
if (pvpCultLogo)
pvpCultLogo->setActive(needCultPvpLogo);
}
// No bar and no string ?

@ -55,6 +55,9 @@ CGroupCell::CGroupCell(const TCtorParam &param)
IgnoreMaxWidth = false;
IgnoreMinWidth = false;
AddChildW = false;
_UserTexture = false;
_TextureTiled = false;
_TextureScaled = false;
setEnclosedGroupDefaultParams();
addGroup (Group);
}
@ -200,20 +203,62 @@ void CGroupCell::draw ()
}
// Draw the background
if (BgColor.A != 0)
if (_UserTexture || BgColor.A != 0)
{
CViewRenderer &rVR = pIM->getViewRenderer();
CRGBA finalColor;
finalColor.modulateFromColor (BgColor, pIM->getGlobalColor());
// Get the parent table
if (getParent ())
if (_UserTexture)
{
CGroupTable *table = static_cast<CGroupTable*> (getParent ());
finalColor.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) finalColor.A) >> 8);
CRGBA col;
if (BgColor.A == 0 )
col = CRGBA(255,255,255,255);
else
col = BgColor;
if (_TextureScaled && !_TextureTiled)
{
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal,
_WReal, _HReal,
0, false,
_TextureId,
col );
}
else
{
if (!_TextureTiled)
{
rVR.draw11RotFlipBitmap (_RenderLayer, _XReal, _YReal,
0, false,
_TextureId,
col);
}
else
{
rVR.drawRotFlipBitmapTiled(_RenderLayer, _XReal, _YReal,
_WReal, _HReal,
0, false,
_TextureId,
0,
col);
}
}
}
else
{
CRGBA finalColor;
finalColor.modulateFromColor (BgColor, pIM->getGlobalColor());
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, _HReal, 0, false, rVR.getBlankTextureId(), finalColor);
// Get the parent table
if (getParent ())
{
CGroupTable *table = static_cast<CGroupTable*> (getParent ());
finalColor.A = (uint8) (((uint16) table->CurrentAlpha * (uint16) finalColor.A) >> 8);
}
//nlinfo("Blank Texture");
rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, _HReal, 0, false, rVR.getBlankTextureId(), finalColor);
}
}
CInterfaceGroup::draw ();
@ -231,6 +276,40 @@ sint32 CGroupCell::getMinUsedW() const
return Group->getMinUsedW();
}
// ----------------------------------------------------------------------------
void CGroupCell::setTexture(const std::string & TxName)
{
if (TxName.empty() || TxName == "none")
{
_UserTexture = false;
nlinfo("Set no texture");
}
else
{
nlinfo("Set texture to cell : %s", TxName.c_str());
_UserTexture = true;
_TextureId.setTexture (TxName.c_str (), 0, 0, -1, -1, false);
}
}
// ----------------------------------------------------------------------------
void CGroupCell::setTextureTile(bool tiled)
{
if (tiled)
nlinfo("Set texture is Tiled");
_TextureTiled = tiled;
}
// ----------------------------------------------------------------------------
void CGroupCell::setTextureScale(bool scaled)
{
if (scaled)
nlinfo("Set texture is Scaled : %s");
_TextureScaled = scaled;
}
// ----------------------------------------------------------------------------
NLMISC_REGISTER_OBJECT(CViewBase, CGroupTable, std::string, "table");

@ -80,6 +80,12 @@ public:
// The cell color
NLMISC::CRGBA BgColor;
// Texture
CViewRenderer::CTextureId _TextureId; /// Accelerator
bool _UserTexture;
bool _TextureTiled;
bool _TextureScaled;
// Alignment
TAlign Align;
TVAlign VAlign;
@ -90,6 +96,11 @@ public:
// The cell is nowrap
bool NoWrap;
void setTexture(const std::string & TxName);
void setTextureTile(bool tiled);
void setTextureScale(bool scaled);
private:
void setEnclosedGroupDefaultParams();
};

@ -358,15 +358,54 @@ void CGuildManager::update()
// If all is valid no more need update and if guild is opened update the interface
if (bAllValid)
{
CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB", false);
if (node && node->getValueBool())
{
// See if we need to show any online/offline messages
static vector<SGuildMember> CachedGuildMembers;
ucstring onlineMessage = CI18N::get("uiPlayerOnline");
ucstring offlineMessage = CI18N::get("uiPlayerOffline");
for (uint i = 0; i < _GuildMembers.size(); ++i)
{
for (uint j = 0; j < CachedGuildMembers.size(); ++j)
{
if ((CachedGuildMembers[j].Name == _GuildMembers[i].Name) &&
(CachedGuildMembers[j].Online != _GuildMembers[i].Online))
{
ucstring msg = (_GuildMembers[i].Online != ccs_offline) ? onlineMessage : offlineMessage;
strFindReplace(msg, "%s", _GuildMembers[i].Name);
string cat = getStringCategory(msg, msg);
map<string, CClientConfig::SSysInfoParam>::const_iterator it;
NLMISC::CRGBA col = CRGBA::Yellow;
it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end())
{
col = it->second.Color;
}
bool dummy;
PeopleInterraction.ChatInput.Guild.displayMessage(msg, col, 2, &dummy);
break;
}
}
}
CachedGuildMembers.clear();
for (uint i = 0; i < _GuildMembers.size(); ++i)
{
CachedGuildMembers.push_back(_GuildMembers[i]);
}
}
// Search for UserEntity to find our own grade
if ((UserEntity != NULL) && (_GuildMembers.size() > 0))
{
uint i;
_Grade = EGSPD::CGuildGrade::Member;
string sUserName = strlwr(UserEntity->getEntityName().toString());
ucstring sUserName = toLower(UserEntity->getEntityName());
for (i = 0; i < _GuildMembers.size(); ++i)
{
if (strlwr(_GuildMembers[i].Name.toString()) == sUserName)
if (toLower(_GuildMembers[i].Name) == sUserName)
{
_Grade = _GuildMembers[i].Grade;
break;
@ -1048,10 +1087,26 @@ class CAHGuildSheetSetLeader : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */)
{
sendMsgSetGrade(EGSPD::CGuildGrade::Leader);
CInterfaceManager *pIM = CInterfaceManager::getInstance();
// Ask if they are sure
pIM->validMessageBox(CInterfaceManager::QuestionIconMsg, CI18N::get("uiQSetLeader"), "guild_member_do_change_leader");
}
};
REGISTER_ACTION_HANDLER (CAHGuildSheetSetLeader, "guild_member_chg_to_leader");
// ***************************************************************************
class CAHGuildSheetSetLeaderConfirm : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */)
{
// Leadership change confirmed
sendMsgSetGrade(EGSPD::CGuildGrade::Leader);
}
};
REGISTER_ACTION_HANDLER (CAHGuildSheetSetLeaderConfirm, "guild_member_do_change_leader");
// ***************************************************************************
class CAHGuildSheetSetHighOfficer : public IActionHandler

@ -176,13 +176,17 @@ public:
void setRightClickHandlerParams(const std::string &params) { _AHOnRightClickParams = params; }
void setOnActiveHandler(const std::string &h) { _AHOnActive = getAH(h,_AHOnActiveParams); }
void setOnActiveParams(const std::string &p) { _AHOnActiveParams = p; }
std::string getOnActiveParams() const { return _AHOnActiveParams; }
void setOnDeactiveHandler(const std::string &h) { _AHOnDeactive = getAH(h,_AHOnDeactiveParams); }
void setOnDeactiveParams(const std::string &p) { _AHOnDeactiveParams = p; }
std::string getOnDeactiveParams() const { return _AHOnDeactiveParams; }
const std::string &getLeftClickHandler() const { return getAHName(_AHOnLeftClick); }
const std::string &getLeftClickHandlerParams() const { return _AHOnLeftClickParams; }
const std::string &getRightClickHandler() const { return getAHName(_AHOnRightClick); }
const std::string &getRightClickHandlerParams() const { return _AHOnRightClickParams; }
const std::string &getOnActiveHandler() const { return getAHName(_AHOnActive); }
const std::string &getOnActiveParams() const { return _AHOnActiveParams; }
const std::string &getOnDeactiveHandler() const { return getAHName(_AHOnDeactive); }
const std::string &getOnDeactiveParams() const { return _AHOnDeactiveParams; }
// find a sub view/ctrl/group in this group from its id
int luaFind(CLuaState &ls);
@ -205,8 +209,18 @@ public:
REFLECT_LUA_METHOD("delGroup", luaDelGroup);
REFLECT_LUA_METHOD("getNumGroups", luaGetNumGroups);
REFLECT_LUA_METHOD("getGroup", luaGetGroup);
REFLECT_STRING ("left_click", getLeftClickHandler, setLeftClickHandler);
REFLECT_STRING ("right_click", getRightClickHandler, setRightClickHandler);
REFLECT_STRING ("left_click_params", getLeftClickHandlerParams, setLeftClickHandlerParams);
REFLECT_STRING ("right_click_params", getRightClickHandlerParams, setRightClickHandlerParams);
REFLECT_STRING ("on_active", getOnActiveHandler, setOnActiveHandler);
REFLECT_STRING ("on_active_params", getOnActiveParams, setOnActiveParams);
REFLECT_STRING ("on_deactive", getOnDeactiveHandler, setOnDeactiveHandler);
REFLECT_STRING ("on_deactive_params", getOnDeactiveParams, setOnDeactiveParams);
REFLECT_STRING ("on_enter", getAHOnEnter, setAHOnEnter);
REFLECT_STRING ("on_enter_params", getAHOnEnterParams, setAHOnEnterParams);
REFLECT_STRING ("on_escape", getAHOnEscape, setAHOnEscape);
REFLECT_STRING ("on_escape_params", getAHOnEscapeParams, setAHOnEscapeParams);
REFLECT_SINT32 ("ofsx", getOfsX, setOfsX);
REFLECT_SINT32 ("ofsy", getOfsY, setOfsY);
REFLECT_BOOL("child_resize_w", getResizeFromChildW, setResizeFromChildW);

@ -824,6 +824,21 @@ void CInterfaceManager::initInGame()
{
gc->setTarget(gc->getSavedTarget());
}
CCDBNodeLeaf *node = getDbProp("UI:SAVE:CHATLOG_STATE", false);
if (node)
{
_LogState = (node->getValue32() != 0);
}
if (_LogState)
{
displaySystemInfo(CI18N::get("uiLogTurnedOn"));
}
else
{
displaySystemInfo(CI18N::get("uiLogTurnedOff"));
}
}
// ------------------------------------------------------------------------------------------------
@ -2372,7 +2387,8 @@ void CInterfaceManager::drawContextHelp ()
if(newCtrl)
{
// get the text
newCtrl->getContextHelpToolTip(_ContextHelpText);
//newCtrl->getContextHelpToolTip(_ContextHelpText);
newCtrl->getContextHelp(_ContextHelpText);
// UserDefined context help
if( !newCtrl->getContextHelpActionHandler().empty() )
{
@ -3408,6 +3424,13 @@ CCDBNodeLeaf* CInterfaceManager::getDbProp(const std::string & name, bool bCreat
return pDBNL;
}
// ------------------------------------------------------------------------------------------------
void CInterfaceManager::delDbProp(const std::string & name)
{
if (name.empty()) return;
_DbRootNode->removeNode( ICDBNode::CTextId(name) );
}
// ------------------------------------------------------------------------------------------------
CCDBNodeBranch *CInterfaceManager::getDbBranch(const std::string &name)
{
@ -5759,7 +5782,7 @@ bool CInterfaceManager::executeLuaScript(const std::string &luaScript, bool smal
std::string msg = e.luaWhat();
char filename[MAX_PATH];
char exceptionName[MAX_PATH];
int line;
uint32 line;
// Hamster: quick fix on AJM code but sscanf is still awfull
if (sscanf(msg.c_str(), "%s: %s.lua:%d:",exceptionName, filename, &line) == 3) // NB: test not exact here, but should work in 99,9 % of cases
{
@ -5770,6 +5793,20 @@ bool CInterfaceManager::executeLuaScript(const std::string &luaScript, bool smal
else // AJM: handle the other 0.1% of cases
{
// Yoyo: seems that previous test doesn't work.... btw, must still print the message please...
std::vector<string> error;
splitString(msg.c_str(), ":", error);
if (error.size() > 3)
{
std::vector<string> contextList;
explode(luaScript, string("\n"), contextList);
fromString(error[2], line);
if (line >= 3 && contextList.size() >= line)
msg = error[0]+": \n>>> "+contextList[line-3]+"\n>>> "+contextList[line-2]+"\n>>> "+contextList[line-1]+"\nError:"+error[2]+": "+error[3];
else if (line >= 2 && contextList.size() >= line)
msg = error[0]+": \n>>>"+contextList[line-2]+"\n>>>"+contextList[line-1]+"\nError:"+error[2]+": "+error[3];
else if (line >= 1 && contextList.size() >= line)
msg = error[0]+": \n>>>"+contextList[line-1]+"\nError:"+error[2]+": "+error[3];
}
nlwarning(formatLuaErrorNlWarn(msg).c_str());
displaySystemInfo(formatLuaErrorSysInfo(msg));
}

@ -232,6 +232,7 @@ public:
CCDBNodeBranch *getDB() const { return _DbRootNode; }
// yoyo: should avoid to try creating DbPropr with this system... very dangerous
CCDBNodeLeaf* getDbProp (const std::string & name, bool bCreate=true);
void delDbProp(const std::string & name);
// get a Db Branch by its name. NULL if don't exist or not a branch (never try to create it)
CCDBNodeBranch *getDbBranch(const std::string &name);
// return the DB as an int32. return 0 if the DB does not exist (never create)

@ -517,7 +517,7 @@ bool CInterfaceParser::parseInterface (const std::vector<std::string> & strings,
{
bool ok;
bool needCheck = checkInData;
bool needCheck = false;
#if !FINAL_VERSION
needCheck = false;
@ -554,10 +554,12 @@ bool CInterfaceParser::parseInterface (const std::vector<std::string> & strings,
string::size_type pos = filename.find ("@");
if (pos != string::npos)
{
std::string bigFilename = CBigFile::getInstance().getBigFileName(filename.substr(0, pos));
std::string path = "data/"+filename.substr(0, pos);
isInData = bigFilename.find(path) != std::string::npos;
vector<string> bigFilePaths;
CBigFile::getInstance().getBigFilePaths(bigFilePaths);
if (CBigFile::getInstance().getBigFileName(filename.substr(0, pos)) != "data/"+filename.substr(0, pos))
isInData = false;
else
isInData = true;
}
if ((needCheck && !isInData) || !file.open (CPath::lookup(firstFileName)))
@ -4685,7 +4687,7 @@ bool CInterfaceParser::loadLUA(const std::string &fileName, std::string &error)
{
// get file
bool needCheck = true;
bool needCheck = false;
#if !FINAL_VERSION
needCheck = false;
@ -4702,10 +4704,10 @@ bool CInterfaceParser::loadLUA(const std::string &fileName, std::string &error)
std::string::size_type pos = pathName.find("@");
if (pos != string::npos)
{
std::string bigFilename = CBigFile::getInstance().getBigFileName(pathName.substr(0, pos));
std::string path = "data/"+pathName.substr(0, pos);
isInData = bigFilename.find(path) != std::string::npos;
if (CBigFile::getInstance().getBigFileName(pathName.substr(0, pos)) != "data/"+pathName.substr(0, pos))
isInData = false;
else
isInData = true;
}
if (needCheck && !isInData)

@ -44,12 +44,14 @@
#include "../sheet_manager.h"
#include "game_share/slot_equipment.h"
#include "game_share/animal_status.h"
#include "game_share/bot_chat_types.h"
#include "../client_cfg.h"
using namespace std;
using namespace NLMISC;
extern NLMISC::CLog g_log;
// Context help
extern void contextHelp (const std::string &help);
@ -131,6 +133,7 @@ void CItemImage::build(CCDBNodeBranch *branch)
Weight = dynamic_cast<CCDBNodeLeaf *>(branch->getNode(ICDBNode::CTextId("WEIGHT"), false));
NameId = dynamic_cast<CCDBNodeLeaf *>(branch->getNode(ICDBNode::CTextId("NAMEID"), false));
InfoVersion= dynamic_cast<CCDBNodeLeaf *>(branch->getNode(ICDBNode::CTextId("INFO_VERSION"), false));
ResaleFlag = dynamic_cast<CCDBNodeLeaf *>(branch->getNode(ICDBNode::CTextId("RESALE_FLAG"), false));
// Should always have at least those one:(ie all but Price)
nlassert(Sheet && Quality && Quantity && UserColor && Weight && NameId && InfoVersion);
@ -1998,6 +2001,9 @@ bool SBagOptions::parse(xmlNodePtr cur, CInterfaceGroup * /* parentGroup */)
prop = xmlGetProp (cur, (xmlChar*)"filter_missmp");
if (prop) DbFilterMissMP = pIM->getDbProp(prop);
prop = xmlGetProp (cur, (xmlChar*)"filter_tp");
if (prop) DbFilterTP = pIM->getDbProp(prop);
return true;
}
@ -2041,6 +2047,13 @@ bool SBagOptions::isSomethingChanged()
LastDbFilterMissMP = (DbFilterMissMP->getValue8() != 0);
}
if (DbFilterTP != NULL)
if ((DbFilterTP->getValue8() != 0) != LastDbFilterTP)
{
bRet = true;
LastDbFilterTP = (DbFilterTP->getValue8() != 0);
}
return bRet;
}
@ -2054,25 +2067,33 @@ bool SBagOptions::canDisplay(CDBCtrlSheet *pCS) const
bool bFilterTool = getFilterTool();
bool bFilterMP = getFilterMP();
bool bFilterMissMP = getFilterMissMP();
bool bFilterTP = getFilterTP();
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS != NULL)
{
// Armor
if ((pIS->Family == ITEMFAMILY::ARMOR) || (pIS->Family == ITEMFAMILY::JEWELRY))
if ((pIS->Family == ITEMFAMILY::ARMOR) ||
(pIS->Family == ITEMFAMILY::JEWELRY))
if (!bFilterArmor) bDisplay = false;
// Weapon
if ((pIS->Family == ITEMFAMILY::SHIELD) || (pIS->Family == ITEMFAMILY::MELEE_WEAPON) ||
(pIS->Family == ITEMFAMILY::RANGE_WEAPON) || (pIS->Family == ITEMFAMILY::AMMO) ||
(pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) || (pIS->Family == ITEMFAMILY::ITEM_SAP_RECHARGE) ||
if ((pIS->Family == ITEMFAMILY::SHIELD) ||
(pIS->Family == ITEMFAMILY::MELEE_WEAPON) ||
(pIS->Family == ITEMFAMILY::RANGE_WEAPON) ||
(pIS->Family == ITEMFAMILY::AMMO) ||
(pIS->Family == ITEMFAMILY::CRYSTALLIZED_SPELL) ||
(pIS->Family == ITEMFAMILY::ITEM_SAP_RECHARGE) ||
(pIS->Family == ITEMFAMILY::BRICK) )
if (!bFilterWeapon) bDisplay = false;
// Tool
if ((pIS->Family == ITEMFAMILY::CRAFTING_TOOL) || (pIS->Family == ITEMFAMILY::HARVEST_TOOL) ||
(pIS->Family == ITEMFAMILY::TAMING_TOOL) || (pIS->Family == ITEMFAMILY::TRAINING_TOOL) ||
(pIS->Family == ITEMFAMILY::BAG) || (pIS->Family == ITEMFAMILY::PET_ANIMAL_TICKET) )
if ((pIS->Family == ITEMFAMILY::CRAFTING_TOOL) ||
(pIS->Family == ITEMFAMILY::HARVEST_TOOL) ||
(pIS->Family == ITEMFAMILY::TAMING_TOOL) ||
(pIS->Family == ITEMFAMILY::TRAINING_TOOL) ||
(pIS->Family == ITEMFAMILY::BAG) ||
(pIS->Family == ITEMFAMILY::PET_ANIMAL_TICKET) )
if (!bFilterTool) bDisplay = false;
// MP
@ -2081,9 +2102,15 @@ bool SBagOptions::canDisplay(CDBCtrlSheet *pCS) const
// Mission MP
if ((pIS->Family == ITEMFAMILY::MISSION_ITEM) ||
(pIS->Family == ITEMFAMILY::XP_CATALYSER) ||
(pIS->Family == ITEMFAMILY::CONSUMABLE) ||
((pIS->Family == ITEMFAMILY::RAW_MATERIAL) && !pIS->canBuildSomeItemPart()))
if (!bFilterMissMP) bDisplay = false;
// Teleporter Pacts
if ((pIS->Family == ITEMFAMILY::TELEPORT))
if (!bFilterTP) bDisplay = false;
// Jobs Items
if (pIS->Id.toString().substr(0, 6) == "rpjob_")
bDisplay = false;
@ -2776,6 +2803,37 @@ public:
REGISTER_ACTION_HANDLER( CHandlerInvAutoEquip, "inv_auto_equip" );
// **********************************************************************************************************
class CHandlerLockInvItem : public IActionHandler
{
void execute (CCtrlBase *pCaller, const std::string &sParams)
{
// get the calling item
CDBCtrlSheet *item = CDBCtrlSheet::getCurrSelSheet();
if ( ! item)
{
nlwarning("<CHandlerDestroyItem::execute> no caller sheet found");
return;
}
string lock = "1";
if (item->getLockedByOwner())
{
lock = "0";
}
uint32 slot = item->getIndexInDB();
uint32 inv = item->getInventoryIndex();
INVENTORIES::TInventory inventory = INVENTORIES::UNDEFINED;
inventory = (INVENTORIES::TInventory)(inv);
if (inventory == INVENTORIES::UNDEFINED)
{
return;
}
NLMISC::ICommand::execute("a lockItem " + INVENTORIES::toString(inventory) + " " + toString(slot) + " " + lock, g_log);
}
};
REGISTER_ACTION_HANDLER( CHandlerLockInvItem, "lock_inv_item" );
// ***************************************************************************
// Inventory Temporary
@ -2844,11 +2902,11 @@ class CHandlerInvTempAll : public IActionHandler
nlctassert(MAX_INVENTORY_ANIMAL==4);
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal1))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(2), pInv->getMaxBagBulk(2)));
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(1), pInv->getMaxBagBulk(1)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal2))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(3), pInv->getMaxBagBulk(3)));
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(2), pInv->getMaxBagBulk(2)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal3))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(4), pInv->getMaxBagBulk(4)));
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(3), pInv->getMaxBagBulk(3)));
if (pInv->isInventoryAvailable(INVENTORIES::pet_animal4))
BagsBulk.push_back(pair <double, double>(pInv->getBagBulk(4), pInv->getMaxBagBulk(4)));

@ -25,6 +25,7 @@
#include "game_share/item_infos.h"
#include "game_share/temp_inventory_mode.h"
#include "game_share/inventories.h"
#include "game_share/bot_chat_types.h"
class CCDBNodeBranch;
class CDBCtrlSheet;
@ -62,6 +63,7 @@ public:
CCDBNodeLeaf *Weight;
CCDBNodeLeaf *NameId;
CCDBNodeLeaf *InfoVersion;
CCDBNodeLeaf *ResaleFlag;
public:
// ctor
@ -77,6 +79,8 @@ public:
uint32 getWeight() const { return (uint32) (Weight ? Weight->getValue32() : 0); }
uint32 getNameId() const { return (uint32) (NameId ? NameId->getValue32() : 0); }
uint8 getInfoVersion() const { return (uint8) (InfoVersion ? (uint8) InfoVersion->getValue8() : 0); }
uint8 getResaleFlag() const { return (uint8) (ResaleFlag ? (uint8) ResaleFlag->getValue8() : 0); }
bool getLockedByOwner() const { return (bool) (ResaleFlag ? (ResaleFlag->getValue8() == BOTCHATTYPE::ResaleKOLockedByOwner) : false); }
//
void setSheetID(uint32 si) { if (Sheet) Sheet->setValue32((sint32) si); }
void setQuality(uint16 quality) { if (Quality) Quality->setValue16((sint16) quality); }
@ -86,6 +90,7 @@ public:
void setWeight(uint32 wgt) { if (Weight) Weight->setValue32((sint32) wgt); }
void setNameId(uint32 nid) { if (NameId) NameId->setValue32((sint32) nid); }
void setInfoVersion(uint8 iv) { if (InfoVersion) InfoVersion->setValue8((sint8) iv); }
void setResaleFlag(uint8 resale) { if (ResaleFlag) ResaleFlag->setValue8(resale); }
};
@ -504,18 +509,20 @@ struct SBagOptions
CCDBNodeLeaf *DbFilterTool;
CCDBNodeLeaf *DbFilterMP;
CCDBNodeLeaf *DbFilterMissMP;
CCDBNodeLeaf *DbFilterTP;
bool LastDbFilterArmor;
bool LastDbFilterWeapon;
bool LastDbFilterTool;
bool LastDbFilterMP;
bool LastDbFilterMissMP;
bool LastDbFilterTP;
// -----------------------
SBagOptions()
{
InvType = CInventoryManager::InvUnknown;
DbFilterArmor = DbFilterWeapon = DbFilterTool = DbFilterMP = DbFilterMissMP = NULL;
LastDbFilterArmor = LastDbFilterWeapon = LastDbFilterTool = LastDbFilterMP = LastDbFilterMissMP = false;
DbFilterArmor = DbFilterWeapon = DbFilterTool = DbFilterMP = DbFilterMissMP = DbFilterTP = NULL;
LastDbFilterArmor = LastDbFilterWeapon = LastDbFilterTool = LastDbFilterMP = LastDbFilterMissMP = LastDbFilterTP = false;
}
bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
@ -552,6 +559,12 @@ struct SBagOptions
return (DbFilterMissMP->getValue8()!=0);
}
bool getFilterTP() const
{
if (DbFilterTP == NULL) return true;
return (DbFilterTP->getValue8() != 0);
}
// Return true if the sheet can be displayed due to filters
bool canDisplay(CDBCtrlSheet *pCS) const;
};

@ -143,7 +143,7 @@ extern NLMISC::CLog g_log;
extern CContinentManager ContinentMngr;
extern uint8 PlayerSelectedSlot;
extern CClientChatManager ChatMngr;
extern void addWebIGParams (string &url);
extern void addWebIGParams (string &url, bool trustedDomain);
// declare ostream << operator for ucstring -> registration of ucstring iin luabind will build a 'tostring' function from it
std::ostream &operator<<(std::ostream &str, const ucstring &value)
@ -1323,6 +1323,7 @@ void CLuaIHM::registerIHM(CLuaState &ls)
ls.registerFunc("getIndexInDB", getIndexInDB);
ls.registerFunc("getUIId", getUIId);
ls.registerFunc("createGroupInstance", createGroupInstance);
ls.registerFunc("createRootGroupInstance", createRootGroupInstance);
ls.registerFunc("createUIElement", createUIElement);
ls.registerFunc("launchContextMenuInGame", launchContextMenuInGame);
ls.registerFunc("parseInterfaceFromString", parseInterfaceFromString);
@ -1356,6 +1357,19 @@ void CLuaIHM::registerIHM(CLuaState &ls)
ls.registerFunc("enableModalWindow", enableModalWindow);
ls.registerFunc("disableModalWindow", disableModalWindow);
ls.registerFunc("getPlayerPos", getPlayerPos);
ls.registerFunc("getPlayerFront", getPlayerFront);
ls.registerFunc("getPlayerDirection", getPlayerDirection);
ls.registerFunc("getPlayerGender", getPlayerGender);
ls.registerFunc("getPlayerName", getPlayerName);
ls.registerFunc("getPlayerTitleRaw", getPlayerTitleRaw);
ls.registerFunc("getPlayerTitle", getPlayerTitle);
ls.registerFunc("getTargetPos", getTargetPos);
ls.registerFunc("getTargetFront", getTargetFront);
ls.registerFunc("getTargetDirection", getTargetDirection);
ls.registerFunc("getTargetGender", getTargetGender);
ls.registerFunc("getTargetName", getTargetName);
ls.registerFunc("getTargetTitleRaw", getTargetTitleRaw);
ls.registerFunc("getTargetTitle", getTargetTitle);
ls.registerFunc("addSearchPathUser", addSearchPathUser);
ls.registerFunc("displaySystemInfo", displaySystemInfo);
ls.registerFunc("disableContextHelpForControl", disableContextHelpForControl);
@ -1363,6 +1377,7 @@ void CLuaIHM::registerIHM(CLuaState &ls)
ls.registerFunc("setWeatherValue", setWeatherValue);
ls.registerFunc("getWeatherValue", getWeatherValue);
ls.registerFunc("getCompleteIslands", getCompleteIslands);
ls.registerFunc("displayBubble", displayBubble);
ls.registerFunc("getIslandId", getIslandId);
ls.registerFunc("getClientCfgVar", getClientCfgVar);
ls.registerFunc("isPlayerFreeTrial", isPlayerFreeTrial);
@ -1370,14 +1385,18 @@ void CLuaIHM::registerIHM(CLuaState &ls)
ls.registerFunc("isInRingMode", isInRingMode);
ls.registerFunc("getUserRace", getUserRace);
ls.registerFunc("getSheet2idx", getSheet2idx);
ls.registerFunc("getTargetSlot", getTargetSlot);
ls.registerFunc("getSlotDataSetId", getSlotDataSetId);
// Through LUABind API
lua_State *L= ls.getStatePointer();
luabind::module(L)
[
LUABIND_FUNC(addDbProp),
LUABIND_FUNC(getDbProp),
LUABIND_FUNC(setDbProp),
LUABIND_FUNC(delDbProp),
LUABIND_FUNC(debugInfo),
LUABIND_FUNC(rawDebugInfo),
LUABIND_FUNC(dumpCallStack),
@ -1456,9 +1475,16 @@ void CLuaIHM::registerIHM(CLuaState &ls)
luabind::def("shellExecute", CMiscFunctions::shellExecute),
LUABIND_FUNC(getPlayerLevel),
LUABIND_FUNC(getPlayerVpa),
LUABIND_FUNC(getPlayerVpb),
LUABIND_FUNC(getPlayerVpc),
LUABIND_FUNC(getTargetLevel),
LUABIND_FUNC(getTargetForceRegion),
LUABIND_FUNC(getTargetLevelForce),
LUABIND_FUNC(getTargetSheet),
LUABIND_FUNC(getTargetVpa),
LUABIND_FUNC(getTargetVpb),
LUABIND_FUNC(getTargetVpc),
LUABIND_FUNC(isTargetNPC),
LUABIND_FUNC(isTargetPlayer), // return 'true' if the target is an npc
LUABIND_FUNC(isTargetUser),
@ -1686,12 +1712,60 @@ void CLuaIHM::setDbProp(const std::string &dbProp, sint32 value)
// Write to the DB if found
CInterfaceManager *pIM= CInterfaceManager::getInstance();
CCDBNodeLeaf *node= pIM->getDbProp(dbProp, false);
if(node)
node->setValue32(value);
else
debugInfo(toString("setDbProp(): '%s' dbProp Not found", dbProp.c_str()));
}
void CLuaIHM::delDbProp(const string &dbProp)
{
//H_AUTO(Lua_CLuaIHM_setDbProp)
// Do not allow Write on SERVER: or LOCAL:
static const string dbServer= "SERVER:";
static const string dbLocal= "LOCAL:";
static const string dbLocalR2= "LOCAL:R2";
if( (0==dbProp.compare(0, dbServer.size(), dbServer)) ||
(0==dbProp.compare(0, dbLocal.size(), dbLocal))
)
{
if (0!=dbProp.compare(0, dbLocalR2.size(), dbLocalR2))
{
nlstop;
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
}
}
// Write to the DB if found
CInterfaceManager *pIM= CInterfaceManager::getInstance();
pIM->delDbProp(dbProp);
}
void CLuaIHM::addDbProp(const std::string &dbProp, sint32 value)
{
//H_AUTO(Lua_CLuaIHM_setDbProp)
// Do not allow Write on SERVER: or LOCAL:
static const std::string dbServer= "SERVER:";
static const std::string dbLocal= "LOCAL:";
static const std::string dbLocalR2= "LOCAL:R2";
if( (0==dbProp.compare(0, dbServer.size(), dbServer)) ||
(0==dbProp.compare(0, dbLocal.size(), dbLocal))
)
{
if (0!=dbProp.compare(0, dbLocalR2.size(), dbLocalR2))
{
nlstop;
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
}
}
// Write to the DB if found
CInterfaceManager *pIM= CInterfaceManager::getInstance();
CCDBNodeLeaf *node= pIM->getDbProp(dbProp, true);
if(node)
node->setValue32(value);
}
// ***************************************************************************
void CLuaIHM::debugInfo(const std::string &cstDbg)
@ -1865,7 +1939,21 @@ std::string CLuaIHM::getDefine(const std::string &def)
// ***************************************************************************
static CEntityCL *getTargetSlot()
static sint32 getTargetSlotNr()
{
const char *dbPath = "UI:VARIABLES:TARGET:SLOT";
CInterfaceManager *im = CInterfaceManager::getInstance();
CCDBNodeLeaf *node = im->getDbProp(dbPath, false);
if (!node) return 0;
if ((uint8) node->getValue32() == (uint8) CLFECOMMON::INVALID_SLOT)
{
return 0;
}
return node->getValue32();
}
// ***************************************************************************
static CEntityCL *getTargetEntity()
{
const char *dbPath = "UI:VARIABLES:TARGET:SLOT";
CInterfaceManager *im = CInterfaceManager::getInstance();
@ -1875,7 +1963,13 @@ static CEntityCL *getTargetSlot()
{
return NULL;
}
return EntitiesMngr.entity((uint) node->getValue32());
return EntitiesMngr.entity((uint) node->getValue32());
}
// ***************************************************************************
static CEntityCL *getSlotEntity(uint slot)
{
return EntitiesMngr.entity(slot);
}
// ***************************************************************************
@ -1890,10 +1984,31 @@ sint32 CLuaIHM::getPlayerLevel()
return sint32(maxskill);
}
// ***************************************************************************
sint64 CLuaIHM::getPlayerVpa()
{
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E0:P"+toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return prop;
}
// ***************************************************************************
sint64 CLuaIHM::getPlayerVpb()
{
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E0:P"+toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop;
}
// ***************************************************************************
sint64 CLuaIHM::getPlayerVpc()
{
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E0:P"+toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop;
}
// ***************************************************************************
sint32 CLuaIHM::getTargetLevel()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return -1;
if ( target->isPlayer() )
{
@ -1913,10 +2028,52 @@ sint32 CLuaIHM::getTargetLevel()
return -1;
}
// ***************************************************************************
ucstring CLuaIHM::getTargetSheet()
{
CEntityCL *target = getTargetEntity();
if (!target) return ucstring();
return target->sheetId().toString();
}
// ***************************************************************************
sint64 CLuaIHM::getTargetVpa()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E"+toString("%d", getTargetSlotNr())+":P"+toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return prop;
}
// ***************************************************************************
sint64 CLuaIHM::getTargetVpb()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E"+toString("%d", getTargetSlotNr())+":P"+toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop;
}
// ***************************************************************************
sint64 CLuaIHM::getTargetVpc()
{
CEntityCL *target = getTargetEntity();
if (!target) return 0;
sint64 prop = CInterfaceManager::getInstance()->getDbProp("SERVER:Entities:E"+toString("%d", getTargetSlotNr())+":P"+toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop;
}
// ***************************************************************************
sint32 CLuaIHM::getTargetForceRegion()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return -1;
if ( target->isPlayer() )
{
@ -1944,7 +2101,7 @@ sint32 CLuaIHM::getTargetForceRegion()
// ***************************************************************************
sint32 CLuaIHM::getTargetLevelForce()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return -1;
if ( target->isPlayer() )
{
@ -1972,7 +2129,7 @@ sint32 CLuaIHM::getTargetLevelForce()
// ***************************************************************************
bool CLuaIHM::isTargetNPC()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return false;
return target->isNPC();
}
@ -1980,7 +2137,7 @@ bool CLuaIHM::isTargetNPC()
// ***************************************************************************
bool CLuaIHM::isTargetPlayer()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return false;
return target->isPlayer();
}
@ -1989,7 +2146,7 @@ bool CLuaIHM::isTargetPlayer()
// ***************************************************************************
bool CLuaIHM::isTargetUser()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return false;
return target->isUser();
}
@ -1998,15 +2155,15 @@ bool CLuaIHM::isTargetUser()
bool CLuaIHM::isPlayerInPVPMode()
{
if (!UserEntity) return false;
return (UserEntity->getPvpMode() & PVP_MODE::PvpFaction || UserEntity->getPvpMode() & PVP_MODE::PvpFactionFlagged || UserEntity->getPvpMode() & PVP_MODE::PvpZoneFaction);
return (UserEntity->getPvpMode() & PVP_MODE::PvpFaction || UserEntity->getPvpMode() & PVP_MODE::PvpFactionFlagged || UserEntity->getPvpMode() & PVP_MODE::PvpZoneFaction) != 0;
}
// ***************************************************************************
bool CLuaIHM::isTargetInPVPMode()
{
CEntityCL *target = getTargetSlot();
CEntityCL *target = getTargetEntity();
if (!target) return false;
return (target->getPvpMode() & PVP_MODE::PvpFaction || target->getPvpMode() & PVP_MODE::PvpFactionFlagged || target->getPvpMode() & PVP_MODE::PvpZoneFaction);
return (target->getPvpMode() & PVP_MODE::PvpFaction || target->getPvpMode() & PVP_MODE::PvpFactionFlagged || target->getPvpMode() & PVP_MODE::PvpZoneFaction) != 0;
}
// ***************************************************************************
@ -2368,6 +2525,53 @@ int CLuaIHM::createGroupInstance(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHM::createRootGroupInstance(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_createGroupInstance)
const char *funcName = "createRootGroupInstance";
CLuaIHM::checkArgCount(ls, funcName, 3);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TTABLE);
std::vector<std::pair<std::string, std::string> > templateParams;
CLuaObject params;
params.pop(ls);
ENUM_LUA_TABLE(params, it)
{
if (!it.nextKey().isString())
{
nlwarning("%s : bad key encountered with type %s, string expected.", funcName, it.nextKey().getTypename());
continue;
}
if (!it.nextValue().isString())
{
nlwarning("%s : bad value encountered with type %s for key %s, string expected.", funcName, it.nextValue().getTypename(), it.nextKey().toString().c_str());
continue;
}
templateParams.push_back(std::pair<std::string, std::string>(it.nextKey().toString(), it.nextValue().toString())); // strange compilation bug here when I use std::make_pair ... :(
}
CInterfaceManager *im = CInterfaceManager::getInstance();
CInterfaceGroup *result = im->createGroupInstance(ls.toString(1), "ui:interface:"+string(ls.toString(2)), templateParams);
if (!result)
{
ls.pushNil();
}
else
{
result->setId("ui:interface:"+string(ls.toString(2)));
result->updateCoords();
im->addWindowToMasterGroup("ui:interface", result);
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(im->getElementFromId("ui:interface"));
result->setParent(pRoot);
if (pRoot)
pRoot->addGroup(result);
result->setActive(true);
CLuaIHM::pushUIOnStack(ls, result);
}
return 1;
}
// ***************************************************************************
int CLuaIHM::createUIElement(CLuaState &ls)
{
@ -2407,6 +2611,42 @@ int CLuaIHM::createUIElement(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHM::displayBubble(CLuaState &ls)
{
//H_AUTO(Lua_CLuaIHM_createUIElement)
const char *funcName = "displayBubble";
CLuaIHM::checkArgCount(ls, funcName, 3);
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER);
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TTABLE);
std::vector<std::string> strs;
std::vector<std::string> links;
CLuaObject params;
params.pop(ls);
ENUM_LUA_TABLE(params, it)
{
if (!it.nextKey().isString())
{
nlwarning("%s : bad key encountered with type %s, string expected.", funcName, it.nextKey().getTypename());
continue;
}
if (!it.nextValue().isString())
{
nlwarning("%s : bad value encountered with type %s for key %s, string expected.", funcName, it.nextValue().getTypename(), it.nextKey().toString().c_str());
continue;
}
links.push_back(it.nextValue().toString());
strs.push_back(it.nextKey().toString());
}
InSceneBubbleManager.webIgChatOpen((uint32)ls.toNumber(1), ls.toString(2), strs, links);
return 1;
}
// ***************************************************************************
int CLuaIHM::getCompleteIslands(CLuaState &ls)
{
@ -3523,7 +3763,7 @@ void CLuaIHM::browseNpcWebPage(const std::string &htmlId, const std::string &url
string("&lang=") + ClientCfg.getHtmlLanguageCode() +
string("&guild_name=") + guildName;
}
/*
/* Already added by GroupHtml
if(webig)
{
// append special webig auth params
@ -4242,6 +4482,126 @@ int CLuaIHM::getPlayerPos(CLuaState &ls)
return 3;
}
// ***************************************************************************
int CLuaIHM::getPlayerFront(CLuaState &ls)
{
checkArgCount(ls, "getPlayerFront", 0);
ls.push(atan2(UserEntity->front().y, UserEntity->front().x));
return 1;
}
// ***************************************************************************
int CLuaIHM::getPlayerDirection(CLuaState &ls)
{
checkArgCount(ls, "getPlayerDirection", 0);
ls.push(atan2(UserEntity->dir().y, UserEntity->dir().x));
return 1;
}
// ***************************************************************************
int CLuaIHM::getPlayerGender(CLuaState &ls)
{
checkArgCount(ls, "getPlayerGender", 0);
ls.push((lua_Number)(UserEntity->getGender()));
return 1;
}
// ***************************************************************************
int CLuaIHM::getPlayerName(CLuaState &ls)
{
checkArgCount(ls, "getPlayerName", 0);
ls.push(UserEntity->getEntityName().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::getPlayerTitleRaw(CLuaState &ls)
{
checkArgCount(ls, "getPlayerTitleRaw", 0);
ls.push(UserEntity->getTitleRaw().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::getPlayerTitle(CLuaState &ls)
{
checkArgCount(ls, "getPlayerTitle", 0);
ls.push(UserEntity->getTitle().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetPos(CLuaState &ls)
{
checkArgCount(ls, "getTargetPos", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(target->pos().x);
ls.push(target->pos().y);
ls.push(target->pos().z);
return 3;
}
// ***************************************************************************
int CLuaIHM::getTargetFront(CLuaState &ls)
{
checkArgCount(ls, "getTargetFront", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(atan2(target->front().y, target->front().x));
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetDirection(CLuaState &ls)
{
checkArgCount(ls, "getTargetDirection", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(atan2(target->dir().y, target->dir().x));
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetGender(CLuaState &ls)
{
checkArgCount(ls, "getTargetGender", 0);
CCharacterCL* target = (CCharacterCL*)getTargetEntity();
if (!target) return (int)GSGENDER::unknown;
ls.push((lua_Number)(target->getGender()));
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetName(CLuaState &ls)
{
checkArgCount(ls, "getTargetName", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(target->getEntityName().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetTitleRaw(CLuaState &ls)
{
checkArgCount(ls, "getTargetTitleRaw", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(target->getTitleRaw().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetTitle(CLuaState &ls)
{
checkArgCount(ls, "getTargetTitle", 0);
CEntityCL *target = getTargetEntity();
if (!target) return 0;
ls.push(target->getTitle().toUtf8());
return 1;
}
// ***************************************************************************
int CLuaIHM::addSearchPathUser(CLuaState &ls)
{
@ -4437,3 +4797,23 @@ int CLuaIHM::getSheet2idx(CLuaState &ls)
return 1;
}
// ***************************************************************************
int CLuaIHM::getTargetSlot(CLuaState &ls)
{
uint32 slot = (uint32)getTargetSlotNr();
ls.push((lua_Number)slot);
return 1;
}
// ***************************************************************************
int CLuaIHM::getSlotDataSetId(CLuaState &ls)
{
CLuaIHM::checkArgCount(ls, "getSlotDataSetId", 1);
CLuaIHM::checkArgType(ls, "getSlotDataSetId", 1, LUA_TNUMBER);
uint32 slot = (uint32)ls.toNumber(1);
CEntityCL *e = getSlotEntity(slot);
string id = toString(e->dataSetId());
ls.push(id);
return 1;
}

@ -185,9 +185,16 @@ private:
// LUA exported Functions with luabind
static sint32 getPlayerLevel(); // get max level among player skills (magi, combat, crafting ,foraging)
static sint64 getPlayerVpa();
static sint64 getPlayerVpb();
static sint64 getPlayerVpc();
static sint32 getTargetLevel(); // get current, precise level of the selected target, or -1 if there's no such selected target
static sint32 getTargetForceRegion(); // get 'force region' for current target, or -1 if there's no selected target
static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target
static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target
static ucstring getTargetSheet(); // get the name of the target sheet (like 'zoha2old.creature')
static sint64 getTargetVpa();
static sint64 getTargetVpb();
static sint64 getTargetVpc();
static bool isTargetNPC(); // return 'true' if the target is an npc
static bool isTargetPlayer(); // return 'true' if the target is a player
static bool isTargetUser(); // return 'true' if the target is the user
@ -202,10 +209,12 @@ private:
static bool isInGame();
static uint32 getPlayerSelectedSlot();
static bool isPlayerSlotNewbieLand(uint32 slot); // test if one of the player slot is a newbieland one, if not so, client must be patched in order to continue
static uint32 getLocalTime();
static uint32 getLocalTime();
static double getPreciseLocalTime();
static sint32 getDbProp(const std::string &dbProp); // return 0 if not found.
static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present.
static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present.
static void delDbProp(const std::string &dbProp);
static std::string getDefine(const std::string &def);
static void messageBox(const ucstring &text);
static void messageBox(const ucstring &text, const std::string &masterGroup);
@ -286,17 +295,24 @@ private:
static int getUICaller(CLuaState &ls); // params: none. return: CInterfaceElement* (nil if error)
static int getCurrentWindowUnder(CLuaState &ls); // params: none. return: CInterfaceElement* (nil if none)
static int getUI(CLuaState &ls); // params: "ui:interface:...". return: CInterfaceElement* (nil if error), an additionnal boolean parameter
// can specify verbose display when the element is note found (default is true)
// can specify verbose display when the element is note found (default is true)
static int createGroupInstance(CLuaState &ls); // params : param 1 = template name,
// param 2 = id of parent where the instance will be inserted
// param 3 = table with ("template_param", "template_param_value") key/value pairs
// param 2 = id of parent where the instance will be inserted
// param 3 = table with ("template_param", "template_param_value") key/value pairs
// such as { id="foo", x="10" } etc. -> returns a new instance of the template, or nil on fail
static int createRootGroupInstance(CLuaState &ls); // params : param 1 = template name,
// param 2 = id of parent where the instance will be inserted
// param 3 = table with ("template_param", "template_param_value") key/value pairs
// such as { id="foo", x="10" } etc. -> returns a new instance of the template, or nil on fail
static int createUIElement(CLuaState &ls); // params : param 1 = template name,
// param 2 = id of parent where the instance will be inserted
// param 3 = table with ("template_param", "template_param_value") key/value pairs
// param 2 = id of parent where the instance will be inserted
// param 3 = table with ("template_param", "template_param_value") key/value pairs
// such as { id="foo", x="10" } etc. -> returns a new instance of the template, or nil on fail
static int displayBubble(CLuaState &ls); // params : param 1 = bot id
// param 2 = text
// param 3 = table with all strings and urls
// {"main text"="http:///", "text option 1"="http:///", "text option 2"="http:///") etc...
static int getIndexInDB(CLuaState &ls); // params: CDBCtrlSheet*.... return: index, or 0 if error
static int getUIId(CLuaState &ls); // params: CInterfaceElement*. return: ui id (empty if error)
static int runAH(CLuaState &ls); // params: CInterfaceElement *, "ah", "params". return: none
@ -334,9 +350,9 @@ private:
static int getServerSeason(CLuaState &ls); // get the last season sent by the server
// 0->auto, computed locally from the current day (or not received from server yet)
// 1->server force spring
// 2->' ' ' summer
// 3->' ' ' autumn
// 4->' ' ' winter
// 2->' ' ' summer
// 3->' ' ' autumn
// 4->' ' ' winter
static int computeCurrSeason(CLuaState &ls); // compute current displayed season (1->spring, etc .)
static int getAutoSeason(CLuaState &ls); // compute automatic season that would be at this time (1->spring, etc .)
@ -345,6 +361,19 @@ private:
static int enableModalWindow(CLuaState &ls);
static int disableModalWindow(CLuaState &ls);
static int getPlayerPos(CLuaState &ls);
static int getPlayerFront(CLuaState &ls);
static int getPlayerDirection(CLuaState &ls);
static int getPlayerGender(CLuaState &ls);
static int getPlayerName(CLuaState &ls);
static int getPlayerTitleRaw(CLuaState &ls);
static int getPlayerTitle(CLuaState &ls);
static int getTargetPos(CLuaState &ls);
static int getTargetFront(CLuaState &ls);
static int getTargetDirection(CLuaState &ls);
static int getTargetGender(CLuaState &ls);
static int getTargetName(CLuaState &ls);
static int getTargetTitleRaw(CLuaState &ls);
static int getTargetTitle(CLuaState &ls);
static int addSearchPathUser(CLuaState &ls);
static int getClientCfgVar(CLuaState &ls);
static int isPlayerFreeTrial(CLuaState &ls);
@ -352,6 +381,8 @@ private:
static int isInRingMode(CLuaState &ls);
static int getUserRace(CLuaState &ls);
static int getSheet2idx(CLuaState &ls);
static int getTargetSlot(CLuaState &ls);
static int getSlotDataSetId(CLuaState &ls);
// LUA functions exported for Dev only (debug)

@ -40,6 +40,7 @@
#include "../net_manager.h"
#include "../connection.h"
#include "group_tab.h"
#include "guild_manager.h"
// Game share
#include "game_share/entity_types.h"
// NeL
@ -1418,7 +1419,47 @@ void CPeopleInterraction::updateContactInList(uint32 contactId, TCharConnectionS
{
sint index = FriendList.getIndexFromContactId(contactId);
if (index != -1)
FriendList.setOnline(index, online);
{
if (FriendList.getOnline(index) != online)
{
// Only do work if online status has changed
FriendList.setOnline(index, online);
CCDBNodeLeaf* node = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_ONLINE_OFFLINE_NOTIFICATIONS_CB", false);
if (node && node->getValueBool())
{
// Only show the message if this player is not in my guild (because then the guild manager will show a message)
std::vector<SGuildMember> GuildMembers = CGuildManager::getInstance()->getGuildMembers();
bool bOnlyFriend = true;
ucstring name = toLower(FriendList.getName(index));
for (uint i = 0; i < GuildMembers.size(); ++i)
{
if (toLower(GuildMembers[i].Name) == name)
{
bOnlyFriend = false;
break;
}
}
// Player is not in my guild
if (bOnlyFriend)
{
ucstring msg = (online != ccs_offline) ? CI18N::get("uiPlayerOnline") : CI18N::get("uiPlayerOffline");
strFindReplace(msg, "%s", FriendList.getName(index));
string cat = getStringCategory(msg, msg);
map<string, CClientConfig::SSysInfoParam>::const_iterator it;
NLMISC::CRGBA col = CRGBA::Yellow;
it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end())
{
col = it->second.Color;
}
bool dummy;
PeopleInterraction.ChatInput.AroundMe.displayMessage(msg, col, 2, &dummy);
}
}
}
}
}
else
{
@ -1988,6 +2029,39 @@ public:
};
REGISTER_ACTION_HANDLER( CHandlerDismissMember, "dismiss_member");
//=================================================================================================================
// Set the leader of the team
class CHandlerSetTeamLeader : public IActionHandler
{
public:
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
{
// retrieve the index of the people
CPeopleList *list;
uint peopleIndex;
if (PeopleInterraction.getPeopleFromCurrentMenu(list, peopleIndex))
{
if (list == &PeopleInterraction.TeamList) // check for good list
{
/*
const string msgName = "TEAM:SET_LEADER";
CBitMemStream out;
if(GenericMsgHeaderMngr.pushNameToStream(msgName, out))
{
uint8 teamMember = (uint8)(peopleIndex);
out.serial(teamMember);
NetMngr.push(out);
//nlinfo("impulseCallBack : %s %d sent", msgName.c_str(), teamMember);
}
else
nlwarning("command 'set_leader': unknown message named '%s'.", msgName.c_str());
*/
NLMISC::ICommand::execute("a setTeamLeader " + toString(peopleIndex), g_log);
}
}
}
};
REGISTER_ACTION_HANDLER( CHandlerSetTeamLeader, "set_team_leader");
//=================================================================================================================
// Set a successor for the team
@ -3236,6 +3310,12 @@ NLMISC_COMMAND(chatLog, "", "")
if (pIM->getLogState())
pIM->displaySystemInfo(CI18N::get("uiLogTurnedOn"));
CCDBNodeLeaf *node = pIM->getDbProp("UI:SAVE:CHATLOG_STATE", false);
if (node)
{
node->setValue32(pIM->getLogState() ? 1 : 0);
}
return true;
};

@ -211,7 +211,8 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b)
{
return (name_a < name_b);
}
else {
else
{
// Compare online status
switch (a.Online)
{
@ -467,18 +468,12 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c
return;
}
ucstring cur_time;
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
cur_time = CInterfaceManager::getTimestampHuman();
ucstring csr;
if (CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw())) csr += ucstring("(CSR) ");
ucstring finalMsg = cur_time + csr + CI18N::get("youTell") + ": " + msg;
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
ucstring finalMsg = csr + CI18N::get("youTell") + ": " + msg;
// display msg with good color
CInterfaceProperty prop;
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
@ -783,10 +778,6 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online)
_Peoples[index].Online = online;
// If the people goes offline remove eventually opened chat
if (online == ccs_offline)
openCloseChat(index, false);
updatePeopleMenu(index);
}
@ -944,14 +935,8 @@ class CHandlerContactEntry : public IActionHandler
ucstring final;
CChatWindow::encodeColorTag(prop.getRGBA(), final, false);
ucstring cur_time;
CCDBNodeLeaf *pNL = CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB", false);
if (pNL && pNL->getValueBool())
cur_time = CInterfaceManager::getTimestampHuman();
ucstring csr;
if (CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw())) csr += ucstring("(CSR) ");
final += cur_time + csr + CI18N::get("youTell")+": ";
ucstring csr(CHARACTER_TITLE::isCsrTitle(UserEntity->getTitleRaw()) ? "(CSR) " : "");
final += csr + CI18N::get("youTell")+": ";
prop.readRGBA("UI:SAVE:CHAT:COLORS:TELL"," ");
CChatWindow::encodeColorTag(prop.getRGBA(), final, true);
final += text;
@ -962,7 +947,6 @@ class CHandlerContactEntry : public IActionHandler
strFindReplace(final, CI18N::get("youTell"), s);
CInterfaceManager::getInstance()->log(final);
}
}
}
};

@ -139,6 +139,7 @@ void CPlayerTrade::restoreItem(CDBCtrlSheet *exchangeSlot)
im.getBagItem(emptySlot).setWeight((uint32) exchangeSlot->getItemWeight());
im.getBagItem(emptySlot).setNameId(exchangeSlot->getItemNameId());
im.getBagItem(emptySlot).setInfoVersion(exchangeSlot->getItemInfoVersion());
im.getBagItem(emptySlot).setResaleFlag(exchangeSlot->getItemResaleFlag());
}

@ -1042,7 +1042,7 @@ void CSkillManager::setPlayerTitle(const std::string &name)
// ***************************************************************************
// ***************************************************************************
#define GROUP_TITLE_COMBO "ui:interface:info_player_skills:content:basics_skills:title:player_title"
#define GROUP_TITLE_COMBO "ui:interface:info_player_skills:content:webinfos:title:player_title"
// ***************************************************************************
class CHandlerTitleInit: public IActionHandler

@ -70,6 +70,10 @@ public:
// from CInterfaceElement
virtual void visit(CInterfaceElementVisitor *visitor);
// special for mouse over : return true and fill the name of the cursor to display
virtual bool getMouseOverShape(std::string &/* texName */, uint8 &/* rot */, NLMISC::CRGBA &/* col */) { return false; }
};

@ -72,6 +72,8 @@ public:
bool getScale() const { return _Scale; }
void setScale (bool s) { _Scale = s; }
bool getTile() const { return _Tile; }
void setTile (bool s) { _Tile = s; }
void setColor (const NLMISC::CRGBA &r) { _Color = r; }
// Reflected

@ -42,5 +42,23 @@ void CViewLink::setHTMLView(CGroupHTML *html)
HTML = html;
}
// ***************************************************************************
bool CViewLink::getMouseOverShape(string &texName, uint8 &rot, CRGBA &col)
{
if (HTML != NULL)
{
if (!LinkTitle.empty())
{
texName = LinkTitle;
rot= 0;
col = CRGBA::White;
return true;
}
}
return false;
}
// ***************************************************************************

@ -38,8 +38,11 @@ public:
// The URI
std::string Link;
std::string LinkTitle;
// Set the main group
void setHTMLView(class CGroupHTML *html);
bool getMouseOverShape(std::string &texName, uint8 &rot, NLMISC::CRGBA &col);
protected:

@ -70,6 +70,7 @@ CViewPointer::CViewPointer (const TCtorParam &param)
_Color = CRGBA(255,255,255,255);
_LastHightLight = NULL;
_StringMode = false;
_ForceStringMode = false;
_StringCursor = NULL;
}
@ -255,6 +256,41 @@ void CViewPointer::draw ()
return;
}
const vector<CViewBase *> &vUP = pIM->getViewsUnderPointer ();
for(uint i=0;i<vUP.size();i++)
{
CViewLink *vLink = dynamic_cast<CViewLink*>(vUP[i]);
if (vLink != NULL)
{
string tooltip;
uint8 rot;
if (vLink->getMouseOverShape(tooltip, rot, col))
{
setString(ucstring(tooltip));
sint32 texId = rVR.getTextureIdFromName ("curs_pick.tga");
CInterfaceGroup *stringCursor = IsMouseCursorHardware() ? _StringCursorHardware : _StringCursor;
if (stringCursor)
{
stringCursor->setX(_PointerX);
stringCursor->setY(_PointerY);
stringCursor->updateCoords();
stringCursor->draw();
// if in hardware mode, force to draw the default cursor no matter what..
if (IsMouseCursorHardware())
drawCursor(texId, col, 0);
}
else
{
drawCursor(texId, col, 0);
}
return;
}
}
}
// Draw if capture right
pCB = pIM->getCapturePointerRight();
if (pCB != NULL)
@ -521,16 +557,50 @@ bool CViewPointer::drawPan(CCtrlBase* pCB, NLMISC::CRGBA col)
// --------------------------------------------------------------------------------------------------------------------
bool CViewPointer::drawCustom(CCtrlBase* pCB)
{
std::string texName;
string texName;
uint8 rot;
NLMISC::CRGBA col;
if (pCB->getMouseOverShape(texName, rot, col))
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 texId = rVR.getTextureIdFromName (texName);
drawCursor(texId, col, 0);
return true;
if (texName[0] == '@')
{
const string &tooltipInfos = texName.substr(1);
string tooltip;
vector<string> tooltipInfosList;
splitString(tooltipInfos, "@", tooltipInfosList);
texName = tooltipInfosList[0];
tooltip = tooltipInfosList[1];
nlinfo(tooltip.c_str());
setString(ucstring(tooltip));
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 texId = rVR.getTextureIdFromName (texName);
CInterfaceGroup *stringCursor = IsMouseCursorHardware() ? _StringCursorHardware : _StringCursor;
if (stringCursor)
{
stringCursor->setX(_PointerX);
stringCursor->setY(_PointerY);
stringCursor->updateCoords();
stringCursor->draw();
// if in hardware mode, force to draw the default cursor no matter what..
if (IsMouseCursorHardware())
drawCursor(texId, col, 0);
}
else
{
drawCursor(texId, col, 0);
}
return true;
}
else
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CViewRenderer &rVR = pIM->getViewRenderer();
sint32 texId = rVR.getTextureIdFromName (texName);
drawCursor(texId, col, 0);
return true;
}
}
return false;
}

@ -153,6 +153,7 @@ private:
// Cursor mode
bool _StringMode;
bool _ForceStringMode;
CInterfaceGroup *_StringCursor;
CInterfaceGroup *_StringCursorHardware;
ucstring _ContextString;

@ -743,8 +743,8 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std:
image.UVMin.V = uvMinV;
image.UVMax.U = uvMaxU;
image.UVMax.V = uvMaxV;
sTGAname = tgaName;
sTGAname = toLower(sTGAname);
sTGAname = toLower(string(tgaName));
string::size_type stripPng = sTGAname.find(".png");
if (stripPng != string::npos)
{
@ -752,6 +752,7 @@ void CViewRenderer::loadTextures (const std::string &textureFileName, const std:
sTGAname[stripPng + 2] = 'g';
sTGAname[stripPng + 3] = 'a';
}
image.Name = sTGAname;
image.GlobalTexturePtr = &(_GlobalTextures.back());
if (getTextureIdFromName(sTGAname) != -1)
@ -1029,6 +1030,7 @@ sint32 CViewRenderer::getTextureIdFromName (const string &sName) const
// convert to lowCase
string nameLwr = toLower(sName);
string::size_type stripPng = nameLwr.find(".png");
if (stripPng != string::npos)
{
@ -1036,7 +1038,7 @@ sint32 CViewRenderer::getTextureIdFromName (const string &sName) const
nameLwr[stripPng + 2] = 'g';
nameLwr[stripPng + 3] = 'a';
}
// Search in map
TTextureMap::const_iterator it= _TextureMap.find(nameLwr);
if( it==_TextureMap.end() )
@ -1531,6 +1533,7 @@ void CViewRenderer::initSystemTextures()
addSystemTexture(RegenTexture, "regen.tga");
addSystemTexture(RegenBackTexture, "regen_back.tga");
addSystemTexture(GlowStarTexture, "glow_star_24.tga");
addSystemTexture(ItemLockedByOwnerTexture, "r2ed_toolbar_lock_small.tga");
}

@ -75,6 +75,7 @@ public:
RegenTexture,
RegenBackTexture,
GlowStarTexture,
ItemLockedByOwnerTexture,
NumSystemTextures,
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save