mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-24 18:08:44 +00:00
Changed: #1135 Merge changes from Ryzom patch 1.10
This commit is contained in:
parent
95e24bab2c
commit
22c276cf24
14 changed files with 228 additions and 60 deletions
Binary file not shown.
Before Width: | Height: | Size: 4 MiB After Width: | Height: | Size: 4 MiB |
|
@ -227,6 +227,9 @@ function game:updateTargetConsiderUI()
|
|||
local wgImpossible = targetWindow:find("impossible")
|
||||
local wgSlotRing = targetWindow:find("slot_ring")
|
||||
local wgToolTip = targetWindow:find("target_tooltip")
|
||||
local wgPvPTag = targetWindow:find("pvp_tags")
|
||||
local wgHeader = targetWindow:find("header_opened")
|
||||
|
||||
wgTargetSlotForce.active = true
|
||||
wgImpossible.active = true
|
||||
|
||||
|
@ -236,28 +239,38 @@ function game:updateTargetConsiderUI()
|
|||
wgTargetLevel.active = false
|
||||
wgImpossible.active = false
|
||||
wgSlotRing.active = false
|
||||
if (isTargetUser()) then
|
||||
if (isTargetUser() and twIsPlayerInPVPMode()) then
|
||||
wgToolTip.tooltip = ""
|
||||
wgPvPTag.active = true
|
||||
wgHeader.h = 56;
|
||||
else
|
||||
wgPvPTag.active = false
|
||||
wgHeader.h = 34;
|
||||
wgToolTip.tooltip = i18n.get("uittConsiderTargetNoSelection")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
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 twIsTargetPlayer() then
|
||||
if (twIsTargetPlayer()) then
|
||||
-- don't display anything ...
|
||||
wgTargetSlotForce.active = false
|
||||
wgTargetLevel.active = false
|
||||
wgImpossible.active = false
|
||||
wgSlotRing.active = false
|
||||
wgToolTip.tooltip = ""
|
||||
wgTargetSlotForce.color = "128 128 128 255"
|
||||
if twIsTargetInPVPMode() then
|
||||
debugInfo("target in pvp")
|
||||
wgPvPTag.active = true
|
||||
wgHeader.h = 56;
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- depending on the number of people in the group, set the max diff for visibility between player level
|
||||
-- & creature level (x 10 per member)
|
||||
local maxDiffLevel = 10
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
min_w="182"
|
||||
max_w="182"
|
||||
min_h="56"
|
||||
max_h="56"
|
||||
max_h="82"
|
||||
resizer="false"
|
||||
global_color="false"
|
||||
global_color_over="true"
|
||||
|
@ -209,15 +209,15 @@
|
|||
<group id="header_opened"
|
||||
x="0"
|
||||
y="0"
|
||||
h="32"
|
||||
h="56"
|
||||
posref="TL TL"
|
||||
group_onclick_r="active_menu"
|
||||
group_params_r="menu=ui:interface:base_menu_with_color">
|
||||
<view type="text"
|
||||
id="target_title"
|
||||
posref="BL BL"
|
||||
posref="TL TL"
|
||||
x="0"
|
||||
y="0"
|
||||
y="-20"
|
||||
color="255 255 255 255"
|
||||
global_color="true"
|
||||
fontsize="11"
|
||||
|
@ -290,9 +290,73 @@
|
|||
h="0"
|
||||
tooltip_parent="win" />
|
||||
</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"
|
||||
x="0"
|
||||
y="-2"
|
||||
y="-26"
|
||||
w="164"
|
||||
h="20"
|
||||
posref="TL TL">
|
||||
|
@ -316,6 +380,7 @@
|
|||
tooltip="uittTargetHp"
|
||||
tooltip_parent="win" />
|
||||
</group>
|
||||
|
||||
<!-- 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)"
|
||||
action="lua"
|
||||
|
|
|
@ -584,7 +584,7 @@ CClientConfig::CClientConfig()
|
|||
CameraDistance = 3.0f;
|
||||
CameraDistStep = 1.0f;
|
||||
CameraDistMin = 1.0f;
|
||||
CameraDistMax = 5.0f;
|
||||
CameraDistMax = 100.0f;
|
||||
DmCameraDistMax = 25.0f;
|
||||
CameraAccel = 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.", "")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/*if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -384,7 +384,7 @@ NLMISC_COMMAND(clearShape, "Remove all shapes added with the 'shape' command.",
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
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>")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/*if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -416,7 +416,7 @@ NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "<x coordina
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
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>")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/*if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -460,7 +460,7 @@ NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "<y coordina
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
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>")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/*if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -504,7 +504,7 @@ NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "<z coordina
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
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>")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/*if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -549,7 +549,7 @@ NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "<ang
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
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>")
|
||||
{
|
||||
#if FINAL_VERSION
|
||||
if (!hasPrivilegeDEV() &&
|
||||
/* if (!hasPrivilegeDEV() &&
|
||||
!hasPrivilegeSGM() &&
|
||||
!hasPrivilegeGM() &&
|
||||
!hasPrivilegeVG() &&
|
||||
|
@ -592,7 +592,7 @@ NLMISC_COMMAND(shape, "Add a shape in the scene.", "<shape file>")
|
|||
!hasPrivilegeG() &&
|
||||
!hasPrivilegeEM() &&
|
||||
!hasPrivilegeEG())
|
||||
return true;
|
||||
return true;*/
|
||||
#endif // FINAL_VERSION
|
||||
|
||||
if(args.size() < 1)
|
||||
|
|
|
@ -520,9 +520,17 @@ bool CEntityManager::removeInstances()
|
|||
Scene->deleteInstance(_ShapeInstances[i].Instance);
|
||||
}
|
||||
_ShapeInstances.clear();
|
||||
_InstancesRemoved = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CEntityManager::instancesRemoved()
|
||||
{
|
||||
bool instRemoved = _InstancesRemoved;
|
||||
_InstancesRemoved = false;
|
||||
return instRemoved;
|
||||
}
|
||||
|
||||
CShapeInstanceReference CEntityManager::getShapeInstanceUnderPos(float x, float y)
|
||||
{
|
||||
CShapeInstanceReference selectedInstance(UInstance(), string(""), string(""));
|
||||
|
|
|
@ -128,6 +128,7 @@ private:
|
|||
|
||||
/// Shapes Instances caches
|
||||
std::vector<CShapeInstanceReference> _ShapeInstances;
|
||||
bool _InstancesRemoved;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -202,6 +203,7 @@ public:
|
|||
|
||||
CShapeInstanceReference createInstance(const string& shape, const CVector &pos, const string &text, const string &url, bool active=true);
|
||||
bool removeInstances();
|
||||
bool instancesRemoved();
|
||||
CShapeInstanceReference getShapeInstanceUnderPos(float x, float y);
|
||||
|
||||
/**
|
||||
|
|
|
@ -2529,17 +2529,24 @@ NLMISC::CRGBA CEntityCL::getColor () const
|
|||
}
|
||||
// ally
|
||||
if (isAlly())
|
||||
{
|
||||
if (getPvpMode() & PVP_MODE::PvpFactionFlagged)
|
||||
{
|
||||
if (isInTeam())
|
||||
return _PvpAllyInTeamColor;
|
||||
if(isInGuild())
|
||||
return _PvpAllyInGuildColor;
|
||||
|
||||
if (getPvpMode()&PVP_MODE::PvpFactionFlagged)
|
||||
return _PvpAllyColor;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
// neutral
|
||||
if (isInTeam())
|
||||
return _GroupColor;
|
||||
|
|
|
@ -2373,8 +2373,8 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS)
|
|||
{
|
||||
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.ArmColor = color->getValue32();
|
||||
SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs);
|
||||
SCharacter3DSetup::setDB("UI:TEMP:CHAR3D:VPA:ARMCOLOR", pIS->Color);
|
||||
//cs.VisualPropA.PropertySubData.ArmColor = pIS->Color;
|
||||
camHeight = -0.55f;
|
||||
}
|
||||
|
@ -2406,11 +2406,17 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS)
|
|||
else if (pIS->Family == ITEMFAMILY::SHIELD)
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
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.WeaponLeftHand = 0;
|
||||
SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -100,7 +100,7 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img)
|
|||
if (NLMISC::CFile::fileExists(dest))
|
||||
{
|
||||
CFile::setRWAccess(dest);
|
||||
NLMISC::CFile::deleteFile(dest.c_str());
|
||||
NLMISC::CFile::deleteFile(dest);
|
||||
}
|
||||
FILE *fp = fopen (dest.c_str(), "wb");
|
||||
if (fp == NULL)
|
||||
|
@ -111,7 +111,7 @@ void CGroupHTML::addImageDownload(const string &url, CViewBase *img)
|
|||
curl_easy_setopt(curl, CURLOPT_FILE, fp);
|
||||
|
||||
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
|
||||
nlwarning("adding handle %x, %d curls", curl, Curls.size());
|
||||
#endif
|
||||
|
@ -145,8 +145,8 @@ string CGroupHTML::localBnpName(const string &url)
|
|||
return dest;
|
||||
}
|
||||
|
||||
// Add a bnp download request in the multi_curl
|
||||
void CGroupHTML::addBnpDownload(const string &url, const string &action)
|
||||
// Add a bnp download request in the multi_curl, return true if already downloaded
|
||||
bool CGroupHTML::addBnpDownload(const string &url, const string &action, const string &script)
|
||||
{
|
||||
// Search if we are not already downloading this url.
|
||||
for(uint i = 0; i < Curls.size(); i++)
|
||||
|
@ -156,13 +156,13 @@ void CGroupHTML::addBnpDownload(const string &url, const string &action)
|
|||
#ifdef LOG_DL
|
||||
nlwarning("already downloading '%s'", url.c_str());
|
||||
#endif
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CURL *curl = curl_easy_init();
|
||||
if (!MultiCurl || !curl)
|
||||
return;
|
||||
return false;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
|
||||
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")
|
||||
{
|
||||
CFile::setRWAccess(dest);
|
||||
NLMISC::CFile::deleteFile(dest.c_str());
|
||||
NLMISC::CFile::deleteFile(dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (action != "delete")
|
||||
|
@ -186,17 +190,18 @@ void CGroupHTML::addBnpDownload(const string &url, const string &action)
|
|||
if (fp == NULL)
|
||||
{
|
||||
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_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
|
||||
nlwarning("adding handle %x, %d curls", curl, Curls.size());
|
||||
#endif
|
||||
RunningCurls++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CGroupHTML::initBnpDownload()
|
||||
|
@ -316,8 +321,6 @@ void CGroupHTML::checkDownloads()
|
|||
{
|
||||
if (lookupLocalFile (finalUrl, file.c_str(), false))
|
||||
{
|
||||
nlinfo("BNPCHECK : downloaded");
|
||||
|
||||
bool memoryCompressed = CPath::isMemoryCompressed();
|
||||
if (memoryCompressed)
|
||||
{
|
||||
|
@ -329,7 +332,8 @@ void CGroupHTML::checkDownloads()
|
|||
CPath::memoryCompress();
|
||||
}
|
||||
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];
|
||||
if (present[HTML_OBJECT_STANDBY] && value[HTML_OBJECT_STANDBY])
|
||||
_ObjectAction = value[HTML_OBJECT_STANDBY];
|
||||
_Object = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1494,10 +1499,15 @@ void CGroupHTML::endElement (uint element_number)
|
|||
{
|
||||
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;
|
||||
}
|
||||
else if (_Object)
|
||||
{
|
||||
_ObjectScript += tmpStr.toString();
|
||||
}
|
||||
else if (_SelectOption)
|
||||
{
|
||||
if (!(_Forms.empty()))
|
||||
|
@ -2447,9 +2461,18 @@ CCtrlButton *CGroupHTML::addButton(CCtrlButton::EType type, const std::string &/
|
|||
if (tooltip)
|
||||
{
|
||||
if (CI18N::hasTranslation(tooltip))
|
||||
ctrlButton->setDefaultContextHelp (CI18N::get(tooltip));
|
||||
{
|
||||
ctrlButton->setDefaultContextHelp(CI18N::get(tooltip));
|
||||
//ctrlButton->setOnContextHelp(CI18N::get(tooltip).toString());
|
||||
}
|
||||
else
|
||||
ctrlButton->setDefaultContextHelp (ucstring(tooltip));
|
||||
{
|
||||
ctrlButton->setDefaultContextHelp(ucstring(tooltip));
|
||||
//ctrlButton->setOnContextHelp(string(tooltip));
|
||||
}
|
||||
|
||||
ctrlButton->setInstantContextHelp(true);
|
||||
ctrlButton->setToolTipParent(TTMouse);
|
||||
}
|
||||
|
||||
getParagraph()->addChild (ctrlButton);
|
||||
|
@ -2486,6 +2509,7 @@ void CGroupHTML::clearContext()
|
|||
_CellParams.clear();
|
||||
_Title = false;
|
||||
_TextArea = false;
|
||||
_Object = false;
|
||||
_Localize = false;
|
||||
|
||||
// TR
|
||||
|
|
|
@ -293,8 +293,8 @@ protected :
|
|||
// the script to execute
|
||||
std::string _LuaScript;
|
||||
|
||||
bool _ParsingBnpUrl;
|
||||
std::string _BnpUrl;
|
||||
bool _Object;
|
||||
std::string _ObjectScript;
|
||||
|
||||
// Someone is conecting. We got problem with libwww : 2 connection requests can deadlock the client.
|
||||
static CGroupHTML *_ConnectingLock;
|
||||
|
@ -488,6 +488,7 @@ protected :
|
|||
std::string _ObjectData;
|
||||
std::string _ObjectMD5Sum;
|
||||
std::string _ObjectAction;
|
||||
std::string _TextAreaScript;
|
||||
|
||||
// Get last char
|
||||
ucchar getLastChar() const;
|
||||
|
@ -539,9 +540,14 @@ private:
|
|||
|
||||
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;
|
||||
std::string url;
|
||||
std::string luaScript;
|
||||
TDataType type;
|
||||
FILE *fp;
|
||||
std::vector<CViewBase *> imgs;
|
||||
|
@ -561,7 +567,7 @@ private:
|
|||
// BnpDownload system
|
||||
void initBnpDownload();
|
||||
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);
|
||||
|
||||
void releaseDownloads();
|
||||
|
|
|
@ -1990,7 +1990,7 @@ bool CLuaIHM::isTargetUser()
|
|||
bool CLuaIHM::isPlayerInPVPMode()
|
||||
{
|
||||
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();
|
||||
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)
|
||||
addContactInList(contactIdPool++, vIgnoreListName[i], ccs_offline, 1);
|
||||
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.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.Online = online;
|
||||
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,10 +2614,11 @@ void CUserEntity::selection(const CLFECOMMON::TCLEntityId &slot) // virtual
|
|||
// Get the new target UID, and set in Database
|
||||
uint tgtSlot= _Selection;
|
||||
uint32 tgtEntityId= CLFECOMMON::INVALID_CLIENT_DATASET_INDEX;
|
||||
if(tgtSlot!=CLFECOMMON::INVALID_SLOT)
|
||||
CEntityCL *entity = NULL;
|
||||
if (tgtSlot!=CLFECOMMON::INVALID_SLOT)
|
||||
{
|
||||
CEntityCL *entity= EntitiesMngr.entity(tgtSlot);
|
||||
if(entity)
|
||||
entity = EntitiesMngr.entity(tgtSlot);
|
||||
if (entity)
|
||||
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
|
||||
prop= pIM->getDbProp("LOCAL:TARGET:CONTEXT_MENU:WEB_PAGE_URL", false);
|
||||
if(prop) prop->setValue32(0);
|
||||
|
|
Loading…
Reference in a new issue