diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 50b381a3c..e88bdfbc5 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -5503,7 +5503,7 @@ namespace NLGUI string suri = elm.getAttribute("href"); if(suri.find("ah:") == 0) { - if (_TrustedDomain) + if (_TrustedDomain || suri.find("ah:script:") == 0) _Link.back() = suri; } else @@ -6360,11 +6360,13 @@ namespace NLGUI void CGroupHTML::htmlOBJECTend(const CHtmlElement &elm) { - if (!_TrustedDomain) - return; + if (_ObjectType=="application/ryzom-data") { + if (!_TrustedDomain) + return; + if (!_ObjectData.empty()) { if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript, _ObjectMD5Sum)) @@ -6374,6 +6376,20 @@ namespace NLGUI _ObjectScript.clear(); } } + else if (_ObjectType=="application/ryzom-tutorial") + { + while(strFindReplace(_ObjectScript, "[", "〈")); + while(strFindReplace(_ObjectScript, "]", "〉")); + CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true); + _ObjectScript.clear(); + } + else if (_ObjectType=="application/ryzom-script") + { + while(strFindReplace(_ObjectScript, "[", "〈")); + while(strFindReplace(_ObjectScript, "]", "〉")); + CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true); + _ObjectScript.clear(); + } _Object = false; } diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index df1debee2..6758d440a 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -326,8 +326,8 @@ CClientConfig::CClientConfig() Local = false; // Default is Net Mode. FSHost = ""; // Default Host. - TexturesInterface.push_back("texture_interfaces_v3"); - TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); + TexturesInterface.push_back("texture_interfaces_v3_2x"); + TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc_2x"); TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); @@ -782,8 +782,8 @@ void CClientConfig::setValues() READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC); // interface textures ingame and r2 - READ_STRINGVECTOR_FV(TexturesInterface); - READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); + //READ_STRINGVECTOR_FV(TexturesInterface); + //READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); // interface files login menus READ_STRINGVECTOR_FV(XMLLoginInterfaceFiles); diff --git a/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp b/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp index d25763bff..839381b91 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_manager.cpp @@ -86,6 +86,12 @@ void CBotChatManager::setCurrPage(CBotChatPage *page) UserEntity->trader(CLFECOMMON::INVALID_SLOT); } _CurrPage = page; + + if (page == NULL && !_AHAfterEnd.empty()) + { + CAHManager::getInstance()->runActionHandler(_AHAfterEnd, NULL, ""); + _AHAfterEnd = ""; + } } // ******************************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/bot_chat_manager.h b/code/ryzom/client/src/interface_v3/bot_chat_manager.h index cbd2713f8..9b9f996fc 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_manager.h +++ b/code/ryzom/client/src/interface_v3/bot_chat_manager.h @@ -93,12 +93,15 @@ public: // Called for local client debugging void debugLocalReceiveMissionInfo(); + void setAHAfterEnd(const std::string &ah) { _AHAfterEnd = ah ;} + ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// private: CBotChatPage *_CurrPage; uint16 _SessionID; + std::string _AHAfterEnd; static CBotChatManager *_Instance; //uint _ChosenMissionFlags; diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp index ad95a35e5..4830fb096 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.cpp @@ -161,6 +161,7 @@ void CBotChatPageMission::acceptMission() /// close the botchat //CBotChatManager::getInstance()->setCurrPage(NULL); _CurrSel = NULL; + CBotChatManager::getInstance()->setAHAfterEnd("context_choose_mission"); } diff --git a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.h b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.h index 03cb8d95e..0e458fc7a 100644 --- a/code/ryzom/client/src/interface_v3/bot_chat_page_mission.h +++ b/code/ryzom/client/src/interface_v3/bot_chat_page_mission.h @@ -51,6 +51,7 @@ private: // an observer to update big mission list from littles pages in server database CHugeListObs _MissionPagesObs; CDBCtrlSheet *_CurrSel; + bool _HaveAcceptedMission; MISSION_DESC::TClientMissionType _MType; }; diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index 2276eb506..015800173 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -28,6 +28,7 @@ #include "nel/gui/action_handler.h" #include "../entities.h" #include "nel/gui/group_paragraph.h" // For CCtrlLink +#include "nel/gui/view_bitmap.h" #include "../net_manager.h" #include "../string_manager_client.h" #include "../login.h" @@ -644,14 +645,42 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const ucstring &message, "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); if (group) { + ucstring finalMessage = message; + + ucstring::size_type pos = message.find(ucstring("|")); + if (pos != std::string::npos) + { + CViewBitmap *pViewIcon = dynamic_cast(group->getView("iconA")); + if (pViewIcon != NULL) + { + string texture = message.substr(0, pos).toString(); + pViewIcon->setTexture(texture); + } + + ucstring::size_type end = message.find(ucstring("|"), pos+1); + if (end != std::string::npos) + { + CViewBitmap *pViewIcon = dynamic_cast(group->getView("iconZ")); + if (pViewIcon != NULL) + { + string texture = message.substr(end+1).toString(); + pViewIcon->setTexture(texture); + } + finalMessage = message.substr(pos+1, end-pos-1); + } + else + finalMessage = message.substr(pos+1); + } + // Skill name CViewText *pViewName = dynamic_cast(group->getView("name")); if (pViewName != NULL) { - pViewName->setTextFormatTaged(message); + pViewName->setTextFormatTaged(finalMessage); pViewName->setColor (color); } + // Link to the interface CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); @@ -865,7 +894,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText, textSize = endOfOriginal; } } - + // Output the message in a bubble bool show = false; diff --git a/code/ryzom/client/src/interface_v3/group_quick_help.cpp b/code/ryzom/client/src/interface_v3/group_quick_help.cpp index 0b789fccf..e89967193 100644 --- a/code/ryzom/client/src/interface_v3/group_quick_help.cpp +++ b/code/ryzom/client/src/interface_v3/group_quick_help.cpp @@ -74,6 +74,8 @@ bool CGroupQuickHelp::submitEvent (const char *event) // Update the text updateParagraph (); + + CLuaManager::getInstance().executeLuaScript(toString("\ngame:processTutorialEvent(\"%s\")\n", event), true); } } return false; diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index e81785ea8..5231dc19a 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -2523,6 +2523,17 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal; CRGBA color = CRGBA::White; + ucstring cleanStr = str; + ucstring::size_type pos = str.find(ucstring("|")); + if (pos != std::string::npos) + { + ucstring::size_type end = str.find(ucstring("|"), pos+1); + if (end != std::string::npos) + cleanStr = str.substr(pos+1, end-pos-1); + else + cleanStr = str.substr(pos+1); + } + // If broadcast, parse lua code if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A') { @@ -2542,11 +2553,11 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat if (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around) { if (PeopleInterraction.SystemInfo) - PeopleInterraction.ChatInput.SystemInfo.displayMessage(str, color, 2); + PeopleInterraction.ChatInput.SystemInfo.displayMessage(cleanStr, color, 2); else { CPeopleInterraction::CSysMsg sysMsg; - sysMsg.Str = str; + sysMsg.Str = cleanStr; sysMsg.Cat = cat; PeopleInterraction.SystemMessageBuffer.push_back( sysMsg ); } @@ -2557,10 +2568,10 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat // If over popup a string at the bottom of the screen if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly)) - InSceneBubbleManager.addMessagePopup(str, color); + InSceneBubbleManager.addMessagePopup(cleanStr, color); else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround) && PeopleInterraction.AroundMe.Window) - PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2); + PeopleInterraction.ChatInput.AroundMe.displayMessage(cleanStr, color, 2); } 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 75b588ce0..ca5de98c8 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -184,6 +184,21 @@ private: REGISTER_ACTION_HANDLER(CHandlerLUA, "lua"); std::deque > CHandlerLUA::_UICallerStack; +// *************************************************************************** +class CHandlerSCRIPT : public IActionHandler +{ +public: + void execute(CCtrlBase *pCaller, const std::string &sParams) + { + string script = sParams; + while(strFindReplace(script, "[", "〈")); + while(strFindReplace(script, "]", "〉")); + strFindReplace(script, "|", "\n"); + CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true); + } +}; +REGISTER_ACTION_HANDLER(CHandlerSCRIPT, "script"); + // *************************************************************************** // Allow also to call script from expression static DECLARE_INTERFACE_USER_FCT(lua) @@ -566,6 +581,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(getSheetType), LUABIND_FUNC(getSheetShape), + LUABIND_FUNC(getCharacterSheetScale), LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetName), LUABIND_FUNC(getFameIndex), @@ -3493,7 +3509,15 @@ std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet) return ""; } +// *************************************************************************** +float CLuaIHMRyzom::getCharacterSheetScale(const std::string &sheet) +{ + const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet)); + const CCharacterSheet *charSheet = dynamic_cast(sheetPtr); + if (charSheet) return charSheet->Scale; + return 1; +} // *************************************************************************** std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet) 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 f8db32363..d574efb68 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -205,6 +205,7 @@ private: static bool isFullyPatched(); static std::string getSheetType(const std::string &sheet); static std::string getSheetShape(const std::string &sheet); + static float getCharacterSheetScale(const std::string &sheet); static std::string getSheetFamily(const std::string &sheet); static std::string getSheetName(uint32 sheetId); static sint32 getFameIndex(const std::string &factionName); diff --git a/code/ryzom/common/src/game_share/fame.cpp b/code/ryzom/common/src/game_share/fame.cpp index cd9e2b850..19c3cbb80 100644 --- a/code/ryzom/common/src/game_share/fame.cpp +++ b/code/ryzom/common/src/game_share/fame.cpp @@ -534,7 +534,7 @@ void CStaticFames::loadTribeThreshold( const string& filename ) // check table structure uint nbTribe = ws.size()-2; nlassert(nbTribe<=_FameTableSize); - nlassert(ws.ColCount == 16); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name + nlassert(ws.ColCount == 17); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name + marauder _TribeCultThresholdPerCiv.resize(nbTribe); @@ -548,7 +548,7 @@ void CStaticFames::loadTribeThreshold( const string& filename ) _TribeCultThresholdPerCiv[i-2].FameIndex = index; - for( uint c=1; csetMarauder(thresholdMarauder*6000); } } } diff --git a/code/ryzom/common/src/game_share/fame.h b/code/ryzom/common/src/game_share/fame.h index fde8611b8..c0cc856bb 100644 --- a/code/ryzom/common/src/game_share/fame.h +++ b/code/ryzom/common/src/game_share/fame.h @@ -52,26 +52,30 @@ public: Kami = 0; Karavan = 0; Neutral = 0; + Marauder = 0; } void setKami(sint32 t) { Kami = t; } void setKaravan(sint32 t) { Karavan = t; } void setNeutral(sint32 t) { Neutral = t; } + void setMarauder(sint32 t) { Marauder = t; } sint32 getKami() const { return Kami; } sint32 getKaravan() const { return Karavan; } sint32 getNeutral() const { return Neutral; } + sint32 getMarauder() const { return Marauder; } private: sint32 Kami; sint32 Karavan; sint32 Neutral; + sint32 Marauder; }; class CTribeCultThresholdPerCiv { public: - bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral) const + bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral, sint32& marauder) const { const CTribeCultThreshold * tc = 0; switch( civ ) @@ -88,12 +92,16 @@ public: case PVP_CLAN::Neutral: tc = &Neutral; break; + case PVP_CLAN::Marauder: + tc = &Marauder; + break; default: return false; } kami = tc->getKami(); karavan = tc->getKaravan(); neutral = tc->getNeutral(); + marauder = tc->getMarauder(); return true; } @@ -103,6 +111,7 @@ public: CTribeCultThreshold Tryker; CTribeCultThreshold Zorai; CTribeCultThreshold Neutral; + CTribeCultThreshold Marauder; }; // declare scoped constant value diff --git a/code/ryzom/common/src/game_share/magic_fx.h b/code/ryzom/common/src/game_share/magic_fx.h index 2a46475e8..414a6586a 100644 --- a/code/ryzom/common/src/game_share/magic_fx.h +++ b/code/ryzom/common/src/game_share/magic_fx.h @@ -136,6 +136,7 @@ namespace MAGICFX OtherFireWall = 14, TeleportKami = 15, // No effect aura TeleportKara = 16, // No effect aura + TeleportMarauder = 17, // No effect aura }; }