Changed: #1135 Merge changes from Ryzom patch 1.10

hg/feature/sound
kervala 14 years ago
parent 95e24bab2c
commit 22c276cf24

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

@ -227,6 +227,9 @@ function game:updateTargetConsiderUI()
local wgImpossible = targetWindow:find("impossible") local wgImpossible = targetWindow:find("impossible")
local wgSlotRing = targetWindow:find("slot_ring") local wgSlotRing = targetWindow:find("slot_ring")
local wgToolTip = targetWindow:find("target_tooltip") local wgToolTip = targetWindow:find("target_tooltip")
local wgPvPTag = targetWindow:find("pvp_tags")
local wgHeader = targetWindow:find("header_opened")
wgTargetSlotForce.active = true wgTargetSlotForce.active = true
wgImpossible.active = true wgImpossible.active = true
@ -236,28 +239,38 @@ function game:updateTargetConsiderUI()
wgTargetLevel.active = false wgTargetLevel.active = false
wgImpossible.active = false wgImpossible.active = false
wgSlotRing.active = false wgSlotRing.active = false
if (isTargetUser()) then if (isTargetUser() and twIsPlayerInPVPMode()) then
wgToolTip.tooltip = "" wgToolTip.tooltip = ""
wgPvPTag.active = true
wgHeader.h = 56;
else else
wgPvPTag.active = false
wgHeader.h = 34;
wgToolTip.tooltip = i18n.get("uittConsiderTargetNoSelection") wgToolTip.tooltip = i18n.get("uittConsiderTargetNoSelection")
end end
return return
end end
local pvpMode = false local pvpMode = false
wgPvPTag.active = false
wgHeader.h = 34;
-- if the selection is a player, then both the local & targeted player must be in PVP mode for the level to be displayed -- if the selection is a player, then both the local & targeted player must be in PVP mode for the level to be displayed
if twIsTargetPlayer() then if (twIsTargetPlayer()) then
-- don't display anything ... -- don't display anything ...
wgTargetSlotForce.active = false
wgTargetLevel.active = false wgTargetLevel.active = false
wgImpossible.active = false wgImpossible.active = false
wgSlotRing.active = false wgSlotRing.active = false
wgToolTip.tooltip = "" wgToolTip.tooltip = ""
wgTargetSlotForce.color = "128 128 128 255" if twIsTargetInPVPMode() then
debugInfo("target in pvp")
wgPvPTag.active = true
wgHeader.h = 56;
end
return return
end end
-- depending on the number of people in the group, set the max diff for visibility between player level -- depending on the number of people in the group, set the max diff for visibility between player level
-- & creature level (x 10 per member) -- & creature level (x 10 per member)
local maxDiffLevel = 10 local maxDiffLevel = 10

@ -181,7 +181,7 @@
min_w="182" min_w="182"
max_w="182" max_w="182"
min_h="56" min_h="56"
max_h="56" max_h="82"
resizer="false" resizer="false"
global_color="false" global_color="false"
global_color_over="true" global_color_over="true"
@ -209,15 +209,15 @@
<group id="header_opened" <group id="header_opened"
x="0" x="0"
y="0" y="0"
h="32" h="56"
posref="TL TL" posref="TL TL"
group_onclick_r="active_menu" group_onclick_r="active_menu"
group_params_r="menu=ui:interface:base_menu_with_color"> group_params_r="menu=ui:interface:base_menu_with_color">
<view type="text" <view type="text"
id="target_title" id="target_title"
posref="BL BL" posref="TL TL"
x="0" x="0"
y="0" y="-20"
color="255 255 255 255" color="255 255 255 255"
global_color="true" global_color="true"
fontsize="11" fontsize="11"
@ -290,9 +290,73 @@
h="0" h="0"
tooltip_parent="win" /> tooltip_parent="win" />
</group> </group>
<group id="pvp_tags"
x="10"
y="-42"
w="164"
h="24"
posref="TL TL">
<!-- new Jauges -->
<view type="bitmap"
id="tag_1"
posref="TL TL"
posparent="pvp_tags"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
<view type="bitmap"
id="tag_0"
posref="TR TL"
posparent="tag_1"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
<view type="bitmap"
id="tag_2"
posref="TR TL"
posparent="tag_0"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
<view type="bitmap"
id="tag_3"
posref="TR TL"
posparent="tag_2"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
<view type="bitmap"
id="tag_4"
posref="TR TL"
posparent="tag_3"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
<view type="bitmap"
id="tag_6"
posref="TR TL"
posparent="tag_4"
x="2"
y="0"
texture="alpha_10.tga"
global_color="false"
inherit_gc_alpha="false" />
</group>
<group id="content" <group id="content"
x="0" x="0"
y="-2" y="-26"
w="164" w="164"
h="20" h="20"
posref="TL TL"> posref="TL TL">
@ -316,6 +380,7 @@
tooltip="uittTargetHp" tooltip="uittTargetHp"
tooltip_parent="win" /> tooltip_parent="win" />
</group> </group>
<!-- when the level of the player change, we should update the consider widget, so add an observer to each of its skills --> <!-- when the level of the player change, we should update the consider widget, so add an observer to each of its skills -->
<link expr="depends(@SERVER:USER:SKILL_POINTS_0:VALUE)" <link expr="depends(@SERVER:USER:SKILL_POINTS_0:VALUE)"
action="lua" action="lua"

