mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 09:36:15 +00:00
Merge with develop
This commit is contained in:
parent
5cb589442c
commit
1987575b2d
136 changed files with 1984 additions and 955 deletions
|
@ -871,7 +871,7 @@ MACRO(NL_SETUP_BUILD)
|
|||
ENDIF(ANDROID)
|
||||
|
||||
IF(APPLE)
|
||||
ADD_PLATFORM_FLAGS("-gdwarf-2")
|
||||
ADD_PLATFORM_FLAGS("-gdwarf-2 -D_DARWIN_UNLIMITED_STREAMS")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace NLGUI
|
|||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
|
||||
// Init part
|
||||
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup);
|
||||
|
||||
virtual void updateCoords();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace NLGUI
|
|||
DECLARE_UI_CLASS( CCtrlDraggable )
|
||||
|
||||
CCtrlDraggable( const TCtorParam ¶m );
|
||||
virtual ~CCtrlDraggable(){};
|
||||
virtual ~CCtrlDraggable(){}
|
||||
|
||||
static CCtrlDraggable *getDraggedSheet(){ return _LastDraggedSheet; }
|
||||
bool isDragged() const{ return dragged; }
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace NLGUI
|
|||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
|
||||
// Init part
|
||||
virtual bool parse (xmlNodePtr cur,CInterfaceGroup * parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup);
|
||||
|
||||
virtual void checkCoords();
|
||||
virtual void updateCoords();
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace NLGUI
|
|||
uint getTextPos(uint nId) const;
|
||||
const ucstring &getTexture(uint i) const;
|
||||
void setGrayed(uint i, bool g);
|
||||
const bool getGrayed(uint i) const;
|
||||
bool getGrayed(uint i) const;
|
||||
void removeText(uint nPos);
|
||||
uint getNumTexts() const {return (uint)_Texts.size();}
|
||||
void sortText();
|
||||
|
|
|
@ -72,10 +72,12 @@ namespace NLGUI
|
|||
GroupChildren = 4 /// module can parse when parsing the group children
|
||||
};
|
||||
|
||||
IParserModule(){
|
||||
IParserModule()
|
||||
{
|
||||
parser = NULL;
|
||||
parsingStage = None;
|
||||
}
|
||||
|
||||
virtual ~IParserModule(){}
|
||||
|
||||
bool canParseInStage( ParsingStage stage )
|
||||
|
|
|
@ -71,13 +71,13 @@ namespace NLGUI
|
|||
private:
|
||||
|
||||
/// Drawing helpers
|
||||
virtual bool drawResizer(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawRotate(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawScale(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawColorPicker(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawLink(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawBrowse(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawPan(CCtrlBase* pCB, NLMISC::CRGBA col){ return false; }
|
||||
virtual bool drawResizer(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawRotate(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawScale(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawColorPicker(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawLink(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawBrowse(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawPan(CCtrlBase* /* pCB */, NLMISC::CRGBA /* col */) { return false; }
|
||||
virtual bool drawCustom(CCtrlBase* pCB);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace NLGUI
|
|||
class IOnWidgetsDrawnHandler
|
||||
{
|
||||
public:
|
||||
virtual ~IOnWidgetsDrawnHandler(){};
|
||||
virtual ~IOnWidgetsDrawnHandler(){}
|
||||
virtual void process() = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -127,6 +127,9 @@ public:
|
|||
/// Returns the code of the language ("fr", "en", ...) defined on system
|
||||
static std::string getSystemLanguageCode ();
|
||||
|
||||
/// Define the code of the language ("fr", "en", ...) defined on system
|
||||
static bool setSystemLanguageCode (const std::string &languageCode);
|
||||
|
||||
/// Find a string in the selected language and return his association.
|
||||
static const ucstring &get (const std::string &label);
|
||||
|
||||
|
@ -230,6 +233,7 @@ private:
|
|||
|
||||
static std::vector<std::string> _LanguageCodes;
|
||||
static std::vector<ucstring> _LanguageNames;
|
||||
static std::string _SystemLanguageCode;
|
||||
|
||||
static bool _LanguagesNamesLoaded;
|
||||
|
||||
|
|
|
@ -236,9 +236,6 @@ private:
|
|||
|
||||
// If not NULL, binary mode detected, use this stream in serials
|
||||
IStream *_BinaryStream;
|
||||
|
||||
// System dependant structure for locale
|
||||
void* _Locale;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -181,9 +181,6 @@ private:
|
|||
|
||||
// Error message
|
||||
std::string _ErrorString;
|
||||
|
||||
// System dependant structure for locale
|
||||
void* _Locale;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,12 @@ struct in6_addr;
|
|||
#ifdef NL_OS_WINDOWS
|
||||
// automatically add the win socket library if you use nel network part
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
|
||||
// it seems that the default loop back address is not defined for ipv6
|
||||
#ifndef IN6ADDR_LOOPBACK_INIT
|
||||
#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
namespace NLMISC
|
||||
|
@ -137,6 +143,9 @@ public:
|
|||
/// Returns true if this CInetAddress is 127.0.0.1
|
||||
bool is127001 () const;
|
||||
|
||||
/// Returns true if this CInetAddress is a loop back address
|
||||
bool isLoopbackIPAddress () const;
|
||||
|
||||
/// Creates a CInetAddress object with local host address, port=0
|
||||
static CInetAddress localHost();
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
// NeL includes
|
||||
#include <nel/misc/time_nl.h>
|
||||
#include <nel/misc/string_common.h>
|
||||
#include <nel/misc/common.h>
|
||||
|
||||
// Project includes
|
||||
|
||||
|
@ -102,7 +103,7 @@ public:
|
|||
{
|
||||
releaseError();
|
||||
|
||||
m_ErrorLog = fopen(errorLog.c_str(), "wt");
|
||||
m_ErrorLog = NLMISC::nlfopen(errorLog, "wt");
|
||||
fwrite(s_ErrorHeader.c_str(), 1, s_ErrorHeader.length(), m_ErrorLog);
|
||||
fwrite("\n", 1, 1, m_ErrorLog);
|
||||
fflush(m_ErrorLog);
|
||||
|
@ -113,7 +114,7 @@ public:
|
|||
{
|
||||
releaseDepend();
|
||||
|
||||
m_DependLog = fopen(dependLog.c_str(), "wt");
|
||||
m_DependLog = NLMISC::nlfopen(dependLog, "wt");
|
||||
fwrite(s_DependHeader.c_str(), 1, s_DependHeader.length(), m_DependLog);
|
||||
fwrite("\n", 1, 1, m_DependLog);
|
||||
// fflush(m_DependLog);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "nel/misc/types_nl.h"
|
||||
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/bitmap.h"
|
||||
#include "nel/misc/events.h"
|
||||
|
@ -115,7 +116,7 @@ void LoadSceneScript (const char *ScriptName, CScene* pScene, vector<SDispCS> &D
|
|||
float posx, posy, posz;
|
||||
float roti, rotj, rotk;
|
||||
|
||||
FILE *f = fopen (CPath::lookup(ScriptName).c_str(),"rb");
|
||||
FILE *f = nlfopen (CPath::lookup(ScriptName), "rb");
|
||||
fseek (f, 0, SEEK_END);
|
||||
uint file_size = ftell (f);
|
||||
fseek (f, 0, SEEK_SET);
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
nlinfo ("init() was called");
|
||||
|
||||
// fp = fopen (NLMISC::CFile::findNewFile("stat.csv").c_str(), "wt");
|
||||
// fp = nlfopen (NLMISC::CFile::findNewFile("stat.csv"), "wt");
|
||||
}
|
||||
|
||||
bool update ()
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/mem_stream.h"
|
||||
#include "nel/misc/path.h"
|
||||
|
@ -276,11 +277,11 @@ void CClient::updatePong (sint64 pingTime, sint64 pongTime, uint32 pongNumber, u
|
|||
}
|
||||
string fn = StatPathName + ConnectionName + "_" + ha + "_" + getDate() + ".pong";
|
||||
|
||||
FILE *fp = fopen (fn.c_str(), "rt");
|
||||
FILE *fp = nlfopen (fn, "rt");
|
||||
if (fp == NULL)
|
||||
{
|
||||
// new file, add the header
|
||||
FILE *fp = fopen (fn.c_str(), "wt");
|
||||
FILE *fp = nlfopen (fn, "wt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
fprintf (fp, "#%s\t%s\t%s\t%s\n", "PingTime", "PongTime", "Delta", "PingNumber");
|
||||
|
@ -292,7 +293,7 @@ void CClient::updatePong (sint64 pingTime, sint64 pongTime, uint32 pongNumber, u
|
|||
fclose (fp);
|
||||
}
|
||||
|
||||
fp = fopen (fn.c_str(), "at");
|
||||
fp = nlfopen (fn, "at");
|
||||
if (fp == NULL)
|
||||
{
|
||||
nlwarning ("Can't open pong file name '%s'", fn.c_str());
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/mem_stream.h"
|
||||
#include "nel/misc/time_nl.h"
|
||||
#include "nel/misc/config_file.h"
|
||||
|
@ -112,7 +113,7 @@ void exit (const string &reason)
|
|||
|
||||
void createConfigFile()
|
||||
{
|
||||
FILE *fp = fopen ("client.cfg", "wt");
|
||||
FILE *fp = nlfopen ("client.cfg", "wt");
|
||||
if (fp == NULL)
|
||||
{
|
||||
InfoLog->displayRawNL ("Can't create client.cfg");
|
||||
|
@ -159,7 +160,7 @@ void checkConnectionName ()
|
|||
|
||||
void loadConfigFile ()
|
||||
{
|
||||
FILE *fp = fopen ("client.cfg", "rt");
|
||||
FILE *fp = nlfopen ("client.cfg", "rt");
|
||||
if (fp == NULL)
|
||||
{
|
||||
createConfigFile();
|
||||
|
|
|
@ -40,8 +40,6 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB})
|
|||
NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB})
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY})
|
||||
ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS)
|
||||
ENDIF()
|
||||
|
||||
|
|
|
@ -38,8 +38,6 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGLES_LIB})
|
|||
NL_ADD_RUNTIME_FLAGS(${NLDRV_OGLES_LIB})
|
||||
|
||||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY})
|
||||
ADD_DEFINITIONS(/DDRIVER_OPENGLES_EXPORTS)
|
||||
ENDIF()
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ namespace NLGUI
|
|||
{
|
||||
char c = toLower( s[ i ] );
|
||||
|
||||
switch( c ){
|
||||
switch( c )
|
||||
{
|
||||
case 'l':
|
||||
_Align &= ~1;
|
||||
break;
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace NLGUI
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
const bool CDBGroupComboBox::getGrayed(uint i) const
|
||||
bool CDBGroupComboBox::getGrayed(uint i) const
|
||||
{
|
||||
if(i<_Grayed.size())
|
||||
return _Grayed[i];
|
||||
|
|
|
@ -5882,9 +5882,11 @@ namespace NLGUI
|
|||
{
|
||||
const char* digits = (Type == "I" ? upper : lower);
|
||||
uint8 i, d=0;
|
||||
do {
|
||||
do
|
||||
{
|
||||
uint32 num = number % 10;
|
||||
if (num % 5 < 4){
|
||||
if (num % 5 < 4)
|
||||
{
|
||||
for (i = num % 5; i > 0; i--)
|
||||
{
|
||||
ret.insert(ret.begin(), digits[d]);
|
||||
|
@ -5904,7 +5906,9 @@ namespace NLGUI
|
|||
}
|
||||
number /= 10;
|
||||
d += 2;
|
||||
} while (number > 0);
|
||||
}
|
||||
while (number > 0);
|
||||
|
||||
if (Type == "I")
|
||||
{
|
||||
ret = toUpper(ret);
|
||||
|
|
|
@ -121,69 +121,112 @@ namespace NLGUI
|
|||
|
||||
// ***************************************************************************
|
||||
// http://stackoverflow.com/a/18335183
|
||||
static std::string correct_non_utf_8(const std::string &str)
|
||||
static std::string correctNonUtf8(const std::string &str)
|
||||
{
|
||||
int i,f_size=str.size();
|
||||
int i, f_size=str.size();
|
||||
unsigned char c,c2,c3,c4;
|
||||
std::string to;
|
||||
to.reserve(f_size);
|
||||
|
||||
for(i=0 ; i<f_size ; i++){
|
||||
for(i=0 ; i<f_size ; i++)
|
||||
{
|
||||
c=(unsigned char)(str[i]);
|
||||
if(c<32){//control char
|
||||
if(c==9 || c==10 || c==13){//allow only \t \n \r
|
||||
if (c<32)
|
||||
{
|
||||
//control char
|
||||
if(c==9 || c==10 || c==13)
|
||||
{
|
||||
//allow only \t \n \r
|
||||
to.append(1,c);
|
||||
}
|
||||
continue;
|
||||
}else if(c<127){//normal ASCII
|
||||
}
|
||||
else if (c<127)
|
||||
{
|
||||
//normal ASCII
|
||||
to.append(1,c);
|
||||
continue;
|
||||
}else if(c<160){//control char (nothing should be defined here either ASCI, ISO_8859-1 or UTF8, so skipping)
|
||||
if(c==128){//fix microsoft mess, add euro
|
||||
}
|
||||
else if (c < 160)
|
||||
{
|
||||
//control char (nothing should be defined here either ASCI, ISO_8859-1 or UTF8, so skipping)
|
||||
if (c == 128)
|
||||
{
|
||||
//fix microsoft mess, add euro
|
||||
to.append(1,226);
|
||||
to.append(1,130);
|
||||
to.append(1,172);
|
||||
}
|
||||
if(c==133){//fix IBM mess, add NEL = \n\r
|
||||
|
||||
if (c == 133)
|
||||
{
|
||||
//fix IBM mess, add NEL = \n\r
|
||||
to.append(1,10);
|
||||
to.append(1,13);
|
||||
}
|
||||
continue;
|
||||
}else if(c<192){//invalid for UTF8, converting ASCII
|
||||
}
|
||||
else if (c < 192)
|
||||
{
|
||||
//invalid for UTF8, converting ASCII
|
||||
to.append(1,(unsigned char)194);
|
||||
to.append(1,c);
|
||||
continue;
|
||||
}else if(c<194){//invalid for UTF8, converting ASCII
|
||||
}
|
||||
else if (c < 194)
|
||||
{
|
||||
//invalid for UTF8, converting ASCII
|
||||
to.append(1,(unsigned char)195);
|
||||
to.append(1,c-64);
|
||||
continue;
|
||||
}else if(c<224 && i+1<f_size){//possibly 2byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
if(c2>127 && c2<192){//valid 2byte UTF8
|
||||
if(c==194 && c2<160){//control char, skipping
|
||||
}
|
||||
else if (c < 224 && i + 1 < f_size)
|
||||
{
|
||||
//possibly 2byte UTF8
|
||||
c2 = (unsigned char)(str[i+1]);
|
||||
|
||||
if (c2 > 127 && c2 < 192)
|
||||
{
|
||||
//valid 2byte UTF8
|
||||
if (c == 194 && c2 < 160)
|
||||
{
|
||||
//control char, skipping
|
||||
;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
}
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}else if(c<240 && i+2<f_size){//possibly 3byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
c3=(unsigned char)(str[i+2]);
|
||||
if(c2>127 && c2<192 && c3>127 && c3<192){//valid 3byte UTF8
|
||||
}
|
||||
else if (c < 240 && i + 2 < f_size)
|
||||
{
|
||||
// possibly 3byte UTF8
|
||||
c2 = (unsigned char)(str[i+1]);
|
||||
c3 = (unsigned char)(str[i+2]);
|
||||
|
||||
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192)
|
||||
{
|
||||
// valid 3byte UTF8
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
to.append(1,c3);
|
||||
i+=2;
|
||||
continue;
|
||||
}
|
||||
}else if(c<245 && i+3<f_size){//possibly 4byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
c3=(unsigned char)(str[i+2]);
|
||||
c4=(unsigned char)(str[i+3]);
|
||||
if(c2>127 && c2<192 && c3>127 && c3<192 && c4>127 && c4<192){//valid 4byte UTF8
|
||||
}
|
||||
else if (c < 245 && i + 3 < f_size)
|
||||
{
|
||||
//possibly 4byte UTF8
|
||||
c2 = (unsigned char)(str[i+1]);
|
||||
c3 = (unsigned char)(str[i+2]);
|
||||
c4 = (unsigned char)(str[i+3]);
|
||||
if (c2 > 127 && c2 < 192 && c3 > 127 && c3 < 192 && c4 > 127 && c4 < 192)
|
||||
{
|
||||
//valid 4byte UTF8
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
to.append(1,c3);
|
||||
|
@ -192,6 +235,7 @@ namespace NLGUI
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//invalid UTF8, converting ASCII (c>245 || string too short for multi-byte))
|
||||
to.append(1,(unsigned char)195);
|
||||
to.append(1,c-64);
|
||||
|
@ -250,7 +294,7 @@ namespace NLGUI
|
|||
}
|
||||
|
||||
// if there is invalid utf-8 chars, then libxml will break everything after first it finds.
|
||||
htmlString = correct_non_utf_8(htmlString);
|
||||
htmlString = correctNonUtf8(htmlString);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -201,12 +201,6 @@ ELSE(WITH_STATIC OR WIN32)
|
|||
TARGET_LINK_LIBRARIES(nelmisc ${PNG_LIBRARY})
|
||||
ENDIF(WITH_STATIC OR WIN32)
|
||||
|
||||
# For DirectInput (di_event_emitter)
|
||||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY} winmm dbghelp)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(nelmisc -lc -ldl)
|
||||
IF(NOT APPLE)
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "nel/misc/dynloadlib.h"
|
||||
#include "nel/misc/command.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef DEBUG_NEW
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
@ -85,6 +87,9 @@ void INelContext::contextReady()
|
|||
_NelContext = this;
|
||||
*(_getInstance()) = this;
|
||||
|
||||
// set numeric locale to C to avoid the use of decimal separators different of a dot
|
||||
char *locale = setlocale(LC_NUMERIC, "C");
|
||||
|
||||
// register any pending thinks
|
||||
|
||||
// register local instance counter in the global instance counter manager
|
||||
|
|
|
@ -3106,11 +3106,17 @@ bool CBitmap::blit(const CBitmap *src, sint32 x, sint32 y)
|
|||
// Private :
|
||||
float CBitmap::getColorInterp (float x, float y, float colorInXY00, float colorInXY10, float colorInXY01, float colorInXY11) const
|
||||
{
|
||||
if (colorInXY00 == colorInXY10
|
||||
&& colorInXY00 == colorInXY01
|
||||
&& colorInXY00 == colorInXY11)
|
||||
return colorInXY00; // Fix rounding error for alpha 255...
|
||||
|
||||
float res = colorInXY00*(1.0f-x)*(1.0f-y) +
|
||||
colorInXY10*( x)*(1.0f-y) +
|
||||
colorInXY01*(1.0f-x)*( y) +
|
||||
colorInXY11*( x)*( y);
|
||||
clamp (res, 0.0f, 255.0f);
|
||||
clamp(res, 0.0f, 255.0f);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ static uint8 INTERLACED_OFFSET[] = { 0, 4, 2, 1 };
|
|||
static uint8 INTERLACED_JUMP[] = { 8, 8, 4, 2 };
|
||||
#endif
|
||||
|
||||
static int readGIFData(GifFileType *gif, GifByteType *data, int length){
|
||||
static int readGIFData(GifFileType *gif, GifByteType *data, int length)
|
||||
{
|
||||
NLMISC::IStream *f = static_cast<NLMISC::IStream *>(gif->UserData);
|
||||
|
||||
if(!f->isReading()) return 0;
|
||||
|
|
|
@ -316,6 +316,13 @@ CConfigFile::~CConfigFile ()
|
|||
|
||||
void CConfigFile::load (const string &fileName, bool lookupPaths )
|
||||
{
|
||||
char *locale = setlocale(LC_NUMERIC, NULL);
|
||||
|
||||
if (!locale || strcmp(locale, "C"))
|
||||
{
|
||||
nlerror("Numeric locale not defined to C, an external library possibly redefined it!");
|
||||
}
|
||||
|
||||
if(fileName.empty())
|
||||
{
|
||||
nlwarning ("CF: Can't load a empty file name configfile");
|
||||
|
@ -597,8 +604,12 @@ bool CConfigFile::exists (const std::string &varName)
|
|||
|
||||
void CConfigFile::save () const
|
||||
{
|
||||
// Avoid any problem, Force Locale to default
|
||||
setlocale(LC_ALL, "C");
|
||||
char *locale = setlocale(LC_NUMERIC, NULL);
|
||||
|
||||
if (!locale || strcmp(locale, "C"))
|
||||
{
|
||||
nlerror("Numeric locale not defined to C, an external library possibly redefined it!");
|
||||
}
|
||||
|
||||
FILE *fp = nlfopen (getFilename(), "w");
|
||||
if (fp == NULL)
|
||||
|
|
|
@ -43,6 +43,7 @@ string CI18N::_SelectedLanguageCode;
|
|||
CI18N::ILoadProxy *CI18N::_LoadProxy = 0;
|
||||
vector<string> CI18N::_LanguageCodes;
|
||||
vector<ucstring> CI18N::_LanguageNames;
|
||||
std::string CI18N::_SystemLanguageCode;
|
||||
bool CI18N::noResolution = false;
|
||||
|
||||
void CI18N::setLoadProxy(ILoadProxy *loadProxy)
|
||||
|
@ -248,10 +249,8 @@ bool CI18N::isLanguageCodeSupported(const std::string &lang)
|
|||
|
||||
std::string CI18N::getSystemLanguageCode ()
|
||||
{
|
||||
static std::string s_cachedSystemLanguage;
|
||||
|
||||
if (!s_cachedSystemLanguage.empty())
|
||||
return s_cachedSystemLanguage;
|
||||
if (!_SystemLanguageCode.empty())
|
||||
return _SystemLanguageCode;
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
// under OS X, locale is only defined in console, not in UI
|
||||
|
@ -317,7 +316,7 @@ std::string CI18N::getSystemLanguageCode ()
|
|||
// only keep language code if supported by NeL
|
||||
if (isLanguageCodeSupported(lang))
|
||||
{
|
||||
s_cachedSystemLanguage = lang;
|
||||
_SystemLanguageCode = lang;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -328,21 +327,116 @@ std::string CI18N::getSystemLanguageCode ()
|
|||
}
|
||||
#endif
|
||||
|
||||
// use system locale (works under Linux and Windows)
|
||||
if (s_cachedSystemLanguage.empty())
|
||||
#ifdef NL_OS_WINDOWS
|
||||
// use user locale under Windows (since Vista)
|
||||
if (_SystemLanguageCode.empty())
|
||||
{
|
||||
std::string lang = NLMISC::toLower(std::string(setlocale(LC_CTYPE, "")));
|
||||
// GetUserDefaultLocaleName prototype
|
||||
typedef int (WINAPI* GetUserDefaultLocaleNamePtr)(LPWSTR lpLocaleName, int cchLocaleName);
|
||||
|
||||
// only keep 2 first characters
|
||||
if (lang.size() > 1)
|
||||
s_cachedSystemLanguage = lang.substr(0, 2);
|
||||
// get pointer on GetUserDefaultLocaleName, kernel32.dll is always in memory so no need to call LoadLibrary
|
||||
GetUserDefaultLocaleNamePtr nlGetUserDefaultLocaleName = (GetUserDefaultLocaleNamePtr)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetUserDefaultLocaleName");
|
||||
|
||||
// only use it if found
|
||||
if (nlGetUserDefaultLocaleName)
|
||||
{
|
||||
// get user locale
|
||||
wchar_t buffer[LOCALE_NAME_MAX_LENGTH];
|
||||
sint res = nlGetUserDefaultLocaleName(buffer, LOCALE_NAME_MAX_LENGTH);
|
||||
|
||||
// convert wide string to std::string
|
||||
std::string lang = wideToUtf8(buffer);
|
||||
|
||||
// only keep 2 first characters
|
||||
if (lang.size() > 1)
|
||||
_SystemLanguageCode = lang.substr(0, 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// use system locale (works under OS X, Linux and Windows)
|
||||
if (_SystemLanguageCode.empty())
|
||||
{
|
||||
// get default locale
|
||||
char *locale = setlocale(LC_CTYPE, "");
|
||||
|
||||
if (locale)
|
||||
{
|
||||
std::string lang(locale);
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
// be sure supported languages are initialized
|
||||
initLanguages();
|
||||
|
||||
// locales names are different under Windows, for example: French_France.1252
|
||||
for(uint i = 0; i < _LanguageNames.size(); ++i)
|
||||
{
|
||||
std::string name = _LanguageNames[i].toUtf8();
|
||||
|
||||
// so we compare the language name with the supported ones
|
||||
if (lang.compare(0, name.length(), name) == 0)
|
||||
{
|
||||
// found, so use its code
|
||||
_SystemLanguageCode = _LanguageCodes[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// only keep 2 first characters
|
||||
if (lang.size() > 1)
|
||||
_SystemLanguageCode = NLMISC::toLower(lang).substr(0, 2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// english is default language
|
||||
if (s_cachedSystemLanguage.empty())
|
||||
s_cachedSystemLanguage = "en";
|
||||
if (_SystemLanguageCode.empty())
|
||||
_SystemLanguageCode = "en";
|
||||
|
||||
return s_cachedSystemLanguage;
|
||||
return _SystemLanguageCode;
|
||||
}
|
||||
|
||||
bool CI18N::setSystemLanguageCode (const std::string &languageCode)
|
||||
{
|
||||
// be sure supported languages are initialized
|
||||
initLanguages();
|
||||
|
||||
std::string lang = NLMISC::toLower(languageCode);
|
||||
|
||||
// specified language is really a code (2 characters)
|
||||
if (lang.length() == 2)
|
||||
{
|
||||
// check if language code is supported
|
||||
for(uint i = 0; i < _LanguageCodes.size(); ++i)
|
||||
{
|
||||
std::string code = NLMISC::toLower(_LanguageCodes[i]);
|
||||
|
||||
if (lang == code)
|
||||
{
|
||||
// found, so use it
|
||||
_SystemLanguageCode = lang;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// specified language is something else
|
||||
else
|
||||
{
|
||||
// check if language name is supported
|
||||
for(uint i = 0; i < _LanguageNames.size(); ++i)
|
||||
{
|
||||
std::string name = NLMISC::toLower(_LanguageNames[i].toUtf8());
|
||||
|
||||
if (name == lang)
|
||||
{
|
||||
// found, so use its code
|
||||
_SystemLanguageCode = _LanguageCodes[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CI18N::removeCComment(ucstring &commentedString)
|
||||
|
|
|
@ -24,11 +24,6 @@
|
|||
// Include from libxml2
|
||||
#include <libxml/xmlerror.h>
|
||||
|
||||
#if defined(NL_OS_WINDOWS) && defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 80
|
||||
#define USE_LOCALE_ATOF
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define NLMISC_READ_BUFFER_SIZE 1024
|
||||
|
@ -46,26 +41,10 @@ const char SEPARATOR = ' ';
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
#define readnumber(dest,thetype,digits,convfunc) \
|
||||
#define readnumber(dest,digits) \
|
||||
string number_as_string; \
|
||||
serialSeparatedBufferIn( number_as_string ); \
|
||||
dest = (thetype)convfunc( number_as_string.c_str() );
|
||||
|
||||
#ifdef USE_LOCALE_ATOF
|
||||
|
||||
#define readnumberlocale(dest,thetype,digits,convfunc) \
|
||||
string number_as_string; \
|
||||
serialSeparatedBufferIn( number_as_string ); \
|
||||
dest = (thetype)convfunc( number_as_string.c_str(), (_locale_t)_Locale );
|
||||
|
||||
#define nl_atof _atof_l
|
||||
|
||||
#else
|
||||
|
||||
#define readnumberlocale(dest,thetype,digits,convfunc) readnumber(dest,thetype,digits,convfunc)
|
||||
#define nl_atof atof
|
||||
|
||||
#endif
|
||||
NLMISC::fromString(number_as_string, dest);
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
|
@ -91,13 +70,6 @@ CIXml::CIXml () : IStream (true /* Input mode */)
|
|||
_ErrorString = "";
|
||||
_TryBinaryMode = false;
|
||||
_BinaryStream = NULL;
|
||||
|
||||
#ifdef USE_LOCALE_ATOF
|
||||
// create C numeric locale
|
||||
_Locale = _create_locale(LC_NUMERIC, "C");
|
||||
#else
|
||||
_Locale = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -113,13 +85,6 @@ CIXml::CIXml (bool tryBinaryMode) : IStream (true /* Input mode */)
|
|||
_ErrorString = "";
|
||||
_TryBinaryMode = tryBinaryMode;
|
||||
_BinaryStream = NULL;
|
||||
|
||||
#ifdef USE_LOCALE_ATOF
|
||||
// create C numeric locale
|
||||
_Locale = _create_locale(LC_NUMERIC, "C");
|
||||
#else
|
||||
_Locale = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -128,10 +93,6 @@ CIXml::~CIXml ()
|
|||
{
|
||||
// Release
|
||||
release ();
|
||||
|
||||
#ifdef USE_LOCALE_ATOF
|
||||
if (_Locale) _free_locale((_locale_t)_Locale);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -468,7 +429,7 @@ void CIXml::serial(uint8 &b)
|
|||
else
|
||||
{
|
||||
// Read the number
|
||||
readnumber( b, uint8, 3, atoi );
|
||||
readnumber( b, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -482,7 +443,7 @@ void CIXml::serial(sint8 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, sint8, 4, atoi );
|
||||
readnumber( b, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -496,7 +457,7 @@ void CIXml::serial(uint16 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, uint16, 5, atoi );
|
||||
readnumber( b, 5 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -510,7 +471,7 @@ void CIXml::serial(sint16 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, sint16, 6, atoi );
|
||||
readnumber( b, 6 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -529,7 +490,7 @@ void CIXml::serial(uint32 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, uint32, 10, atoui );
|
||||
readnumber( b, 10 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,7 +504,7 @@ void CIXml::serial(sint32 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, sint32, 11, atoi );
|
||||
readnumber( b, 11 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,7 +518,7 @@ void CIXml::serial(uint64 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, uint64, 20, atoiInt64 );
|
||||
readnumber( b, 20 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -571,7 +532,7 @@ void CIXml::serial(sint64 &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumber( b, sint64, 20, atoiInt64 );
|
||||
readnumber( b, 20 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -585,7 +546,7 @@ void CIXml::serial(float &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumberlocale( b, float, 128, nl_atof );
|
||||
readnumber( b, 128 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -599,7 +560,7 @@ void CIXml::serial(double &b)
|
|||
}
|
||||
else
|
||||
{
|
||||
readnumberlocale( b, double, 128, nl_atof );
|
||||
readnumber( b, 128 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,22 +43,11 @@ const char SEPARATOR = ' ';
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
#ifdef USE_LOCALE_SPRINTF
|
||||
|
||||
#define writenumber(src,format,digits) \
|
||||
char number_as_cstring [digits+1]; \
|
||||
_sprintf_l( number_as_cstring, format, (_locale_t)_Locale, src ); \
|
||||
serialSeparatedBufferOut( number_as_cstring );
|
||||
|
||||
#else
|
||||
|
||||
#define writenumber(src,format,digits) \
|
||||
char number_as_cstring [digits+1]; \
|
||||
sprintf( number_as_cstring, format, src ); \
|
||||
serialSeparatedBufferOut( number_as_cstring );
|
||||
|
||||
#endif
|
||||
|
||||
// ***************************************************************************
|
||||
// XML callbacks
|
||||
// ***************************************************************************
|
||||
|
@ -149,13 +138,6 @@ COXml::COXml () : IStream (false /* Output mode */)
|
|||
|
||||
// Push begin
|
||||
_PushBegin = false;
|
||||
|
||||
#ifdef USE_LOCALE_SPRINTF
|
||||
// create C numeric locale
|
||||
_Locale = _create_locale(LC_NUMERIC, "C");
|
||||
#else
|
||||
_Locale = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -215,10 +197,6 @@ COXml::~COXml ()
|
|||
{
|
||||
// Flush document to the internal stream
|
||||
flush ();
|
||||
|
||||
#ifdef USE_LOCALE_SPRINTF
|
||||
if (_Locale) _free_locale((_locale_t)_Locale);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1963,14 +1963,15 @@ bool CFile::createEmptyFile (const std::string& filename)
|
|||
bool CFile::fileExists (const string& filename)
|
||||
{
|
||||
//H_AUTO(FileExists);
|
||||
#ifdef NL_OS_WINDOWS
|
||||
DWORD attr = GetFileAttributesW(utf8ToWide(filename));
|
||||
// attributes are valid and file is not a directory
|
||||
if (attr == INVALID_FILE_ATTRIBUTES || (attr & FILE_ATTRIBUTE_DIRECTORY)) return false;
|
||||
return true;
|
||||
#else
|
||||
return access(filename.c_str(), R_OK) != -1;
|
||||
#endif
|
||||
FILE *file = nlfopen(filename, "rb");
|
||||
|
||||
if (file)
|
||||
{
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -92,18 +92,18 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size)
|
|||
|
||||
BOOLEAN IN6_IS_ADDR_UNSPECIFIED(CONST IN6_ADDR *a)
|
||||
{
|
||||
//
|
||||
// We can't use the in6addr_any variable, since that would
|
||||
// require existing callers to link with a specific library.
|
||||
//
|
||||
return (BOOLEAN)((a->s6_words[0] == 0) &&
|
||||
(a->s6_words[1] == 0) &&
|
||||
(a->s6_words[2] == 0) &&
|
||||
(a->s6_words[3] == 0) &&
|
||||
(a->s6_words[4] == 0) &&
|
||||
(a->s6_words[5] == 0) &&
|
||||
(a->s6_words[6] == 0) &&
|
||||
(a->s6_words[7] == 0));
|
||||
//
|
||||
// We can't use the in6addr_any variable, since that would
|
||||
// require existing callers to link with a specific library.
|
||||
//
|
||||
return (BOOLEAN)((a->s6_words[0] == 0) &&
|
||||
(a->s6_words[1] == 0) &&
|
||||
(a->s6_words[2] == 0) &&
|
||||
(a->s6_words[3] == 0) &&
|
||||
(a->s6_words[4] == 0) &&
|
||||
(a->s6_words[5] == 0) &&
|
||||
(a->s6_words[6] == 0) &&
|
||||
(a->s6_words[7] == 0));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -714,25 +714,51 @@ std::vector<CInetAddress> CInetAddress::localAddresses()
|
|||
if (status)
|
||||
{
|
||||
// will come here if the local hostname (/etc/hostname in Linux) is not the real name
|
||||
throw ESocket( (string("Hostname resolution failed for ")+string(localhost)).c_str() );
|
||||
throw ESocket( toString("Hostname resolution failed for %s", localhost).c_str() );
|
||||
}
|
||||
|
||||
struct addrinfo *p = res;
|
||||
|
||||
// for loopback ipv4
|
||||
bool IPv4LoopbackAdded = false;
|
||||
|
||||
// for loopback ipv6
|
||||
bool IPv6LoopbackAdded = false;
|
||||
|
||||
// process all addresses
|
||||
while (p != NULL)
|
||||
{
|
||||
// check address family
|
||||
if (p->ai_family == AF_INET)
|
||||
{
|
||||
// ipv4
|
||||
// loopback ipv4
|
||||
if (!IPv4LoopbackAdded)
|
||||
{
|
||||
// add loopback address only once
|
||||
struct in_addr psin_addrIPv4;
|
||||
psin_addrIPv4.s_addr = htonl(INADDR_LOOPBACK);
|
||||
vect.push_back(CInetAddress(&psin_addrIPv4, localhost));
|
||||
|
||||
IPv4LoopbackAdded = true;
|
||||
}
|
||||
|
||||
struct sockaddr_in *ipv4 = (struct sockaddr_in *)p->ai_addr;
|
||||
|
||||
vect.push_back( CInetAddress( &ipv4->sin_addr, localhost ) );
|
||||
|
||||
}
|
||||
else if (p->ai_family == AF_INET6)
|
||||
{
|
||||
// ipv6
|
||||
// loopback ipv6
|
||||
if (!IPv6LoopbackAdded)
|
||||
{
|
||||
// add loopback address only once
|
||||
struct in6_addr psin_addrIPv6 = IN6ADDR_LOOPBACK_INIT;
|
||||
vect.push_back(CInetAddress(&psin_addrIPv6, localhost));
|
||||
|
||||
IPv6LoopbackAdded = true;
|
||||
}
|
||||
|
||||
struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)p->ai_addr;
|
||||
|
||||
vect.push_back( CInetAddress( &ipv6->sin6_addr, localhost ) );
|
||||
|
@ -747,7 +773,7 @@ std::vector<CInetAddress> CInetAddress::localAddresses()
|
|||
|
||||
if(vect.empty())
|
||||
{
|
||||
throw ESocket( (string("No network card detected for ")+string(localhost)).c_str() );
|
||||
throw ESocket(toString("No network card detected for %s", localhost).c_str() );
|
||||
}
|
||||
|
||||
return vect;
|
||||
|
@ -758,6 +784,16 @@ bool CInetAddress::is127001 () const
|
|||
return (internalIPAddress () == htonl(0x7F000001));
|
||||
}
|
||||
|
||||
bool CInetAddress::isLoopbackIPAddress () const
|
||||
{
|
||||
std::string sIPAddress = ipAddress();
|
||||
|
||||
return (sIPAddress.compare("::") == 0) ||
|
||||
(sIPAddress.compare("::1") == 0) ||
|
||||
(sIPAddress.compare("127.0.0.1") == 0) ||
|
||||
(sIPAddress.compare("0:0:0:0:0:0:0:1") == 0);
|
||||
}
|
||||
|
||||
|
||||
std::string vectorCInetAddressToString(const std::vector<CInetAddress> &addrs)
|
||||
{
|
||||
|
|
|
@ -828,17 +828,17 @@ void CUnifiedNetwork::addService(const string &name, const vector<CInetAddress>
|
|||
for (uint i = 0; i < addr.size(); i++)
|
||||
{
|
||||
// first we have to look if we have a network that can established the connection
|
||||
|
||||
|
||||
uint j = 0;
|
||||
// it s 127.0.0.1, it s ok
|
||||
if (!addr[i].is127001 ())
|
||||
|
||||
if (!addr[i].isLoopbackIPAddress())
|
||||
{
|
||||
// it's loopback ip address, it's ok
|
||||
for (j = 0; j < laddr.size (); j++)
|
||||
{
|
||||
if (laddr[j].internalNetAddress () == addr[i].internalNetAddress ())
|
||||
{
|
||||
// it's ok, we can try
|
||||
break;
|
||||
break; // it's ok, we can try
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1272,8 +1272,7 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
uint8 connectionId = _IdCnx[sid.get()].DefaultNetwork;
|
||||
|
||||
if (nid == 0xFF)
|
||||
{
|
||||
// it s often happen because they didn't set a good network configuration, so it s in debug to disable it easily
|
||||
{ // default network
|
||||
//nldebug ("HNETL5: nid %hu, will use the default connection %hu", (uint16)nid, (uint16)connectionId);
|
||||
}
|
||||
else if (nid >= _IdCnx[sid.get()].NetworkConnectionAssociations.size())
|
||||
|
@ -1294,8 +1293,12 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
|
||||
if (connectionId >= _IdCnx[sid.get()].Connections.size() || !_IdCnx[sid.get()].Connections[connectionId].valid() || !_IdCnx[sid.get()].Connections[connectionId].CbNetBase->connected())
|
||||
{
|
||||
// there's a problem with the selected connectionID, so try to find a valid one
|
||||
nlwarning ("HNETL5: Can't find selected connection id %hu to send message to %s because connection is not valid or connected, find a valid connection id", (uint16)connectionId, _IdCnx[sid.get()].ServiceName.c_str ());
|
||||
|
||||
if (nid != 0xFF)
|
||||
{
|
||||
// not a default network. There's a problem with the selected connectionID, so try to find a valid one
|
||||
nlwarning ("HNETL5: Can't find selected connection id %hu to send message to %s because connection is not valid or connected, find a valid connection id", (uint16)connectionId, _IdCnx[sid.get()].ServiceName.c_str ());
|
||||
}
|
||||
|
||||
for (connectionId = 0; connectionId < _IdCnx[sid.get()].Connections.size(); connectionId++)
|
||||
{
|
||||
|
@ -1303,6 +1306,19 @@ uint8 CUnifiedNetwork::findConnectionId (TServiceId sid, uint8 nid)
|
|||
{
|
||||
// we found one at last, use this one
|
||||
//nldebug ("HNETL5: Ok, we found a valid connectionid, use %hu", (uint16)connectionId);
|
||||
if (nid < _IdCnx[sid.get()].NetworkConnectionAssociations.size())
|
||||
{
|
||||
_IdCnx[sid.get()].NetworkConnectionAssociations[nid] = connectionId; // we set the preferred networkConnectionAssociation
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nid == 0xFF)
|
||||
{
|
||||
_IdCnx[sid.get()].DefaultNetwork = connectionId;
|
||||
}
|
||||
}
|
||||
|
||||
nlwarning ("HNETL5: selected connection id %hu from network %hu to send message to %s", (uint16)connectionId, (uint16)nid, _IdCnx[sid.get()].ServiceName.c_str ());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1782,7 +1798,7 @@ bool CUnifiedNetwork::isServiceLocal (TServiceId sid)
|
|||
{
|
||||
for (uint j = 0; j < _IdCnx[sid.get()].ExtAddress.size(); j++)
|
||||
{
|
||||
if (_IdCnx[sid.get()].ExtAddress[j].is127001 ())
|
||||
if (_IdCnx[sid.get()].ExtAddress[j].isLoopbackIPAddress ())
|
||||
return true;
|
||||
|
||||
if (_IdCnx[sid.get()].ExtAddress[j].internalIPAddress () == laddr[i].internalIPAddress ())
|
||||
|
|
|
@ -195,13 +195,17 @@ uint32 CAudioDecoderVorbis::getNextBytes(uint8 *buffer, uint32 minimum, uint32 m
|
|||
uint8 CAudioDecoderVorbis::getChannels()
|
||||
{
|
||||
vorbis_info *vi = ov_info(&_OggVorbisFile, -1);
|
||||
return (uint8)vi->channels;
|
||||
if (vi) return (uint8)vi->channels;
|
||||
nlwarning("ov_info returned NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint CAudioDecoderVorbis::getSamplesPerSec()
|
||||
{
|
||||
vorbis_info *vi = ov_info(&_OggVorbisFile, -1);
|
||||
return (uint)vi->rate;
|
||||
if (vi) return (uint)vi->rate;
|
||||
nlwarning("ov_info returned NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 CAudioDecoderVorbis::getBitsPerSample()
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/3d/scene_group.h"
|
||||
#include "nel/3d/zone.h"
|
||||
#include "nel/3d/skeleton_shape.h"
|
||||
|
@ -660,9 +661,7 @@ int main(int argc, const char *argv[])
|
|||
options.insert (argv[i]);
|
||||
|
||||
// Open log
|
||||
FILE *logStream;
|
||||
logStream= fopen(std::string(getLogDirectory() + "file_info.log").c_str(), "wt");
|
||||
|
||||
FILE *logStream = nlfopen(getLogDirectory() + "file_info.log", "wt");
|
||||
|
||||
// parse dir or file ??
|
||||
const char *fileName= argv[1];
|
||||
|
|
|
@ -998,7 +998,8 @@ int main(int nNbArg, char **ppArgs)
|
|||
ChDir (sExeDir);
|
||||
|
||||
// out a text file, with list of
|
||||
FILE *out= fopen(ppArgs[4], "wt");
|
||||
FILE *out = NLMISC::nlfopen(ppArgs[4], "wt");
|
||||
|
||||
if(!out)
|
||||
{
|
||||
outString(string("ERROR: cannot save ")+ppArgs[4]);
|
||||
|
|
|
@ -29,12 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#undef free
|
||||
#endif
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QtCore/QtCore>
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
|
|
|
@ -21,12 +21,6 @@
|
|||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
// NeL includes
|
||||
|
|
|
@ -21,12 +21,6 @@
|
|||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTextEdit>
|
||||
#include <QLineEdit>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "nel/misc/time_nl.h"
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/triangle.h"
|
||||
#include "nel/misc/bsphere.h"
|
||||
#include "3d/quad_tree.h"
|
||||
|
@ -3121,8 +3122,8 @@ void CNelExport::deleteLM(INode& ZeNode)
|
|||
sprintf( tmp, "%d", i );
|
||||
sSaveName += tmp;
|
||||
sSaveName += ".tga";
|
||||
FILE *file;
|
||||
if( file = fopen(sSaveName.c_str(),"rb") )
|
||||
FILE *file = nlfopen(sSaveName, "rb")
|
||||
if (file)
|
||||
{
|
||||
fclose( file );
|
||||
DeleteFile( sSaveName.c_str() );
|
||||
|
@ -3521,8 +3522,8 @@ bool CNelExport::exportScene(std::vector<INode*>& vectNode)
|
|||
sprintf( tmp, "%d", i );
|
||||
sSaveName += tmp;
|
||||
sSaveName += ".tga";
|
||||
FILE *file;
|
||||
if( file = fopen(sSaveName.c_str(),"rb") )
|
||||
FILE *file = nlfopen(sSaveName, "rb");
|
||||
if (file)
|
||||
{
|
||||
fclose( file );
|
||||
DeleteFile( sSaveName.c_str() );
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <nel/misc/path.h>
|
||||
#include <nel/misc/common.h>
|
||||
#include <nel/misc/file.h>
|
||||
#include <nel/misc/config_file.h>
|
||||
#include <nel/3d/u_light.h>
|
||||
|
@ -851,7 +852,7 @@ bool ShapesExporter::renderPS(UInstance &entity, const string &output_path, doub
|
|||
{
|
||||
if(step > 0)
|
||||
{
|
||||
FILE *fp = fopen(string(CPath::standardizePath(output_path)+"nb_steps.txt").c_str(), "w");
|
||||
FILE *fp = nlfopen(CPath::standardizePath(output_path)+"nb_steps.txt", "w");
|
||||
if(fp) { fprintf(fp, "%d", step); fclose(fp); }
|
||||
}
|
||||
nlinfo("PS duration %f after %f with nothing with %d steps, dt %f", duration, startTime, step, deltaTime);
|
||||
|
@ -873,7 +874,7 @@ bool ShapesExporter::createThumbnail(const string &filename, const string &path)
|
|||
uint selectedFrame = 0;
|
||||
if(CFile::getExtension(filename) == "ps")
|
||||
{
|
||||
FILE *fp = fopen(string(CPath::standardizePath(output_path)+"nb_steps.txt").c_str(), "r");
|
||||
FILE *fp = nlfopen(CPath::standardizePath(output_path)+"nb_steps.txt", "r");
|
||||
if(fp)
|
||||
{
|
||||
char str[100];
|
||||
|
|
|
@ -34,12 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
// STL includes
|
||||
|
||||
// Qt includes
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTextEdit>
|
||||
#include <QLineEdit>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/bitmap.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/debug.h"
|
||||
|
@ -49,7 +50,7 @@ std::string getOutputFileName(const std::string &inputFileName);
|
|||
uint8 getType(const std::string &sFileNameDest)
|
||||
{
|
||||
uint32 dds;
|
||||
FILE *f = fopen(sFileNameDest.c_str(),"rb");
|
||||
FILE *f = nlfopen(sFileNameDest, "rb");
|
||||
if(f==NULL)
|
||||
{
|
||||
return NOT_DEFINED;
|
||||
|
@ -105,7 +106,7 @@ uint8 getType(const std::string &sFileNameDest)
|
|||
bool sameType(const std::string &sFileNameDest, uint8 &algo, bool wantMipMap)
|
||||
{
|
||||
uint32 dds;
|
||||
FILE *f = fopen(sFileNameDest.c_str(),"rb");
|
||||
FILE *f = nlfopen(sFileNameDest, "rb");
|
||||
if(f==NULL)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -26,12 +26,6 @@
|
|||
#undef free
|
||||
#endif
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QtCore/QtCore>
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <iostream>
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/3d/quad_tree.h"
|
||||
#include "nel/3d/zone.h"
|
||||
#include "nel/3d/landscape.h"
|
||||
|
@ -978,7 +979,7 @@ int main(sint argc, char **argv)
|
|||
}
|
||||
|
||||
#if WELD_LOG
|
||||
fdbg = fopen("log.txt","wt");
|
||||
fdbg = nlfopen("log.txt","wt");
|
||||
fprintf(fdbg,"Center zone : %s\n",argv[1]);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <nel/misc/types_nl.h>
|
||||
#include <nel/misc/config_file.h>
|
||||
#include <nel/misc/debug.h>
|
||||
#include <nel/misc/common.h>
|
||||
#include <nel/misc/path.h>
|
||||
#include <nel/misc/i18n.h>
|
||||
|
||||
|
@ -743,7 +744,7 @@ void displayZones()
|
|||
\****************************************************************/
|
||||
void writeConfigFile(const char * configFileName)
|
||||
{
|
||||
FILE * f = fopen(configFileName,"wt");
|
||||
FILE * f = nlfopen(configFileName, "wt");
|
||||
|
||||
if(f==NULL)
|
||||
{
|
||||
|
@ -801,7 +802,7 @@ void writeConfigFile(const char * configFileName)
|
|||
\****************************************************************/
|
||||
void initViewerConfig(const char * configFileName)
|
||||
{
|
||||
FILE * f = fopen(configFileName,"rt");
|
||||
FILE *f = nlfopen(configFileName, "rt");
|
||||
if(f==NULL)
|
||||
{
|
||||
nlwarning("'%s' not found, default values used", configFileName);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/smart_ptr.h"
|
||||
#include "nel/misc/command.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/path.h"
|
||||
//#include "nel/memory/memory_manager.h"
|
||||
#include "nel/misc/i18n.h"
|
||||
|
@ -685,12 +686,13 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType
|
|||
{
|
||||
const uint BUFFER_SIZE = 16*1024;
|
||||
char lineBuffer[BUFFER_SIZE];
|
||||
FILE *s;
|
||||
|
||||
vector<string> fields;
|
||||
vector<string> args;
|
||||
|
||||
if ((s = fopen(file.c_str(), "r")) == NULL)
|
||||
FILE *s = nlfopen(file, "r");
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
fprintf(stderr, "Can't find file %s to convert\n", file.c_str());
|
||||
return;
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
#ifndef RCERROR_DATA
|
||||
#define RCERROR_DATA
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QString>
|
||||
|
||||
struct SCrashReportData
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "progress_dialog.h"
|
||||
#include <sys/timeb.h>
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
|
@ -468,9 +469,13 @@ void CData_mirrorDlg::OnOK()
|
|||
if (!LogDirectory.empty())
|
||||
{
|
||||
string sTmp = LogDirectory + "data_mirror.txt";
|
||||
FILE *f = fopen(sTmp.c_str(),"at");
|
||||
fprintf(f,"Modified file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
FILE *f = nlfopen(sTmp ,"at");
|
||||
|
||||
if (f)
|
||||
{
|
||||
fprintf(f,"Modified file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -503,9 +508,12 @@ void CData_mirrorDlg::OnOK()
|
|||
if (!LogDirectory.empty())
|
||||
{
|
||||
string sTmp = LogDirectory + "data_mirror.txt";
|
||||
FILE *f = fopen(sTmp.c_str(),"at");
|
||||
fprintf(f,"Added file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
FILE *f = nlfopen(sTmp, "at");
|
||||
if (f)
|
||||
{
|
||||
fprintf(f,"Added file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -535,9 +543,13 @@ void CData_mirrorDlg::OnOK()
|
|||
if (!LogDirectory.empty())
|
||||
{
|
||||
string sTmp = LogDirectory + "data_mirror.txt";
|
||||
FILE *f = fopen(sTmp.c_str(),"at");
|
||||
fprintf(f,"Removed file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
FILE *f = nlfopen(sTmp, "at");
|
||||
|
||||
if (f)
|
||||
{
|
||||
fprintf(f,"Removed file : %s\n", dest.c_str());
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ int _getch()
|
|||
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/sheet_id.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
|
@ -86,7 +87,7 @@ int main(int argc, const char *argv[])
|
|||
sort(sheets.begin(), sheets.end(), Pred);
|
||||
|
||||
// display.
|
||||
FILE *out= fopen("sheetid.txt", "wb");
|
||||
FILE *out= nlfopen("sheetid.txt", "wb");
|
||||
if(out)
|
||||
{
|
||||
for(uint i=0;i<sheets.size();i++)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// misc
|
||||
#include <nel/misc/types_nl.h>
|
||||
#include <nel/misc/file.h>
|
||||
#include <nel/misc/common.h>
|
||||
#include <nel/misc/path.h>
|
||||
#include <nel/misc/config_file.h>
|
||||
|
||||
|
@ -567,9 +568,9 @@ int main( int argc, char ** argv )
|
|||
// dump the list of extensions in a txt file
|
||||
if( dumpExtensions )
|
||||
{
|
||||
FILE * extListOutput;
|
||||
string extListFileName = outputPath + "sheet_ext.txt";
|
||||
if( !(extListOutput = fopen(extListFileName.c_str(),"w")) )
|
||||
FILE *extListOutput = nlfopen(extListFileName, "w");
|
||||
if (!extListOutput)
|
||||
{
|
||||
nlwarning("Can't open output file %s",extListFileName.c_str());
|
||||
return 1;
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
#ifndef WORDS_DICDLG_H
|
||||
#define WORDS_DICDLG_H
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
#undef Q_COMPILER_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "ui_words_dic_Qt.h"
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/app_context.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/sstring.h"
|
||||
#include "nel/misc/algo.h"
|
||||
|
||||
|
@ -228,7 +229,7 @@ int main(int argc, char *argv[])
|
|||
// read the index file
|
||||
set<string> fileInIndex;
|
||||
char lineBuffer[1024];
|
||||
FILE *fp = fopen(indexFileName.c_str(), "rt");
|
||||
FILE *fp = nlfopen(indexFileName, "rt");
|
||||
while (fgets(lineBuffer, 1024, fp))
|
||||
fileInIndex.insert(CSString(lineBuffer).strip());
|
||||
|
||||
|
@ -263,8 +264,8 @@ int main(int argc, char *argv[])
|
|||
if (!validFiles.empty() && needRepack)
|
||||
{
|
||||
// open the pack file
|
||||
// FILE *fp = fopen(filename.c_str(), "wt");
|
||||
FILE *fp = fopen(packFileName.c_str(), "wt");
|
||||
// FILE *fp = nlfopen(filename, "wt");
|
||||
FILE *fp = nlfopen(packFileName, "wt");
|
||||
|
||||
fprintf(fp, "<nel:packed_xml>\n");
|
||||
|
||||
|
@ -275,7 +276,7 @@ int main(int argc, char *argv[])
|
|||
printf("Adding file '%s'...\n", CFile::getFilename(subFileName).c_str());
|
||||
fprintf(fp, " <nel:xml_file name=\"%s\">\n", CFile::getFilename(subFileName).c_str());
|
||||
|
||||
FILE *subFp = fopen(subFileName.c_str(), "rt");
|
||||
FILE *subFp = nlfopen(subFileName, "rt");
|
||||
nlassert(subFp != NULL);
|
||||
char buffer[MaxLineSize];
|
||||
char *result;
|
||||
|
@ -304,7 +305,7 @@ int main(int argc, char *argv[])
|
|||
fclose(fp);
|
||||
|
||||
// write the disposable index file used by pack to check for erased file
|
||||
fp = fopen(indexFileName.c_str(), "wt");
|
||||
fp = nlfopen(indexFileName, "wt");
|
||||
for (uint i=0; i<validFiles.size(); ++i)
|
||||
{
|
||||
fprintf(fp, "%s\n", CFile::getFilename(validFiles[i]).c_str());
|
||||
|
@ -327,8 +328,8 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
printf("Unpacking directory '%s'...\n", dirName.c_str());
|
||||
// open the pack file
|
||||
// FILE *fp = fopen((dirName+"/tmp."+DefaultExt).c_str(), "rt");
|
||||
FILE *fp = fopen(filename.c_str(), "rt");
|
||||
// FILE *fp = nlfopen(dirName+"/tmp."+DefaultExt, "rt");
|
||||
FILE *fp = nlfopen(filename, "rt");
|
||||
if (!recursive)
|
||||
{
|
||||
// if we are not recursive, we MUST have a file here
|
||||
|
|
|
@ -333,7 +333,7 @@ std::string getServiceStateFileName(const std::string& serviceAlias,const std::s
|
|||
std::string getOfflineServiceState(const std::string& serviceAlias,const std::string& serviceExecutionPath)
|
||||
{
|
||||
// open the file for reading
|
||||
FILE* f= fopen(getServiceStateFileName(serviceAlias,serviceExecutionPath).c_str(),"rt");
|
||||
FILE* f = nlfopen(getServiceStateFileName(serviceAlias,serviceExecutionPath), "rt");
|
||||
if (f==NULL) return "Offline";
|
||||
|
||||
// setup a buffer to hold the text read from the file
|
||||
|
@ -366,7 +366,7 @@ bool writeServiceLaunchCtrl(const std::string& serviceAlias,const std::string& s
|
|||
NLMISC::CFile::createDirectoryTree(serviceExecutionPath);
|
||||
|
||||
// open the file for writing
|
||||
FILE* f= fopen(getServiceLaunchCtrlFileName(serviceAlias,serviceExecutionPath,delay).c_str(),"wt");
|
||||
FILE* f= nlfopen(getServiceLaunchCtrlFileName(serviceAlias,serviceExecutionPath,delay), "wt");
|
||||
if (f==NULL) return false;
|
||||
|
||||
// write the text to the file
|
||||
|
@ -1636,7 +1636,7 @@ NLMISC_COMMAND(aesSystem, "Execute a system() call", "<command>")
|
|||
|
||||
char str[1024];
|
||||
|
||||
FILE *fp = fopen(fn.c_str(), "rt");
|
||||
FILE *fp = nlfopen(fn, "rt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
while (true)
|
||||
|
@ -1654,7 +1654,7 @@ NLMISC_COMMAND(aesSystem, "Execute a system() call", "<command>")
|
|||
log.displayNL("No stdout");
|
||||
}
|
||||
|
||||
fp = fopen(fne.c_str(), "rt");
|
||||
fp = nlfopen(fne, "rt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
while (true)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#endif
|
||||
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/thread.h"
|
||||
|
||||
|
@ -586,7 +587,7 @@ private:
|
|||
string dest = filename.substr(0, filename.size ()-4);
|
||||
setRWAccess(dest);
|
||||
if(VerboseLog) nlinfo("Calling fopen('%s','wb')", dest.c_str());
|
||||
FILE *fp = fopen (dest.c_str(), "wb");
|
||||
FILE *fp = nlfopen (dest, "wb");
|
||||
if (fp == NULL)
|
||||
{
|
||||
string err = toString("Can't open file '%s' : code=%d %s, (error code 32)", dest.c_str(), errno, strerror(errno));
|
||||
|
|
|
@ -454,6 +454,7 @@ XMLInterfaceFiles = {
|
|||
"config.xml",
|
||||
"widgets.xml",
|
||||
"webig_widgets.xml",
|
||||
"appzone.xml",
|
||||
"player.xml",
|
||||
"inventory.xml",
|
||||
"interaction.xml",
|
||||
|
|
192
code/ryzom/client/data/gamedev/interfaces_v3/appzone.lua
Normal file
192
code/ryzom/client/data/gamedev/interfaces_v3/appzone.lua
Normal file
|
@ -0,0 +1,192 @@
|
|||
|
||||
-- global
|
||||
AppZone = {
|
||||
id = "ui:interface:appzone",
|
||||
homeuri = "?action=appzone_toolbar",
|
||||
launchuri = "?action=launch_app",
|
||||
addappuri = "?action=list_user_apps",
|
||||
mode = "h_bar",
|
||||
imagesize = 26
|
||||
}
|
||||
|
||||
-- use client.cfg value when available
|
||||
local uri getClientCfg("AppZoneUrl")
|
||||
if uri == nil or uri == '' then
|
||||
uri = 'http://app.ryzom.com/'
|
||||
end
|
||||
|
||||
AppZone.homeuri = uri .. AppZone.homeuri
|
||||
AppZone.launchuri = uri .. AppZone.launchuri
|
||||
AppZone.addappuri = uri .. AppZone.addappuri
|
||||
|
||||
function AppZone:getRoot()
|
||||
return getUI(self.id)
|
||||
end
|
||||
|
||||
function AppZone:onButtonHome()
|
||||
local webig = getUI("ui:interface:webig")
|
||||
webig:find("html").url = self.addappuri
|
||||
webig.active = true
|
||||
end
|
||||
|
||||
function AppZone:calculateSize(count, spacer, mode)
|
||||
local w, h
|
||||
if mode == "h_bar" then
|
||||
-- icon=32, space=2+2
|
||||
w = count * self.imagesize + spacer * 15
|
||||
w = w + 55 + 10 + 20
|
||||
h = self.imagesize + 2
|
||||
elseif mode == "h_box" then
|
||||
w = count * self.imagesize
|
||||
w = w + 20
|
||||
h = self.imagesize + 2
|
||||
h = h * spacer
|
||||
h = h + 15
|
||||
elseif mode == "v_bar" then
|
||||
-- icon=32, space=2+2
|
||||
h = count * self.imagesize + spacer * 15
|
||||
h = h + 20 + 20 + 12
|
||||
w = self.imagesize + 2 + 18
|
||||
else
|
||||
h = count * self.imagesize
|
||||
h = h + 20 + 25
|
||||
w = self.imagesize + 2
|
||||
w = w * spacer
|
||||
w = w + 16
|
||||
end
|
||||
|
||||
local ui = getUI("ui:interface")
|
||||
if w > ui.w then
|
||||
w = ui.w
|
||||
end
|
||||
if h > ui.h then
|
||||
h = ui.h
|
||||
end
|
||||
|
||||
return w, h
|
||||
end
|
||||
|
||||
function AppZone:setElementCount(count,spacer,m)
|
||||
self.mode = m
|
||||
|
||||
local root = self:getRoot()
|
||||
local content = root:find("content")
|
||||
local html = root:find("html")
|
||||
|
||||
local button_toggle = root:find("toggle_mode")
|
||||
local button_reload = root:find("browse_reload")
|
||||
local button_home = root:find("browse_home")
|
||||
|
||||
local w, h = self:calculateSize(count, spacer, self.mode)
|
||||
root.h = h
|
||||
root.w = w
|
||||
content.w = w
|
||||
content.h = h
|
||||
|
||||
-- set position of buttons
|
||||
if self.mode == "h_bar" then
|
||||
-- button_toggle.posref = "BL BL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = 0
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 15
|
||||
html.y = 0
|
||||
button_reload.x = -25
|
||||
button_reload.y = -25
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0
|
||||
button_home.y = -3 + 5
|
||||
elseif self.mode == "h_box" then
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = -25
|
||||
button_reload.y = -4 - 20
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0
|
||||
button_home.y = -3 + h - 18
|
||||
elseif self.mode == "v_bar" then
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = 0
|
||||
button_reload.y = -4
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 4 - 7
|
||||
button_home.y = -3
|
||||
else
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = -25
|
||||
button_reload.y = -4 - 20
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0 - w + 54 + 12
|
||||
button_home.y = -3
|
||||
end
|
||||
end
|
||||
|
||||
function AppZone:setMode(m)
|
||||
self.mode = m
|
||||
|
||||
self:reload()
|
||||
end
|
||||
|
||||
function AppZone:setActive(s)
|
||||
self:getRoot().active = s
|
||||
end
|
||||
|
||||
function AppZone:launchApp(appid, appwin, appurl)
|
||||
if not appwin then
|
||||
if string.match(appid, "^[0-9]+$") then
|
||||
appwin = "app" .. tostring(appid)
|
||||
else
|
||||
appwin = "webig"
|
||||
end
|
||||
end
|
||||
|
||||
if not appurl then
|
||||
appurl = self.launchuri .. "&appid=" .. tostring(appid)
|
||||
end
|
||||
|
||||
if WebBrowser then
|
||||
WebBrowser:openWindow(appwin, appurl)
|
||||
else
|
||||
-- fallback if WebBrowser not present
|
||||
local webig = getUI("ui:interface:webig")
|
||||
webig:find("html").url = appurl;
|
||||
webig.active = true
|
||||
end
|
||||
end
|
||||
|
||||
function AppZone:reload()
|
||||
local url = self.homeuri
|
||||
url = url .. "&mode=" .. tostring(self.mode)
|
||||
|
||||
local html = self:getRoot():find("html")
|
||||
html.url = url
|
||||
end
|
||||
|
||||
-- slash command: /appzone <cmd>
|
||||
function AppZone:handle(cmd)
|
||||
if cmd == 'show' then
|
||||
self:setActive(true)
|
||||
elseif cmd == 'hide' then
|
||||
self:setActive(false)
|
||||
elseif cmd == 'reload' then
|
||||
self:reload()
|
||||
elseif cmd == 'list' then
|
||||
self:onButtonHome()
|
||||
else
|
||||
self:launchApp(cmd)
|
||||
end
|
||||
end
|
258
code/ryzom/client/data/gamedev/interfaces_v3/appzone.xml
Normal file
258
code/ryzom/client/data/gamedev/interfaces_v3/appzone.xml
Normal file
|
@ -0,0 +1,258 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface_config>
|
||||
<root id="interface"
|
||||
x="0"
|
||||
y="0"
|
||||
w="800"
|
||||
h="600"
|
||||
active="true" />
|
||||
|
||||
<!-- default: active, h_bar -->
|
||||
<variable entry="UI:VARIABLES:ISACTIVE:APPZONE"
|
||||
type="sint32"
|
||||
value="1" />
|
||||
<variable entry="UI:SAVE:APPZONE:MODE"
|
||||
type="sint32"
|
||||
value="1" />
|
||||
|
||||
<!-- load lua after variable are setup -->
|
||||
<lua file="appzone.lua" />
|
||||
<lua file="webbrowser.lua" />
|
||||
|
||||
<proc id="appzone_proc_active">
|
||||
<action handler="set"
|
||||
params="dblink=UI:VARIABLES:ISACTIVE:APPZONE|value=1" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_deactive">
|
||||
<action handler="set"
|
||||
params="dblink=UI:VARIABLES:ISACTIVE:APPZONE|value=0" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode_set">
|
||||
<action handler="set"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=@0" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode_inc">
|
||||
<action handler="set"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=add(@UI:SAVE:APPZONE:MODE,1)" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode">
|
||||
<action handler="set"
|
||||
cond="le(@UI:SAVE:APPZONE:MODE,0)"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=1" />
|
||||
<action handler="set"
|
||||
cond="ge(@UI:SAVE:APPZONE:MODE,5)"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=1" />
|
||||
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,1)"
|
||||
params="AppZone:setMode('h_bar')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,2)"
|
||||
params="AppZone:setMode('h_box')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,3)"
|
||||
params="AppZone:setMode('v_bar')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,4)"
|
||||
params="AppZone:setMode('v_box')" />
|
||||
</proc>
|
||||
|
||||
<group type="menu"
|
||||
id="appzone_menu"
|
||||
extends="base_menu_with_color">
|
||||
<action id="settings"
|
||||
name="uiBrowseHome"
|
||||
handler="lua"
|
||||
params="AppZone:onButtonHome()" />
|
||||
<action id="reload"
|
||||
name="uiBrowseRefresh"
|
||||
handler="lua"
|
||||
params="AppZone:reload()" />
|
||||
<action id="hide"
|
||||
name="uiHide"
|
||||
handler="lua"
|
||||
params="AppZone:setActive(false)" />
|
||||
<separator />
|
||||
</group>
|
||||
|
||||
<group id="appzone"
|
||||
type="container"
|
||||
x="0"
|
||||
y="0"
|
||||
w="200"
|
||||
h="26"
|
||||
posref="MM MM"
|
||||
min_w="26"
|
||||
min_h="26"
|
||||
max_w="1600"
|
||||
max_h="1600"
|
||||
pop_max_w="1600"
|
||||
pop_max_h="1600"
|
||||
title=""
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
header_active="false"
|
||||
right_button="false"
|
||||
options="layer0_pad"
|
||||
movable="true"
|
||||
active="true"
|
||||
opened="true"
|
||||
openable="false"
|
||||
resizer="false"
|
||||
on_active="proc"
|
||||
on_active_params="appzone_proc_active"
|
||||
on_deactive="proc"
|
||||
on_deactive_params="appzone_proc_deactive"
|
||||
group_onclick_r="active_menu"
|
||||
group_params_r="menu=ui:interface:appzone_menu">
|
||||
<group id="header_closed"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
posref="TL TL" />
|
||||
<group id="header_opened"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
wmin="5"
|
||||
sizeref="w"
|
||||
posref="TL TL" />
|
||||
<group id="content"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="26"
|
||||
posref="TL TL">
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="toggle_mode"
|
||||
posref="BL BL"
|
||||
x="2"
|
||||
y="0"
|
||||
tx_normal="tb_mode.tga"
|
||||
tx_pushed="tb_mode.tga"
|
||||
tooltip="uiMk_mode"
|
||||
onclick_l="proc"
|
||||
params_l="appzone_proc_mode_inc" />
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="browse_home"
|
||||
posref="BR BR"
|
||||
x="0"
|
||||
y="-3"
|
||||
tx_normal="r2_palette_components.tga"
|
||||
tx_pushed="r2_palette_components.tga"
|
||||
tooltip="uittBrowseHome"
|
||||
onclick_l="lua"
|
||||
params_l="AppZone:onButtonHome()" />
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="browse_reload"
|
||||
posref="TL BL"
|
||||
posparent="browse_home"
|
||||
x="0"
|
||||
y="-4"
|
||||
tx_normal="r2ed_icon_rotate.tga"
|
||||
tx_pushed="r2ed_icon_rotate.tga"
|
||||
tooltip="uiBrowseRefresh"
|
||||
onclick_l="lua"
|
||||
params_l="AppZone:reload()" />
|
||||
<group id="html"
|
||||
type="webig_html"
|
||||
posref="TL TL"
|
||||
url=""
|
||||
title_prefix=""
|
||||
sizeref="wh"
|
||||
x="15"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
background_color="0 0 0 0"
|
||||
error_color="255 240 48 255"
|
||||
link_color="240 155 100 255"
|
||||
text_color="210 210 210 255"
|
||||
h1_color="255 255 255 255"
|
||||
h2_color="255 255 255 255"
|
||||
h3_color="255 255 255 255"
|
||||
h4_color="255 255 255 255"
|
||||
h5_color="255 255 255 255"
|
||||
h6_color="255 255 255 255"
|
||||
text_font_size="10"
|
||||
h1_font_size="16"
|
||||
h2_font_size="14"
|
||||
h3_font_size="13"
|
||||
h4_font_size="12"
|
||||
h5_font_size="11"
|
||||
h6_font_size="11"
|
||||
paragraph_begin_space="12"
|
||||
multi_line_space_factor="0.25"
|
||||
td_begin_space="0"
|
||||
li_begin_space="4"
|
||||
ul_begin_space="12"
|
||||
li_indent="-10"
|
||||
ul_indent="30"
|
||||
checkbox_bitmap_normal="patch_off.tga"
|
||||
checkbox_bitmap_pushed="patch_on.tga"
|
||||
checkbox_bitmap_over=""
|
||||
background_bitmap_view=""
|
||||
home=""
|
||||
browse_next_time="false"
|
||||
timeout="5"
|
||||
form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="black"
|
||||
posref="BR BR"
|
||||
sizeref="hw"
|
||||
w="0"
|
||||
h="0"
|
||||
inherit_gc_alpha="true" />
|
||||
<view type="bitmap"
|
||||
id="black2"
|
||||
posparent="black"
|
||||
posref="MM MM"
|
||||
sizeref="wh"
|
||||
w="0"
|
||||
h="0"
|
||||
inherit_gc_alpha="true"
|
||||
scale="true"
|
||||
texture="blank.tga"
|
||||
global_color="false" />
|
||||
<group type="list"
|
||||
id="text_list"
|
||||
fontsize="9"
|
||||
posref="TL TL"
|
||||
posparent="black"
|
||||
x="0"
|
||||
y="0"
|
||||
space="0"
|
||||
sizeref="hw"
|
||||
w="-4"
|
||||
h="0"
|
||||
maxelements="2000" />
|
||||
<ctrl style="skin_scroll"
|
||||
id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="appzone" />
|
||||
|
||||
<command name="appzone"
|
||||
action="lua"
|
||||
params="AppZone:handle('$')" />
|
||||
|
||||
</interface_config>
|
|
@ -32,7 +32,7 @@ end
|
|||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
function bgdownloader:setIcon(icon)
|
||||
local bm = self:getProgressGroup():find("bm");
|
||||
local bm = self:getProgressGroup():find("bm")
|
||||
if icon == "" then
|
||||
bm.active = false
|
||||
else
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
------------------------------------------------------------------------------------------------------------
|
||||
-- create the game namespace without reseting if already created in an other file.
|
||||
if (game==nil) then
|
||||
game= {};
|
||||
game = {}
|
||||
end
|
||||
|
||||
|
||||
|
@ -12,14 +12,14 @@ end
|
|||
-- called to construct guild flags background in the modal window
|
||||
function game:bcCreateGuildInitFlags()
|
||||
|
||||
local ui = getUICaller();
|
||||
local ui = getUICaller()
|
||||
|
||||
for i = 0,14 do
|
||||
local uiBack = getUI(getUIId(ui) .. ':back' .. i);
|
||||
uiBack.image1.back = i+1;
|
||||
uiBack.image1.symbol = 0;
|
||||
uiBack.image1.color1 = runExpr('makeRGB(255,255,255)');
|
||||
uiBack.image1.color2 = runExpr('makeRGB(0,0,0)');
|
||||
local uiBack = getUI(getUIId(ui) .. ':back' .. i)
|
||||
uiBack.image1.back = i+1
|
||||
uiBack.image1.symbol = 0
|
||||
uiBack.image1.color1 = runExpr('makeRGB(255,255,255)')
|
||||
uiBack.image1.color2 = runExpr('makeRGB(0,0,0)')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -28,37 +28,37 @@ end
|
|||
-- trap some parts should be deprecated ... try to clean it up
|
||||
function game:bcMissionsUpdate()
|
||||
|
||||
local mt = getDbProp('UI:TEMP:MISSION:MISSION_TYPE');
|
||||
local mt = getDbProp('UI:TEMP:MISSION:MISSION_TYPE')
|
||||
|
||||
-- init bot_chat_missions title
|
||||
local title = 'uiBotChatMissions';
|
||||
if (mt == 3) then title = 'uiBotChatZCCharges';
|
||||
elseif (mt == 4) then title = 'uiBotChatBuilding';
|
||||
elseif (mt == 5) then title = 'uiBotChatRMBuy';
|
||||
elseif (mt == 6) then title = 'uiBotChatRMUpgrade';
|
||||
local title = 'uiBotChatMissions'
|
||||
if (mt == 3) then title = 'uiBotChatZCCharges'
|
||||
elseif (mt == 4) then title = 'uiBotChatBuilding'
|
||||
elseif (mt == 5) then title = 'uiBotChatRMBuy'
|
||||
elseif (mt == 6) then title = 'uiBotChatRMUpgrade'
|
||||
end
|
||||
local ui = getUI('ui:interface:bot_chat_missions');
|
||||
ui.title = title;
|
||||
local ui = getUI('ui:interface:bot_chat_missions')
|
||||
ui.title = title
|
||||
|
||||
-- init desc
|
||||
title = 'uiSelectMission';
|
||||
if (mt == 3) then title = 'uiSelectZCCharge';
|
||||
elseif (mt == 4) then title = 'uiSelectBuilding';
|
||||
elseif (mt == 5) then title = 'uiSelectRMBuy';
|
||||
elseif (mt == 6) then title = 'uiSelectRMUpgrade';
|
||||
title = 'uiSelectMission'
|
||||
if (mt == 3) then title = 'uiSelectZCCharge'
|
||||
elseif (mt == 4) then title = 'uiSelectBuilding'
|
||||
elseif (mt == 5) then title = 'uiSelectRMBuy'
|
||||
elseif (mt == 6) then title = 'uiSelectRMUpgrade'
|
||||
end
|
||||
ui.header_opened.mission_title.hardtext = title;
|
||||
ui.header_opened.mission_title.hardtext = title
|
||||
|
||||
ui.header_opened.zc_duty.active = (mt == 3);
|
||||
ui.header_opened.xp_guild.active = ((mt == 5) or (mt == 6));
|
||||
ui.header_opened.zc_duty.active = (mt == 3)
|
||||
ui.header_opened.xp_guild.active = ((mt == 5) or (mt == 6))
|
||||
|
||||
-- init bot_chat_accept_mission title
|
||||
title = 'uiAcceptMission';
|
||||
if (mt == 3) then title = 'uiAcceptZCCharge';
|
||||
elseif (mt == 4) then title = 'uiAcceptBuilding';
|
||||
elseif (mt == 5) then title = 'uiAcceptRMBuy';
|
||||
elseif (mt == 6) then title = 'uiAcceptRMUpgrade';
|
||||
title = 'uiAcceptMission'
|
||||
if (mt == 3) then title = 'uiAcceptZCCharge'
|
||||
elseif (mt == 4) then title = 'uiAcceptBuilding'
|
||||
elseif (mt == 5) then title = 'uiAcceptRMBuy'
|
||||
elseif (mt == 6) then title = 'uiAcceptRMUpgrade'
|
||||
end
|
||||
ui = getUI('ui:interface:bot_chat_accept_mission');
|
||||
ui = getUI('ui:interface:bot_chat_accept_mission')
|
||||
ui.title = title;
|
||||
end
|
||||
|
|
|
@ -3,36 +3,36 @@
|
|||
------------------------------------------------------------------------------------------------------------
|
||||
-- create the game namespace without reseting if already created in an other file.
|
||||
if (help==nil) then
|
||||
help= {};
|
||||
help = {}
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
function help:closeCSBrowserHeader()
|
||||
local ui = getUI('ui:interface:cs_browser');
|
||||
local ui = getUI('ui:interface:cs_browser')
|
||||
|
||||
-- save size
|
||||
ui_cs_browser_h = ui.h;
|
||||
ui_cs_browser_w = ui.w;
|
||||
ui_cs_browser_h = ui.h
|
||||
ui_cs_browser_w = ui.w
|
||||
|
||||
-- reduce window size
|
||||
ui.pop_min_h = 32;
|
||||
ui.h = 0;
|
||||
ui.w = 216;
|
||||
ui.pop_min_h = 32
|
||||
ui.h = 0
|
||||
ui.w = 216
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
function help:openCSBrowserHeader()
|
||||
local ui = getUI('ui:interface:cs_browser');
|
||||
ui.pop_min_h = 96;
|
||||
local ui = getUI('ui:interface:cs_browser')
|
||||
ui.pop_min_h = 96
|
||||
|
||||
-- set size from saved values
|
||||
if (ui_cs_browser_h ~= nil) then
|
||||
ui.h = ui_cs_browser_h;
|
||||
ui.h = ui_cs_browser_h
|
||||
end
|
||||
|
||||
if (ui_cs_browser_w ~= nil) then
|
||||
ui.w = ui_cs_browser_w;
|
||||
ui.w = ui_cs_browser_w
|
||||
end
|
||||
end
|
|
@ -161,7 +161,7 @@ end
|
|||
------------------------------------------------------------------------------------------------------------
|
||||
-- Compute the current Max Resist
|
||||
function game:getMagicResistMaxLevel()
|
||||
local mlvl= self:getMagicResistBaseLevel() + getDbProp(formatUI('%player_resist_maxratio'));
|
||||
local mlvl= 25 + self:getMagicResistBaseLevel() + getDbProp(formatUI('%player_resist_maxratio'));
|
||||
return math.max(0,mlvl);
|
||||
end
|
||||
|
||||
|
@ -267,27 +267,27 @@ function game:onDrawNpcWebPage()
|
|||
local available
|
||||
if config.Local == 1 then
|
||||
available = (NicoMagicURL ~= "")
|
||||
else
|
||||
available = isDynStringAvailable(self.NpcWebPage.UrlTextId)
|
||||
else
|
||||
available = isDynStringAvailable(self.NpcWebPage.UrlTextId)
|
||||
end
|
||||
if(available) then
|
||||
if(available) then
|
||||
local ucUrl
|
||||
if config.Local == 1 then
|
||||
ucUrl = ucstring(NicoMagicURL) -- for test in local mode
|
||||
ucUrl = ucstring(NicoMagicURL) -- for test in local mode
|
||||
else
|
||||
ucUrl = getDynString(self.NpcWebPage.UrlTextId);
|
||||
end
|
||||
-- browse
|
||||
local uiStr= getUIId(getUICaller());
|
||||
-- if the url
|
||||
-- if the url
|
||||
local utf8Url = ucUrl:toUtf8()
|
||||
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
||||
local isRing = string.find(utf8Url, "ring_access_point=1") ~= nil
|
||||
if isRing then
|
||||
getUI("ui:interface:npc_web_browser").active = false
|
||||
runAH(nil, "context_ring_sessions", "")
|
||||
return
|
||||
else
|
||||
local hideWindow = string.find(utf8Url, "_hideWindow=1") ~= nil
|
||||
local hideWindow = string.find(utf8Url, "_hideWindow=1") ~= nil
|
||||
if hideWindow then
|
||||
getUI("ui:interface:npc_web_browser").active = false
|
||||
end
|
||||
|
@ -336,14 +336,14 @@ function game:startNpcWebPage()
|
|||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
function game:closeNpcWebBrowserHeader()
|
||||
local ui = getUI('ui:interface:npc_web_browser');
|
||||
|
||||
|
||||
-- save size
|
||||
ui_npc_web_browser_h = ui.h;
|
||||
ui_npc_web_browser_w = ui.w;
|
||||
|
||||
|
||||
-- reduce window size
|
||||
ui.pop_min_h = 32;
|
||||
ui.h = 0;
|
||||
|
@ -351,7 +351,7 @@ function game:closeNpcWebBrowserHeader()
|
|||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
function game:openNpcWebBrowserHeader()
|
||||
local ui = getUI('ui:interface:npc_web_browser');
|
||||
ui.pop_min_h = 96;
|
||||
|
@ -360,7 +360,7 @@ function game:openNpcWebBrowserHeader()
|
|||
if (ui_npc_web_browser_h ~= nil) then
|
||||
ui.h = ui_npc_web_browser_h;
|
||||
end
|
||||
|
||||
|
||||
if (ui_npc_web_browser_w ~= nil) then
|
||||
ui.w = ui_npc_web_browser_w;
|
||||
end
|
||||
|
@ -538,7 +538,7 @@ function game:updateFameBar(path)
|
|||
uiMaxLimit.x = barX + barW * (fameMax + 100) / 200;
|
||||
|
||||
-- init bar3d
|
||||
if (bar3dStart < bar3dLimit) then
|
||||
if (bar3dStart < bar3dLimit) then
|
||||
uiBar3d.x= bar3dStart;
|
||||
uiBar3d.w= bar3dLimit-bar3dStart;
|
||||
else
|
||||
|
@ -553,7 +553,7 @@ function game:updateFameBarTT(path)
|
|||
local fameMax = getDbProp(path .. ':THRESHOLD');
|
||||
|
||||
local text = i18n.get('uittFameMaxPossible');
|
||||
text = findReplaceAll(text, '%famemax', tostring(fameMax));
|
||||
text = findReplaceAll(text, '%famemax', tostring(fameMax));
|
||||
setContextHelpText(text);
|
||||
end
|
||||
|
||||
|
@ -564,12 +564,12 @@ function game:getPvpEffects()
|
|||
local i;
|
||||
local hasBonus = false;
|
||||
local hasMalus = false;
|
||||
|
||||
|
||||
local text = ''
|
||||
local textBonus = '';
|
||||
local textMalus = '';
|
||||
local fmt;
|
||||
|
||||
|
||||
-- check every malus and bonus
|
||||
for i=0, n do
|
||||
local path = formatUI('SERVER:PVP_EFFECTS:#1', i);
|
||||
|
@ -611,7 +611,7 @@ function game:getPvpEffects()
|
|||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
function game:getFactionName(id)
|
||||
function game:getFactionName(id)
|
||||
if (id == self.TPVPClan.Kami) then
|
||||
return i18n.get('uiFameKami');
|
||||
elseif (id == self.TPVPClan.Karavan) then
|
||||
|
@ -636,10 +636,10 @@ function game:getAllegiancePoints()
|
|||
local civPoints = getDbProp(path .. ':CIV_POINTS');
|
||||
local cult = getDbProp(path .. ':CULT');
|
||||
local cultPoints = getDbProp(path .. ':CULT_POINTS');
|
||||
|
||||
|
||||
local text;
|
||||
local uiGroup= getUICaller();
|
||||
|
||||
|
||||
-- civ allegiance
|
||||
if (civ == self.TPVPClan.None or civ == self.TPVPClan.Neutral) then
|
||||
text = i18n.get('uiPvpFameNoCivAllegiance');
|
||||
|
@ -647,9 +647,9 @@ function game:getAllegiancePoints()
|
|||
text = i18n.get('uiPvpFameAllegiancePoints');
|
||||
text = findReplaceAll(text, '%faction', self:getFactionName(civ));
|
||||
text = findReplaceAll(text, '%points', tostring(civPoints));
|
||||
end
|
||||
end
|
||||
uiGroup.civ_allegiance_pts.uc_hardtext_format = text;
|
||||
|
||||
|
||||
-- cult allegiance
|
||||
if (cult == self.TPVPClan.None or cult == self.TPVPClan.Neutral) then
|
||||
text = i18n.get('uiPvpFameNoCultAllegiance');
|
||||
|
@ -698,11 +698,11 @@ function game:fameAllegianceTooltipCultGuild()
|
|||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
function game:tooltipDeltaValue(base, max)
|
||||
-- Calculate delta
|
||||
local val = max - base;
|
||||
|
||||
|
||||
local text;
|
||||
if (val == 0) then
|
||||
text = concatUCString('@{FFFF}', tostring(max));
|
||||
|
@ -729,37 +729,37 @@ function game:tooltipDeltaValue(base, max)
|
|||
text = concatUCString(text, ')');
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return text;
|
||||
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
function game:tooltipScore(dbBase, dbMax, ttFormat)
|
||||
-- Get DB values
|
||||
local base = getDbProp(dbBase);
|
||||
local max = getDbProp(dbMax);
|
||||
|
||||
|
||||
-- Tooltip text
|
||||
local fmt = i18n.get(ttFormat);
|
||||
local text = self:tooltipDeltaValue(base, max);
|
||||
fmt = findReplaceAll(fmt, "%n", text );
|
||||
|
||||
|
||||
-- Set tooltip
|
||||
setContextHelpText(fmt);
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
--
|
||||
function game:tooltipScoreEP(dbBase, dbMax, ttFormat, dbLvl, dbMod)
|
||||
-- Defender level
|
||||
local defLvl= getDbProp(formatUI(dbLvl));
|
||||
defLvl = math.max(0, defLvl);
|
||||
|
||||
|
||||
-- Attacker level
|
||||
local attLvl = getBaseSkillValueMaxChildren(getSkillIdFromName('SF'));
|
||||
|
||||
|
||||
-- Get DB values
|
||||
local base = getDbProp(dbBase);
|
||||
local max = getDbProp(dbMax);
|
||||
|
@ -774,7 +774,7 @@ function game:tooltipScoreEP(dbBase, dbMax, ttFormat, dbLvl, dbMod)
|
|||
fmt = findReplaceAll(fmt, "%n", text );
|
||||
fmt = findReplaceAll(fmt, "%l", tostring(attLvl));
|
||||
fmt = findReplaceAll(fmt, "%p", textChance);
|
||||
|
||||
|
||||
-- Set tooltip
|
||||
setContextHelpText(fmt);
|
||||
end
|
||||
|
@ -786,7 +786,7 @@ end
|
|||
---------------------------------- RING STATS ---------------------------------------------------
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
RingPlayerInfo =
|
||||
RingPlayerInfo =
|
||||
{
|
||||
WaitingInfo = false,
|
||||
LastRefreshTime = 0,
|
||||
|
@ -810,7 +810,7 @@ end
|
|||
--
|
||||
function RingPlayerInfo:initRingStatPlayer()
|
||||
|
||||
setOnDraw(self:getWindow(), "RingPlayerInfo:onRingRatingPlayerDraw()")
|
||||
setOnDraw(self:getWindow(), "RingPlayerInfo:onRingRatingPlayerDraw()")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
|
@ -819,16 +819,16 @@ function RingPlayerInfo:onRingRatingPlayerDraw()
|
|||
|
||||
local timeInSec = nltime.getLocalTime() / 1000
|
||||
if self.WaitingInfo then
|
||||
if timeInSec - self.LastRefreshTime > self.WaitingPeriod then
|
||||
if timeInSec - self.LastRefreshTime > self.WaitingPeriod then
|
||||
self.WaitingInfo = false
|
||||
self.LastRefreshTime = nltime.getLocalTime() / 1000
|
||||
else
|
||||
else
|
||||
if not self.InfoReceived then
|
||||
--debugInfo("No received info")
|
||||
end
|
||||
end
|
||||
else
|
||||
if timeInSec - self.LastRefreshTime > self.RefreshPeriod then
|
||||
if timeInSec - self.LastRefreshTime > self.RefreshPeriod then
|
||||
self:refresh()
|
||||
else
|
||||
--debugInfo("pas de refresh")
|
||||
|
@ -844,7 +844,7 @@ function RingPlayerInfo:updatePendingRefresh()
|
|||
|
||||
if self.PendingRefresh then
|
||||
local currTime = nltime.getLocalTime() / 1000
|
||||
if currTime - self.LastRefreshQuerryTime > self.MinRefreshPeriod and game.getRingStats then
|
||||
if currTime - self.LastRefreshQuerryTime > self.MinRefreshPeriod and game.getRingStats then
|
||||
self.LastRefreshQuerryTime = currTime
|
||||
self.PendingRefresh = false
|
||||
game.getRingStats()
|
||||
|
@ -924,10 +924,10 @@ end
|
|||
--
|
||||
function RingPlayerInfo:refresh()
|
||||
|
||||
self.PendingRefresh = true
|
||||
self.PendingRefresh = true
|
||||
self.LastRefreshTime = nltime.getLocalTime() / 1000
|
||||
self.WaitingInfo = true
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
|
@ -937,7 +937,7 @@ function RingPlayerInfo:tooltipEcosystemPoints(rp, maxRp, ttFormat)
|
|||
local fmt = i18n.get(ttFormat);
|
||||
fmt = findReplaceAll(fmt, "%n", rp );
|
||||
fmt = findReplaceAll(fmt, "%p", maxRp );
|
||||
|
||||
|
||||
-- Set tooltip
|
||||
return fmt;
|
||||
end
|
||||
|
@ -954,8 +954,8 @@ function RingPlayerInfo:updateRRPSLevel(dbVal, tooltip)
|
|||
local ui= getUICaller();
|
||||
local uiText= ui.val;
|
||||
|
||||
-- set the text
|
||||
uiText.uc_hardtext= tostring(val)
|
||||
-- set the text
|
||||
uiText.uc_hardtext= tostring(val)
|
||||
|
||||
self:tooltipRRPs(dbVal, tooltip)
|
||||
end
|
||||
|
@ -970,7 +970,7 @@ function RingPlayerInfo:tooltipRRPs(dbBase, ttFormat)
|
|||
local fmt = i18n.get(ttFormat);
|
||||
local text = tostring(val)
|
||||
fmt = findReplaceAll(fmt, "%n", text );
|
||||
|
||||
|
||||
-- Set tooltip
|
||||
setContextHelpText(fmt);
|
||||
end
|
||||
|
@ -1013,7 +1013,7 @@ end
|
|||
--------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
function game:updateOrganization(path, uiOrgText, uiStatusText, uiPointsText)
|
||||
|
||||
|
||||
local org = getDbProp(path.."1:VALUE")
|
||||
getUICaller()[uiOrgText].uc_hardtext = i18n.get('uiOrganization_' .. org)
|
||||
|
||||
|
@ -1022,7 +1022,7 @@ function game:updateOrganization(path, uiOrgText, uiStatusText, uiPointsText)
|
|||
|
||||
local points = getDbProp(path.."3:VALUE")
|
||||
getUICaller()[uiPointsText].uc_hardtext= points
|
||||
|
||||
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
|
@ -1033,10 +1033,10 @@ end
|
|||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:popMissionList()
|
||||
local menu = getUI("ui:interface:mission_cb_menu")
|
||||
function game:popMissionList()
|
||||
local menu = getUI("ui:interface:mission_cb_menu")
|
||||
enableModalWindow(getUICaller(), "ui:interface:mission_cb_menu")
|
||||
self:updateMissionMenuSize()
|
||||
self:updateMissionMenuSize()
|
||||
end
|
||||
|
||||
|
||||
|
@ -1053,12 +1053,12 @@ function game:getMissionDbPath(missionIndex)
|
|||
return "SERVER:GROUP:MISSIONS:" .. tostring(missionIndex - numMissions)
|
||||
else
|
||||
return "SERVER:MISSIONS:" .. tostring(missionIndex)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:getCurrMissionIndex()
|
||||
local result = getDbProp("UI:SAVE:MISSION_SELECTED")
|
||||
function game:getCurrMissionIndex()
|
||||
local result = getDbProp("UI:SAVE:MISSION_SELECTED")
|
||||
return result
|
||||
end
|
||||
|
||||
|
@ -1071,10 +1071,10 @@ end
|
|||
function game:updateCurrMissionComboBox()
|
||||
local numMissions = tonumber(getDefine("ipj_nb_mission"))
|
||||
local missionFound = false
|
||||
local cb = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
local missionList = getUI("ui:interface:info_player_journal:content:mission_list")
|
||||
local cb = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
local missionList = getUI("ui:interface:info_player_journal:content:mission_list")
|
||||
for i = 0, numMissions - 1 do
|
||||
if getDbProp("SERVER:MISSIONS:" .. i .. ":TITLE") ~= 0
|
||||
if getDbProp("SERVER:MISSIONS:" .. i .. ":TITLE") ~= 0
|
||||
or getDbProp("SERVER:GROUP:MISSIONS:" .. i .. ":TITLE") ~= 0 then
|
||||
missionFound = true
|
||||
break
|
||||
|
@ -1095,20 +1095,20 @@ function game:updateCurrMissionComboBox()
|
|||
missionList.no_available_mission.active = false
|
||||
cb.arrow.active = true
|
||||
cb.select.active = true
|
||||
local currMission = self:getCurrMissionIndex()
|
||||
local currMission = self:getCurrMissionIndex()
|
||||
|
||||
local dbPath = self:getMissionDbPath(currMission)
|
||||
--
|
||||
local selected = (currMission ~= -1)
|
||||
local dbPath = self:getMissionDbPath(currMission)
|
||||
--
|
||||
local selected = (currMission ~= -1)
|
||||
if selected then
|
||||
cb.mission_title.textid_dblink = dbPath .. ":TITLE"
|
||||
selected = (tile ~= 0)
|
||||
end
|
||||
end
|
||||
cb.mission_ico.active = selected
|
||||
cb.mission_title.active = selected
|
||||
cb.no_selected_mission.active = not selected
|
||||
missionList.no_selected_mission.active = not selected
|
||||
if selected then
|
||||
if selected then
|
||||
if getDbProp(dbPath .. ":FINISHED") == 0 then
|
||||
cb.mission_ico.texture = runExpr("getMissionSmallIcon(" .. tostring(getDbProp(dbPath .. ":ICON") .. ")"))
|
||||
elseif getDbProp(dbPath .. ":FINISHED") == 1 then
|
||||
|
@ -1116,17 +1116,17 @@ function game:updateCurrMissionComboBox()
|
|||
else
|
||||
cb.mission_ico.texture = "Small_Task_Failed.tga"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionSelected(index)
|
||||
function game:onMissionSelected(index)
|
||||
disableModalWindow()
|
||||
self:updateCurrMissionComboBox()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onGroupMissionSelected(index)
|
||||
function game:onGroupMissionSelected(index)
|
||||
disableModalWindow()
|
||||
self:updateCurrMissionComboBox()
|
||||
end
|
||||
|
@ -1138,33 +1138,33 @@ function game:onMissionDBIndexChanged()
|
|||
-- if selection was made from the list, update the other list
|
||||
if missionIndex >= self:getGroupMissionFirstIndex() then
|
||||
local groupMissionIndex = missionIndex - self:getGroupMissionFirstIndex()
|
||||
getUI("ui:interface:info_player_journal:content:mission_list:b_group_title" .. tostring(groupMissionIndex)).pushed = true
|
||||
getUI("ui:interface:info_player_journal:content:mission_list:b_group_title" .. tostring(groupMissionIndex)).pushed = true
|
||||
getUI("ui:interface:mission_cb_menu:mission_list:b_group_title" .. tostring(groupMissionIndex)).pushed = true
|
||||
else
|
||||
getUI("ui:interface:info_player_journal:content:mission_list:b_title" .. tostring(missionIndex)).pushed = true
|
||||
getUI("ui:interface:info_player_journal:content:mission_list:b_title" .. tostring(missionIndex)).pushed = true
|
||||
getUI("ui:interface:mission_cb_menu:mission_list:b_title" .. tostring(missionIndex)).pushed = true
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionTitleChanged(index)
|
||||
function game:onMissionTitleChanged(index)
|
||||
-- if title is not nil then a new mission has been added -> if db initilization is over, then selected this new mission
|
||||
if getDbProp(self:getMissionDbPath(index) .. ":TITLE") ~= 0 then
|
||||
if game.InGameDbInitialized or config.Local then
|
||||
if getDbProp(self:getMissionDbPath(index) .. ":TITLE") ~= 0 then
|
||||
if game.InGameDbInitialized or config.Local then
|
||||
self:setCurrentMission(index)
|
||||
end
|
||||
else
|
||||
else
|
||||
self:updateCurrMissionComboBox()
|
||||
self:updateMissionMenuSize()
|
||||
end
|
||||
end
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onGroupMissionTitleChanged(index)
|
||||
if getDbProp(self:getMissionDbPath(index + 15) .. ":TITLE") ~= 0 then
|
||||
if game.InGameDbInitialized or config.Local then
|
||||
function game:onGroupMissionTitleChanged(index)
|
||||
if getDbProp(self:getMissionDbPath(index + 15) .. ":TITLE") ~= 0 then
|
||||
if game.InGameDbInitialized or config.Local then
|
||||
self:setCurrentMission(index + 15)
|
||||
end
|
||||
else
|
||||
else
|
||||
self:updateCurrMissionComboBox()
|
||||
self:updateMissionMenuSize()
|
||||
end
|
||||
|
@ -1174,21 +1174,21 @@ end
|
|||
function game:updateMissionMenuSize()
|
||||
local parentCB = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
local menu = getUI("ui:interface:mission_cb_menu")
|
||||
if not menu.active then return end
|
||||
if not menu.active then return end
|
||||
local maxNumMissions = 2 * self:getGroupMissionFirstIndex()
|
||||
local missionCount = 0
|
||||
local missionCount = 0
|
||||
for k = 0, maxNumMissions - 1 do
|
||||
if getDbProp(self:getMissionDbPath(k) .. ":TITLE") ~= 0 then
|
||||
missionCount = missionCount + 1
|
||||
missionCount = missionCount + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
menu.h = 8 + missionCount * 18
|
||||
menu.y = 0
|
||||
menu:updateCoords()
|
||||
local y = parentCB.y_real - menu.h_real - 1
|
||||
if y < 0 then
|
||||
y = parentCB.y_real + parentCB.h_real + 1
|
||||
end
|
||||
end
|
||||
local scrW
|
||||
local scrH
|
||||
scrW, scrH = getWindowSize()
|
||||
|
@ -1197,7 +1197,7 @@ function game:updateMissionMenuSize()
|
|||
end
|
||||
menu.w = parentCB.w_real
|
||||
menu.y = y
|
||||
menu.x = parentCB.x_real
|
||||
menu.x = parentCB.x_real
|
||||
menu.h = 8 + missionCount * 18
|
||||
menu:invalidateCoords()
|
||||
end
|
||||
|
@ -1205,7 +1205,7 @@ end
|
|||
--------------------------------------------------------------------------------------------------------------
|
||||
--function game:updateMissionDescCloseButton(index)
|
||||
-- local dbPath = self:getMissionDbPath(index)
|
||||
-- if index == self:getCurrMissionIndex() then
|
||||
-- if index == self:getCurrMissionIndex() then
|
||||
-- local closeText = getUI("ui:interface:info_player_journal:content:desc:close")
|
||||
-- local button = getUI("ui:interface:info_player_journal:content:desc:uppart:over_icon")
|
||||
-- local finished = getDbProp(dbPath .. ":FINISHED")
|
||||
|
@ -1224,29 +1224,29 @@ end
|
|||
--end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionFinished(index)
|
||||
self:updateCurrMissionComboBox()
|
||||
function game:onMissionFinished(index)
|
||||
self:updateCurrMissionComboBox()
|
||||
--self:updateMissionDescCloseButton(index)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onGroupMissionFinished(index)
|
||||
function game:onGroupMissionFinished(index)
|
||||
self:updateCurrMissionComboBox()
|
||||
--self:updateMissionDescCloseButton(index + game:getGroupMissionFirstIndex())
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:expandMissionList()
|
||||
local missionCB = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
function game:expandMissionList()
|
||||
local missionCB = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
missionCB.active = not missionCB.active
|
||||
self:updateMissionWindowLayout()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:updateMissionWindowLayout()
|
||||
function game:updateMissionWindowLayout()
|
||||
if not isInRingMode() then
|
||||
local missionCB = getUI("ui:interface:info_player_journal:content:mission_combo")
|
||||
local missionList = getUI("ui:interface:info_player_journal:content:mission_list")
|
||||
local missionList = getUI("ui:interface:info_player_journal:content:mission_list")
|
||||
local fake = getUI("ui:interface:info_player_journal:content:fake")
|
||||
local sepBis = getUI("ui:interface:info_player_journal:content:separator_bis")
|
||||
local desc = getUI("ui:interface:info_player_journal:content:desc")
|
||||
|
@ -1254,18 +1254,18 @@ function game:updateMissionWindowLayout()
|
|||
local popMinH
|
||||
local win = getUI("ui:interface:info_player_journal")
|
||||
|
||||
if missionCB.active then
|
||||
sepBis.active = false
|
||||
if missionCB.active then
|
||||
sepBis.active = false
|
||||
missionList.active = false
|
||||
fake.sizeref=""
|
||||
fake.y = -32
|
||||
fake.h = 0
|
||||
expanded = 0
|
||||
expanded = 0
|
||||
desc.max_sizeref ="wh"
|
||||
desc.max_h= -42
|
||||
win.pop_min_h = 152 - win.content_y_offset
|
||||
else
|
||||
sepBis.active = true
|
||||
else
|
||||
sepBis.active = true
|
||||
missionList.active = true
|
||||
fake.sizeref="wh5"
|
||||
fake.y = -8
|
||||
|
@ -1274,23 +1274,23 @@ function game:updateMissionWindowLayout()
|
|||
desc.max_sizeref ="wh5"
|
||||
desc.max_h=16
|
||||
win.pop_min_h = 152 - win.content_y_offset
|
||||
end
|
||||
end
|
||||
|
||||
local fixedEntry = getUI("ui:interface:info_player_journal:content:mission_fixed_entry")
|
||||
local fixedEntry = getUI("ui:interface:info_player_journal:content:mission_fixed_entry")
|
||||
fixedEntry:updateCoords()
|
||||
desc.max_h = desc.max_h - fixedEntry.h
|
||||
|
||||
setDbProp("UI:SAVE:EXPAND_MISSION_LIST", expanded)
|
||||
getUI("ui:interface:info_player_journal"):invalidateCoords()
|
||||
getUI("ui:interface:info_player_journal"):invalidateCoords()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionJournalOpened()
|
||||
function game:onMissionJournalOpened()
|
||||
local missionDesc = getUI("ui:interface:info_player_journal:content:desc")
|
||||
missionDesc.active = getDbProp("UI:SAVE:MISSION_SELECTED") ~= -1
|
||||
missionDesc.active = getDbProp("UI:SAVE:MISSION_SELECTED") ~= -1
|
||||
|
||||
local expandList = getDbProp("UI:SAVE:EXPAND_MISSION_LIST")
|
||||
local expandList = getDbProp("UI:SAVE:EXPAND_MISSION_LIST")
|
||||
self:updateMissionJournalMode()
|
||||
|
||||
if not isInRingMode() then
|
||||
|
@ -1304,9 +1304,9 @@ function game:onMissionJournalOpened()
|
|||
|
||||
self:updateMissionJournalHeader()
|
||||
self:updateMissionWindowLayout()
|
||||
self:updateMissionJournalFixedEntry()
|
||||
self:updateMissionJournalFixedEntry()
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
@ -1315,12 +1315,12 @@ function game:updateMissionJournalHeader()
|
|||
local win = getUI("ui:interface:info_player_journal")
|
||||
local headerActive = getDbProp("UI:SAVE:MISSION_JOURNAL_HEADER_ACTIVE") ~= 0
|
||||
win.header_active = headerActive
|
||||
win.right_button_enabled = headerActive
|
||||
win.right_button_enabled = headerActive
|
||||
if headerActive then
|
||||
win.uc_title_opened = i18n.get("uiJournalTitle")
|
||||
win.uc_title_opened = i18n.get("uiJournalTitle")
|
||||
win.content_y_offset = 0
|
||||
else
|
||||
win.uc_title_opened = ucstring("")
|
||||
win.uc_title_opened = ucstring("")
|
||||
win.content_y_offset = win.header_opened.h_real + 3
|
||||
end
|
||||
end
|
||||
|
@ -1329,13 +1329,13 @@ end
|
|||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:updateMissionJournalFixedEntry()
|
||||
-- update fixed entry text
|
||||
|
||||
local fixedEntryRing = getUI("ui:interface:info_player_journal:no_available_missions:main:mission_fixed_entry")
|
||||
|
||||
local fixedEntryRing = getUI("ui:interface:info_player_journal:no_available_missions:main:mission_fixed_entry")
|
||||
local fixedEntryMain = getUI("ui:interface:info_player_journal:content:mission_fixed_entry")
|
||||
|
||||
|
||||
fixedEntryRing.active = game.InGameDbInitialized and isInRingMode()
|
||||
fixedEntryMain.active = game.InGameDbInitialized and not isInRingMode()
|
||||
|
||||
fixedEntryMain.active = game.InGameDbInitialized and not isInRingMode()
|
||||
|
||||
|
||||
|
||||
local id = "uiFixedMissionEntry"
|
||||
|
@ -1346,22 +1346,22 @@ function game:updateMissionJournalFixedEntry()
|
|||
end
|
||||
if isPlayerFreeTrial() then
|
||||
id = id .. "_Trial"
|
||||
end
|
||||
end
|
||||
else
|
||||
if isInRingMode() then
|
||||
id = id .. "_R2"
|
||||
else
|
||||
if isInRingMode() then
|
||||
id = id .. "_R2"
|
||||
else
|
||||
id = id .. "_Mainland_" .. getUserRace()
|
||||
end
|
||||
end
|
||||
end
|
||||
fixedEntryMain.uc_hardtext = i18n.get(id)
|
||||
fixedEntryRing.uc_hardtext = i18n.get(id)
|
||||
|
||||
|
||||
self:updateMissionWindowLayout()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:setCurrentMission(index)
|
||||
function game:setCurrentMission(index)
|
||||
mw = getMissionWindow()
|
||||
mw.active = game.InGameDbInitialized
|
||||
if index < self:getGroupMissionFirstIndex() then
|
||||
|
@ -1372,7 +1372,7 @@ function game:setCurrentMission(index)
|
|||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionComboWheelUp()
|
||||
function game:onMissionComboWheelUp()
|
||||
local currMissionIndex = self:getCurrMissionIndex()
|
||||
while currMissionIndex > 0 do
|
||||
currMissionIndex = currMissionIndex - 1
|
||||
|
@ -1384,7 +1384,7 @@ function game:onMissionComboWheelUp()
|
|||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:onMissionComboWheelDown()
|
||||
function game:onMissionComboWheelDown()
|
||||
local currMissionIndex = self:getCurrMissionIndex()
|
||||
local maxNumMission = 2 * self:getGroupMissionFirstIndex()
|
||||
while currMissionIndex < (maxNumMission - 1) do
|
||||
|
@ -1399,37 +1399,37 @@ end
|
|||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
function game:toggleMissionJournalCaption()
|
||||
local dbPath = "UI:SAVE:MISSION_JOURNAL_HEADER_ACTIVE"
|
||||
function game:toggleMissionJournalCaption()
|
||||
local dbPath = "UI:SAVE:MISSION_JOURNAL_HEADER_ACTIVE"
|
||||
setDbProp(dbPath, 1 - getDbProp(dbPath))
|
||||
local win = getUI("ui:interface:info_player_journal")
|
||||
local win = getUI("ui:interface:info_player_journal")
|
||||
self:updateMissionJournalHeader()
|
||||
self:updateMissionWindowLayout()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- handler called by C++ to tell that the main loop is about to begin
|
||||
function game:onMainLoopBegin()
|
||||
game.InGameDbInitialized = false
|
||||
function game:onMainLoopBegin()
|
||||
game.InGameDbInitialized = false
|
||||
game.PrevSessionMission = getDbProp("UI:VARIABLES:MISSION_SELECTED_PREV_SESSION")
|
||||
|
||||
|
||||
debugInfo("onMainLoopBegin()")
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- handler called by C++ to tell that all initial value have been set in the db
|
||||
function game:onInGameDbInitialized()
|
||||
function game:onInGameDbInitialized()
|
||||
game.InGameDbInitialized = true
|
||||
-- if the journal is opened, force an update for the fixed entry text
|
||||
-- if the journal is opened, force an update for the fixed entry text
|
||||
-- (says if we're in start island, paying account ...) need DB flags like
|
||||
-- IS_NEWBIE & IS_TRIAL to be received
|
||||
game:updateMissionJournalFixedEntry()
|
||||
-- If a mission was previously selected, restore it
|
||||
game:updateMissionJournalFixedEntry()
|
||||
-- If a mission was previously selected, restore it
|
||||
if game.PrevSessionMission ~= -1 then
|
||||
self:setCurrentMission(game.PrevSessionMission)
|
||||
self:setCurrentMission(game.PrevSessionMission)
|
||||
end
|
||||
|
||||
|
||||
game:setInfoPlayerCharacterRace()
|
||||
end
|
||||
|
||||
|
@ -1437,7 +1437,7 @@ function game:onWebIgReady()
|
|||
-- Call init webig
|
||||
getUI("ui:interface:web_transactions:content:html"):browse("home")
|
||||
getUI("ui:interface:webig:content:html"):browse("home")
|
||||
|
||||
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
|
@ -1464,7 +1464,7 @@ end
|
|||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
-- ring journal on / off
|
||||
function game:setMissionJournalRingMode(isRing)
|
||||
function game:setMissionJournalRingMode(isRing)
|
||||
local journal = getUI("ui:interface:info_player_journal")
|
||||
if isRing then
|
||||
journal.content.expand_mission_list.active = false
|
||||
|
@ -1480,7 +1480,7 @@ function game:setMissionJournalRingMode(isRing)
|
|||
journal.no_available_missions.active = true
|
||||
else
|
||||
journal.content.expand_mission_list.active = true
|
||||
journal.no_available_missions.active = false;
|
||||
journal.no_available_missions.active = false;
|
||||
journal.content.active = true;
|
||||
--journal.content.mission_list.active = true;
|
||||
journal.content.sv.active = true;
|
||||
|
@ -1494,8 +1494,8 @@ end
|
|||
--------------------------------------------------------------------------------------------------------------
|
||||
-- update mission journal depending on wether we're in the ring or not
|
||||
function game:updateMissionJournalMode()
|
||||
--local isRing = r2~=nil and r2.Mode~=nil and r2.Mode=='r2ed_anim_test'
|
||||
game:setMissionJournalRingMode(isInRingMode())
|
||||
--local isRing = r2~=nil and r2.Mode~=nil and r2.Mode=='r2ed_anim_test'
|
||||
game:setMissionJournalRingMode(isInRingMode())
|
||||
end
|
||||
|
||||
|
||||
|
@ -1521,22 +1521,22 @@ function game:onNewMissionStepAdded(stepIndex)
|
|||
end
|
||||
|
||||
-- debugInfo("New Step")
|
||||
if missionIndex < 15 then
|
||||
if missionIndex < 15 then
|
||||
dbPath = "SERVER:MISSIONS:" .. tostring(missionIndex) .. ":GOALS:" .. tostring(stepIndex) .. ":TEXT"
|
||||
else
|
||||
else
|
||||
dbPath = "SERVER:GROUP:MISSIONS:" .. tostring(missionIndex - 15) .. ":GOALS:" .. tostring(stepIndex) .. ":TEXT"
|
||||
end
|
||||
end
|
||||
local stringID = getDbProp(dbPath)
|
||||
if stringID ~= 0 then
|
||||
-- debugInfo(tostring(stringID))
|
||||
table.insert(remainingMissionTextIDs, stringID)
|
||||
setOnDraw(missionWnd, "game:ensureLastMissionStepVisibility0()")
|
||||
else
|
||||
setOnDraw(missionWnd, "game:ensureLastMissionStepVisibility0()")
|
||||
else
|
||||
end
|
||||
end
|
||||
|
||||
function game:ensureLastMissionStepVisibility0()
|
||||
|
||||
|
||||
local missing = false
|
||||
for k, v in pairs(remainingMissionTextIDs) do
|
||||
if not isDynStringAvailable(v) then
|
||||
|
@ -1545,54 +1545,54 @@ function game:ensureLastMissionStepVisibility0()
|
|||
end
|
||||
end
|
||||
local missionWnd = getMissionWindow()
|
||||
if not missing then
|
||||
if not missing then
|
||||
remainingMissionTextIDs = {}
|
||||
-- delay real update to newt frame
|
||||
setOnDraw(missionWnd, "game:ensureLastMissionStepVisibility1()")
|
||||
-- delay real update to newt frame
|
||||
setOnDraw(missionWnd, "game:ensureLastMissionStepVisibility1()")
|
||||
else
|
||||
-- for debug : dump the list of remaining "dyn string"
|
||||
-- for debug : dump the list of remaining "dyn string"
|
||||
--local stringList = "{"
|
||||
--for k, v in remainingMissionTextIDs do
|
||||
-- if not isDynStringAvailable(v) then
|
||||
-- if not isDynStringAvailable(v) then
|
||||
-- stringList = stringList .. " " .. tostring(v)
|
||||
-- end
|
||||
--end
|
||||
--stringList = stringList .. "}"
|
||||
--stringList = stringList .. "}"
|
||||
end
|
||||
end
|
||||
|
||||
function game:ensureLastMissionStepVisibility1()
|
||||
function game:ensureLastMissionStepVisibility1()
|
||||
local missionWnd = getMissionWindow()
|
||||
local scrollBar = missionWnd:find("sv_desc")
|
||||
--scrollBar.trackPos = 20000 -- move upward
|
||||
local scrollBar = missionWnd:find("sv_desc")
|
||||
--scrollBar.trackPos = 20000 -- move upward
|
||||
--scrollBar:updateCoords()
|
||||
--setOnDraw(missionWnd, "")
|
||||
local descWnd = missionWnd:find("desc")
|
||||
--setOnDraw(missionWnd, "")
|
||||
local descWnd = missionWnd:find("desc")
|
||||
local maxNumSteps = getDefine("ipj_nb_goal")
|
||||
local topStep
|
||||
for stepIndex = 0, maxNumSteps -1 do
|
||||
for stepIndex = 0, maxNumSteps -1 do
|
||||
local currStep = descWnd["step" .. tostring(stepIndex)]
|
||||
if currStep.active then
|
||||
topStep = currStep
|
||||
end
|
||||
end
|
||||
-- debugInfo("Found step : " .. topStep.hardtext)
|
||||
if topStep == nil then
|
||||
if topStep == nil then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
scrollBar:ensureVisible(topStep, "M", "M")
|
||||
|
||||
|
||||
--local wantedY = topStep.h_real / 2 - (descWnd.y_real - topStep.y_real)
|
||||
--local wantedY = descWnd.y_real + descWnd.h_real - topStep.y_real
|
||||
--local offsetY = wantedY - descWnd.max_h_real / 2
|
||||
--if offsetY < 0 then offsetY = 0 end
|
||||
--local wantedY = descWnd.y_real + descWnd.h_real - topStep.y_real
|
||||
--local offsetY = wantedY - descWnd.max_h_real / 2
|
||||
--if offsetY < 0 then offsetY = 0 end
|
||||
--descWnd.ofsy = offsetY
|
||||
--descWnd:invalidateCoords()
|
||||
--descWnd:updateCoords()
|
||||
|
||||
setOnDraw(missionWnd, "")
|
||||
|
||||
setOnDraw(missionWnd, "")
|
||||
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
|
@ -1606,9 +1606,9 @@ end
|
|||
|
||||
function game:addRpJob(jobtype, id, value, rpjobs)
|
||||
local base_path = "ui:interface:info_player_skills:content:rpjobs:rpjob_"..jobtype.."_"..id..":rpjob_"..jobtype.."_infos_"..id
|
||||
|
||||
|
||||
local group = getUI("ui:interface:info_player_skills:content:rpjobs:rpjob_"..jobtype.."_"..id)
|
||||
|
||||
|
||||
if (value == nil) then
|
||||
group.active = false
|
||||
else
|
||||
|
@ -1618,16 +1618,16 @@ function game:addRpJob(jobtype, id, value, rpjobs)
|
|||
group.active = false
|
||||
else
|
||||
group.active = true
|
||||
|
||||
|
||||
local echelon_value = rpjobs[sitem][1]
|
||||
local quantity = rpjobs[sitem][2]
|
||||
|
||||
|
||||
local maxlevel = (echelon_value*6)-30
|
||||
|
||||
|
||||
if (quantity > maxlevel) then
|
||||
quantity = maxlevel
|
||||
end
|
||||
|
||||
|
||||
local base = getUI(base_path..":t")
|
||||
base.hardtext = i18n.get(name):toUtf8()
|
||||
local ui = getUI(base_path..":icon")
|
||||
|
@ -1657,7 +1657,7 @@ function game:getRPJobs()
|
|||
rpjobs_elementary = {}
|
||||
rpjobs_roleplay = {}
|
||||
rpjobs = {}
|
||||
|
||||
|
||||
for i = 0, 499, 1 do
|
||||
local sheet = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":SHEET")
|
||||
if (sheet ~= 0) then
|
||||
|
@ -1665,7 +1665,7 @@ function game:getRPJobs()
|
|||
if (string.sub(name, 0, 6) == "rpjob_") then
|
||||
local quality = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":QUALITY")
|
||||
local quantity = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":QUANTITY")
|
||||
|
||||
|
||||
if (name == "rpjob_advanced.sitem") then
|
||||
table.insert(rpjobs_advanced, quality)
|
||||
else
|
||||
|
@ -1688,7 +1688,7 @@ function game:getRPJobs()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for id=1,2,1 do
|
||||
game:addRpJob("advanced", id, rpjobs_advanced[id], rpjobs)
|
||||
end
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
-- create the game namespace without reseting if already created in an other file.
|
||||
if (outgame==nil) then
|
||||
outgame= {};
|
||||
if (outgame == nil) then
|
||||
outgame = {}
|
||||
end
|
||||
|
||||
|
||||
|
@ -20,15 +20,13 @@ end
|
|||
|
||||
-- Fyros
|
||||
function outgame:getFyrosFirstName()
|
||||
local nbFyrosFirstNames = 0;
|
||||
for _ in pairs(fyrosFirstNames) do nbFyrosFirstNames = nbFyrosFirstNames + 1 end
|
||||
local nbFyrosFirstNames = #fyrosFirstNames
|
||||
|
||||
return fyrosFirstNames[math.random(nbFyrosFirstNames)]
|
||||
end
|
||||
|
||||
function outgame:getFyrosLastName()
|
||||
local nbFyrosLastNames = 0;
|
||||
for _ in pairs(fyrosLastNames) do nbFyrosLastNames = nbFyrosLastNames + 1 end
|
||||
local nbFyrosLastNames = #fyrosLastNames
|
||||
|
||||
return fyrosLastNames[math.random(nbFyrosLastNames)]
|
||||
end
|
||||
|
@ -36,98 +34,97 @@ end
|
|||
-- Matis
|
||||
function outgame:getMatisFirstName(sex)
|
||||
-- 1 = male, 2 = female
|
||||
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX");
|
||||
local dbNameSex = getDbProp("UI:TEMP:NAME_SEX")
|
||||
|
||||
if sex ~= nil then
|
||||
dbNameSex = sex;
|
||||
dbNameSex = sex
|
||||
end
|
||||
|
||||
local FirstName = ""
|
||||
if tonumber(dbNameSex) == 1 then
|
||||
local nbMatisMaleFirstNames = 0;
|
||||
for _ in pairs(matisMaleFirstNames) do nbMatisMaleFirstNames = nbMatisMaleFirstNames + 1 end
|
||||
FirstName = matisMaleFirstNames[math.random(nbMatisMaleFirstNames)];
|
||||
local nbMatisMaleFirstNames = #matisMaleFirstNames
|
||||
FirstName = matisMaleFirstNames[math.random(nbMatisMaleFirstNames)]
|
||||
else
|
||||
local nbMatisFemaleFirstNames = 0;
|
||||
for _ in pairs(matisFemaleFirstNames) do nbMatisFemaleFirstNames = nbMatisFemaleFirstNames + 1 end
|
||||
FirstName = matisFemaleFirstNames[math.random(nbMatisFemaleFirstNames)];
|
||||
local nbMatisFemaleFirstNames = #matisFemaleFirstNames
|
||||
FirstName = matisFemaleFirstNames[math.random(nbMatisFemaleFirstNames)]
|
||||
end
|
||||
|
||||
return FirstName;
|
||||
return FirstName
|
||||
end
|
||||
|
||||
function outgame:getMatisLastName()
|
||||
|
||||
local nbMatisLastNames = 0;
|
||||
for _ in pairs(matisLastNames) do nbMatisLastNames = nbMatisLastNames + 1 end
|
||||
local nbMatisLastNames = #matisLastNames
|
||||
|
||||
return matisLastNames[math.random(nbMatisLastNames)]
|
||||
end
|
||||
|
||||
-- Tryker
|
||||
function outgame:getTrykerFirstName()
|
||||
local nbTrykerFirstNames = 0;
|
||||
for _ in pairs(trykerFirstNames) do nbTrykerFirstNames = nbTrykerFirstNames + 1 end
|
||||
local nbTrykerFirstNames = #trykerFirstNames
|
||||
|
||||
return trykerFirstNames[math.random(nbTrykerFirstNames)]
|
||||
end
|
||||
|
||||
function outgame:getTrykerLastName()
|
||||
local nbTrykerLastNames = 0;
|
||||
for _ in pairs(trykerLastNames) do nbTrykerLastNames = nbTrykerLastNames + 1 end
|
||||
local nbTrykerLastNames = #trykerLastNames
|
||||
|
||||
return trykerLastNames[math.random(nbTrykerLastNames)]
|
||||
end
|
||||
|
||||
-- Zoraï
|
||||
function outgame:getZoraiFirstName()
|
||||
local nbFirstNamesOne = 0;
|
||||
for _ in pairs(zoraiFirstNamesOne) do nbFirstNamesOne = nbFirstNamesOne + 1 end
|
||||
local FirstNameOne = zoraiFirstNamesOne[math.random(nbFirstNamesOne)];
|
||||
local nbFirstNamesOne = #zoraiFirstNamesOne
|
||||
local FirstNameOne = zoraiFirstNamesOne[math.random(nbFirstNamesOne)]
|
||||
|
||||
local nbFirstNamesTwo = 0;
|
||||
for _ in pairs(zoraiFirstNamesTwo) do nbFirstNamesTwo = nbFirstNamesTwo + 1 end
|
||||
local FirstNameTwo = zoraiFirstNamesTwo[math.random(nbFirstNamesTwo)];
|
||||
local nbFirstNamesTwo = #zoraiFirstNamesTwo
|
||||
local FirstNameTwo = zoraiFirstNamesTwo[math.random(nbFirstNamesTwo)]
|
||||
|
||||
return FirstNameOne .. "-" .. FirstNameTwo
|
||||
end
|
||||
|
||||
function outgame:getZoraiLastName()
|
||||
local nbLastNames = 0;
|
||||
for _ in pairs(zoraiLastNames) do nbLastNames = nbLastNames + 1 end
|
||||
local nbLastNames = #zoraiLastNames
|
||||
|
||||
return zoraiLastNames[math.random(nbLastNames)]
|
||||
end
|
||||
|
||||
function outgame:procGenerateName()
|
||||
local uiNameFull = getUI("ui:outgame:appear_name:name_full");
|
||||
local uiGenText = getUI("ui:outgame:appear_name:eb");
|
||||
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
|
||||
local dbNameSubRaceFirstName = getDbProp("UI:TEMP:NAME_SUB_RACE_FIRST_NAME");
|
||||
local dbNameSubRaceLastName = getDbProp("UI:TEMP:NAME_SUB_RACE_LAST_NAME");
|
||||
local uiNameFull = getUI("ui:outgame:appear_name:name_full")
|
||||
local uiGenText = getUI("ui:outgame:appear_name:eb")
|
||||
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE")
|
||||
local dbNameSubRaceFirstName = getDbProp("UI:TEMP:NAME_SUB_RACE_FIRST_NAME")
|
||||
local dbNameSubRaceLastName = getDbProp("UI:TEMP:NAME_SUB_RACE_LAST_NAME")
|
||||
|
||||
local nameResult = "";
|
||||
local fullnameResult = "";
|
||||
local nameResult = ""
|
||||
local fullnameResult = ""
|
||||
|
||||
-- Look at outgame:procUpdateNameRaceLabel() for the "race" list.
|
||||
-- fy ma try zo -->
|
||||
local firstName = "test2"
|
||||
local lastName = "test"
|
||||
|
||||
-- Fyros and Matis are using "first name, last name" order
|
||||
-- Trykers and Zoraïs are using "last name, first name" order
|
||||
if tonumber(dbNameRace) == 1 then
|
||||
-- Fyros
|
||||
firstName = self:getFyrosFirstName()
|
||||
lastName = self:getFyrosLastName()
|
||||
fullnameResult = firstName .. " " .. lastName
|
||||
elseif tonumber(dbNameRace) == 2 then
|
||||
-- Matis
|
||||
firstName = self:getMatisFirstName()
|
||||
lastName = self:getMatisLastName()
|
||||
fullnameResult = firstName .. " " .. lastName
|
||||
elseif tonumber(dbNameRace) == 3 then
|
||||
-- Tryker
|
||||
firstName = self:getTrykerFirstName()
|
||||
lastName = self:getTrykerLastName()
|
||||
fullnameResult = lastName .. " " .. firstName
|
||||
elseif tonumber(dbNameRace) == 4 then
|
||||
-- Zorai
|
||||
firstName = self:getZoraiFirstName()
|
||||
lastName = self:getZoraiLastName()
|
||||
fullnameResult = lastName .. " " .. firstName
|
||||
elseif tonumber(dbNameRace) == 5 then
|
||||
-- Maraudeurs
|
||||
|
||||
|
@ -163,97 +160,99 @@ function outgame:procGenerateName()
|
|||
-- Zorai
|
||||
lastName = self:getZoraiLastName()
|
||||
end
|
||||
|
||||
fullnameResult = firstName .. " " .. lastName
|
||||
end
|
||||
|
||||
fullnameResult = firstName .. " " .. lastName
|
||||
-- always use first name for character name
|
||||
nameResult = firstName
|
||||
|
||||
uiNameFull.hardtext = fullnameResult;
|
||||
uiNameFull.hardtext = fullnameResult
|
||||
|
||||
nameResult = string.gsub(nameResult, "'", "");
|
||||
nameResult = string.gsub(nameResult, " ", "");
|
||||
nameResult = string.gsub(nameResult, "-", "");
|
||||
nameResult = string.lower( nameResult );
|
||||
nameResult = nameResult:gsub("^%l", string.upper);
|
||||
uiGenText.input_string = nameResult;
|
||||
nameResult = string.gsub(nameResult, "'", "")
|
||||
nameResult = string.gsub(nameResult, " ", "")
|
||||
nameResult = string.gsub(nameResult, "-", "")
|
||||
nameResult = string.lower(nameResult)
|
||||
nameResult = nameResult:gsub("^%l", string.upper)
|
||||
uiGenText.input_string = nameResult
|
||||
end
|
||||
|
||||
-- Name sex slider update.
|
||||
function outgame:procUpdateNameSexLabel()
|
||||
local nameSexType = { "uiCP_Sex_Male", "uiCP_Sex_Female" }
|
||||
local uiNameSexText = getUI("ui:outgame:appear_name:name_sex_slider:name_sex");
|
||||
local uiNameSex = getDbProp("UI:TEMP:NAME_SEX");
|
||||
local uiNameSexText = getUI("ui:outgame:appear_name:name_sex_slider:name_sex")
|
||||
local uiNameSex = getDbProp("UI:TEMP:NAME_SEX")
|
||||
|
||||
tempstr = tostring(i18n.get(nameSexType[tonumber(uiNameSex)]));
|
||||
tempstr = string.lower(tempstr);
|
||||
tempstr = (tempstr:gsub("^%l", string.upper));
|
||||
tempstr = tostring(i18n.get(nameSexType[tonumber(uiNameSex)]))
|
||||
tempstr = string.lower(tempstr)
|
||||
tempstr = (tempstr:gsub("^%l", string.upper))
|
||||
|
||||
uiNameSexText.hardtext = tempstr;
|
||||
uiNameSexText.hardtext = tempstr
|
||||
end
|
||||
|
||||
-- Name race slider update.
|
||||
function outgame:procUpdateNameRaceLabel()
|
||||
local nameRaceType = { "Fyros", "Matis", "Tryker", "Zoraï", "uiCP_Maraudeur" }
|
||||
|
||||
local uiNameRaceText = getUI("ui:outgame:appear_name:name_race_slider:name_race");
|
||||
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE");
|
||||
local uiNameRaceText = getUI("ui:outgame:appear_name:name_race_slider:name_race")
|
||||
local dbNameRace = getDbProp("UI:TEMP:NAME_RACE")
|
||||
|
||||
local uiNameSexSlider = getUI("ui:outgame:appear_name:name_sex_slider");
|
||||
local uiNameSexSlider = getUI("ui:outgame:appear_name:name_sex_slider")
|
||||
|
||||
local uiNameSubRaceFirstNameSlider = getUI("ui:outgame:appear_name:name_sub_race_first_name_slider");
|
||||
local uiNameSubRaceLastNameSlider = getUI("ui:outgame:appear_name:name_sub_race_last_name_slider");
|
||||
local uiNameSubRaceFirstNameSlider = getUI("ui:outgame:appear_name:name_sub_race_first_name_slider")
|
||||
local uiNameSubRaceLastNameSlider = getUI("ui:outgame:appear_name:name_sub_race_last_name_slider")
|
||||
|
||||
local uiNameGenerate = getUI("ui:outgame:appear_name:generate");
|
||||
local uiNameGenerate = getUI("ui:outgame:appear_name:generate")
|
||||
-- Show/Hide sex slider
|
||||
|
||||
uiNameGenerate.y = "-50"
|
||||
if tonumber(dbNameRace) == 2 then
|
||||
uiNameSexSlider.active = true;
|
||||
uiNameSexSlider.active = true
|
||||
uiNameGenerate.y = "-65"
|
||||
else
|
||||
uiNameSexSlider.active = false;
|
||||
uiNameSexSlider.active = false
|
||||
end
|
||||
|
||||
-- Show/Hide sub race slider
|
||||
if tonumber(dbNameRace) == 5 then
|
||||
uiNameSubRaceFirstNameSlider.active = true;
|
||||
uiNameSubRaceLastNameSlider.active = true;
|
||||
uiNameSubRaceFirstNameSlider.active = true
|
||||
uiNameSubRaceLastNameSlider.active = true
|
||||
uiNameGenerate.y = "-105"
|
||||
else
|
||||
uiNameSubRaceFirstNameSlider.active = false;
|
||||
uiNameSubRaceLastNameSlider.active = false;
|
||||
uiNameSubRaceFirstNameSlider.active = false
|
||||
uiNameSubRaceLastNameSlider.active = false
|
||||
end
|
||||
|
||||
uiNameRaceText.hardtext = tostring(nameRaceType[tonumber(dbNameRace)]);
|
||||
uiNameRaceText.hardtext = tostring(nameRaceType[tonumber(dbNameRace)])
|
||||
end
|
||||
|
||||
|
||||
local matisF = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Female")) )):gsub("^%l", string.upper);
|
||||
local matisM = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Male")) )):gsub("^%l", string.upper);
|
||||
local matisF = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Female")) )):gsub("^%l", string.upper)
|
||||
local matisM = "Matis " .. (string.lower(tostring(i18n.get("uiCP_Sex_Male")) )):gsub("^%l", string.upper)
|
||||
|
||||
function outgame:procUpdateNameSubRaceFirstNameLabel()
|
||||
local nameSubRaceFirstNameType = { "Fyros", matisM, matisF, "Tryker", "Zoraï" }
|
||||
local uiNameSubRaceFirstNameText = getUI("ui:outgame:appear_name:name_sub_race_first_name_slider:name_race");
|
||||
local dbNameSubRaceFirstName = getDbProp("UI:TEMP:NAME_SUB_RACE_FIRST_NAME");
|
||||
local uiNameSubRaceFirstNameText = getUI("ui:outgame:appear_name:name_sub_race_first_name_slider:name_race")
|
||||
local dbNameSubRaceFirstName = getDbProp("UI:TEMP:NAME_SUB_RACE_FIRST_NAME")
|
||||
|
||||
uiNameSubRaceFirstNameText.hardtext= tostring(nameSubRaceFirstNameType[tonumber(dbNameSubRaceFirstName)]);
|
||||
uiNameSubRaceFirstNameText.hardtext= tostring(nameSubRaceFirstNameType[tonumber(dbNameSubRaceFirstName)])
|
||||
end
|
||||
|
||||
function outgame:procUpdateNameSubRaceLastNameLabel()
|
||||
local nameSubRaceLastNameType = { "Fyros", "Matis", "Tryker", "Zoraï" }
|
||||
local uiNameSubRaceLastNameText = getUI("ui:outgame:appear_name:name_sub_race_last_name_slider:name_race");
|
||||
local dbNameSubRaceLastName = getDbProp("UI:TEMP:NAME_SUB_RACE_LAST_NAME");
|
||||
local uiNameSubRaceLastNameText = getUI("ui:outgame:appear_name:name_sub_race_last_name_slider:name_race")
|
||||
local dbNameSubRaceLastName = getDbProp("UI:TEMP:NAME_SUB_RACE_LAST_NAME")
|
||||
|
||||
uiNameSubRaceLastNameText.hardtext= tostring(nameSubRaceLastNameType[tonumber(dbNameSubRaceLastName)]);
|
||||
uiNameSubRaceLastNameText.hardtext= tostring(nameSubRaceLastNameType[tonumber(dbNameSubRaceLastName)])
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
-- called to construct icons
|
||||
function outgame:activePackElement(id, icon)
|
||||
local uiDesc = getUI("ui:outgame:appear:job_options:options:desc");
|
||||
uiDesc['ico' .. tostring(id)].active= true;
|
||||
uiDesc['ico' .. tostring(id)].texture= icon;
|
||||
uiDesc['ico' .. tostring(id) .. 'txt'].active= true;
|
||||
local uiDesc = getUI("ui:outgame:appear:job_options:options:desc")
|
||||
uiDesc['ico' .. tostring(id)].active = true
|
||||
uiDesc['ico' .. tostring(id)].texture = icon
|
||||
uiDesc['ico' .. tostring(id) .. 'txt'].active = true
|
||||
end
|
||||
|
||||
|
||||
|
@ -261,13 +260,13 @@ end
|
|||
-- called to construct pack text
|
||||
function outgame:setPackJobText(id, spec)
|
||||
-- Set Pack content
|
||||
local uiPackText = getUI("ui:outgame:appear:job_options:options:desc:pack_" .. id);
|
||||
uiPackText.hardtext= "uiCP_Job_" .. id .. tostring(spec);
|
||||
local uiPackText = getUI("ui:outgame:appear:job_options:options:desc:pack_" .. id)
|
||||
uiPackText.hardtext= "uiCP_Job_" .. id .. tostring(spec)
|
||||
|
||||
-- Set specialization text
|
||||
local uiResText = getUI("ui:outgame:appear:job_options:options:result:res");
|
||||
local uiResText = getUI("ui:outgame:appear:job_options:options:result:res")
|
||||
if(spec==2) then
|
||||
uiResText.hardtext= "uiCP_Res_" .. id;
|
||||
uiResText.hardtext= "uiCP_Res_" .. id
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -275,63 +274,63 @@ end
|
|||
-- called to construct pack
|
||||
function outgame:buildActionPack()
|
||||
|
||||
local uiDesc = getUI("ui:outgame:appear:job_options:options:desc");
|
||||
local uiDesc = getUI("ui:outgame:appear:job_options:options:desc")
|
||||
if (uiDesc==nil) then
|
||||
return;
|
||||
return
|
||||
end
|
||||
|
||||
-- Reset All
|
||||
for i = 1,20 do
|
||||
uiDesc['ico' .. tostring(i)].active= false;
|
||||
uiDesc['ico' .. tostring(i) .. 'txt'].active= false;
|
||||
uiDesc['ico' .. tostring(i)].active = false
|
||||
uiDesc['ico' .. tostring(i) .. 'txt'].active = false
|
||||
end
|
||||
|
||||
-- Build Default Combat
|
||||
self:activePackElement(1, 'f1.tga'); -- Dagger
|
||||
self:activePackElement(2, 'f2.tga'); -- Accurate Attack
|
||||
self:activePackElement(1, 'f1.tga') -- Dagger
|
||||
self:activePackElement(2, 'f2.tga') -- Accurate Attack
|
||||
|
||||
-- Build Default Magic
|
||||
self:activePackElement(6, 'm2.tga'); -- Gloves
|
||||
self:activePackElement(7, 'm1.tga'); -- Acid
|
||||
self:activePackElement(6, 'm2.tga') -- Gloves
|
||||
self:activePackElement(7, 'm1.tga') -- Acid
|
||||
|
||||
-- Build Default Forage
|
||||
self:activePackElement(11, 'g1.tga'); -- Forage Tool
|
||||
self:activePackElement(12, 'g2.tga'); -- Basic Extract
|
||||
self:activePackElement(11, 'g1.tga') -- Forage Tool
|
||||
self:activePackElement(12, 'g2.tga') -- Basic Extract
|
||||
|
||||
-- Build Default Craft
|
||||
self:activePackElement(16, 'c2.tga'); -- Craft Tool
|
||||
self:activePackElement(17, 'c1.tga'); -- 50 raw mat
|
||||
self:activePackElement(18, 'c3.tga'); -- Craft Root
|
||||
self:activePackElement(19, 'c4.tga'); -- Boots Plan
|
||||
self:activePackElement(16, 'c2.tga') -- Craft Tool
|
||||
self:activePackElement(17, 'c1.tga') -- 50 raw mat
|
||||
self:activePackElement(18, 'c3.tga') -- Craft Root
|
||||
self:activePackElement(19, 'c4.tga') -- Boots Plan
|
||||
|
||||
-- Build Option
|
||||
if (getDbProp('UI:TEMP:JOB_FIGHT') == 2) then
|
||||
self:activePackElement(3, 'f3.tga'); -- Increase damage
|
||||
self:activePackElement(3, 'f3.tga') -- Increase damage
|
||||
elseif (getDbProp('UI:TEMP:JOB_MAGIC') == 2) then
|
||||
self:activePackElement(8, 'm5.tga'); -- Fear
|
||||
self:activePackElement(8, 'm5.tga') -- Fear
|
||||
elseif (getDbProp('UI:TEMP:JOB_FORAGE') == 2) then
|
||||
self:activePackElement(13, 'g3.tga'); -- Basic Prospection
|
||||
self:activePackElement(13, 'g3.tga') -- Basic Prospection
|
||||
elseif (getDbProp('UI:TEMP:JOB_CRAFT') == 2) then
|
||||
self:activePackElement(20, 'c6.tga'); -- Gloves Plan
|
||||
self:activePackElement(17, 'c5.tga'); -- Replace 17, with 100x RawMat
|
||||
self:activePackElement(20, 'c6.tga') -- Gloves Plan
|
||||
self:activePackElement(17, 'c5.tga') -- Replace 17, with 100x RawMat
|
||||
end
|
||||
|
||||
|
||||
-- Reset Text
|
||||
self:setPackJobText('F', 1);
|
||||
self:setPackJobText('M', 1);
|
||||
self:setPackJobText('G', 1);
|
||||
self:setPackJobText('C', 1);
|
||||
self:setPackJobText('F', 1)
|
||||
self:setPackJobText('M', 1)
|
||||
self:setPackJobText('G', 1)
|
||||
self:setPackJobText('C', 1)
|
||||
|
||||
-- Set correct text for specalized version
|
||||
if (getDbProp('UI:TEMP:JOB_FIGHT') == 2) then
|
||||
self:setPackJobText('F', 2);
|
||||
self:setPackJobText('F', 2)
|
||||
elseif (getDbProp('UI:TEMP:JOB_MAGIC') == 2) then
|
||||
self:setPackJobText('M', 2);
|
||||
self:setPackJobText('M', 2)
|
||||
elseif (getDbProp('UI:TEMP:JOB_FORAGE') == 2) then
|
||||
self:setPackJobText('G', 2);
|
||||
self:setPackJobText('G', 2)
|
||||
elseif (getDbProp('UI:TEMP:JOB_CRAFT') == 2) then
|
||||
self:setPackJobText('C', 2);
|
||||
self:setPackJobText('C', 2)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -91,7 +91,11 @@
|
|||
<action handler="set" params="target='ui:interface:gestion_windows:x'|value=div(sub(getprop('ui:interface:w'),getprop('ui:interface:gestion_windows:w')),2)" />
|
||||
<action handler="set" params="target='ui:interface:gestion_windows:y'|value=add(getprop('ui:interface:gestion_windows:h'),div(sub(getprop('ui:interface:h'),getprop('ui:interface:gestion_windows:h')),2))" />
|
||||
<action handler="set" params="target='ui:interface:gestion_windows:active'|value=@UI:TEMP:ACTIVE" />
|
||||
|
||||
|
||||
<!-- AppZone -->
|
||||
<action handler="set" params="target='ui:interface:appzone:active'|value=1" />
|
||||
<action handler="set" params="target='ui:interface:appzone:x'|value=div(sub(getprop('ui:interface:w'),getprop('ui:interface:appzone:w')),2)" />
|
||||
<action handler="set" params="target='ui:interface:appzone:y'|value=add(getprop('ui:interface:appzone:h'),2)" />
|
||||
</proc>
|
||||
|
||||
<proc id="proc_reset_interface">
|
||||
|
@ -470,4 +474,4 @@
|
|||
|
||||
</proc>
|
||||
|
||||
</interface_config>
|
||||
</interface_config>
|
||||
|
|
|
@ -109,7 +109,7 @@ function game.RingAccessPointFilter:validate()
|
|||
if config.Local == 1 then
|
||||
ucUrl = ucstring(NicoMagicURL) -- for test in local mode
|
||||
else
|
||||
ucUrl = getDynString(game.NpcWebPage.UrlTextId);
|
||||
ucUrl = getDynString(game.NpcWebPage.UrlTextId)
|
||||
end
|
||||
debugInfo(tostring(ucUrl))
|
||||
local utf8Url = ucUrl:toUtf8()
|
||||
|
|
|
@ -2,39 +2,39 @@
|
|||
------------------------------------------------------------------------------------------------------------
|
||||
-- create the game namespace without reseting if already created in an other file.
|
||||
if (game==nil) then
|
||||
game= {};
|
||||
game = {}
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--
|
||||
function game:getMilkoTooltipWithKey(prop, tooltip, tooltip_pushed, name, param)
|
||||
local tt;
|
||||
local tt
|
||||
|
||||
-- Check if button is toggled and choose the good tooltip
|
||||
if (prop ~= '' and tooltip_pushed ~= '') then
|
||||
local db = getDbProp(prop);
|
||||
local db = getDbProp(prop)
|
||||
if (db == 1) then
|
||||
tt = tooltip_pushed;
|
||||
tt = tooltip_pushed
|
||||
else
|
||||
tt = tooltip;
|
||||
tt = tooltip
|
||||
end
|
||||
else
|
||||
tt = tooltip;
|
||||
end
|
||||
|
||||
-- Get key shortcut
|
||||
local text = i18n.get(tt);
|
||||
local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)');
|
||||
local text = i18n.get(tt)
|
||||
local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)')
|
||||
|
||||
if (key ~= nil and key ~= '') then
|
||||
key = ' @{2F2F}(' .. key .. ')';
|
||||
text = concatUCString(text, key);
|
||||
key = ' @{2F2F}(' .. key .. ')'
|
||||
text = concatUCString(text, key)
|
||||
end
|
||||
|
||||
setContextHelpText(text);
|
||||
setContextHelpText(text)
|
||||
end
|
||||
|
||||
function game:taskbarDisableTooltip(ui)
|
||||
local uiGroup = getUI(ui);
|
||||
disableContextHelpForControl(uiGroup);
|
||||
local uiGroup = getUI(ui)
|
||||
disableContextHelpForControl(uiGroup)
|
||||
end
|
|
@ -1091,7 +1091,10 @@
|
|||
|
||||
<instance template="win_button" id="webig" color="UI:SAVE:WIN:COLORS:COM" text="uimwWebIG" posparent="fame" posref="BL TL" x="0" y="-4"
|
||||
pushflag="UI:VARIABLES:ISACTIVE:WEBIG" win_name="webig" />
|
||||
|
||||
|
||||
<instance template="win_button" id="appzone" color="UI:SAVE:WIN:COLORS:COM" text="uimwAppZone" posparent="webig" posref="BL TL" x="0" y="-4"
|
||||
pushflag="UI:VARIABLES:ISACTIVE:APPZONE" win_name="appzone" />
|
||||
|
||||
</group>
|
||||
<view type="bitmap" id="com_ico_back" posparent="communication" posref="TL TL" x="-22" y="22" texture="W_slot_categorie.tga" global_color="false" />
|
||||
<view type="bitmap" id="com_ico" posparent="com_ico_back" posref="MM MM" x="2" y="-2" texture="spe_com.tga" global_color="false" />
|
||||
|
|
161
code/ryzom/client/data/gamedev/interfaces_v3/webbrowser.lua
Normal file
161
code/ryzom/client/data/gamedev/interfaces_v3/webbrowser.lua
Normal file
|
@ -0,0 +1,161 @@
|
|||
|
||||
-- global
|
||||
WebBrowser = {
|
||||
template = "webig_browser",
|
||||
apps = {}
|
||||
}
|
||||
|
||||
function WebBrowser:openWindow(id, url)
|
||||
-- default value if url is not set
|
||||
url = url or "http://app.ryzom.com/"
|
||||
|
||||
local newWindow = false
|
||||
local app = self:findAppById(id)
|
||||
|
||||
if not app then
|
||||
app = {}
|
||||
app.id = id
|
||||
app.title = ""
|
||||
app.url = url
|
||||
-- getUI() object
|
||||
app.uiWindow = nil
|
||||
app.winid = "ui:interface:" .. id
|
||||
app.winw = 780
|
||||
app.winh = 500
|
||||
app.minimized = true
|
||||
app.activeUrl = ""
|
||||
|
||||
table.insert(self.apps, app)
|
||||
end
|
||||
|
||||
if not app.uiWindow then
|
||||
-- if there is window present (eg, 'webig'), then reuse it
|
||||
app.uiWindow = getUI(app.winid, false)
|
||||
if not app.uiWindow then
|
||||
app.uiWindow = createRootGroupInstance(self.template, app.id, {
|
||||
x = 0, y = 0, w = app.winw, h = app.winh, home = app.url,
|
||||
browse_redo = "ui:interface:" .. app.id .. ":browser:header_opened:browse_redo",
|
||||
browse_undo = "ui:interface:" .. app.id .. ":browser:header_opened:browse_undo",
|
||||
browse_refresh = "ui:interface:" .. app.id .. ":browser:header_opened:browse_refresh"
|
||||
})
|
||||
if not app.uiWindow then
|
||||
return
|
||||
end
|
||||
app.uiWindow:center()
|
||||
end
|
||||
|
||||
newWindow = true
|
||||
end
|
||||
|
||||
app.activeUrl = url
|
||||
|
||||
-- trigger on_open event
|
||||
if not app.uiWindow.opened then
|
||||
app.uiWindow.opened = true
|
||||
end
|
||||
|
||||
-- trigger on_active event
|
||||
if not app.uiWindow.active then
|
||||
app.uiWindow.active = true
|
||||
end
|
||||
|
||||
local html = app.uiWindow:find("html")
|
||||
html:browse(url)
|
||||
|
||||
setTopWindow(app.uiWindow)
|
||||
end
|
||||
|
||||
function WebBrowser:findAppById(id)
|
||||
for k,app in pairs(self.apps) do
|
||||
if app.id == id then
|
||||
return app
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function WebBrowser:findAppFromUiCaller()
|
||||
-- id = app123
|
||||
local id = getUICaller().id:match("ui:interface:([^:]*):?")
|
||||
local app = self:findAppById(id)
|
||||
if app then
|
||||
return app
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onActive()
|
||||
if app then
|
||||
self:restoreWindow(app)
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickHeaderClose()
|
||||
local app = self:findAppFromUiCaller()
|
||||
if app then
|
||||
self:saveWindow(app)
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickHeaderOpen()
|
||||
local app = self:findAppFromUiCaller()
|
||||
if app then
|
||||
self:restoreWindow(app)
|
||||
end
|
||||
end
|
||||
|
||||
-- save current window dimension and minimize window
|
||||
function WebBrowser:saveWindow(app)
|
||||
app.minimized = true
|
||||
app.winw = app.uiWindow.w
|
||||
app.winh = app.uiWindow.h
|
||||
-- minimize
|
||||
app.uiWindow.w = 150
|
||||
app.uiWindow.h = 0
|
||||
end
|
||||
|
||||
function WebBrowser:restoreWindow(app)
|
||||
if app.minimized then
|
||||
app.uiWindow.w = app.winw
|
||||
app.uiWindow.h = app.winh
|
||||
app.minimized = false
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickRedo()
|
||||
-- caller is :header_opened:browse_redo
|
||||
local uiWindow = getUICaller().parent.parent
|
||||
local html = uiWindow:find("html")
|
||||
if html ~= nil then
|
||||
runAH(nil, "browse_redo", "name=" .. html.id)
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickUndo()
|
||||
-- caller is :header_opened:browse_undo
|
||||
local uiWindow = getUICaller().parent.parent
|
||||
|
||||
local html = uiWindow:find("html")
|
||||
if html ~= nil then
|
||||
runAH(nil, "browse_undo", "name=" .. html.id)
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickRefresh()
|
||||
-- caller is :header_opened:browse_refresh
|
||||
local uiWindow = getUICaller().parent.parent
|
||||
|
||||
local html = uiWindow:find("html")
|
||||
if html ~= nil then
|
||||
html:refresh()
|
||||
end
|
||||
end
|
||||
|
||||
function WebBrowser:onClickHome()
|
||||
-- caller is :header_opened:browse_home
|
||||
local uiWindow = getUICaller().parent.parent
|
||||
|
||||
local html = uiWindow:find("html")
|
||||
if html ~= nil then
|
||||
html:browse("home")
|
||||
end
|
||||
end
|
|
@ -180,7 +180,7 @@ function webig:doRemoveDbSheetQuantity(sheet_list, ctrl)
|
|||
end
|
||||
end
|
||||
|
||||
--assert(nil, "RELOADABLE SCRIPT");
|
||||
--assert(nil, "RELOADABLE SCRIPT")
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6927,7 +6927,203 @@
|
|||
</group>
|
||||
</group>
|
||||
</template>
|
||||
<!-- html <hr> element -->
|
||||
|
||||
<!-- html browsing context -->
|
||||
<template name="webig_html"
|
||||
keep="true"
|
||||
home=""
|
||||
browse_redo=""
|
||||
browse_undo=""
|
||||
browse_refresh="">
|
||||
<group id="html"
|
||||
type="webig_html"
|
||||
posref="TL TL"
|
||||
home="#home"
|
||||
title_prefix=""
|
||||
sizeref="wh"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
background_color="0 0 0 255"
|
||||
error_color="255 240 48 255"
|
||||
link_color="240 155 100 255"
|
||||
text_color="210 210 210 255"
|
||||
h1_color="255 255 255 255"
|
||||
h2_color="255 255 255 255"
|
||||
h3_color="255 255 255 255"
|
||||
h4_color="255 255 255 255"
|
||||
h5_color="255 255 255 255"
|
||||
h6_color="255 255 255 255"
|
||||
text_font_size="10"
|
||||
h1_font_size="20"
|
||||
h2_font_size="18"
|
||||
h3_font_size="16"
|
||||
h4_font_size="14"
|
||||
h5_font_size="12"
|
||||
h6_font_size="12"
|
||||
paragraph_begin_space="12"
|
||||
multi_line_space_factor="0.25"
|
||||
td_begin_space="0"
|
||||
li_begin_space="4"
|
||||
ul_begin_space="12"
|
||||
li_indent="-10"
|
||||
ul_indent="30"
|
||||
checkbox_bitmap_normal="w_slot_on.tga"
|
||||
checkbox_bitmap_pushed="w_opacity_on.tga"
|
||||
checkbox_bitmap_over=""
|
||||
background_bitmap_view="background_bitmap"
|
||||
browse_next_time="false"
|
||||
form_text_area_group="edit_box_widget_multiline"
|
||||
browse_refresh="#browse_refresh"
|
||||
browse_undo="#browse_undo"
|
||||
browse_redo="#browse_redo"
|
||||
timeout="10">
|
||||
<group id="black"
|
||||
posref="BR BR"
|
||||
sizeref="hw"
|
||||
w="-10"
|
||||
h="-12"
|
||||
inherit_gc_alpha="true" />
|
||||
<instance template="inner_thin_border"
|
||||
posparent="black"
|
||||
inherit_gc_alpha="true " />
|
||||
<view id="background_bitmap"
|
||||
type="bitmap"
|
||||
posparent="black"
|
||||
posref="MM MM"
|
||||
sizeref="wh"
|
||||
w="-2"
|
||||
h="-2"
|
||||
inherit_gc_alpha="true"
|
||||
scale="true"
|
||||
texture="blank.tga"
|
||||
global_color="false" />
|
||||
<group id="text_list"
|
||||
type="list"
|
||||
fontsize="9"
|
||||
posref="TL TL"
|
||||
posparent="black"
|
||||
x="2"
|
||||
y="-2"
|
||||
space="0"
|
||||
sizeref="hw"
|
||||
w="-4"
|
||||
h="-4"
|
||||
maxelements="2000" />
|
||||
<ctrl id="scroll_bar"
|
||||
style="skin_scroll" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- html browser window -->
|
||||
<template name="webig_browser"
|
||||
keep="true"
|
||||
home=""
|
||||
w="480"
|
||||
h="400"
|
||||
browse_redo=""
|
||||
browse_undo=""
|
||||
browse_refresh="">
|
||||
<group id="browser"
|
||||
type="container"
|
||||
w="#w"
|
||||
h="#h"
|
||||
x="0"
|
||||
y="0"
|
||||
pop_max_w="2000"
|
||||
pop_max_h="2000"
|
||||
pop_min_w="64"
|
||||
pop_min_h="32"
|
||||
header_color="UI:SAVE:WIN:COLORS:COM"
|
||||
posref="TL TL"
|
||||
title=""
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
right_button="true"
|
||||
movable="true"
|
||||
lockable="true"
|
||||
active="true"
|
||||
openable="true"
|
||||
opened="true"
|
||||
resizer="true"
|
||||
on_active="lua"
|
||||
on_active_params="WebBrowser:onActive()">
|
||||
<group id="header_closed"
|
||||
w="64"
|
||||
h="16"
|
||||
posref="TL TL"
|
||||
on_active="lua"
|
||||
on_active_params="WebBrowser:onClickHeaderClose()" />
|
||||
<group id="header_opened"
|
||||
h="16"
|
||||
w="480"
|
||||
posref="TL TL"
|
||||
on_active="lua"
|
||||
on_active_params="WebBrowser:onClickHeaderOpen()">
|
||||
<ctrl style="text_button_header"
|
||||
id="browse_redo"
|
||||
button_type="push_button"
|
||||
posref="MR MR"
|
||||
x="-16"
|
||||
y="0"
|
||||
hardtext="uiBrowseRedoButton"
|
||||
tooltip="uittBrowseRedo"
|
||||
onclick_l="lua"
|
||||
params_l="WebBrowser:onClickRedo()"
|
||||
frozen="true" />
|
||||
<ctrl style="text_button_header"
|
||||
id="browse_undo"
|
||||
button_type="push_button"
|
||||
posparent="browse_redo"
|
||||
posref="ML MR"
|
||||
x="-4"
|
||||
y="0"
|
||||
hardtext="uiBrowseUndoButton"
|
||||
tooltip="uittBrowseUndo"
|
||||
onclick_l="lua"
|
||||
params_l="WebBrowser:onClickUndo()"
|
||||
frozen="true" />
|
||||
<ctrl style="text_button_header"
|
||||
id="browse_refresh"
|
||||
button_type="push_button"
|
||||
posparent="browse_undo"
|
||||
posref="ML MR"
|
||||
x="-4"
|
||||
y="0"
|
||||
hardtext="uiBrowseRefresh"
|
||||
tooltip="uittBrowseRefresh"
|
||||
onclick_l="lua"
|
||||
params_l="WebBrowser:onClickRefresh()"
|
||||
frozen="true" />
|
||||
<ctrl style="text_button_header"
|
||||
id="browse_home"
|
||||
button_type="push_button"
|
||||
posparent="browse_refresh"
|
||||
posref="ML MR"
|
||||
x="-4"
|
||||
y="0"
|
||||
hardtext="uiBrowseHome"
|
||||
tooltip="uittBrowseHome"
|
||||
onclick_l="lua"
|
||||
params_l="WebBrowser:onClickHome()" />
|
||||
</group>
|
||||
|
||||
<group id="content"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
posref="TL TL">
|
||||
<instance template="webig_html"
|
||||
home="#home"
|
||||
browse_redo="#browse_redo"
|
||||
browse_undo="#browse_undo"
|
||||
browse_refresh="#browse_refresh" />
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- html <hr> element -->
|
||||
<template name="html_hr"
|
||||
keep="true">
|
||||
|
|
|
@ -30,13 +30,6 @@
|
|||
#include <csignal>
|
||||
#endif
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
#include <stdio.h>
|
||||
#include <sys/resource.h>
|
||||
#include "nel/misc/dynloadlib.h"
|
||||
#include "app_bundle_utils.h"
|
||||
#endif
|
||||
|
||||
#include "nel/misc/debug.h"
|
||||
#include "nel/misc/command.h"
|
||||
#include "nel/net/tcp_sock.h"
|
||||
|
@ -226,23 +219,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
#endif // TEST_CRASH_COUNTER
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
struct rlimit rlp, rlp2, rlp3;
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &rlp);
|
||||
|
||||
rlp2.rlim_cur = 1024;
|
||||
rlp2.rlim_max = rlp.rlim_max;
|
||||
setrlimit(RLIMIT_NOFILE, &rlp2);
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &rlp3);
|
||||
nlinfo("rlimit before %d %d\n", rlp.rlim_cur, rlp.rlim_max);
|
||||
nlinfo("rlimit after %d %d\n", rlp3.rlim_cur, rlp3.rlim_max);
|
||||
|
||||
// add the bundle's plugins path as library search path (for nel drivers)
|
||||
CLibrary::addLibPath(getAppBundlePath() + "/Contents/PlugIns/nel/");
|
||||
#endif
|
||||
|
||||
#if defined(NL_OS_WINDOWS)
|
||||
|
||||
#ifdef TEST_CRASH_COUNTER
|
||||
|
@ -291,6 +267,10 @@ int main(int argc, char **argv)
|
|||
// TODO for Linux : splashscreen
|
||||
#endif
|
||||
|
||||
// initialize log
|
||||
initLog();
|
||||
|
||||
|
||||
// initialize patch manager and set the ryzom full path, before it's used
|
||||
CPatchManager *pPM = CPatchManager::getInstance();
|
||||
pPM->setRyzomFilename(Args.getProgramPath() + Args.getProgramName());
|
||||
|
|
|
@ -2223,6 +2223,7 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const
|
|||
#endif
|
||||
|
||||
std::string currentPath = CPath::standardizePath(CPath::getCurrentPath());
|
||||
std::string etcPath = CPath::standardizePath(getRyzomEtcPrefix());
|
||||
|
||||
// look in the current working directory first
|
||||
if (CFile::isExists(currentPath + defaultConfigFileName))
|
||||
|
@ -2232,13 +2233,14 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const
|
|||
else if (CFile::isExists(Args.getStartupPath() + defaultConfigFileName))
|
||||
p_name = Args.getStartupPath() + defaultConfigFileName;
|
||||
|
||||
// look in prefix path
|
||||
// look in application directory
|
||||
else if (CFile::isExists(defaultConfigPath + defaultConfigFileName))
|
||||
p_name = defaultConfigPath + defaultConfigFileName;
|
||||
|
||||
// if some client_default.cfg was found return true
|
||||
if (p_name.size())
|
||||
return true;
|
||||
// look in etc prefix path
|
||||
else if (!etcPath.empty() && CFile::isExists(etcPath + defaultConfigFileName))
|
||||
p_name = etcPath + defaultConfigFileName;
|
||||
|
||||
return false;
|
||||
// if some client_default.cfg was found return true
|
||||
return !p_name.empty();
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace NL3D
|
|||
|
||||
class CEntitySheet;
|
||||
class CEntityCL;
|
||||
class CAttackInfo;
|
||||
struct CAttackInfo;
|
||||
|
||||
class CItemSheet;
|
||||
|
||||
|
|
|
@ -569,7 +569,7 @@ void CLoginStateMachine::run()
|
|||
break;
|
||||
case st_disconnect:
|
||||
// Far TP part 2: disconnect from the FS and unload shard-specific data (called from farTPmainLoop())
|
||||
// FarTP.disconnectFromPreviousShard();
|
||||
FarTP.disconnectFromPreviousShard();
|
||||
|
||||
SM_BEGIN_EVENT_TABLE
|
||||
SM_EVENT(ev_connect, st_reconnect_fs);
|
||||
|
@ -1406,9 +1406,6 @@ void CFarTP::farTPmainLoop()
|
|||
{
|
||||
ConnectionReadySent = false;
|
||||
LoginSM.pushEvent(CLoginStateMachine::ev_far_tp_main_loop_entered);
|
||||
|
||||
disconnectFromPreviousShard();
|
||||
|
||||
uint nbRecoSelectCharReceived = 0;
|
||||
|
||||
bool welcomeWindow = true;
|
||||
|
|
|
@ -148,7 +148,7 @@ bool CCurlHttpClient::verifyServer(bool verify)
|
|||
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
|
||||
curl_easy_setopt(_Curl, CURLOPT_SSLCERTTYPE, "PEM");
|
||||
// would allow to provide the CA in memory instead of using CURLOPT_CAINFO, but needs to include and link OpenSSL
|
||||
if (curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function) == CURLE_NOT_BUILT_IN)
|
||||
if (curl_easy_setopt(_Curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function) != CURLE_OK)
|
||||
{
|
||||
nlwarning("Unable to support CURLOPT_SSL_CTX_FUNCTION, curl not compiled with OpenSSL ?");
|
||||
}
|
||||
|
|
|
@ -105,6 +105,12 @@ extern HINSTANCE HInstance;
|
|||
extern HWND SlashScreen;
|
||||
#endif // NL_OS_WINDOWS
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
#include <stdio.h>
|
||||
#include <sys/resource.h>
|
||||
#include "nel/misc/dynloadlib.h"
|
||||
#endif
|
||||
|
||||
#include "app_bundle_utils.h"
|
||||
|
||||
#include <new>
|
||||
|
@ -796,6 +802,65 @@ static bool addRyzomIconBitmap(const std::string &directory, vector<CBitmap> &bi
|
|||
}
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------
|
||||
// initLog :
|
||||
// Initialize the client.log file
|
||||
//---------------------------------------------------
|
||||
void initLog()
|
||||
{
|
||||
// Add a displayer for Debug Infos.
|
||||
createDebug();
|
||||
|
||||
// Client.Log displayer
|
||||
nlassert( !ErrorLog->getDisplayer("CLIENT.LOG") );
|
||||
CFileDisplayer *ClientLogDisplayer = new CFileDisplayer(getLogDirectory() + "client.log", true, "CLIENT.LOG");
|
||||
DebugLog->addDisplayer (ClientLogDisplayer);
|
||||
InfoLog->addDisplayer (ClientLogDisplayer);
|
||||
WarningLog->addDisplayer (ClientLogDisplayer);
|
||||
ErrorLog->addDisplayer (ClientLogDisplayer);
|
||||
AssertLog->addDisplayer (ClientLogDisplayer);
|
||||
|
||||
// Display the client version.
|
||||
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
struct rlimit rlp, rlp2, rlp3;
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &rlp);
|
||||
|
||||
rlim_t value = 1024;
|
||||
|
||||
rlp2.rlim_cur = std::min(value, rlp.rlim_max);
|
||||
rlp2.rlim_max = rlp.rlim_max;
|
||||
|
||||
if (setrlimit(RLIMIT_NOFILE, &rlp2))
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
{
|
||||
nlwarning("Unable to set rlimit with error: the specified limit is invalid");
|
||||
}
|
||||
else if (errno == EPERM)
|
||||
{
|
||||
nlwarning("Unable to set rlimit with error: the limit specified would have raised the maximum limit value and the caller is not the super-user");
|
||||
}
|
||||
else
|
||||
{
|
||||
nlwarning("Unable to set rlimit with error: unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &rlp3);
|
||||
nlinfo("rlimit before %llu %llu", (uint64)rlp.rlim_cur, (uint64)rlp.rlim_max);
|
||||
nlinfo("rlimit after %llu %llu", (uint64)rlp3.rlim_cur, (uint64)rlp3.rlim_max);
|
||||
|
||||
// add the bundle's plugins path as library search path (for nel drivers)
|
||||
if (CFile::isExists(getAppBundlePath() + "/Contents/PlugIns/nel"))
|
||||
{
|
||||
CLibrary::addLibPath(getAppBundlePath() + "/Contents/PlugIns/nel/");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
// prelogInit :
|
||||
// Initialize the application before login
|
||||
|
@ -848,21 +913,6 @@ void prelogInit()
|
|||
// Due to Bug #906, we disable the stl xml allocation
|
||||
// nlverify (xmlMemSetup (XmlFree4NeL, XmlMalloc4NeL, XmlRealloc4NeL, XmlStrdup4NeL) == 0);
|
||||
|
||||
// Add a displayer for Debug Infos.
|
||||
createDebug();
|
||||
|
||||
// Client.Log displayer
|
||||
nlassert( !ErrorLog->getDisplayer("CLIENT.LOG") );
|
||||
CFileDisplayer *ClientLogDisplayer = new CFileDisplayer(getLogDirectory() + "client.log", true, "CLIENT.LOG");
|
||||
DebugLog->addDisplayer (ClientLogDisplayer);
|
||||
InfoLog->addDisplayer (ClientLogDisplayer);
|
||||
WarningLog->addDisplayer (ClientLogDisplayer);
|
||||
ErrorLog->addDisplayer (ClientLogDisplayer);
|
||||
AssertLog->addDisplayer (ClientLogDisplayer);
|
||||
|
||||
// Display the client version.
|
||||
nlinfo("RYZOM VERSION : %s", getDebugVersion().c_str());
|
||||
|
||||
// Init the debug memory
|
||||
initDebugMemory();
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ namespace NLMISC
|
|||
class IProgressCallback;
|
||||
}
|
||||
|
||||
// Initialize the log
|
||||
void initLog();
|
||||
|
||||
// Initialize the application before login step
|
||||
void prelogInit();
|
||||
|
||||
|
|
|
@ -786,7 +786,7 @@ CInterface3DCharacter::~CInterface3DCharacter()
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DCharacter::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DCharacter::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
@ -808,7 +808,7 @@ bool CInterface3DCharacter::parse (xmlNodePtr cur, CInterface3DScene *parentGrou
|
|||
|
||||
_Char3D = new CCharacter3D;
|
||||
_Char3D->copyAnimation(copyAnim);
|
||||
_Char3D->init (parentGroup->getScene());
|
||||
_Char3D->init (dynamic_cast<CInterface3DScene*>(parentGroup)->getScene());
|
||||
_Char3D->setPos (pos.x, pos.y, pos.z);
|
||||
_Char3D->setRotEuler ( rot.x * ((float)(NLMISC::Pi / 180)),
|
||||
rot.y * ((float)(NLMISC::Pi / 180)),
|
||||
|
@ -1073,7 +1073,7 @@ CInterface3DIG::~CInterface3DIG()
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DIG::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DIG::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
@ -1095,8 +1095,8 @@ bool CInterface3DIG::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
|||
setRotX (_Rot.x);
|
||||
setRotY (_Rot.y);
|
||||
setRotZ (_Rot.z);
|
||||
_IG->addToScene (*parentGroup->getScene(), CViewRenderer::getInstance()->getDriver() );
|
||||
parentGroup->getScene()->setToGlobalInstanceGroup (_IG);
|
||||
_IG->addToScene (*dynamic_cast<CInterface3DScene*>(parentGroup)->getScene(), CViewRenderer::getInstance()->getDriver() );
|
||||
dynamic_cast<CInterface3DScene*>(parentGroup)->getScene()->setToGlobalInstanceGroup (_IG);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1235,7 +1235,7 @@ CInterface3DShape::~CInterface3DShape()
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DShape::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DShape::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
@ -1249,7 +1249,7 @@ bool CInterface3DShape::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
|||
ptr = xmlGetProp (cur, (xmlChar*)"name");
|
||||
if (ptr) _Name = toLower((const char*)ptr);
|
||||
|
||||
_Instance = parentGroup->getScene()->createInstance(_Name);
|
||||
_Instance = dynamic_cast<CInterface3DScene*>(parentGroup)->getScene()->createInstance(_Name);
|
||||
if (_Instance.empty())
|
||||
return false;
|
||||
|
||||
|
@ -1385,7 +1385,7 @@ void CInterface3DShape::setName (const std::string &ht)
|
|||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DCamera::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DCamera::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
@ -1422,12 +1422,12 @@ CInterface3DLight::~CInterface3DLight()
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DLight::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DLight::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
||||
_Light = parentGroup->getScene()->createPointLight();
|
||||
_Light = dynamic_cast<CInterface3DScene*>(parentGroup)->getScene()->createPointLight();
|
||||
|
||||
CXMLAutoPtr ptr((const char*)xmlGetProp (cur, (xmlChar*)"pos"));
|
||||
if (ptr) _Pos = convertVector(ptr);
|
||||
|
@ -1514,7 +1514,7 @@ CInterface3DFX::~CInterface3DFX()
|
|||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool CInterface3DFX::parse (xmlNodePtr cur, CInterface3DScene *parentGroup)
|
||||
bool CInterface3DFX::parse (xmlNodePtr cur, CInterfaceGroup *parentGroup)
|
||||
{
|
||||
if (!CInterfaceElement::parse(cur, parentGroup))
|
||||
return false;
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
CInterface3DCharacter();
|
||||
virtual ~CInterface3DCharacter();
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
|
||||
virtual void checkCoords();
|
||||
|
||||
|
@ -236,7 +236,7 @@ public:
|
|||
|
||||
virtual ~CInterface3DShape();
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
|
||||
NL3D::UInstance getShape() { return _Instance; }
|
||||
|
||||
|
@ -295,7 +295,7 @@ public:
|
|||
|
||||
virtual ~CInterface3DIG();
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
|
||||
NL3D::UInstanceGroup *getIG() { return _IG; }
|
||||
|
||||
|
@ -357,7 +357,7 @@ public:
|
|||
_Dist = 0;
|
||||
}
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
float getFOV() { return _FOV; }
|
||||
NLMISC::CVector getPos() { return _Pos; }
|
||||
NLMISC::CVector getTarget() { return _Target; }
|
||||
|
@ -436,7 +436,7 @@ public:
|
|||
|
||||
virtual ~CInterface3DLight();
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
|
||||
float getPosX() const { return _Pos.x; }
|
||||
float getPosY() const { return _Pos.y; }
|
||||
|
@ -498,7 +498,7 @@ public:
|
|||
|
||||
virtual ~CInterface3DFX();
|
||||
|
||||
virtual bool parse (xmlNodePtr cur, CInterface3DScene *parentGroup);
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
|
||||
virtual void checkCoords();
|
||||
|
||||
|
|
|
@ -2635,7 +2635,13 @@ public:
|
|||
{
|
||||
ucstring title;
|
||||
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
|
||||
pMenu->addLineAtIndex(5 + insertion_index, title+" @{T8}/"+s, "chat_target_selected", "dyn"+s, "dyn"+s);
|
||||
|
||||
// replace dynamic channel name and shortcut
|
||||
ucstring res = CI18N::get("uiFilterMenuDynamic");
|
||||
strFindReplace(res, "%channel", title);
|
||||
strFindReplace(res, "%shortcut", s);
|
||||
|
||||
pMenu->addLineAtIndex(5 + insertion_index, res, "chat_target_selected", "dyn"+s, "dyn"+s);
|
||||
insertion_index++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -779,7 +779,8 @@ void initLoginScreen()
|
|||
|
||||
ClientApp = ClientCfg.ConfigFile.getVar("Application").asString(0);
|
||||
|
||||
string l = ClientCfg.LastLogin;
|
||||
// give priority to login specified as argument
|
||||
string l = !LoginLogin.empty() ? LoginLogin:ClientCfg.LastLogin;
|
||||
|
||||
if(!l.empty())
|
||||
{
|
||||
|
|
|
@ -922,21 +922,23 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
|||
contentPrefix += "set RYZOM_CLIENT=\"%1\"\n";
|
||||
contentPrefix += "set UNPACKPATH=\"%2\"\n";
|
||||
contentPrefix += "set ROOTPATH=\"%3\"\n";
|
||||
contentPrefix += "set STARTUPPATH=\"%4\"\n";
|
||||
contentPrefix += toString("set UPGRADE_FILE=\"%%ROOTPATH%%\\%s\"\n", UpgradeBatchFilename.c_str());
|
||||
contentPrefix += "\n";
|
||||
contentPrefix += "set LOGIN=%4\n";
|
||||
contentPrefix += "set PASSWORD=%5\n";
|
||||
contentPrefix += "set SHARDID=%6\n";
|
||||
contentPrefix += "set LOGIN=%5\n";
|
||||
contentPrefix += "set PASSWORD=%6\n";
|
||||
contentPrefix += "set SHARDID=%7\n";
|
||||
#else
|
||||
contentPrefix += "#!/bin/sh\n";
|
||||
contentPrefix += "export RYZOM_CLIENT=$1\n";
|
||||
contentPrefix += "export UNPACKPATH=$2\n";
|
||||
contentPrefix += "export ROOTPATH=$3\n";
|
||||
contentPrefix += "export STARTUPPATH=$4\n";
|
||||
contentPrefix += toString("export UPGRADE_FILE=$ROOTPATH/%s\n", UpgradeBatchFilename.c_str());
|
||||
contentPrefix += "\n";
|
||||
contentPrefix += "LOGIN=$4\n";
|
||||
contentPrefix += "PASSWORD=$5\n";
|
||||
contentPrefix += "SHARDID=$6\n";
|
||||
contentPrefix += "LOGIN=$5\n";
|
||||
contentPrefix += "PASSWORD=$6\n";
|
||||
contentPrefix += "SHARDID=$7\n";
|
||||
#endif
|
||||
|
||||
contentPrefix += "\n";
|
||||
|
@ -958,7 +960,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
|||
if (wantRyzomRestart)
|
||||
{
|
||||
// client shouldn't be in memory anymore else it couldn't be overwritten
|
||||
contentSuffix += toString("start \"\" /D \"%%ROOTPATH%%\" \"%%RYZOM_CLIENT%%\" %s %%LOGIN%% %%PASSWORD%% %%SHARDID%%\n", additionalParams.c_str());
|
||||
contentSuffix += toString("start \"\" /D \"%%STARTUPPATH%%\" \"%%RYZOM_CLIENT%%\" %s %%LOGIN%% %%PASSWORD%% %%SHARDID%%\n", additionalParams.c_str());
|
||||
}
|
||||
#else
|
||||
if (wantRyzomRestart)
|
||||
|
@ -976,7 +978,7 @@ void CPatchManager::createBatchFile(CProductDescriptionForClient &descFile, bool
|
|||
if (wantRyzomRestart)
|
||||
{
|
||||
// change to previous client directory
|
||||
contentSuffix += "cd \"$ROOTPATH\"\n\n";
|
||||
contentSuffix += "cd \"$STARTUPPATH\"\n\n";
|
||||
|
||||
// launch new client
|
||||
contentSuffix += toString("\"$RYZOM_CLIENT\" %s $LOGIN $PASSWORD $SHARDID\n", additionalParams.c_str());
|
||||
|
@ -1017,10 +1019,25 @@ void CPatchManager::executeBatchFile()
|
|||
|
||||
std::string batchFilename;
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
|
||||
std::string startupPath = Args.getStartupPath();
|
||||
|
||||
// 3 first parameters are Ryzom client full path, patch directory full path and client root directory full path
|
||||
#ifdef NL_OS_WINDOWS
|
||||
batchFilename = CPath::standardizeDosPath(ClientRootPath);
|
||||
|
||||
arguments.push_back(CPath::standardizeDosPath(RyzomFilename));
|
||||
arguments.push_back(CPath::standardizeDosPath(ClientPatchPath));
|
||||
arguments.push_back(CPath::standardizeDosPath(ClientRootPath));
|
||||
arguments.push_back(CPath::standardizeDosPath(startupPath));
|
||||
#else
|
||||
batchFilename = ClientRootPath;
|
||||
|
||||
arguments.push_back(RyzomFilename);
|
||||
arguments.push_back(ClientPatchPath);
|
||||
arguments.push_back(ClientRootPath);
|
||||
arguments.push_back(startupPath);
|
||||
#endif
|
||||
|
||||
batchFilename += UpdateBatchFilename;
|
||||
|
@ -1028,19 +1045,6 @@ void CPatchManager::executeBatchFile()
|
|||
// make script executable
|
||||
CFile::setRWAccess(batchFilename);
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
|
||||
// 3 first parameters are Ryzom client full path, patch directory full path and client root directory full path
|
||||
#ifdef NL_OS_WINDOWS
|
||||
arguments.push_back(CPath::standardizeDosPath(RyzomFilename));
|
||||
arguments.push_back(CPath::standardizeDosPath(ClientPatchPath));
|
||||
arguments.push_back(CPath::standardizeDosPath(ClientRootPath));
|
||||
#else
|
||||
arguments.push_back(RyzomFilename);
|
||||
arguments.push_back(ClientPatchPath);
|
||||
arguments.push_back(ClientRootPath);
|
||||
#endif
|
||||
|
||||
// append login, password and shard
|
||||
if (!LoginLogin.empty())
|
||||
{
|
||||
|
|
|
@ -10,6 +10,6 @@ fi
|
|||
chmod +x "$ROOTPATH/ryzom_client"
|
||||
chmod +x "$ROOTPATH/crash_report"
|
||||
chmod +x "$ROOTPATH/ryzom_client_patcher"
|
||||
chmod +x "$ROOTPATH/ryzom_configuration"
|
||||
chmod +x "$ROOTPATH/ryzom_configuration_qt"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -405,8 +405,8 @@ IBackupServiceInterfaceImplementation::~IBackupServiceInterfaceImplementation()
|
|||
// backupInterfaceSingletonInstantiator
|
||||
//
|
||||
// This object provokes instantiation of our singleton at service startup
|
||||
// The instantiation of the signleton provokes registration in the singleton registry
|
||||
// menaing that the init() routine gets called properly in service init, etc.
|
||||
// The instantiation of the singleton provokes registration in the singleton registry
|
||||
// meaning that the init() routine gets called properly in service init, etc.
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
class CBackupInterfaceSingletonInstantiator
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
|
||||
/*bool write(char *filename)
|
||||
{
|
||||
FILE *outf=nlfopen(filename, "wb");
|
||||
FILE *outf=NLMISC::nlfopen(filename, "wb");
|
||||
if (outf==NULL)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ inline bool CMirroredDataSet::propIsList( TPropertyIndex propIndex ) const
|
|||
* Display the values of one property for all entities
|
||||
*/
|
||||
template <class T, class CPropLocationClass>
|
||||
inline void CMirroredDataSet::displayPropValues( TPropertyIndex propIndex, T* pt, NLMISC::CLog& log ) const
|
||||
inline void CMirroredDataSet::displayPropValues( TPropertyIndex propIndex, T* /* pt */, NLMISC::CLog& log ) const
|
||||
{
|
||||
// std::stringstream ss;
|
||||
// ss << "Mirror property " << propIndex << ":" << endl;
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
void addTaskAt(T t, CTask<T>* task) { task->setTime(t); _Tasks.push_back(task);_Clean = false; }
|
||||
uint32 getSize() const { return (uint32)_Tasks.size(); }
|
||||
CTask<T>* getTaskAt(uint32 index) const { nlassert( index < _Tasks.size()); return _Tasks[index].getTask();}
|
||||
void removeTaskAt(uint32 index){ nlassert( index < _Tasks.size()); _Tasks.erase(_Tasks.begin() + index); };
|
||||
void removeTaskAt(uint32 index){ nlassert( index < _Tasks.size()); _Tasks.erase(_Tasks.begin() + index); }
|
||||
|
||||
|
||||
// Waiting task are discared
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "nel/misc/singleton.h"
|
||||
#include <time.h>
|
||||
#include "nel/misc/path.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/net/module.h"
|
||||
#include "nel/net/module_builder_parts.h"
|
||||
#include "nel/net/unified_network.h"
|
||||
|
@ -297,7 +298,7 @@ namespace ADMIN
|
|||
|
||||
// read the persistent state file if any
|
||||
string filename = CPath::standardizePath(IService::getInstance()->SaveFilesDirectory.toString(), true)+AESPersistentStateFilename;
|
||||
FILE *fp = fopen(filename.c_str(), "rt");
|
||||
FILE *fp = nlfopen(filename, "rt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
char buffer[1024];
|
||||
|
@ -567,7 +568,7 @@ namespace ADMIN
|
|||
if (now > _LastNagiosReport+_NagiosReportDelay)
|
||||
{
|
||||
// write the nagios report
|
||||
FILE *fp = fopen("aes_nagios_report.txt", "wt");
|
||||
FILE *fp = nlfopen("aes_nagios_report.txt", "wt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
// output the current date
|
||||
|
@ -632,7 +633,7 @@ namespace ADMIN
|
|||
{
|
||||
/// The persistent service orders need to be saved
|
||||
string filename = CPath::standardizePath(IService::getInstance()->SaveFilesDirectory.toString(), true)+AESPersistentStateFilename;
|
||||
FILE *fp = fopen(filename.c_str(), "wt");
|
||||
FILE *fp = nlfopen(filename, "wt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
{
|
||||
|
@ -801,7 +802,7 @@ namespace ADMIN
|
|||
std::string getOfflineServiceState(const std::string& serviceAlias)
|
||||
{
|
||||
// open the file for reading
|
||||
FILE* f= fopen(getServiceStateFileName(serviceAlias).c_str(),"rt");
|
||||
FILE* f= nlfopen(getServiceStateFileName(serviceAlias), "rt");
|
||||
if (f==NULL) return "STOPPED";
|
||||
|
||||
// setup a buffer to hold the text read from the file
|
||||
|
@ -825,7 +826,7 @@ namespace ADMIN
|
|||
uint32 getOfflineServicePID(const std::string& serviceAlias)
|
||||
{
|
||||
// open the file for reading
|
||||
FILE* f= fopen(getServicePIDFileName(serviceAlias).c_str(),"rt");
|
||||
FILE* f = nlfopen(getServicePIDFileName(serviceAlias), "rt");
|
||||
if (f==NULL) return 0;
|
||||
|
||||
// setup a buffer to hold the text read from the file
|
||||
|
@ -853,7 +854,7 @@ namespace ADMIN
|
|||
uint32 getServiceStartLoopCounter(const std::string& serviceAlias)
|
||||
{
|
||||
// open the file for reading
|
||||
FILE* f= fopen(getServiceLoopCounterFileName(serviceAlias).c_str(),"rt");
|
||||
FILE* f= nlfopen(getServiceLoopCounterFileName(serviceAlias), "rt");
|
||||
if (f==NULL)
|
||||
return 0;
|
||||
|
||||
|
@ -936,7 +937,7 @@ namespace ADMIN
|
|||
NLMISC::CFile::createDirectoryTree(path);
|
||||
|
||||
// open the file for writing
|
||||
FILE* f= fopen(getServiceLaunchCtrlFileName(serviceAlias, path, deferred).c_str(),"wt");
|
||||
FILE* f = nlfopen(getServiceLaunchCtrlFileName(serviceAlias, path, deferred).c_str(),"wt");
|
||||
if (f==NULL) return false;
|
||||
|
||||
// write the text to the file
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "nel/misc/types_nl.h"
|
||||
#include <time.h>
|
||||
#include "nel/misc/file.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/sstring.h"
|
||||
#include "nel/misc/mutable_container.h"
|
||||
#include "nel/net/service.h"
|
||||
|
@ -195,7 +196,7 @@ namespace ADMIN
|
|||
|
||||
// read the persistent state file if any
|
||||
string filename = CPath::standardizePath(IService::getInstance()->SaveFilesDirectory.toString(), true)+ASPersistentStateFilename;
|
||||
FILE *fp = fopen(filename.c_str(), "rt");
|
||||
FILE *fp = nlfopen(filename, "rt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
char buffer[1024];
|
||||
|
@ -232,7 +233,7 @@ namespace ADMIN
|
|||
if (_NeedToWriteStateFile)
|
||||
{
|
||||
string filename = CPath::standardizePath(IService::getInstance()->SaveFilesDirectory.toString(), true)+ASPersistentStateFilename;
|
||||
FILE *fp = fopen(filename.c_str(), "wt");
|
||||
FILE *fp = nlfopen(filename, "wt");
|
||||
if (fp != NULL)
|
||||
{
|
||||
CSString line;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "nel/misc/command.h"
|
||||
#include "nel/misc/variable.h"
|
||||
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/aabbox.h"
|
||||
#include "nel/misc/vector.h"
|
||||
#include "nel/misc/vectord.h"
|
||||
|
@ -1979,7 +1980,7 @@ public:
|
|||
CBMP4Image<2,2>::SHdr imageHdr(imageWidth, imageHeight);
|
||||
CBMP4Image<2,2>::SPalette imagePalette;
|
||||
|
||||
FILE *outf = fopen((OutputPath+name+".bmp").c_str(),"wb");
|
||||
FILE *outf = nlfopen(OutputPath+name+".bmp", "wb");
|
||||
|
||||
if (outf == NULL)
|
||||
return;
|
||||
|
@ -2095,8 +2096,8 @@ public:
|
|||
CBMP4Image<2,2>::SHdr imageHdr(imageWidth, imageHeight);
|
||||
CBMP4Image<2,2>::SPalette imagePalette;
|
||||
|
||||
FILE *outf = fopen((OutputPath+name+".bmp").c_str(),"wb");
|
||||
FILE *outfh = fopen((OutputPath+name+"_hm.bmp").c_str(),"wb");
|
||||
FILE *outf = nlfopen(OutputPath+name+".bmp", "wb");
|
||||
FILE *outfh = nlfopen(OutputPath+name+"_hm.bmp", "wb");
|
||||
|
||||
if (outf == NULL)
|
||||
return;
|
||||
|
|
|
@ -183,7 +183,7 @@ std::string CAIScriptDataManager::dirname()
|
|||
// string fullfilename = dirname() + "/" + name + ".ai_script_data";
|
||||
// if (!CFile::fileExists(fullfilename) || CFile::getFileSize(fullfilename)==0)
|
||||
// {
|
||||
// FILE* fp = fopen(fullfilename.c_str(), "w");
|
||||
// FILE* fp = nlfopen(fullfilename, "w");
|
||||
// if (fp)
|
||||
// {
|
||||
// fprintf(fp, "// This file contains data for the AI script\n");
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "entities_game_service.h"
|
||||
#include "egs_globals.h"
|
||||
#include "nel/misc/noise_value.h"
|
||||
#include "nel/misc/common.h"
|
||||
#include "nel/misc/variable.h"
|
||||
#include "nel/misc/words_dictionary.h"
|
||||
#include "game_share/time_weather_season/time_date_season_manager.h"
|
||||
|
@ -587,7 +588,7 @@ void CDeposit::selectRMsByFilters( std::vector<std::string>& exactRMCodesS, cons
|
|||
if ( ! depositReportCreated )
|
||||
{
|
||||
depositReportCreated = true;
|
||||
depositReportFile = fopen( "deposit_contents.csv", "wt" ); // fclose() auto?
|
||||
depositReportFile = nlfopen( "deposit_contents.csv", "wt" ); // fclose() auto?
|
||||
if ( depositReportFile )
|
||||
{
|
||||
fprintf( depositReportFile, "Deposit;RM;When in year;When in day;Weather;\n" );
|
||||
|
|
|
@ -2564,8 +2564,7 @@ void CGameItem::dumpGameItemStats( const string& fileName )
|
|||
{
|
||||
if( !fileName.empty() )
|
||||
{
|
||||
FILE * f;
|
||||
f = fopen(fileName.c_str(),"w");
|
||||
FILE *f = nlfopen(fileName, "w");
|
||||
|
||||
if(f)
|
||||
{
|
||||
|
|
|
@ -791,7 +791,7 @@ void CGameItemManager::destroyItem( CGameItemPtr &ptr )
|
|||
//void CGameItemManager::dumpGameItemList( const string& fileName )
|
||||
//{
|
||||
// FILE * f;
|
||||
// f = fopen(fileName.c_str(),"w");
|
||||
// f = nlfopen(fileName, "w");
|
||||
//
|
||||
// if(f)
|
||||
// {
|
||||
|
|
|
@ -1240,8 +1240,8 @@ bool forageTestDoExtract(
|
|||
}
|
||||
|
||||
// Request and output results
|
||||
FILE *f = fopen( std::string(getLogDirectory() + "forage_test.csv").c_str(), "at" );
|
||||
FILE *f2 = fopen( std::string(getLogDirectory() + "forage_test.log").c_str(), "at" );
|
||||
FILE *f = nlfopen(getLogDirectory() + "forage_test.csv", "at" );
|
||||
FILE *f2 = nlfopen(getLogDirectory() + "forage_test.log", "at" );
|
||||
float reqS = 1.0f / (reqPeriod * 10.0f);
|
||||
float req [CHarvestSource::NbPosRTProps];
|
||||
float abs [CHarvestSource::NbPosRTProps];
|
||||
|
|
|
@ -1884,13 +1884,13 @@ void CDepositMapsBatchTask::run()
|
|||
if ( ! CFile::isExists( pathName ) )
|
||||
CFile::createDirectory( pathName );
|
||||
pathName += "/";
|
||||
FILE *outputF = fopen( (pathName + "deposit_maps.html").c_str(), "w" );
|
||||
FILE *outputF = nlfopen(pathName + "deposit_maps.html", "w");
|
||||
if ( ! outputF )
|
||||
{
|
||||
nlwarning( "Can't create file %sdeposit_maps.html", pathName.c_str() );
|
||||
return;
|
||||
}
|
||||
FILE *inputF = fopen( _InputFilename.c_str(), "r" );
|
||||
FILE *inputF = nlfopen(_InputFilename, "r");
|
||||
if ( ! inputF )
|
||||
{
|
||||
fprintf( outputF, "File %s not found", _InputFilename.c_str() );
|
||||
|
|
|
@ -192,7 +192,7 @@ void CCDBSynchronised::write( const string& fileName )
|
|||
if ( _DataStructRoot )
|
||||
{
|
||||
TWriteCallbackArg wca;
|
||||
wca.F = fopen( fileName.c_str(),"w" );
|
||||
wca.F = nlfopen(fileName, "w");
|
||||
wca.Container = &_DataContainer;
|
||||
ICDBStructNode::CTextId id;
|
||||
_DataStructRoot->foreachLeafCall( cbWrite, id, &wca );
|
||||
|
|
|
@ -102,11 +102,11 @@ void CPlayer::checkCrashMarker()
|
|||
if (!CFile::isExists(LastLoadFileName))
|
||||
{
|
||||
// create the file if needed
|
||||
nlverify(LastLoad = fopen(LastLoadFileName, "wb"));
|
||||
nlverify(LastLoad = nlfopen(LastLoadFileName, "wb"));
|
||||
fclose(LastLoad);
|
||||
}
|
||||
|
||||
nlverify(LastLoad = fopen(LastLoadFileName, "r+b"));
|
||||
nlverify(LastLoad = nlfopen(LastLoadFileName, "r+b"));
|
||||
|
||||
// check
|
||||
uint32 lastBad[2];
|
||||
|
|
|
@ -118,7 +118,7 @@ void CSession::log(const NLMISC::CSString& lang,const NLMISC::CSString& txt)
|
|||
nlassert(!fileName.empty());
|
||||
|
||||
nlinfo("Opening new log file: %s",fileName.c_str());
|
||||
_Files[lang]= fopen(fileName.c_str(),"wb");
|
||||
_Files[lang]= nlfopen(fileName, "wb");
|
||||
DROP_IF(_Files[lang]==NULL,"Failed to open log file for writing: "+fileName,return);
|
||||
}
|
||||
fprintf(_Files[lang],"%s\n",txt.c_str());
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue