diff --git a/.hgignore b/.hgignore index 41a0e58cf..990487a2a 100644 --- a/.hgignore +++ b/.hgignore @@ -242,6 +242,9 @@ external_stlport nel_tools* ryzom_tools* +#personal projects +personal/ + #Dumps *.dmp diff --git a/.hgtags b/.hgtags index 5ff627e15..6a404b346 100644 --- a/.hgtags +++ b/.hgtags @@ -12,3 +12,5 @@ bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom-patch-3.0.1 4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0 043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch +00dde390a394fce9da06c2f3264140282158d39f 3.3.0 +dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 0e72cc5f9..425f296f5 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -475,6 +475,10 @@ IF(WITH_STUDIO) ADD_SUBDIRECTORY(studio) ENDIF() +IF(WITH_PERSONAL) + ADD_SUBDIRECTORY(personal) +ENDIF() + # To build the documention, you will have to enable it # and then do the equivalent of "make DoxygenDoc". IF(BUILD_DOCUMENTATION) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 8d3478579..35ba3e40e 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -66,6 +66,8 @@ namespace NLGUI std::vector< std::string > trustedDomains; /// Maximum concurrent MultiCurl connections per CGroupHTML instance sint32 curlMaxConnections; + /// cacert.pem location + std::string curlCABundle; SWebOptions(): curlMaxConnections(2) { @@ -104,6 +106,10 @@ namespace NLGUI sint32 MaxHeight; }; + // ImageDownload system + enum TDataType {ImgType= 0, BnpType}; + enum TImageType {NormalImage=0, OverImage}; + // Constructor CGroupHTML(const TCtorParam ¶m); ~CGroupHTML(); @@ -149,6 +155,10 @@ namespace NLGUI // End of the paragraph void endParagraph(); + + // add image download (used by view_bitmap.cpp to load web images) + void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage); + std::string localImageName(const std::string &url); // Timeout void setTimeout(float tm) {_TimeoutValue= std::max(0.f, tm);} @@ -720,6 +730,8 @@ namespace NLGUI return 0; return _Indent.back(); } + + // Current node is a title bool _Title; @@ -809,10 +821,6 @@ namespace NLGUI private: // decode all HTML entities static ucstring decodeHTMLEntities(const ucstring &str); - - // ImageDownload system - enum TDataType {ImgType= 0, BnpType}; - enum TImageType {NormalImage=0, OverImage}; struct CDataImageDownload { @@ -855,8 +863,6 @@ namespace NLGUI void initImageDownload(); void checkImageDownload(); - void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage); - std::string localImageName(const std::string &url); std::string getAbsoluteUrl(const std::string &url); bool isTrustedDomain(const std::string &domain); diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index 9c9585fcc..acdaa15f5 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -885,7 +885,7 @@ namespace NLGUI } if (eventDesc.getEventTypeExtended() == NLGUI::CEventDescriptorMouse::mousewheel && _Vertical) { - moveTrackY (eventDesc.getWheel() * 12); + moveTargetY (-(eventDesc.getWheel() * 12)); return true; } } @@ -1226,6 +1226,12 @@ namespace NLGUI if(hReal <= maxHReal) return; + if (_TargetStepY > 1) + { + sint sign = (0 < dy) - (dy < 0); + dy = sign * max(1, (dy / _TargetStepY)) * _TargetStepY; + } + // compute the new ofsY. sint32 ofsY= _Target->getOfsY(); ofsY+= dy; diff --git a/code/nel/src/gui/group_editbox.cpp b/code/nel/src/gui/group_editbox.cpp index e7ed22583..13979f4aa 100644 --- a/code/nel/src/gui/group_editbox.cpp +++ b/code/nel/src/gui/group_editbox.cpp @@ -1005,7 +1005,6 @@ namespace NLGUI { case KeyESCAPE: _CurrentHistoricIndex= -1; - CWidgetManager::getInstance()->setCaptureKeyboard(NULL); // stop selection _CurrSelection = NULL; _CursorAtPreviousLineEnd = false; @@ -1014,6 +1013,7 @@ namespace NLGUI setInputString(ucstring("")); triggerOnChangeAH(); } + CWidgetManager::getInstance()->setCaptureKeyboard(NULL); break; case KeyTAB: makeTopWindow(); diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 7b2621b18..e0ed401ce 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -395,13 +395,18 @@ namespace NLGUI return false; } -#if defined(NL_OS_WINDOWS) // https:// if (toLower(download.url.substr(0, 8)) == "https://") { +#if defined(NL_OS_WINDOWS) curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, &CCurlCertificates::sslCtxFunction); - } +#else + if (!options.curlCABundle.empty()) + { + curl_easy_setopt(curl, CURLOPT_CAINFO, options.curlCABundle.c_str()); + } #endif + } download.data = new CCurlWWWData(curl, download.url); download.fp = fp; @@ -1565,6 +1570,8 @@ namespace NLGUI { if ((*it).first == "template") templateName = (*it).second; + else if ((*it).first == "display" && (*it).second == "inline-block") + _BlockLevelElement.back() = false; else tmplParams.push_back(TTmplParam((*it).first, (*it).second)); } @@ -4022,13 +4029,6 @@ namespace NLGUI void CGroupHTML::endParagraph() { - // Remove previous paragraph if empty - if (_Paragraph && (_Paragraph->getNumChildren() == 0)) - { - _Paragraph->getParent ()->delGroup(_Paragraph); - _Paragraph = NULL; - } - _Paragraph = NULL; paragraphChange (); @@ -4038,13 +4038,6 @@ namespace NLGUI void CGroupHTML::newParagraph(uint beginSpace) { - // Remove previous paragraph if empty - if (_Paragraph && (_Paragraph->getNumChildren() == 0)) - { - _Paragraph->getParent ()->delGroup(_Paragraph); - _Paragraph = NULL; - } - // Add a new paragraph CGroupParagraph *newParagraph = new CGroupParagraph(CViewBase::TCtorParam()); newParagraph->setResizeFromChildH(true); @@ -4884,13 +4877,6 @@ namespace NLGUI if (!group) return; - // Remove previous paragraph if empty - if (_Paragraph && (_Paragraph->getNumChildren() == 0)) - { - _Paragraph->getParent ()->delGroup(_Paragraph); - _Paragraph = NULL; - } - registerAnchor(group); if (!_DivName.empty()) @@ -5354,13 +5340,18 @@ namespace NLGUI return; } -#if defined(NL_OS_WINDOWS) // https:// if (toLower(url.substr(0, 8)) == "https://") { +#if defined(NL_OS_WINDOWS) curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, &CCurlCertificates::sslCtxFunction); - } +#else + if (!options.curlCABundle.empty()) + { + curl_easy_setopt(curl, CURLOPT_CAINFO, options.curlCABundle.c_str()); + } #endif + } // do not follow redirects, we have own handler curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0); @@ -5841,6 +5832,8 @@ namespace NLGUI CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING); std::string html = ls.toString(1); + // Always trust domain if rendered from lua + _TrustedDomain = true; renderHtmlString(html); return 0; diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index dce9fc266..d349411e1 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -1305,7 +1305,7 @@ namespace NLGUI CInterfaceGroup *currParent = _Parent; while (currParent) { - if (currParent->moveSBTrackY (this, eventDesc.getWheel()*12)) + if (currParent->moveSBTargetY (this, -(eventDesc.getWheel()*12))) return true; currParent = currParent->getParent(); } diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index b479cb889..79b8c32a4 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -21,6 +21,7 @@ #include "nel/gui/widget_manager.h" #include "nel/gui/interface_group.h" #include "nel/gui/group_container_base.h" +#include "nel/gui/group_html.h" using namespace std; using namespace NLMISC; @@ -452,7 +453,19 @@ namespace NLGUI // ---------------------------------------------------------------------------- void CViewBitmap::setTexture(const std::string & TxName) { - _TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); + if (TxName.find("://") != string::npos || TxName.find("//") == 0) + { + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html")); + if (groupHtml) { + string localname = groupHtml->localImageName(TxName); + if (!CFile::fileExists(localname)) + localname = "web_del.tga"; + _TextureId.setTexture (localname.c_str(), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); + groupHtml->addImageDownload(TxName, dynamic_cast(this)); + } + } + else + _TextureId.setTexture (TxName.c_str (), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); } // ---------------------------------------------------------------------------- diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 7bd537fc0..881b4fa5d 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -895,8 +895,8 @@ namespace NLGUI return maxw; else { - sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal()); - return std::min(parentWidth-(sint)(_XReal-_Parent->getXReal()), maxw); + sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal() - _Parent->getMarginLeft()); + return std::min(parentWidth-(sint)(_XReal-(_Parent->getXReal()-_Parent->getMarginLeft())), (sint)_LineMaxW); } } diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 47bdf3886..7a3a38e70 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -1356,10 +1356,14 @@ bool CBitmap::decompressDXT1(bool alpha) { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= c[bits&3].A; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= c[bits&3].A; bits>>=2; } } @@ -1466,10 +1470,14 @@ bool CBitmap::decompressDXT3() { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k]= c[bits&3].R; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+1]= c[bits&3].G; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+2]= c[bits&3].B; - dataTmp[m][pixelsCount + j*wtmp*4 + 4*k+3]= alpha[4*j+k]; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= alpha[4*j+k]; bits>>=2; } } @@ -1602,10 +1610,14 @@ bool CBitmap::decompressDXT5() { for(k=0; k<4; k++) { - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +0]= c[bits&3].R; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +1]= c[bits&3].G; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +2]= c[bits&3].B; - dataTmp[m][pixelsCount + (j*wtmp+k)*4 +3]= (uint8) alpha[codeAlpha[4*j+k]]; + uint32 index = pixelsCount + (j*wtmp+k)*4; + // incase input image does not have proper width/height + if (index+3 > mipMapSz) break; + + dataTmp[m][index+0]= c[bits&3].R; + dataTmp[m][index+1]= c[bits&3].G; + dataTmp[m][index+2]= c[bits&3].B; + dataTmp[m][index+3]= (uint8) alpha[codeAlpha[4*j+k]]; bits>>=2; } } diff --git a/code/personal/README.md b/code/personal/README.md new file mode 100644 index 000000000..cb2ebdf41 --- /dev/null +++ b/code/personal/README.md @@ -0,0 +1,9 @@ + +cmake option to include CMakeLists.txt from this directory is `-DWITH_PERSONAL=ON` + +Example: + +``` +ADD_SUBDIRECTORY(example) +``` + diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index c128ac28a..4ffddc935 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -52,6 +52,11 @@ ForgetPwdURL = "http://shard.ryzomcore.org/ams/?page=forgot_password"; LoginSupportURL = "https://plus.google.com/u/0/communities/103798956862568269036"; InstallWebPage = ""; +// Full path and filename where cURL can find certificate bundle file +// cacert.pem file can be downloaded from https://curl.haxx.se/docs/caextract.html +// and added to client data path or system specific bundle can be used +// Ubuntu has "/etc/ssl/certs/ca-certificates.crt" +//CurlCABundle = "cacert.pem"; //////////////// // INTERFACES // @@ -315,6 +320,10 @@ CameraSpeedMin = 2.0; CameraSpeedMax = 100.0; CameraResetSpeed = 10.0; // Speed in radian/s +// Default values for map +MaxMapScale = 2.0; +R2EDMaxMapScale = 8.0; + ////////////////// // SOUND CONFIG // ////////////////// diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml b/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml index 2d3271082..b8d9e358e 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.xml @@ -436,6 +436,9 @@ + + - - - + w="380" + onenter="" + title="uiGuildDescWarning" + tooltip="uiGuildDescWarning" /> + + + + - + posref="BL BL" + x="150" + y="15" /> + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/game_context_menu.xml b/code/ryzom/client/data/gamedev/interfaces_v3/game_context_menu.xml index 14ef15b80..25fd8b202 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/game_context_menu.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/game_context_menu.xml @@ -97,7 +97,6 @@ - @@ -107,6 +106,9 @@ + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml b/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml index 8c2eb9f82..d3c886282 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/macros.xml @@ -234,6 +234,8 @@ + + @@ -324,6 +326,8 @@ + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml index dcc2515ea..0f1ab111c 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml @@ -25,6 +25,8 @@ + + @@ -144,6 +146,7 @@ + @@ -155,10 +158,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -316,11 +388,53 @@ selection_axis_color = "0 0 0 127" compass="ui:interface:compass" - scale_max="2" - scale_max_r2="8" - /> - - + /> + + + + + + + + + + + + + + + + + + + + @@ -409,8 +523,7 @@ player_pos_tex="player_pos.tga" - scale_max="2" - /> + /> diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 14741b7ad..e808361fe 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -433,6 +433,7 @@ CClientConfig::CClientConfig() WebIgTrustedDomains.push_back(WebIgMainDomain); CurlMaxConnections = 2; + CurlCABundle.clear(); RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php"; ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php"; @@ -606,6 +607,9 @@ CClientConfig::CClientConfig() CameraSpeedMax = 1.0f; CameraResetSpeed = 2.0f; + MaxMapScale = 2.0f; + R2EDMaxMapScale = 8.0f; + // VERBOSES VerboseVP = false; VerboseAnimUser = false; @@ -1091,6 +1095,8 @@ void CClientConfig::setValues() if (ClientCfg.CurlMaxConnections < 0) ClientCfg.CurlMaxConnections = 2; + READ_STRING_FV(CurlCABundle); + /////////////// // ANIMATION // // AnimatedAngleThreshold @@ -1473,6 +1479,9 @@ void CClientConfig::setValues() READ_FLOAT_FV(CameraDistance) } + // Default values for CGroupMap + READ_FLOAT_FV(MaxMapScale); + READ_FLOAT_FV(R2EDMaxMapScale); ///////////// // SHADOWS // diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 9b24f3058..c9ecebd2d 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -315,6 +315,7 @@ struct CClientConfig std::vector WebIgTrustedDomains; sint32 CurlMaxConnections; + string CurlCABundle; /////////////// // ANIMATION // @@ -598,6 +599,10 @@ struct CClientConfig float CameraSpeedMax; float CameraResetSpeed; + // Default values for CGroupMap + float MaxMapScale; + float R2EDMaxMapScale; + ////////////// // VERBOSES // bool VerboseVP; diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index 98d4c619c..30514fb95 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -3055,6 +3055,7 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */, if (!instance.empty()) { _SelectionFX.cast (instance); + _SelectionFX.setLoadBalancingGroup("SelectionFx"); if (_SelectionFX.empty()) { // shape found, but not a particle system @@ -3083,6 +3084,7 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */, if (!instance.empty()) { _MouseOverFX.cast (instance); + _MouseOverFX.setLoadBalancingGroup("SelectionFx"); if (_MouseOverFX.empty()) { // shape found, but not a particle system diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index cce91b5ba..910c454d0 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -593,6 +593,8 @@ void initMainLoop() Scene->setGroupLoadMaxPolygon("Skin", ClientCfg.SkinNbMaxPoly); Scene->setGroupLoadMaxPolygon("Fx", ClientCfg.FxNbMaxPoly); Scene->setMaxSkeletonsInNotCLodForm(ClientCfg.NbMaxSkeletonNotCLod); + // separate group for mouse/target selection reticle + Scene->setGroupLoadMaxPolygon("SelectionFx", 10000); // enable Scene Lighting Scene->enableLightingSystem(true); Scene->setAmbientGlobal(CRGBA::Black); diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index 88b454279..0533441cf 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -1548,12 +1548,48 @@ void CDBCtrlSheet::setupDisplayAsPhrase(const std::vector &bri // Get the best SBrick to display. CSheetId rootBrickSheetId= bricks[0]; - { CSheetId bestBrickSheetId= pBM->getSabrinaCom().getPhraseBestDisplayBrick(bricks); setupDisplayAsSBrick (rootBrickSheetId.asInt(), bestBrickSheetId.asInt() ); } + // Override background if type is forace extraction/prospection and ecosystem brick is used + { + BRICK_FAMILIES::TBrickFamily family = pBM->getSabrinaCom().getPhraseForageFamily(bricks); + std::string icon; + switch(family) + { + case BRICK_FAMILIES::BHFEMA: + case BRICK_FAMILIES::BHFPMA: + icon = "bk_matis_brick.tga"; + break; + case BRICK_FAMILIES::BHFEMB: + case BRICK_FAMILIES::BHFPMB: + icon = "bk_fyros_brick.tga"; + break; + case BRICK_FAMILIES::BHFEMC: + case BRICK_FAMILIES::BHFPMC: + icon = "bk_zorai_brick.tga"; + break; + case BRICK_FAMILIES::BHFEMD: + case BRICK_FAMILIES::BHFPMD: + icon = "bk_tryker_brick.tga"; + break; + case BRICK_FAMILIES::BHFEME: + case BRICK_FAMILIES::BHFPME: + icon = "bk_generic_brick.tga"; + break; + default: + icon = ""; + break; + } + if (!icon.empty()) + { + CViewRenderer &rVR = *CViewRenderer::getInstance(); + _DispBackBmpId = rVR.getTextureIdFromName(icon); + } + } + // not so beautiful to display .sphrase name in progression, and in botchat if(_ActualType==SheetType_SPhraseId) { diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 929e35f71..37a0a8a57 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -426,6 +426,8 @@ CGroupMap::CGroupMap(const TCtorParam ¶m) // _TargetLM = NULL; _HomeLM = NULL; + _LandmarkFilter.clear(); + _MatchedLandmarks.clear(); // _ScaleMax = 8.f; _ScaleMaxR2 = 8.f; @@ -711,9 +713,11 @@ bool CGroupMap::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup) } // + _ScaleMax = ClientCfg.MaxMapScale; ptr = (char*) xmlGetProp( cur, (xmlChar*)"scale_max" ); if (ptr) fromString((const char *) ptr, _ScaleMax); // + _ScaleMaxR2 = ClientCfg.R2EDMaxMapScale; ptr = (char*) xmlGetProp( cur, (xmlChar*)"scale_max_r2" ); if (ptr) fromString((const char *) ptr, _ScaleMaxR2); // @@ -900,9 +904,19 @@ void CGroupMap::updateCoords() // bool newLandMarkShown = false; uint i; for (i = 0; i < _ContinentLM.size(); ++i) - setupFromZoom(_ContinentLM[i], _ContinentLM[i]->Type, _MeterPerPixel); + { + if (_ContinentLM[i]->SearchMatch) + _ContinentLM[i]->setActive(true); + else + setupFromZoom(_ContinentLM[i], _ContinentLM[i]->Type, _MeterPerPixel); + } for (i = 0; i < _ContinentText.size(); ++i) - setupFromZoom(_ContinentText[i], _ContinentText[i]->Type, _MeterPerPixel); + { + if (_ContinentText[i]->SearchMatch) + _ContinentText[i]->setActive(true); + else + setupFromZoom(_ContinentText[i], _ContinentText[i]->Type, _MeterPerPixel); + } // updateLandMarkList(_ContinentLM); updateLandMarkTextList(_ContinentText); @@ -2235,6 +2249,31 @@ void CGroupMap::centerOnPlayer() computeOffsets(); invalidateCoords(); } +//============================================================================================================ +void CGroupMap::centerOnWorldPos(const CVector2f &worldPos) +{ + CVector2f mapPos; + worldToMap(mapPos, worldPos); + + sint32 sx, sy; + mapToScreen(sx, sy, mapPos); + + sint32 x, y, w, h; + computeMapRectInsideGroup(x, y, w, h); + + sint32 dx, dy; + if (sx < getXReal()) + dx = -(getXReal() - sx + w/2); + else + dx = sx - getXReal() - w/2; + + if (sy < getYReal()) + dy = -(getYReal() - sy + h/2); + else + dy = sy - getYReal() - h/2; + + pan(dx, dy); +} //============================================================================================================ void CGroupMap::setScale(float newUserScale, const NLMISC::CVector2f &/* center */) @@ -2257,7 +2296,6 @@ void CGroupMap::setScale(float newScale) setScale(newScale, mapCoords); } - //============================================================================================================ void CGroupMap::updateLandMarkList(TLandMarkButtonVect &lmVect) { @@ -2289,6 +2327,63 @@ void CGroupMap::updateLandMarkTextList(TLandMarkTextVect &lmVect) } } +//============================================================================================================ +void CGroupMap::updateMatchedLandmarks() +{ + CInterfaceGroup *gc = getParentContainer(); + if (!gc) return; + + // visible landmark count + CViewText *pVT = dynamic_cast(gc->getView("lm_count")); + if (pVT) + { + // show total landmark count if search filter has not been set + uint c = _MatchedLandmarks.size(); + if (c == 0 && _LandmarkFilter.size() == 0) + c = _UserLM.size(); + + pVT->setText(toString(c)); + } + + // list of matched landmarks + CGroupList *pL = dynamic_cast(gc->getGroup("lm_result")); + if (!pL) return; + + pL->clearGroups(); + + if (_LandmarkFilter.size() == 0) return; + + // create result list + for(uint k = 0; k < _MatchedLandmarks.size(); ++k) + { + std::vector > params; + params.clear(); + params.push_back(std::pair("id", toString("lm%d", k))); + params.push_back(std::pair("tooltip", _MatchedLandmarks[k].Title.toUtf8())); + params.push_back(std::pair("index", toString(k))); + + CInterfaceGroup *g = CWidgetManager::getInstance()->getParser()->createGroupInstance("lm_search_result", pL->getId(), params); + if (g) + { + pL->addChild(g); + + CViewText* t = dynamic_cast(g->getView("title")); + if (t) + { + t->setSingleLineTextFormatTaged(_MatchedLandmarks[k].Title); + } + + CViewBitmap* b = dynamic_cast(g->getView("icon")); + if (b) + { + b->setTexture(_MatchedLandmarks[k].Options.LandMarkTexNormal); + b->setColor(_MatchedLandmarks[k].Options.ColorNormal); + } + } + } + pL->invalidateCoords(); +} + //============================================================================================================ void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm) { @@ -2306,6 +2401,9 @@ void CGroupMap::removeLandMarks(TLandMarkButtonVect &lm) //============================================================================================================ void CGroupMap::createLMWidgets(const std::vector &lms) { + // disable any match in "world" mode + bool notWorldMode = _CurMap->Name != "world"; + for (uint32 k = 0; k < lms.size(); ++k) { const CContLandMark &rCLM =lms[k]; @@ -2314,6 +2412,12 @@ void CGroupMap::createLMWidgets(const std::vector &lms) worldToMap(mapPos, rCLM.Pos); const ucstring ucsTmp(CStringManagerClient::getPlaceLocalizedName(rCLM.TitleTextID)); + const ucstring lcTitle = toLower(ucsTmp); + + bool searchMatch = notWorldMode && _LandmarkFilter.size() > 0 && filterLandmark(lcTitle); + if (searchMatch) + _MatchedLandmarks.push_back(SMatchedLandmark(rCLM.Pos, ucsTmp, _ContinentLMOptions)); + // Add button if not a region nor a place if ((rCLM.Type != CContLandMark::Region) && (rCLM.Type != CContLandMark::Place) && (rCLM.Type != CContLandMark::Street)) @@ -2323,6 +2427,7 @@ void CGroupMap::createLMWidgets(const std::vector &lms) else addLandMark(_ContinentLM, mapPos, CI18N::get("uiStable"), _ContinentLMOptions); _ContinentLM.back()->Type = rCLM.Type; + _ContinentLM.back()->SearchMatch = searchMatch; } else // just add a text { @@ -2341,6 +2446,7 @@ void CGroupMap::createLMWidgets(const std::vector &lms) pNewText->setShadowColor(CRGBA(0,0,0,255)); pNewText->setModulateGlobalColor(false); pNewText->Type = rCLM.Type; + pNewText->SearchMatch = searchMatch; _ContinentText.push_back(pNewText); addView(pNewText); } @@ -2369,6 +2475,7 @@ void CGroupMap::createLMWidgets(const std::vector &lms) void CGroupMap::createContinentLandMarks() { uint32 k; + _MatchedLandmarks.clear(); if (_MapMode != MapMode_Normal) return; if (_CurMap == NULL) return; @@ -2387,22 +2494,35 @@ void CGroupMap::createContinentLandMarks() if (_CurMap->Name == "world") { createLMWidgets(ContinentMngr.WorldMap); - invalidateCoords(); - return; } - - if (_CurContinent == NULL) return; - - // Continent Landmarks - createLMWidgets(_CurContinent->ContLandMarks); - // User Landmarks - for(k = 0; k < _CurContinent->UserLandMarks.size(); ++k) + else if (_CurContinent) { - NLMISC::CVector2f mapPos; - worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos); + // Continent Landmarks + createLMWidgets(_CurContinent->ContLandMarks); + // User Landmarks + for(k = 0; k < _CurContinent->UserLandMarks.size(); ++k) + { + NLMISC::CVector2f mapPos; + worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos); - addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k)); + CLandMarkOptions options = getUserLandMarkOptions(k); + addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, options); + + if (_LandmarkFilter.size() > 0) + { + if (filterLandmark(_CurContinent->UserLandMarks[k].Title)) + { + _MatchedLandmarks.push_back(SMatchedLandmark(_CurContinent->UserLandMarks[k].Pos, _CurContinent->UserLandMarks[k].Title, options)); + } + else + { + _UserLM.back()->setActive(false); + } + } + } } + + updateMatchedLandmarks(); invalidateCoords(); } @@ -2421,6 +2541,20 @@ static void hideTeleportButtonsInPopupMenuIfNotEnoughPriv() if(ie) ie->setActive(showTeleport); } +//============================================================================================================ +void CGroupMap::setLandmarkFilter(const std::string &s) +{ + _LandmarkFilter.clear(); + + if (!s.empty()) { + ucstring ucs; + ucs.fromUtf8(s); + splitUCString(toLower(s), ucstring(" "), _LandmarkFilter); + } + + // recreate landmarks + createContinentLandMarks(); +} //============================================================================================================ void CGroupMap::updateUserLandMarks() @@ -2440,6 +2574,10 @@ void CGroupMap::updateUserLandMarks() worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos); addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k)); + + // hide landmark if not matching filter + if (!filterLandmark(_CurContinent->UserLandMarks[k].Title)) + _UserLM.back()->setActive(false); } invalidateCoords(); @@ -2482,6 +2620,22 @@ void CGroupMap::updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOption lmb->setColorPushed(options.ColorPushed); } +//============================================================================================================ +bool CGroupMap::filterLandmark(const ucstring &title) const +{ + if (_LandmarkFilter.size() > 0) + { + ucstring lcTitle = toLower(title); + for(uint i = 0; i< _LandmarkFilter.size(); ++i) { + if (lcTitle.find(_LandmarkFilter[i]) == ucstring::npos) { + return false; + } + } + } + + return true; +} + //============================================================================================================ void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector2f &pos, const ucstring &title, const CLandMarkOptions &options) { @@ -2965,6 +3119,30 @@ void CGroupMap::targetLandmark(CCtrlButton *lm) } } +//========================================================================================================= +void CGroupMap::targetLandmarkResult(uint32 index) +{ + if (index > _MatchedLandmarks.size()) return; + + CCompassTarget ct; + ct.Pos = _MatchedLandmarks[index].Pos; + ct.Name = _MatchedLandmarks[index].Title; + // type sets compass arrow color + ct.setType(CCompassTarget::UserLandMark); + + centerOnWorldPos(ct.Pos); + + CInterfaceManager *im = CInterfaceManager::getInstance(); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_CompassId)); + if (gc) + { + gc->setActive(true); + gc->setTarget(ct); + gc->blink(); + CWidgetManager::getInstance()->setTopWindow(gc); + } +} + //========================================================================================================= void CGroupMap::getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos) { @@ -3159,6 +3337,51 @@ SMap *CGroupMap::getParentMap(SMap *map) // ACTION HANDLERS // ///////////////////// +//========================================================================================================= +// Set landmark filter +class CAHLandMarkFilter : public IActionHandler +{ + virtual void execute (CCtrlBase * /* pCaller */, const string ¶ms ) + { + string id = getParam(params, "map"); + + CGroupMap* map = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(id)); + if (!map) return; + + string text = getParam(params, "text"); + if (text.empty() && params.find("text=") == std::string::npos) + { + string group = getParam(params, "group"); + CGroupEditBox* eb = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(group)); + if (!eb) return; + + text = eb->getInputString().toUtf8(); + } + + map->setLandmarkFilter(text); + } +}; +REGISTER_ACTION_HANDLER(CAHLandMarkFilter, "land_mark_filter"); + +//========================================================================================================= +// Landmark selected from result list +class CAHLandMarkResultSelected : public IActionHandler +{ + virtual void execute (CCtrlBase * /* pCaller */, const string ¶ms) + { + string id = getParam(params, "map"); + CGroupMap* map = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(id)); + if (!map) return; + + sint index; + string nr = getParam(params, "index"); + if (!fromString(nr, index)) return; + + map->targetLandmarkResult(index); + } +}; +REGISTER_ACTION_HANDLER(CAHLandMarkResultSelected, "land_mark_result_selected"); + //========================================================================================================= // A land mark button has been pushed class CAHLandMarkSelected : public IActionHandler diff --git a/code/ryzom/client/src/interface_v3/group_map.h b/code/ryzom/client/src/interface_v3/group_map.h index a252bae11..52980c0d8 100644 --- a/code/ryzom/client/src/interface_v3/group_map.h +++ b/code/ryzom/client/src/interface_v3/group_map.h @@ -139,6 +139,9 @@ public: // center the map on the player void centerOnPlayer(); + // center current map on world coords (if not out of map bounds) + void centerOnWorldPos(const NLMISC::CVector2f &worldPos); + void setPlayerPos(const NLMISC::CVector2f &p) { _PlayerPos = p; } NLMISC::CVector2f getPlayerPos() const { return _PlayerPos; } // test if player is currently panning the map @@ -169,12 +172,16 @@ public: CLandMarkOptions getUserLandMarkOptions(uint32 lmindex) const; // target the given landmark void targetLandmark(CCtrlButton *lm); + void targetLandmarkResult(uint32 index); // get the world position of a landmark or return vector Null if not found void getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos); //Remove and re-create UserLandMarks void updateUserLandMarks(); + // set landmarks visibility based text query + void setLandmarkFilter(const std::string &s); + // set the selection axis pos & visibility void setSelectionAxis(bool active, const NLMISC::CVector2f &worldPos = NLMISC::CVector2f::Null); @@ -262,6 +269,7 @@ private: NLMISC::CVector2f Pos; CContLandMark::TContLMType Type; bool HandleEvents; + bool SearchMatch; public: virtual bool handleEvent (const NLGUI::CEventDescriptor& event) { @@ -279,6 +287,7 @@ private: Type = CContLandMark::Unknown; Pos.set(0.f, 0.f); HandleEvents = true; + SearchMatch = false; } }; typedef std::vector TLandMarkButtonVect; @@ -289,12 +298,14 @@ private: public: NLMISC::CVector2f Pos; CContLandMark::TContLMType Type; + bool SearchMatch; CLandMarkText(const TCtorParam ¶m) : CViewText(param) { Type = CContLandMark::Unknown; Pos.set(0.f, 0.f); + SearchMatch = false; } }; typedef std::vector TLandMarkTextVect; @@ -448,6 +459,20 @@ private: typedef std::set TDecos; TDecos _Decos; + // filter keywords + std::vector _LandmarkFilter; + struct SMatchedLandmark + { + SMatchedLandmark(const NLMISC::CVector2f pos, const ucstring &title, CLandMarkOptions opts) + : Pos(pos), Title(title), Options(opts) + {} + NLMISC::CVector2f Pos; + ucstring Title; + + CLandMarkOptions Options; + }; + std::vector _MatchedLandmarks; + ////////////////////// // Respawn handling // // //////////////// // @@ -486,6 +511,7 @@ private: */ void updateLandMarkList(TLandMarkButtonVect &lm); void updateLandMarkTextList(TLandMarkTextVect &lm); + void updateMatchedLandmarks(); // void removeLandMarks(TLandMarkButtonVect &lm); /** create landmarks from the continent (and remove previous ones) @@ -501,6 +527,9 @@ private: // update a landmark button void updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOptions &options); + // Test title against landmark filter + bool filterLandmark(const ucstring &title) const; + // update the scale depending on the window size and the user scale void updateScale(); diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index a63d4b5ac..7fbda32a1 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -471,6 +471,16 @@ CInterfaceManager::CInterfaceManager() CGroupHTML::options.appName = getUserAgentName(); CGroupHTML::options.appVersion = getUserAgentVersion(); CGroupHTML::options.curlMaxConnections = ClientCfg.CurlMaxConnections; + if (!ClientCfg.CurlCABundle.empty()) + { + string filename = CPath::lookup(ClientCfg.CurlCABundle, false); + if (!filename.empty()) + { + filename = CPath::getFullPath(filename, false); + CGroupHTML::options.curlCABundle = filename; + nlinfo("curl ca bundle '%s'", filename.c_str()); + } + } NLGUI::CDBManager::getInstance()->resizeBanks( NB_CDB_BANKS ); interfaceLinkUpdater = new CInterfaceLink::CInterfaceLinkUpdater(); diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 241e8f269..36780f9e5 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -491,6 +491,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) luabind::module(L) [ LUABIND_FUNC(getDbProp), + LUABIND_FUNC(getDbProp64), LUABIND_FUNC(setDbProp), LUABIND_FUNC(addDbProp), LUABIND_FUNC(delDbProp), @@ -2570,6 +2571,22 @@ sint32 CLuaIHMRyzom::getDbProp(const std::string &dbProp) } } +sint64 CLuaIHMRyzom::getDbProp64(const std::string &dbProp) +{ + //H_AUTO(Lua_CLuaIHM_getDbProp) + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false); + + if (node) + return node->getValue64(); + else + { + debugInfo(toString("getDbProp(): '%s' dbProp Not found", dbProp.c_str())); + return 0; + } +} + + void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value) { //H_AUTO(Lua_CLuaIHM_setDbProp) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 0c29bbd3c..fa8e57c9c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -120,6 +120,7 @@ private: ///////////////////////////// Standard Lua stuff ends here ////////////////////////////////////////////// static sint32 getDbProp(const std::string &dbProp); // return 0 if not found. + static sint64 getDbProp64(const std::string &dbProp); // return 0 if not found. static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present. static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present. static void delDbProp(const std::string &dbProp); diff --git a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp index fdb4f45c8..cff97fc68 100644 --- a/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp +++ b/code/ryzom/client/src/interface_v3/macrocmd_manager.cpp @@ -777,6 +777,25 @@ public: }; REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdEdit, "new_macro_cmd_edit"); +// *************************************************************************** +// Called from context menu when we right click on a command of the new_macro container +class CHandlerNewMacroCmdCopy: public IActionHandler +{ +public: + virtual void execute(CCtrlBase *pCaller, const string &/* Params */) + { + CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); + sint nCmdNb = getCmdNbFromId(pCaller->getId()); + pMCM->CurrentEditMacro.addCommand(pMCM->CurrentEditMacro.Commands[nCmdNb].Name, + pMCM->CurrentEditMacro.Commands[nCmdNb].Params, + nCmdNb); + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + CMacroCmdManager::getInstance()->EditCmd->deactivate(); + CAHManager::getInstance()->runActionHandler("new_macro_open",NULL); + } +}; +REGISTER_ACTION_HANDLER( CHandlerNewMacroCmdCopy, "new_macro_cmd_copy"); + // *************************************************************************** // Called from context menu when we right click on a command of the new_macro container class CHandlerNewMacroCmdDelete: public IActionHandler @@ -1087,6 +1106,29 @@ public: }; REGISTER_ACTION_HANDLER( CHandlerMacrosEdit, "macros_edit"); +// *************************************************************************** +// Called from context menu on a macro +class CHandlerMacrosCopy : public IActionHandler +{ +public: + virtual void execute(CCtrlBase *pCaller, const string &/* Params */) + { + sint nMacNb = getMacroFromId(pCaller->getId()); + CInterfaceManager *pIM = CInterfaceManager::getInstance(); + CMacroCmdManager *pMCM = CMacroCmdManager::getInstance(); + + // duplicate selected macro + CMacroCmd m = pMCM->getMacros()[nMacNb]; + m.ID = -1; + m.Combo.Key = KeyCount; + m.Combo.KeyButtons = noKeyButton; + pMCM->addMacro(m, nMacNb+1); + + CAHManager::getInstance()->runActionHandler("macros_open",NULL); + } +}; +REGISTER_ACTION_HANDLER( CHandlerMacrosCopy, "macros_copy"); + // *************************************************************************** // Called from context menu on a macro class CHandlerMacrosDel : public IActionHandler diff --git a/code/ryzom/common/src/game_share/generate_client_db.xslt b/code/ryzom/common/src/game_share/generate_client_db.xslt index 0680a3e39..699630569 100644 --- a/code/ryzom/common/src/game_share/generate_client_db.xslt +++ b/code/ryzom/common/src/game_share/generate_client_db.xslt @@ -58,9 +58,37 @@ +// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + ///////////////////////////////////////////////////////////////// -// WARNING : this is a generated file, don't change it ! +// +// +// +// +// +// WARNING : this is a generated file, don't change it ! +// +// +// +// +// +// ///////////////////////////////////////////////////////////////// + #include "stdpch.h" #include "database_.h" @@ -125,8 +153,35 @@ void CBankAccessor_::init() #ifndef INCLUDED__H #define INCLUDED__H +// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + ///////////////////////////////////////////////////////////////// -// WARNING : this is a generated file, don't change it ! +// +// +// +// +// +// WARNING : this is a generated file, don't change it ! +// +// +// +// +// +// ///////////////////////////////////////////////////////////////// #include "nel/misc/string_common.h" @@ -693,4 +748,4 @@ void ::init(ICDBStructNode *parent< - \ No newline at end of file + diff --git a/code/ryzom/common/src/game_share/pvp_clan.cpp b/code/ryzom/common/src/game_share/pvp_clan.cpp index d6b4f6a0a..f030b73f5 100644 --- a/code/ryzom/common/src/game_share/pvp_clan.cpp +++ b/code/ryzom/common/src/game_share/pvp_clan.cpp @@ -37,6 +37,7 @@ namespace PVP_CLAN NL_STRING_CONVERSION_TABLE_ENTRY(Matis) NL_STRING_CONVERSION_TABLE_ENTRY(Tryker) NL_STRING_CONVERSION_TABLE_ENTRY(Zorai) + NL_STRING_CONVERSION_TABLE_ENTRY(Marauder) NL_END_STRING_CONVERSION_TABLE(TPVPClan, PVPClanConversion, Unknown) TPVPClan fromString(const std::string & str) @@ -69,6 +70,7 @@ namespace PVP_CLAN factionIndexes[Matis] = CStaticFames::getInstance().getFactionIndex("matis"); factionIndexes[Tryker] = CStaticFames::getInstance().getFactionIndex("tryker"); factionIndexes[Zorai] = CStaticFames::getInstance().getFactionIndex("zorai"); + factionIndexes[Marauder] = CStaticFames::getInstance().getFactionIndex("black_kami"); for (uint i = BeginClans; i <= EndClans; i++) nlassert( factionIndexes[i] != CStaticFames::INVALID_FACTION_INDEX ); @@ -84,7 +86,7 @@ namespace PVP_CLAN { // These names are in order of the enum TPVPClan // The first two clans, "None" and "Neutral", don't count. Subtract 2 from the lookup. - std::string FactionNames[] = { "kami","karavan","fyros","matis","tryker","zorai" }; + std::string FactionNames[] = { "kami","karavan","fyros","matis","tryker","zorai","marauder" }; for (int looper = BeginClans; looper <= EndClans; looper += 1) { @@ -111,6 +113,7 @@ namespace PVP_CLAN factionSheetIds[Matis] = "matis.faction"; factionSheetIds[Tryker] = "tryker.faction"; factionSheetIds[Zorai] = "zorai.faction"; + factionSheetIds[Marauder] = "marauder.faction"; for (uint i = BeginClans; i <= EndClans; i++) nlassert( factionSheetIds[i] != NLMISC::CSheetId::Unknown ); diff --git a/code/ryzom/common/src/game_share/pvp_clan.h b/code/ryzom/common/src/game_share/pvp_clan.h index 717c5c138..14352828b 100644 --- a/code/ryzom/common/src/game_share/pvp_clan.h +++ b/code/ryzom/common/src/game_share/pvp_clan.h @@ -44,7 +44,9 @@ namespace PVP_CLAN Zorai, EndCivs = Zorai, // end of civs - EndClans = Zorai, // end of clans + + Marauder, + EndClans = Marauder, // end of clans Unknown, NbClans = Unknown, diff --git a/code/ryzom/common/src/game_share/sabrina_com.cpp b/code/ryzom/common/src/game_share/sabrina_com.cpp index 234bf2a87..e7d21cd60 100644 --- a/code/ryzom/common/src/game_share/sabrina_com.cpp +++ b/code/ryzom/common/src/game_share/sabrina_com.cpp @@ -140,6 +140,55 @@ TOOL_TYPE::TCraftingToolType CSabrinaCom::getPhraseFaberPlanToolType(const std: return TOOL_TYPE::Unknown; } +// *************************************************************************** +BRICK_FAMILIES::TBrickFamily CSabrinaCom::getPhraseForageFamily(const std::vector &phraseBricks) const +{ + if(phraseBricks.empty()) + return BRICK_FAMILIES::Unknown; + + BRICK_TYPE::EBrickType bType= _BC->getBrickType(phraseBricks[0]); + if ( (bType == BRICK_TYPE::FORAGE_PROSPECTION) || (bType == BRICK_TYPE::FORAGE_EXTRACTION) ) + { + for ( uint i=1; igetBrickFamily( brickId, indexInFamily ); + // FPMA=prospection, FEMA=extraction + if ((brickFamily == BRICK_FAMILIES::BHFPMA || brickFamily == BRICK_FAMILIES::BHFEMA)) + { + // remapping need to be used because prospection ecosystem families + // have resource speciality inserted right in the middle + // luckily indexInFamily and TBrickFamily is defined in the same order + BRICK_FAMILIES::TBrickFamily bf = (BRICK_FAMILIES::TBrickFamily)(brickFamily + indexInFamily - 1); + // A:matis, B:fyros, C:zorai, D:tryker, E:prime roots + switch (bf) { + case BRICK_FAMILIES::BHFPMA: + case BRICK_FAMILIES::BHFPMB: + return bf; + case BRICK_FAMILIES::BHFPRMFMA: + return BRICK_FAMILIES::BHFPMC; + case BRICK_FAMILIES::BHFPRMFMB: + return BRICK_FAMILIES::BHFPMD; + case BRICK_FAMILIES::BHFPRMFMC: + return BRICK_FAMILIES::BHFPME; + case BRICK_FAMILIES::BHFEMA: + case BRICK_FAMILIES::BHFEMB: + case BRICK_FAMILIES::BHFEMC: + case BRICK_FAMILIES::BHFEMD: + case BRICK_FAMILIES::BHFEME: + return bf; + default: + break; + } + } + } + } + + return BRICK_FAMILIES::Unknown; +} + // *************************************************************************** NLMISC::CSheetId CSabrinaCom::getPhraseBestDisplayBrick(const std::vector &phraseBricks) const { diff --git a/code/ryzom/common/src/game_share/sabrina_com.h b/code/ryzom/common/src/game_share/sabrina_com.h index 4613cdcd0..d799a421e 100644 --- a/code/ryzom/common/src/game_share/sabrina_com.h +++ b/code/ryzom/common/src/game_share/sabrina_com.h @@ -91,6 +91,9 @@ public: /// For Faber. TOOL_TYPE::TCraftingToolType getPhraseFaberPlanToolType(const std::vector &phraseBricks) const; + //// For Display, if ecosystem is in use, then return it + BRICK_FAMILIES::TBrickFamily getPhraseForageFamily(const std::vector &phraseBricks) const; + /// For Display. Return the brick (should be in phrase) used to display the phrase as icon NLMISC::CSheetId getPhraseBestDisplayBrick(const std::vector &phraseBricks) const;