@ -584,7 +584,7 @@ CClientConfig::CClientConfig()
CameraDistance = 3.0f; CameraDistance = 3.0f;
CameraDistStep = 1.0f; CameraDistStep = 1.0f;
CameraDistMin = 1.0f; CameraDistMin = 1.0f;
CameraDistMax = 5.0f; CameraDistMax = 100.0f;
DmCameraDistMax = 25.0f; DmCameraDistMax = 25.0f;
CameraAccel = 0.2f; CameraAccel = 0.2f;
CameraSpeedMin = 0.2f; CameraSpeedMin = 0.2f;

@ -376,7 +376,7 @@ NLMISC_COMMAND(dumpShapePos, "Dump Last Added Shape Pos.", "")
NLMISC_COMMAND(clearShape, "Remove all shapes added with the 'shape' command.", "") NLMISC_COMMAND(clearShape, "Remove all shapes added with the 'shape' command.", "")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /*if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -384,7 +384,7 @@ NLMISC_COMMAND(clearShape, "Remove all shapes added with the 'shape' command.",
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if (ShapeAddedByCommand.empty()) if (ShapeAddedByCommand.empty())
@ -408,7 +408,7 @@ NLMISC_COMMAND(clearShape, "Remove all shapes added with the 'shape' command.",
NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "<x coordinate>") NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "<x coordinate>")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /*if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -416,7 +416,7 @@ NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "<x coordina
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if (args.size() != 1) return false; if (args.size() != 1) return false;
@ -452,7 +452,7 @@ NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "<x coordina
NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "<y coordinate>") NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "<y coordinate>")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /*if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -460,7 +460,7 @@ NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "<y coordina
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if (args.size() != 1) return false; if (args.size() != 1) return false;
@ -496,7 +496,7 @@ NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "<y coordina
NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "<z coordinate>") NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "<z coordinate>")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /*if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -504,7 +504,7 @@ NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "<z coordina
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if (args.size() != 1) return false; if (args.size() != 1) return false;
@ -541,7 +541,7 @@ NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "<z coordina
NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "<angle>") NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "<angle>")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /*if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -549,7 +549,7 @@ NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "<ang
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if (args.size() != 1) return false; if (args.size() != 1) return false;
@ -584,7 +584,7 @@ NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "<ang
NLMISC_COMMAND(shape, "Add a shape in the scene.", "<shape file>") NLMISC_COMMAND(shape, "Add a shape in the scene.", "<shape file>")
{ {
#if FINAL_VERSION #if FINAL_VERSION
if (!hasPrivilegeDEV() && /* if (!hasPrivilegeDEV() &&
!hasPrivilegeSGM() && !hasPrivilegeSGM() &&
!hasPrivilegeGM() && !hasPrivilegeGM() &&
!hasPrivilegeVG() && !hasPrivilegeVG() &&
@ -592,7 +592,7 @@ NLMISC_COMMAND(shape, "Add a shape in the scene.", "<shape file>")
!hasPrivilegeG() && !hasPrivilegeG() &&
!hasPrivilegeEM() && !hasPrivilegeEM() &&
!hasPrivilegeEG()) !hasPrivilegeEG())
return true; return true;*/
#endif // FINAL_VERSION #endif // FINAL_VERSION
if(args.size() < 1) if(args.size() < 1)

