Merge with develop

This commit is contained in:
kervala 2015-12-07 19:14:55 +01:00
commit 5a8b6a7993
6 changed files with 53 additions and 38 deletions

View file

@ -33,6 +33,7 @@
#include "view.h" // For the cameraDistance funtion #include "view.h" // For the cameraDistance funtion
#include "user_entity.h" #include "user_entity.h"
#include "misc.h" #include "misc.h"
#include "user_agent.h"
// 3D Interface. // 3D Interface.
#include "nel/3d/u_driver.h" #include "nel/3d/u_driver.h"
@ -40,10 +41,6 @@
// Game Share. // Game Share.
#include "game_share/time_weather_season/time_and_season.h" #include "game_share/time_weather_season/time_and_season.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif // HAVE_CONFIG_H
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
#include "app_bundle_utils.h" #include "app_bundle_utils.h"
#endif // NL_OS_MAC #endif // NL_OS_MAC
@ -1977,10 +1974,10 @@ void CClientConfig::init(const string &configFileName)
if (varPtr) if (varPtr)
{ {
string str = varPtr->asString (); string str = varPtr->asString ();
if (str != RYZOM_VERSION && ClientCfg.SaveConfig) if (str != getVersion() && ClientCfg.SaveConfig)
{ {
nlinfo ("Update and save the ClientVersion variable in config file %s -> %s", str.c_str(), RYZOM_VERSION); nlinfo ("Update and save the ClientVersion variable in config file %s -> %s", str.c_str(), getVersion().c_str());
varPtr->setAsString (RYZOM_VERSION); varPtr->setAsString (getVersion());
ClientCfg.ConfigFile.save (); ClientCfg.ConfigFile.save ();
} }
} }
@ -2194,12 +2191,12 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
// on mac, client_default.cfg should be searched in .app/Contents/Resources/ // on mac, client_default.cfg should be searched in .app/Contents/Resources/
defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/"); defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/");
#elif defined(RYZOM_ETC_PREFIX) #elif defined(NL_OS_UNIX)
// if RYZOM_ETC_PREFIX is defined, client_default.cfg might be over there // if RYZOM_ETC_PREFIX is defined, client_default.cfg might be over there
defaultConfigPath = CPath::standardizePath(RYZOM_ETC_PREFIX); if (!getRyzomEtcPrefix().empty()) defaultConfigPath = CPath::standardizePath(getRyzomEtcPrefix());
#else #else
// some other prefix here :) // some other prefix here :)
#endif // RYZOM_ETC_PREFIX #endif // NL_OS_UNIX
// look in the current working directory first // look in the current working directory first
if (CFile::isExists(defaultConfigFileName)) if (CFile::isExists(defaultConfigFileName))

View file

@ -99,10 +99,7 @@
#include "far_tp.h" #include "far_tp.h"
#include "zone_util.h" #include "zone_util.h"
#include "nel/gui/lua_manager.h" #include "nel/gui/lua_manager.h"
#include "user_agent.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
// //
@ -690,10 +687,10 @@ NLMISC_COMMAND(bugReport, "Call the bug report tool with dump", "<AddScreenshot>
sys += "AttachedFile "+filename+" "; sys += "AttachedFile "+filename+" ";
} }
sys += "ClientVersion "RYZOM_VERSION" "; sys += NLMISC::toString("ClientVersion %s ", getVersion().c_str());
// for now, set the same version than client one // for now, set the same version than client one
sys += "ShardVersion "RYZOM_VERSION" "; sys += NLMISC::toString("ShardVersion %s ", getVersion().c_str());
if (ClientCfg.Local) if (ClientCfg.Local)
sys += "ShardName OFFLINE "; sys += "ShardName OFFLINE ";

View file

