diff --git a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga index 2c9b1156e..14ab1b585 100644 Binary files a/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga and b/code/ryzom/client/data/gamedev/adds/interfaces/new_texture_interfaces_dxtc.tga differ diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua index 0046a5ee7..9dcd49238 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua +++ b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.lua @@ -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,27 +239,37 @@ 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" - return + 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) @@ -326,7 +339,7 @@ function game:updateTargetConsiderUI() wgToolTip.tooltip = i18n.get("uittConsiderBoss") end end - + if impossible then wgToolTip.tooltip = concatUCString(wgToolTip.tooltip, ucstring("\n"), i18n.get("uittConsiderUnknownLevel")) end diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml index 5f953dc94..7d7e88220 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/interaction.xml @@ -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 @@ + + + + + + + + + + + @@ -316,7 +380,8 @@ tooltip="uittTargetHp" tooltip_parent="win" /> - + + diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index e1e5d9c7d..a15271527 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -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; diff --git a/code/ryzom/client/src/commands.cpp b/code/ryzom/client/src/commands.cpp index cb88846e1..d908d0fc4 100644 --- a/code/ryzom/client/src/commands.cpp +++ b/code/ryzom/client/src/commands.cpp @@ -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.", "") { #if FINAL_VERSION - if (!hasPrivilegeDEV() && + /*if (!hasPrivilegeDEV() && !hasPrivilegeSGM() && !hasPrivilegeGM() && !hasPrivilegeVG() && @@ -416,7 +416,7 @@ NLMISC_COMMAND(setShapeX, "Set X position for last created shape.", "") { #if FINAL_VERSION - if (!hasPrivilegeDEV() && + /*if (!hasPrivilegeDEV() && !hasPrivilegeSGM() && !hasPrivilegeGM() && !hasPrivilegeVG() && @@ -460,7 +460,7 @@ NLMISC_COMMAND(setShapeY, "Set Y position for last created shape.", "") { #if FINAL_VERSION - if (!hasPrivilegeDEV() && + /*if (!hasPrivilegeDEV() && !hasPrivilegeSGM() && !hasPrivilegeGM() && !hasPrivilegeVG() && @@ -504,7 +504,7 @@ NLMISC_COMMAND(setShapeZ, "Set Z position for last created shape.", "") { #if FINAL_VERSION - if (!hasPrivilegeDEV() && + /*if (!hasPrivilegeDEV() && !hasPrivilegeSGM() && !hasPrivilegeGM() && !hasPrivilegeVG() && @@ -549,7 +549,7 @@ NLMISC_COMMAND(setShapeDir, "Set direction angle for last created shape.", "") { #if FINAL_VERSION - if (!hasPrivilegeDEV() && +/* if (!hasPrivilegeDEV() && !hasPrivilegeSGM() && !hasPrivilegeGM() && !hasPrivilegeVG() && @@ -592,7 +592,7 @@ NLMISC_COMMAND(shape, "Add a shape in the scene.", "") !hasPrivilegeG() && !hasPrivilegeEM() && !hasPrivilegeEG()) - return true; + return true;*/ #endif // FINAL_VERSION if(args.size() < 1) diff --git a/code/ryzom/client/src/entities.cpp b/code/ryzom/client/src/entities.cpp index 94dd6855b..b1af0a092 100644 --- a/code/ryzom/client/src/entities.cpp +++ b/code/ryzom/client/src/entities.cpp @@ -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("")); diff --git a/code/ryzom/client/src/entities.h b/code/ryzom/client/src/entities.h index 8d0d780c5..68bdddfaa 100644 --- a/code/ryzom/client/src/entities.h +++ b/code/ryzom/client/src/entities.h @@ -128,6 +128,7 @@ private: /// Shapes Instances caches std::vector _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); /** diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 42ee1c7de..d3aa6cb69 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -2530,15 +2530,22 @@ NLMISC::CRGBA CEntityCL::getColor () const // ally if (isAlly()) { - if (isInTeam()) - return _PvpAllyInTeamColor; - if(isInGuild()) - return _PvpAllyInGuildColor; - - if (getPvpMode()&PVP_MODE::PvpFactionFlagged) + if (getPvpMode() & PVP_MODE::PvpFactionFlagged) + { + if (isInTeam()) + return _PvpAllyInTeamColor; + if(isInGuild()) + return _PvpAllyInGuildColor; 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()) diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index f9277aa9a..1ac2e025b 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -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 diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index f0f9e2308..de5ad2e0b 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -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,9 +1499,14 @@ 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 diff --git a/code/ryzom/client/src/interface_v3/group_html.h b/code/ryzom/client/src/interface_v3/group_html.h index 1d8fd9229..98740d871 100644 --- a/code/ryzom/client/src/interface_v3/group_html.h +++ b/code/ryzom/client/src/interface_v3/group_html.h @@ -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 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(); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index b43c7f4ba..93ecf2581 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -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); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index a8900a3ab..75706156d 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -1299,10 +1299,6 @@ void CPeopleInterraction::initContactLists( const std::vector &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); } } diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index aebd2bcc9..05f856230 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -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(pIM->getElementFromId("ui:interface:target:pvp_tags")); + CViewBase * contentView = dynamic_cast(pIM->getElementFromId("ui:interface:target:content")); + + if ((tgtSlot!=CLFECOMMON::INVALID_SLOT) && entity) + { + CPlayerCL *pPlayer = dynamic_cast(entity); + + if (pPlayer) + { + for (uint8 i = 0; i < 7; i++) + { + CViewBitmap * tag = dynamic_cast(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);