From 1e7904c5cd5d28a2354c0a06e2d76f55953e7a30 Mon Sep 17 00:00:00 2001 From: Ulu Kyn Date: Fri, 23 Mar 2018 23:11:22 +0000 Subject: [PATCH 01/25] Added tag 3.3.0 for changeset 00dde390a394 --HG-- branch : develop --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5ff627e15..8304168ca 100644 --- a/.hgtags +++ b/.hgtags @@ -12,3 +12,4 @@ 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 From b1f1e081a7f9c616de507500e92125ff570dda4b Mon Sep 17 00:00:00 2001 From: Ulu Kyn Date: Wed, 2 May 2018 16:10:15 +0000 Subject: [PATCH 02/25] Added tag ryzom-patch-3.3.1 for changeset dcd4c4d161ef --HG-- branch : develop --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8304168ca..6a404b346 100644 --- a/.hgtags +++ b/.hgtags @@ -13,3 +13,4 @@ bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3 4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0 043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch 00dde390a394fce9da06c2f3264140282158d39f 3.3.0 +dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1 From aa612e379937bbce970511f4dd475d2793b3b1bd Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 30 Apr 2018 15:14:04 +0300 Subject: [PATCH 03/25] Changed: Set max map scale from client cfg --HG-- branch : develop --- code/ryzom/client/client_default.cfg | 4 ++++ code/ryzom/client/data/gamedev/interfaces_v3/map.xml | 7 ++----- code/ryzom/client/src/client_cfg.cpp | 6 ++++++ code/ryzom/client/src/client_cfg.h | 4 ++++ code/ryzom/client/src/interface_v3/group_map.cpp | 2 ++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index c128ac28a..0f917d2f4 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -315,6 +315,10 @@ CameraSpeedMin = 2.0; CameraSpeedMax = 100.0; CameraResetSpeed = 10.0; // Speed in radian/s +// Default values for map +MaxMapScale = 2.0f; +R2EDMaxMapScale = 8.0f; + ////////////////// // SOUND CONFIG // ////////////////// diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml index dcc2515ea..66d948e03 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml @@ -316,9 +316,7 @@ selection_axis_color = "0 0 0 127" compass="ui:interface:compass" - scale_max="2" - scale_max_r2="8" - /> + /> @@ -409,8 +407,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 4e644ff14..881f99b16 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -603,6 +603,9 @@ CClientConfig::CClientConfig() CameraSpeedMax = 1.0f; CameraResetSpeed = 2.0f; + MaxMapScale = 2.0f; + R2EDMaxMapScale = 8.0f; + // VERBOSES VerboseVP = false; VerboseAnimUser = false; @@ -1466,6 +1469,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 4d4d746e0..aa9eba8c2 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -591,6 +591,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/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 929e35f71..6160db539 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -711,9 +711,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); // From b48b1dc0cccdf6f69b188fb0fd02aa90741980f5 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 2 May 2018 17:05:35 +0300 Subject: [PATCH 04/25] Changed: Set icon background from land speciality sbrick --HG-- branch : develop --- .../client/src/interface_v3/dbctrl_sheet.cpp | 38 +++++++++++++- .../common/src/game_share/sabrina_com.cpp | 49 +++++++++++++++++++ .../ryzom/common/src/game_share/sabrina_com.h | 3 ++ 3 files changed, 89 insertions(+), 1 deletion(-) 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/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; From 23d95705fd03c6075689a07e6819369267808936 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 1 Mar 2017 20:04:54 +0200 Subject: [PATCH 05/25] Added: Map search filter --HG-- branch : develop --- code/nel/src/gui/group_editbox.cpp | 2 +- .../data/gamedev/interfaces_v3/commands.xml | 3 + .../client/data/gamedev/interfaces_v3/map.xml | 84 ++++++++++++++- .../client/src/interface_v3/group_map.cpp | 100 +++++++++++++++++- .../ryzom/client/src/interface_v3/group_map.h | 14 +++ 5 files changed, 196 insertions(+), 7 deletions(-) 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/ryzom/client/data/gamedev/interfaces_v3/commands.xml b/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml index 31a1a7099..2a8897555 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/commands.xml @@ -122,6 +122,9 @@ + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml index 66d948e03..f2e90bbc0 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,7 +158,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -191,8 +236,10 @@ + - + @@ -317,8 +364,39 @@ compass="ui:interface:compass" /> - - + + + + + + + + + diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index 6160db539..a05a6f9bb 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(); + _MatchedLandmarkCount = 0; // _ScaleMax = 8.f; _ScaleMaxR2 = 8.f; @@ -902,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); @@ -2316,6 +2328,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 = _LandmarkFilter.size() > 0 && filterLandmark(lcTitle); + if (searchMatch) + _MatchedLandmarkCount++; + // Add button if not a region nor a place if ((rCLM.Type != CContLandMark::Region) && (rCLM.Type != CContLandMark::Place) && (rCLM.Type != CContLandMark::Street)) @@ -2325,6 +2343,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 { @@ -2343,6 +2362,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); } @@ -2372,6 +2392,8 @@ void CGroupMap::createContinentLandMarks() { uint32 k; + _MatchedLandmarkCount = 0; + if (_MapMode != MapMode_Normal) return; if (_CurMap == NULL) return; @@ -2403,8 +2425,24 @@ void CGroupMap::createContinentLandMarks() NLMISC::CVector2f mapPos; worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos); - addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k)); + if (filterLandmark(_CurContinent->UserLandMarks[k].Title)) + { + addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k)); + _MatchedLandmarkCount++; + } } + + // update visible landmark count + CInterfaceGroup *gc = getParentContainer(); + if (gc) + { + CViewText *pVT = dynamic_cast(gc->getView("lm_count")); + if (pVT) + { + pVT->setText(toString(_MatchedLandmarkCount)); + } + } + invalidateCoords(); } @@ -2423,6 +2461,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() @@ -2484,6 +2536,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) { @@ -3161,6 +3229,32 @@ 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"); + //========================================================================================================= // 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..bead3d20f 100644 --- a/code/ryzom/client/src/interface_v3/group_map.h +++ b/code/ryzom/client/src/interface_v3/group_map.h @@ -175,6 +175,9 @@ public: //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 +265,7 @@ private: NLMISC::CVector2f Pos; CContLandMark::TContLMType Type; bool HandleEvents; + bool SearchMatch; public: virtual bool handleEvent (const NLGUI::CEventDescriptor& event) { @@ -279,6 +283,7 @@ private: Type = CContLandMark::Unknown; Pos.set(0.f, 0.f); HandleEvents = true; + SearchMatch = false; } }; typedef std::vector TLandMarkButtonVect; @@ -289,12 +294,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 +455,10 @@ private: typedef std::set TDecos; TDecos _Decos; + // filter keywords + std::vector _LandmarkFilter; + uint32 _MatchedLandmarkCount; + ////////////////////// // Respawn handling // // //////////////// // @@ -501,6 +512,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(); From 6389fe3048d931e99977cbbc5698ebeabb90f48f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 7 May 2018 16:53:54 +0300 Subject: [PATCH 06/25] Fixed: Bad value in client_default.cfg --HG-- branch : develop --- code/ryzom/client/client_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 0f917d2f4..6de6c1e8e 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -316,8 +316,8 @@ CameraSpeedMax = 100.0; CameraResetSpeed = 10.0; // Speed in radian/s // Default values for map -MaxMapScale = 2.0f; -R2EDMaxMapScale = 8.0f; +MaxMapScale = 2.0; +R2EDMaxMapScale = 8.0; ////////////////// // SOUND CONFIG // From 98ae75fe571a8924ce8b133dc524755c35a6af2f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 7 May 2018 21:37:40 +0300 Subject: [PATCH 07/25] Added: curl ca bundle option to client cfg --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 2 ++ code/nel/src/gui/group_html.cpp | 18 ++++++++++++++---- code/ryzom/client/client_default.cfg | 5 +++++ code/ryzom/client/src/client_cfg.cpp | 3 +++ code/ryzom/client/src/client_cfg.h | 1 + .../src/interface_v3/interface_manager.cpp | 10 ++++++++++ 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 8d3478579..56144b61e 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) { diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 7b2621b18..de1064bd7 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; @@ -5354,13 +5359,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); diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 6de6c1e8e..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 // diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index 881f99b16..112875cc9 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -430,6 +430,7 @@ CClientConfig::CClientConfig() WebIgTrustedDomains.push_back(WebIgMainDomain); CurlMaxConnections = 2; + CurlCABundle.clear(); RingReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes_ring/index.php"; ReleaseNotePath = "http://" + WebIgMainDomain + "/releasenotes/index.php"; @@ -1087,6 +1088,8 @@ void CClientConfig::setValues() if (ClientCfg.CurlMaxConnections < 0) ClientCfg.CurlMaxConnections = 2; + READ_STRING_FV(CurlCABundle); + /////////////// // ANIMATION // // AnimatedAngleThreshold diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index aa9eba8c2..f562dfde0 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -308,6 +308,7 @@ struct CClientConfig std::vector WebIgTrustedDomains; sint32 CurlMaxConnections; + string CurlCABundle; /////////////// // ANIMATION // diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 14abf00a1..53eddd7b9 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(); From e625f2b3c7e1dd6c36ff40c025422d58c4f19d81 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 10 May 2018 12:46:11 +0300 Subject: [PATCH 08/25] Fixed: Mouse wheel should scroll target object instead scroll bar (fixes issue #327) --HG-- branch : develop --- code/nel/src/gui/ctrl_scroll.cpp | 2 +- code/nel/src/gui/interface_group.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index 9c9585fcc..50e7c6aa1 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; } } 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(); } From 5b4759df72bf2347cb3cc6699ff11ef0b0e6899e Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 10 May 2018 15:30:01 +0300 Subject: [PATCH 09/25] Changed: Show map search results in a list --HG-- branch : develop --- .../client/data/gamedev/interfaces_v3/map.xml | 42 +++- .../client/src/interface_v3/group_map.cpp | 187 +++++++++++++++--- .../ryzom/client/src/interface_v3/group_map.h | 17 +- 3 files changed, 211 insertions(+), 35 deletions(-) diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml index f2e90bbc0..0f1ab111c 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/map.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/map.xml @@ -204,6 +204,31 @@ + + + + + + h="-4" + child_resize_w="true"> + + + + + + + + + + + diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index a05a6f9bb..a841beb44 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -427,7 +427,7 @@ CGroupMap::CGroupMap(const TCtorParam ¶m) _TargetLM = NULL; _HomeLM = NULL; _LandmarkFilter.clear(); - _MatchedLandmarkCount = 0; + _MatchedLandmarks.clear(); // _ScaleMax = 8.f; _ScaleMaxR2 = 8.f; @@ -2249,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 */) @@ -2271,7 +2296,6 @@ void CGroupMap::setScale(float newScale) setScale(newScale, mapCoords); } - //============================================================================================================ void CGroupMap::updateLandMarkList(TLandMarkButtonVect &lmVect) { @@ -2303,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) { @@ -2320,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]; @@ -2330,9 +2414,9 @@ void CGroupMap::createLMWidgets(const std::vector &lms) const ucstring ucsTmp(CStringManagerClient::getPlaceLocalizedName(rCLM.TitleTextID)); const ucstring lcTitle = toLower(ucsTmp); - bool searchMatch = _LandmarkFilter.size() > 0 && filterLandmark(lcTitle); + bool searchMatch = notWorldMode && _LandmarkFilter.size() > 0 && filterLandmark(lcTitle); if (searchMatch) - _MatchedLandmarkCount++; + _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) && @@ -2391,8 +2475,7 @@ void CGroupMap::createLMWidgets(const std::vector &lms) void CGroupMap::createContinentLandMarks() { uint32 k; - - _MatchedLandmarkCount = 0; + _MatchedLandmarks.clear(); if (_MapMode != MapMode_Normal) return; if (_CurMap == NULL) return; @@ -2411,38 +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); - - if (filterLandmark(_CurContinent->UserLandMarks[k].Title)) + // Continent Landmarks + createLMWidgets(_CurContinent->ContLandMarks); + // User Landmarks + for(k = 0; k < _CurContinent->UserLandMarks.size(); ++k) { - addLandMark(_UserLM, mapPos, _CurContinent->UserLandMarks[k].Title, getUserLandMarkOptions(k)); - _MatchedLandmarkCount++; - } - } - - // update visible landmark count - CInterfaceGroup *gc = getParentContainer(); - if (gc) - { - CViewText *pVT = dynamic_cast(gc->getView("lm_count")); - if (pVT) - { - pVT->setText(toString(_MatchedLandmarkCount)); + NLMISC::CVector2f mapPos; + worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos); + + 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(); } @@ -3035,6 +3115,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) { @@ -3255,6 +3359,25 @@ class CAHLandMarkFilter : public IActionHandler }; 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 bead3d20f..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,6 +172,7 @@ 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); @@ -457,7 +461,17 @@ private: // filter keywords std::vector _LandmarkFilter; - uint32 _MatchedLandmarkCount; + 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 // @@ -497,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) From b5a0fbe2663a39fe42412f213d689332ed27693e Mon Sep 17 00:00:00 2001 From: Riasan Date: Wed, 9 May 2018 21:33:02 +0200 Subject: [PATCH 10/25] Changed: rework "creat guild" UI Window --HG-- branch : develop --- .../gamedev/interfaces_v3/bot_chat_v4.xml | 126 ++++++++++-------- 1 file changed, 69 insertions(+), 57 deletions(-) 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" /> + Date: Fri, 11 May 2018 14:42:49 +0300 Subject: [PATCH 11/25] Added: Duplicating macro or macro commands --HG-- branch : develop --- .../data/gamedev/interfaces_v3/macros.xml | 4 ++ .../src/interface_v3/macrocmd_manager.cpp | 42 +++++++++++++++++++ 2 files changed, 46 insertions(+) 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/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 From 4cca062177aa906a8682373d3905875780177ec7 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 11 May 2018 14:51:54 +0300 Subject: [PATCH 12/25] Changed: Move leave team menu option --HG-- branch : develop --- .../client/data/gamedev/interfaces_v3/game_context_menu.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @@ + + + From a62c8eefd46f2ff1892a5d9f20edec59ba2f8e9c Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 13 May 2018 17:00:45 +0300 Subject: [PATCH 13/25] Fixed: Filtered user landmarks became visible when landmark was edited/removed. --HG-- branch : develop --- code/ryzom/client/src/interface_v3/group_map.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index a841beb44..37a0a8a57 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -2574,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(); From ebbb270bc1b3ca6624d82496e4d6125e6b71bd49 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 13 May 2018 17:00:45 +0300 Subject: [PATCH 14/25] Fixed: Use target_stepy to calculate dy for scrolling --HG-- branch : develop --- code/nel/src/gui/ctrl_scroll.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/nel/src/gui/ctrl_scroll.cpp b/code/nel/src/gui/ctrl_scroll.cpp index 50e7c6aa1..acdaa15f5 100644 --- a/code/nel/src/gui/ctrl_scroll.cpp +++ b/code/nel/src/gui/ctrl_scroll.cpp @@ -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; From 30caac063eae3f9b3cdfad6f480005f65ef0b872 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Wed, 23 May 2018 22:18:19 +0300 Subject: [PATCH 15/25] Fixed: Wrong text width when used inside html list element --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 2faae3a0a..c14a7f9a1 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -886,8 +886,8 @@ namespace NLGUI return _LineMaxW; else { - sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal()); - return std::min(parentWidth-(sint)(_XReal-_Parent->getXReal()), (sint)_LineMaxW); + sint parentWidth = std::min(_Parent->getMaxWReal(), _Parent->getWReal() - _Parent->getMarginLeft()); + return std::min(parentWidth-(sint)(_XReal-(_Parent->getXReal()-_Parent->getMarginLeft())), (sint)_LineMaxW); } } From c228349098c97cddf2d46a9e14e95c150894230f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 28 May 2018 14:36:58 +0300 Subject: [PATCH 16/25] Added: Personal projects directory --HG-- branch : develop --- .hgignore | 3 +++ code/CMakeLists.txt | 4 ++++ code/personal/README.md | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 code/personal/README.md 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/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/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) +``` + From e2617bfe9bd64345b56d2947a21663f31b576381 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 28 May 2018 14:46:16 +0300 Subject: [PATCH 17/25] Fixed: Decoding dds with improper width/height --HG-- branch : develop --- code/nel/src/misc/bitmap.cpp | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) 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; } } From 97d0d45384fde8f8fc4187f2b06db0dafcf61387 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 29 May 2018 22:34:29 +0300 Subject: [PATCH 18/25] Fixed: lua:showDiv accessing already deleted objects --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index de1064bd7..ef193b54e 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4027,13 +4027,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 (); @@ -4043,13 +4036,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); @@ -4889,13 +4875,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()) From 6573d96fd7c44393a864e4898303e97946739eba Mon Sep 17 00:00:00 2001 From: ulukyn Date: Thu, 31 May 2018 21:03:05 +0200 Subject: [PATCH 19/25] Fixed: enable _TrustedDomain when html is rendered by lua code --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index ef193b54e..c3494028c 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -5830,6 +5830,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; From 6499b1b0535280f17e91da87126c025099bde819 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Wed, 6 Jun 2018 14:15:42 +0200 Subject: [PATCH 20/25] Added: getDbProp64 to get 64b values from db with lua --HG-- branch : develop --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 17 +++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 2 files changed, 18 insertions(+) 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); From f80e36ebd689bf17893a0f930cb5481e554d8272 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 7 Jun 2018 12:59:58 +0300 Subject: [PATCH 21/25] Changed: Workaround for huge target reticle when max polygon is set to low --HG-- branch : develop --- code/ryzom/client/src/entity_cl.cpp | 2 ++ code/ryzom/client/src/init_main_loop.cpp | 2 ++ 2 files changed, 4 insertions(+) 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); From f0757edb36fe1c03bc68cf3ba1e39bdd09dc3090 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Thu, 7 Jun 2018 17:01:51 +0200 Subject: [PATCH 22/25] Added: New PvpClan "Marauder" based on fame "black_kami" --HG-- branch : develop --- code/ryzom/common/src/game_share/pvp_clan.cpp | 5 ++++- code/ryzom/common/src/game_share/pvp_clan.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) 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, From 24b99e677c9a1069b1c42d5269fb0541be1b481e Mon Sep 17 00:00:00 2001 From: ulukyn Date: Thu, 7 Jun 2018 17:49:15 +0200 Subject: [PATCH 23/25] Changed: Added WinchGate headers to generate_client_db --HG-- branch : develop --- .../src/game_share/generate_client_db.xslt | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) 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 + From 1a128ac26987316adf71be909a2de095e345e944 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Tue, 12 Jun 2018 13:39:33 +0200 Subject: [PATCH 24/25] Added: Diplay:inline-block option to style of div in group_html --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index c3494028c..e0ed401ce 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1570,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)); } From 0863830734194f226bf1fb5a34a6d4217e961eaf Mon Sep 17 00:00:00 2001 From: ulukyn Date: Tue, 12 Jun 2018 14:43:20 +0200 Subject: [PATCH 25/25] Added: Downloadable textures in texture property of CViewBitmap --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 16 ++++++++++------ code/nel/src/gui/view_bitmap.cpp | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 56144b61e..35ba3e40e 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -106,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(); @@ -151,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);} @@ -722,6 +730,8 @@ namespace NLGUI return 0; return _Indent.back(); } + + // Current node is a title bool _Title; @@ -811,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 { @@ -857,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/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); } // ----------------------------------------------------------------------------