@ -95,14 +95,6 @@
#include "browse_faq.h" #include "browse_faq.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef RYZOM_CLIENT_ICON
#define RYZOM_CLIENT_ICON "ryzom_client"
#endif
// XMLLib // XMLLib
#include <libxml/xmlmemory.h> #include <libxml/xmlmemory.h>
@ -682,8 +674,8 @@ void addSearchPaths(IProgressCallback &progress)
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX) #elif defined(NL_OS_UNIX)
defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX)); if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
#endif #endif
// add in last position, a specific possibly read only directory // add in last position, a specific possibly read only directory
@ -727,8 +719,9 @@ void addPreDataPaths(NLMISC::IProgressCallback &progress)
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources"); defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX) #elif defined(NL_OS_UNIX)
defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX)); defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX));
if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
#endif #endif
// add in last position, a specific possibly read only directory // add in last position, a specific possibly read only directory
@ -767,7 +760,7 @@ static bool addRyzomIconBitmap(const std::string &directory, vector<CBitmap> &bi
if (CFile::isDirectory(directory)) if (CFile::isDirectory(directory))
{ {
// build filename from directory and default ryzom client icon name // build filename from directory and default ryzom client icon name
std::string filename = NLMISC::toString("%s/%s.png", directory.c_str(), RYZOM_CLIENT_ICON); std::string filename = NLMISC::toString("%s/%s.png", directory.c_str(), getRyzomClientIcon().c_str());
if (CFile::fileExists(filename)) if (CFile::fileExists(filename))
{ {

View file

@ -43,6 +43,10 @@
#define RYZOM_SYSTEM "unknown" #define RYZOM_SYSTEM "unknown"
#endif #endif
#ifndef RYZOM_CLIENT_ICON
#define RYZOM_CLIENT_ICON "ryzom_client"
#endif
std::string getUserAgent() std::string getUserAgent()
{ {
return getUserAgentName() + "/" + getUserAgentVersion(); return getUserAgentName() + "/" + getUserAgentVersion();
@ -114,3 +118,18 @@ bool isStereoAvailable()
return false; return false;
#endif #endif
} }
std::string getRyzomClientIcon()
{
return RYZOM_CLIENT_ICON;
}
std::string getRyzomEtcPrefix()
{
return RYZOM_ETC_PREFIX;
}
std::string getRyzomSharePrefix()
{
return RYZOM_SHARE_PREFIX;
}

View file

@ -27,6 +27,10 @@ std::string getDebugVersion();
bool isStereoAvailable(); bool isStereoAvailable();
std::string getRyzomClientIcon();
std::string getRyzomEtcPrefix();
std::string getRyzomSharePrefix();
#endif // CL_USER_AGENT_H #endif // CL_USER_AGENT_H
/* End of user_agent.h */ /* End of user_agent.h */

View file

@ -1,11 +1,16 @@
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom_client.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop") IF(RYZOM_ETC_PREFIX STREQUAL ".")
# in case of local client, only copy 48x48 icon
INSTALL(FILES ryzom_48x48.png DESTINATION ${RYZOM_ETC_PREFIX} RENAME ${RYZOM_CLIENT_ICON}.png)
ELSE()
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom_client.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop" DESTINATION share/applications) INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop" DESTINATION share/applications)
INSTALL(FILES ryzom_client.png DESTINATION share/pixmaps) INSTALL(FILES ryzom_client.png DESTINATION share/pixmaps)
INSTALL(FILES ryzom_client.xpm DESTINATION share/pixmaps) INSTALL(FILES ryzom_client.xpm DESTINATION share/pixmaps)
INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ${RYZOM_CLIENT_ICON}.png)
INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ${RYZOM_CLIENT_ICON}.png)
INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ${RYZOM_CLIENT_ICON}.png)
INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ${RYZOM_CLIENT_ICON}.png)
INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ${RYZOM_CLIENT_ICON}.png)
INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ${RYZOM_CLIENT_ICON}.png) INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ${RYZOM_CLIENT_ICON}.png)
ENDIF()