@ -520,9 +520,17 @@ bool CEntityManager::removeInstances()
Scene->deleteInstance(_ShapeInstances[i].Instance); Scene->deleteInstance(_ShapeInstances[i].Instance);
} }
_ShapeInstances.clear(); _ShapeInstances.clear();
_InstancesRemoved = true;
return true; return true;
} }
bool CEntityManager::instancesRemoved()
{
bool instRemoved = _InstancesRemoved;
_InstancesRemoved = false;
return instRemoved;
}
CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float y) CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float y)
{ {
CShapeInstanceReference selectedInstance(UInstance(), string(""), string("")); CShapeInstanceReference selectedInstance(UInstance(), string(""), string(""));

@ -128,6 +128,7 @@ private:
/// Shapes Instances caches /// Shapes Instances caches
std::vector<CShapeInstanceReference> _ShapeInstances; std::vector<CShapeInstanceReference> _ShapeInstances;
bool _InstancesRemoved;
typedef struct typedef struct
{ {
@ -202,6 +203,7 @@ public:
CShapeInstanceReference createInstance(const string& shape, const CVector &pos, const string &text, const string &url, bool active=true); CShapeInstanceReference createInstance(const string& shape, const CVector &pos, const string &text, const string &url, bool active=true);
bool removeInstances(); bool removeInstances();
bool instancesRemoved();
CShapeInstanceReference getShapeInstanceUnderPos(float x, float y); CShapeInstanceReference getShapeInstanceUnderPos(float x, float y);
/** /**

@ -2529,17 +2529,24 @@ NLMISC::CRGBA CEntityCL::getColor () const
} }
// ally // ally
if (isAlly()) if (isAlly())
{
if (getPvpMode() & PVP_MODE::PvpFactionFlagged)
{ {
if (isInTeam()) if (isInTeam())
return _PvpAllyInTeamColor; return _PvpAllyInTeamColor;
if(isInGuild()) if(isInGuild())
return _PvpAllyInGuildColor; return _PvpAllyInGuildColor;
if (getPvpMode()&PVP_MODE::PvpFactionFlagged)
return _PvpAllyColor; return _PvpAllyColor;
}
else else
{
if (isInTeam())
return CRGBA(min(255, _PvpAllyInTeamColor.R+150), min(255, _PvpAllyInTeamColor.G+150), min(255, _PvpAllyInTeamColor.B+150),_PvpAllyInTeamColor.A);
if(isInGuild())
return CRGBA(min(255, _PvpAllyInGuildColor.R+150), min(255, _PvpAllyInGuildColor.G+150), min(255, _PvpAllyInGuildColor.B+150),_PvpAllyInGuildColor.A);
return CRGBA(min(255, _PvpAllyColor.R+150), min(255, _PvpAllyColor.G+150), min(255, _PvpAllyColor.B+150),_PvpAllyColor.A); return CRGBA(min(255, _PvpAllyColor.R+150), min(255, _PvpAllyColor.G+150), min(255, _PvpAllyColor.B+150),_PvpAllyColor.A);
} }
}
// neutral // neutral
if (isInTeam()) if (isInTeam())
return _GroupColor; return _GroupColor;

@ -2373,8 +2373,8 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS)
{ {
CCDBNodeLeaf *color = dbBranch->getLeaf( setup.SrcSheet->getSheet()+":USER_COLOR", false ); CCDBNodeLeaf *color = dbBranch->getLeaf( setup.SrcSheet->getSheet()+":USER_COLOR", false );
cs.VisualPropA.PropertySubData.ArmModel = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::ARMS_SLOT ); cs.VisualPropA.PropertySubData.ArmModel = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::ARMS_SLOT );
cs.VisualPropA.PropertySubData.ArmColor = color->getValue32();
SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs); SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs);
SCharacter3DSetup::setDB("UI:TEMP:CHAR3D:VPA:ARMCOLOR", pIS->Color);
//cs.VisualPropA.PropertySubData.ArmColor = pIS->Color; //cs.VisualPropA.PropertySubData.ArmColor = pIS->Color;
camHeight = -0.55f; camHeight = -0.55f;
} }
@ -2406,11 +2406,17 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS)
else if (pIS->Family == ITEMFAMILY::SHIELD) else if (pIS->Family == ITEMFAMILY::SHIELD)
{ {
cs.VisualPropA.PropertySubData.WeaponLeftHand = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::LEFT_HAND_SLOT ); cs.VisualPropA.PropertySubData.WeaponLeftHand = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::LEFT_HAND_SLOT );
CItemSheet *pES = SheetMngr.getItem(SLOTTYPE::RIGHT_HAND_SLOT, cs.VisualPropA.PropertySubData.WeaponRightHand);
if (pES->ItemType == ITEM_TYPE::TWO_HAND_AXE || pES->ItemType == ITEM_TYPE::TWO_HAND_MACE || pES->ItemType == ITEM_TYPE::TWO_HAND_SWORD ||
pES->ItemType == ITEM_TYPE::MAGICIAN_STAFF || pES->ItemType == ITEM_TYPE::AUTOLAUCH || pES->ItemType == ITEM_TYPE::LAUNCHER || pES->ItemType == ITEM_TYPE::RIFLE)
cs.VisualPropA.PropertySubData.WeaponRightHand = 0;
SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs); SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs);
} }
else if (pIS->Family == ITEMFAMILY::MELEE_WEAPON || pIS->Family == ITEMFAMILY::RANGE_WEAPON) else if (pIS->Family == ITEMFAMILY::MELEE_WEAPON || pIS->Family == ITEMFAMILY::RANGE_WEAPON)
{ {
cs.VisualPropA.PropertySubData.WeaponRightHand = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::RIGHT_HAND_SLOT ); cs.VisualPropA.PropertySubData.WeaponRightHand = CVisualSlotManager::getInstance()->sheet2Index( CSheetId(setup.SrcSheet->getSheetId()), SLOTTYPE::RIGHT_HAND_SLOT );
cs.VisualPropA.PropertySubData.WeaponLeftHand = 0;
SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs); SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs);
} }
else else

@ -100,7 +100,7 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img)
if (NLMISC::CFile::fileExists(dest)) if (NLMISC::CFile::fileExists(dest))
{ {
CFile::setRWAccess(dest); CFile::setRWAccess(dest);
NLMISC::CFile::deleteFile(dest.c_str()); NLMISC::CFile::deleteFile(dest);
} }
FILE *fp = fopen (dest.c_str(), "wb"); FILE *fp = fopen (dest.c_str(), "wb");
if (fp == NULL) if (fp == NULL)
@ -111,7 +111,7 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img)
curl_easy_setopt(curl, CURLOPT_FILE, fp); curl_easy_setopt(curl, CURLOPT_FILE, fp);
curl_multi_add_handle(MultiCurl, curl); curl_multi_add_handle(MultiCurl, curl);
Curls.push_back(CDataDownload(curl, url, fp, ImgType, img)); Curls.push_back(CDataDownload(curl, url, fp, ImgType, img, ""));
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("adding handle %x, %d curls", curl, Curls.size()); nlwarning("adding handle %x, %d curls", curl, Curls.size());
#endif #endif
@ -145,8 +145,8 @@ string CGroupHTML::localBnpName(const string &url)
return dest; return dest;
} }
// Add a bnp download request in the multi_curl // Add a bnp download request in the multi_curl, return true if already downloaded
void CGroupHTML::addBnpDownload(const string &url, const string &action) bool CGroupHTML::addBnpDownload(const string &url, const string &action, const string &script)
{ {
// Search if we are not already downloading this url. // Search if we are not already downloading this url.
for(uint i = 0; i < Curls.size(); i++) for(uint i = 0; i < Curls.size(); i++)
@ -156,13 +156,13 @@ void CGroupHTML::addBnpDownload(const string &url, const string &action)
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("already downloading '%s'", url.c_str()); nlwarning("already downloading '%s'", url.c_str());
#endif #endif
return; return false;
} }
} }
CURL *curl = curl_easy_init(); CURL *curl = curl_easy_init();
if (!MultiCurl || !curl) if (!MultiCurl || !curl)
return; return false;
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
@ -177,7 +177,11 @@ void CGroupHTML::addBnpDownload(const string &url, const string &action)
if (action == "override" || action == "delete") if (action == "override" || action == "delete")
{ {
CFile::setRWAccess(dest); CFile::setRWAccess(dest);
NLMISC::CFile::deleteFile(dest.c_str()); NLMISC::CFile::deleteFile(dest);
}
else
{
return true;
} }
} }
if (action != "delete") if (action != "delete")
@ -186,17 +190,18 @@ void CGroupHTML::addBnpDownload(const string &url, const string &action)
if (fp == NULL) if (fp == NULL)
{ {
nlwarning("Can't open file '%s' for writing: code=%d '%s'", dest.c_str (), errno, strerror(errno)); nlwarning("Can't open file '%s' for writing: code=%d '%s'", dest.c_str (), errno, strerror(errno));
return; return false;
} }
curl_easy_setopt(curl, CURLOPT_FILE, fp); curl_easy_setopt(curl, CURLOPT_FILE, fp);
curl_multi_add_handle(MultiCurl, curl); curl_multi_add_handle(MultiCurl, curl);
Curls.push_back(CDataDownload(curl, url, fp, BnpType, NULL)); Curls.push_back(CDataDownload(curl, url, fp, BnpType, NULL, script));
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("adding handle %x, %d curls", curl, Curls.size()); nlwarning("adding handle %x, %d curls", curl, Curls.size());
#endif #endif
RunningCurls++; RunningCurls++;
} }
return false;
} }
void CGroupHTML::initBnpDownload() void CGroupHTML::initBnpDownload()
@ -316,8 +321,6 @@ void CGroupHTML::checkDownloads()
{ {
if (lookupLocalFile (finalUrl, file.c_str(), false)) if (lookupLocalFile (finalUrl, file.c_str(), false))
{ {
nlinfo("BNPCHECK : downloaded");
bool memoryCompressed = CPath::isMemoryCompressed(); bool memoryCompressed = CPath::isMemoryCompressed();
if (memoryCompressed) if (memoryCompressed)
{ {
@ -329,7 +332,8 @@ void CGroupHTML::checkDownloads()
CPath::memoryCompress(); CPath::memoryCompress();
} }
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->executeLuaScript("game:onBnpDownloadFinish()", true); pIM->executeLuaScript(_ObjectScript, true);
_ObjectScript = "";
} }
} }
} }
@ -1367,6 +1371,7 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c
_ObjectMD5Sum = value[HTML_OBJECT_ID]; _ObjectMD5Sum = value[HTML_OBJECT_ID];
if (present[HTML_OBJECT_STANDBY] && value[HTML_OBJECT_STANDBY]) if (present[HTML_OBJECT_STANDBY] && value[HTML_OBJECT_STANDBY])
_ObjectAction = value[HTML_OBJECT_STANDBY]; _ObjectAction = value[HTML_OBJECT_STANDBY];
_Object = true;
break; break;
} }
@ -1494,10 +1499,15 @@ void CGroupHTML::endElement (uint element_number)
{ {
if (!_ObjectData.empty()) if (!_ObjectData.empty())
{ {
addBnpDownload(_ObjectData, _ObjectAction); if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript))
{
CInterfaceManager *pIM = CInterfaceManager::getInstance();
pIM->executeLuaScript(_ObjectScript, true);
} }
} }
} }
_Object = false;
}
} }
} }
@ -2101,6 +2111,10 @@ void CGroupHTML::addString(const ucstring &str)
{ {
_TextAreaContent += tmpStr; _TextAreaContent += tmpStr;
} }
else if (_Object)
{
_ObjectScript += tmpStr.toString();
}
else if (_SelectOption) else if (_SelectOption)
{ {
if (!(_Forms.empty())) if (!(_Forms.empty()))
@ -2447,9 +2461,18 @@ CCtrlButton *CGroupHTML::addButton(CCtrlButton::EType type, const std::string &/
if (tooltip) if (tooltip)
{ {
if (CI18N::hasTranslation(tooltip)) if (CI18N::hasTranslation(tooltip))
{
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip)); ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
//ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString());
}
else else
{
ctrlButton->setDefaultContextHelp(ucstring(tooltip)); ctrlButton->setDefaultContextHelp(ucstring(tooltip));
//ctrlButton->setOnContextHelp(string(tooltip));
}
ctrlButton->setInstantContextHelp(true);
ctrlButton->setToolTipParent(TTMouse);
} }
getParagraph()->addChild (ctrlButton); getParagraph()->addChild (ctrlButton);
@ -2486,6 +2509,7 @@ void CGroupHTML::clearContext()
_CellParams.clear(); _CellParams.clear();
_Title = false; _Title = false;
_TextArea = false; _TextArea = false;
_Object = false;
_Localize = false; _Localize = false;
// TR // TR

@ -293,8 +293,8 @@ protected :
// the script to execute // the script to execute
std::string _LuaScript; std::string _LuaScript;
bool _ParsingBnpUrl; bool _Object;
std::string _BnpUrl; std::string _ObjectScript;
// Someone is conecting. We got problem with libwww : 2 connection requests can deadlock the client. // Someone is conecting. We got problem with libwww : 2 connection requests can deadlock the client.
static CGroupHTML *_ConnectingLock; static CGroupHTML *_ConnectingLock;
@ -488,6 +488,7 @@ protected :
std::string _ObjectData; std::string _ObjectData;
std::string _ObjectMD5Sum; std::string _ObjectMD5Sum;
std::string _ObjectAction; std::string _ObjectAction;
std::string _TextAreaScript;
// Get last char // Get last char
ucchar getLastChar() const; ucchar getLastChar() const;
@ -539,9 +540,14 @@ private:
struct CDataDownload struct CDataDownload
{ {
CDataDownload(CURL *c, const std::string &u, FILE *f, TDataType t, CViewBase *i) : curl(c), url(u), fp(f), type(t) { imgs.push_back(i); } CDataDownload(CURL *c, const std::string &u, FILE *f, TDataType t, CViewBase *i, const std::string &s) : curl(c), url(u), luaScript(s), type(t), fp(f)
{
if (t == ImgType) imgs.push_back(i);
}
CURL *curl; CURL *curl;
std::string url; std::string url;
std::string luaScript;
TDataType type; TDataType type;
FILE *fp; FILE *fp;
std::vector<CViewBase *> imgs; std::vector<CViewBase *> imgs;
@ -561,7 +567,7 @@ private:
// BnpDownload system // BnpDownload system
void initBnpDownload(); void initBnpDownload();
void checkBnpDownload(); void checkBnpDownload();
void addBnpDownload(const std::string &url, const std::string &action); bool addBnpDownload(const std::string &url, const std::string &action, const std::string &script);
std::string localBnpName(const std::string &url); std::string localBnpName(const std::string &url);
void releaseDownloads(); void releaseDownloads();

@ -1990,7 +1990,7 @@ bool CLuaIHM::isTargetUser()
bool CLuaIHM::isPlayerInPVPMode() bool CLuaIHM::isPlayerInPVPMode()
{ {
if (!UserEntity) return false; if (!UserEntity) return false;
return (UserEntity->getPvpMode() & PVP_MODE::PvpZoneFaction) != 0; return (UserEntity->getPvpMode() & PVP_MODE::PvpFaction || UserEntity->getPvpMode() & PVP_MODE::PvpFactionFlagged || UserEntity->getPvpMode() & PVP_MODE::PvpZoneFaction);
} }
// *************************************************************************** // ***************************************************************************
@ -1998,7 +1998,7 @@ bool CLuaIHM::isTargetInPVPMode()
{ {
CEntityCL *target = getTargetSlot(); CEntityCL *target = getTargetSlot();
if (!target) return false; if (!target) return false;
return (target->getPvpMode() & PVP_MODE::PvpZoneFaction) != 0; return (target->getPvpMode() & PVP_MODE::PvpFaction || target->getPvpMode() & PVP_MODE::PvpFactionFlagged || target->getPvpMode() & PVP_MODE::PvpZoneFaction);
} }
// *************************************************************************** // ***************************************************************************

@ -1299,10 +1299,6 @@ void CPeopleInterraction::initContactLists( const std::vector<uint32> &vFriendLi
for (uint i = 0; i < vIgnoreListName.size(); ++i) for (uint i = 0; i < vIgnoreListName.size(); ++i)
addContactInList(contactIdPool++, vIgnoreListName[i], ccs_offline, 1); addContactInList(contactIdPool++, vIgnoreListName[i], ccs_offline, 1);
updateAllFreeTellerHeaders(); updateAllFreeTellerHeaders();
CInterfaceManager* pIM= CInterfaceManager::getInstance();
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(pIM->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
FriendList.sortEx(order);
} }
//================================================================================================================= //=================================================================================================================
@ -1325,6 +1321,10 @@ void CPeopleInterraction::addContactInList(uint32 contactId, const ucstring &nam
pl.setOnline(index, online); pl.setOnline(index, online);
pl.setContactId(index, contactId); pl.setContactId(index, contactId);
} }
CInterfaceManager* pIM= CInterfaceManager::getInstance();
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(pIM->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
FriendList.sortEx(order);
} }
//================================================================================================================= //=================================================================================================================
@ -1346,6 +1346,10 @@ void CPeopleInterraction::addContactInList(uint32 contactId, uint32 nameID, TCha
w.List = nList; // Friend list == 0 // Ignore list == 1 w.List = nList; // Friend list == 0 // Ignore list == 1
w.Online = online; w.Online = online;
WaitingContacts.push_back(w); WaitingContacts.push_back(w);
CInterfaceManager* pIM= CInterfaceManager::getInstance();
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(pIM->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
FriendList.sortEx(order);
} }
} }

@ -2614,9 +2614,10 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual
// Get the new target UID, and set in Database // Get the new target UID, and set in Database
uint tgtSlot= _Selection; uint tgtSlot= _Selection;
uint32 tgtEntityId= CLFECOMMON::INVALID_CLIENT_DATASET_INDEX; uint32 tgtEntityId= CLFECOMMON::INVALID_CLIENT_DATASET_INDEX;
CEntityCL *entity = NULL;
if (tgtSlot!=CLFECOMMON::INVALID_SLOT) if (tgtSlot!=CLFECOMMON::INVALID_SLOT)
{ {
CEntityCL *entity= EntitiesMngr.entity(tgtSlot); entity = EntitiesMngr.entity(tgtSlot);
if (entity) if (entity)
tgtEntityId= entity->dataSetId(); tgtEntityId= entity->dataSetId();
} }
@ -2656,6 +2657,38 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual
} }
} }
// update pvp tags
CViewBase * tagView = dynamic_cast<CViewBase*>(pIM->getElementFromId("ui:interface:target:pvp_tags"));
CViewBase * contentView = dynamic_cast<CViewBase*>(pIM->getElementFromId("ui:interface:target:content"));
if ((tgtSlot!=CLFECOMMON::INVALID_SLOT) && entity)
{
CPlayerCL *pPlayer = dynamic_cast<CPlayerCL*>(entity);
if (pPlayer)
{
for (uint8 i = 0; i < 7; i++)
{
CViewBitmap * tag = dynamic_cast<CViewBitmap*>(pIM->getElementFromId("ui:interface:target:pvp_tags:tag_"+toString(i)));
if (tag)
{
if ((pPlayer->getPvpMode()&PVP_MODE::PvpFaction || pPlayer->getPvpMode()&PVP_MODE::PvpFactionFlagged) && pPlayer->isPvpAlly(i))
{
tag->setTexture("pvp_ally_"+toString(i)+".tga");
}
else if ((pPlayer->getPvpMode()&PVP_MODE::PvpFaction || pPlayer->getPvpMode()&PVP_MODE::PvpFactionFlagged) && pPlayer->isPvpEnnemy(i))
{
tag->setTexture("pvp_enemy_"+toString(i)+".tga");
}
else
{
tag->setTexture("alpha_10.tga");
}
}
}
}
}
// clear web page // clear web page
prop= pIM->getDbProp("LOCAL:TARGET:CONTEXT_MENU:WEB_PAGE_URL", false); prop= pIM->getDbProp("LOCAL:TARGET:CONTEXT_MENU:WEB_PAGE_URL", false);
if(prop) prop->setValue32(0); if(prop) prop->setValue32(0);

Loading…
Cancel
Save